[vhffs-dev] [688] Don't show avatar display/ upload part in group preferences if avatars are disabled

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 688
Author:   gradator
Date:     2007-07-08 02:04:30 +0000 (Sun, 08 Jul 2007)

Log Message:
-----------
Don't show avatar display/upload part in group preferences if avatars are disabled

Modified Paths:
--------------
    trunk/vhffs-panel/group/prefs.pl
    trunk/vhffs-panel/templates/Makefile.am
    trunk/vhffs-panel/templates/group/prefs.tmpl

Added Paths:
-----------
    trunk/vhffs-panel/templates/group/prefs_avatar.tmpl


Modified: trunk/vhffs-panel/group/prefs.pl
===================================================================
--- trunk/vhffs-panel/group/prefs.pl	2007-07-08 01:33:58 UTC (rev 687)
+++ trunk/vhffs-panel/group/prefs.pl	2007-07-08 02:04:30 UTC (rev 688)
@@ -181,7 +181,6 @@
 	$template->param( VALUE_OWNER => $group->get_owner_username );
 	$template->param( TEXT_DESCRIPTION => gettext("Project Description") );
 	$template->param( VALUE_DESCRIPTION => CGI::escapeHTML($group->get_description) );
-	$template->param( VALUE_OID => $group->get_oid);
 	$template->param( TEXT_MODIFY => gettext("Modify") );
 	$template->param( TEXT_DELETE_PROJECT => gettext("Delete this project") );
 	$template->param( TEXT_BEFORE_DELETE => gettext("This action is non-reversible. All services associated to this project will be DESTROYED.") );
@@ -194,12 +193,16 @@
 	$template->param( TEXT_JOIN_GROUP => gettext("Add a user in this group") );
 	$template->param( TEXT_SEND => gettext('Add') );
 
-	$template->param( SEND_AVATAR => gettext('Update') );
-	$template->param( TEXT_AVATAR => gettext('Logo') );
-	$template->param( EXPLAIN_AVATAR => gettext('The avatar is an image to describe the group') );
-	$template->param( CURRENT_AVATAR => gettext('Current avatar') );
-    $template->param( UPDATE_AVATAR => gettext('Update avatar') );
-
+	if( $vhffs->get_config->get_panel_avatar )  {
+		my $tavatar = new HTML::Template( filename => $templatedir.'/group/prefs_avatar.tmpl', global_vars => 1 );		
+		$tavatar->param( SEND_AVATAR => gettext('Update') );
+		$tavatar->param( TEXT_AVATAR => gettext('Logo') );
+		$tavatar->param( EXPLAIN_AVATAR => gettext('The avatar is an image to describe the group') );
+		$tavatar->param( CURRENT_AVATAR => gettext('Current avatar') );
+		$tavatar->param( UPDATE_AVATAR => gettext('Update avatar') );
+		$tavatar->param( VALUE_OID => $group->get_oid);
+		$template->param( AVATAR => $tavatar->output );
+	}
 	
 	$template->param( USERS => Vhffs::Panel::Group::getall_users( $vhffs , $group->get_gid ) );
     $template->param( REMOVE_USER_TEXT => gettext( 'Remove' ) );

Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am	2007-07-08 01:33:58 UTC (rev 687)
+++ trunk/vhffs-panel/templates/Makefile.am	2007-07-08 02:04:30 UTC (rev 688)
@@ -91,6 +91,7 @@
 	group/info.tmpl \
 	group/list_user.tmpl \
 	group/prefs.tmpl \
+	group/prefs_avatar.tmpl \
 	mail/create.tmpl \
 	mailinglist/create.tmpl \
 	mailinglist/list_part.tmpl \

Modified: trunk/vhffs-panel/templates/group/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/group/prefs.tmpl	2007-07-08 01:33:58 UTC (rev 687)
+++ trunk/vhffs-panel/templates/group/prefs.tmpl	2007-07-08 02:04:30 UTC (rev 688)
@@ -46,18 +46,8 @@
 <tmpl_if name="ADD_USER_MSG"><p class="<tmpl_var name="ADD_USER_MSG_CLASS">"><tmpl_var name="ADD_USER_MSG"></p></tmpl_if>
 <tmpl_var name="USERS_LIST">
 
-<h2><tmpl_var name="TEXT_AVATAR"></h2>
-    <h3><tmpl_var name="CURRENT_AVATAR"></h3>
-	<p><img src="../getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="avatar for this group"/></p>
+<tmpl_var name="AVATAR">
 
-    <h3><tmpl_var name="UPDATE_AVATAR"></h3>
-    <form method="post" action="../object/upavatar.pl" enctype="multipart/form-data">
-        <p><tmpl_var name="EXPLAIN_AVATAR"></p>
-        <input type="hidden" name="OID" value="<tmpl_var name="VALUE_OID">"/>
-        <p><input type="file" name="avatar"/></p>
-        <p><input type="submit" value="<tmpl_var name="SEND_AVATAR">" /></p>
-    </form>
-
 <h2><tmpl_var name="TEXT_DELETE_PROJECT"></h2>
 
 <form method="post" action="delete.pl">

Added: trunk/vhffs-panel/templates/group/prefs_avatar.tmpl
===================================================================
--- trunk/vhffs-panel/templates/group/prefs_avatar.tmpl	2007-07-08 01:33:58 UTC (rev 687)
+++ trunk/vhffs-panel/templates/group/prefs_avatar.tmpl	2007-07-08 02:04:30 UTC (rev 688)
@@ -0,0 +1,11 @@
+<h2><tmpl_var name="TEXT_AVATAR"></h2>
+    <h3><tmpl_var name="CURRENT_AVATAR"></h3>
+        <p><img src="../getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="avatar for this group"/></p>
+
+    <h3><tmpl_var name="UPDATE_AVATAR"></h3>
+    <form method="post" action="../object/upavatar.pl" enctype="multipart/form-data">
+        <p><tmpl_var name="EXPLAIN_AVATAR"></p>
+        <input type="hidden" name="OID" value="<tmpl_var name="VALUE_OID">"/>
+        <p><input type="file" name="avatar"/></p>
+        <p><input type="submit" value="<tmpl_var name="SEND_AVATAR">" /></p>
+    </form>


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/