[vhffs-dev] [405] _Really_ disable avatar when they are deactivated... |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 405
Author: gradator
Date: 2007-01-19 00:13:37 +0000 (Fri, 19 Jan 2007)
Log Message:
-----------
_Really_ disable avatar when they are deactivated...
Modified Paths:
--------------
branches/vhffs_4.1/vhffs-panel/public/lastusers.pl
branches/vhffs_4.1/vhffs-panel/public/user.pl
branches/vhffs_4.1/vhffs-panel/templates/public/misc/lastusers-part.tmpl
branches/vhffs_4.1/vhffs-panel/templates/public/user.tmpl
branches/vhffs_4.1/vhffs-panel/templates/user/prefs.tmpl
branches/vhffs_4.1/vhffs-panel/user/prefs.pl
trunk/vhffs-panel/public/lastusers.pl
trunk/vhffs-panel/public/user.pl
trunk/vhffs-panel/templates/public/misc/lastusers-part.tmpl
trunk/vhffs-panel/templates/public/user.tmpl
trunk/vhffs-panel/templates/user/prefs.tmpl
trunk/vhffs-panel/user/prefs.pl
Added Paths:
-----------
branches/vhffs_4.1/vhffs-panel/templates/user/prefs_avatar.tmpl
trunk/vhffs-panel/templates/user/prefs_avatar.tmpl
Modified: branches/vhffs_4.1/vhffs-panel/public/lastusers.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/lastusers.pl 2007-01-18 22:44:59 UTC (rev 404)
+++ branches/vhffs_4.1/vhffs-panel/public/lastusers.pl 2007-01-19 00:13:37 UTC (rev 405)
@@ -43,6 +43,7 @@
use Vhffs::Acl;
use Vhffs::Constants;
use Vhffs::Panel::Main;
+use Vhffs::Conf;
my $vhffs = init Vhffs::Main;
my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
my $template;
@@ -78,9 +79,7 @@
$template->param( TEXT_LASTNAME => gettext("Lastname") );
$template->param( VALUE_LASTNAME => $user->get_lastname );
$template->param( TEXT_GROUPS => gettext("Groups") );
-
-
-
+ $template->param( IMG_AVATAR => "<img src=\"/getavatar.pl?oid=".$user->get_oid."\" alt=\"".$user->get_firstname." avatar\"/>" ) if( $vhffs->get_config->get_panel_avatar() );
$template->param( VALUE_OID => $user->get_oid );
my $output = "";
Modified: branches/vhffs_4.1/vhffs-panel/public/user.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/user.pl 2007-01-18 22:44:59 UTC (rev 404)
+++ branches/vhffs_4.1/vhffs-panel/public/user.pl 2007-01-19 00:13:37 UTC (rev 405)
@@ -83,6 +83,7 @@
$template->param( TEXT_LASTNAME => gettext("Lastname") );
$template->param( VALUE_LASTNAME => $user->get_lastname );
$template->param( TEXT_GROUPS => gettext("Groups") );
+ $template->param( IMG_AVATAR => "<img src=\"/getavatar.pl?oid=".$user->get_oid."\" alt=\"".$user->get_firstname." avatar\"/>" ) if( $vhffs->get_config->get_panel_avatar() );
$template->param( VALUE_OID => $user->get_oid );
Modified: branches/vhffs_4.1/vhffs-panel/templates/public/misc/lastusers-part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/public/misc/lastusers-part.tmpl 2007-01-18 22:44:59 UTC (rev 404)
+++ branches/vhffs_4.1/vhffs-panel/templates/public/misc/lastusers-part.tmpl 2007-01-19 00:13:37 UTC (rev 405)
@@ -1,6 +1,7 @@
<div class="public_user">
<h2><tmpl_var name="TEXT_TITLE"></h2>
-<img src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="<tmpl_var name="VALUE_USERNAME"> avatar"/>
+<!-- <img src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="<tmpl_var name="VALUE_USERNAME"> avatar"/> -->
+<tmpl_var name="IMG_AVATAR">
<ul>
<li>
<tmpl_var name="TEXT_USERNAME">
Modified: branches/vhffs_4.1/vhffs-panel/templates/public/user.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/public/user.tmpl 2007-01-18 22:44:59 UTC (rev 404)
+++ branches/vhffs_4.1/vhffs-panel/templates/public/user.tmpl 2007-01-19 00:13:37 UTC (rev 405)
@@ -14,7 +14,8 @@
<div class="public_user">
<h1><tmpl_var name="VALUE_USERNAME"></h1>
-<img src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="<tmpl_var name="VALUE_USERNAME"> avatar"/>
+<!-- <img src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="<tmpl_var name="VALUE_USERNAME"> avatar"/> -->
+<tmpl_var name="IMG_AVATAR">
<p>
<tmpl_var name="TEXT_USERNAME">: <tmpl_var name="VALUE_USERNAME">
<br/>
Modified: branches/vhffs_4.1/vhffs-panel/templates/user/prefs.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/user/prefs.tmpl 2007-01-18 22:44:59 UTC (rev 404)
+++ branches/vhffs_4.1/vhffs-panel/templates/user/prefs.tmpl 2007-01-19 00:13:37 UTC (rev 405)
@@ -73,25 +73,9 @@
<p class="button" id="buttonModify">
<input type="submit" value="<tmpl_var name="TEXT_SEND">"/>
</p>
-
</form>
- <h2><tmpl_var name="TEXT_AVATAR"></h2>
- <form method="post" action="../object/upavatar.pl" enctype="multipart/form-data">
- <p>
- <h3><tmpl_var name="CURRENT_AVATAR"></h3>
- <img alt="avatar for your user" src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">"/>
- </p>
- <p>
- <tmpl_var name="EXPLAIN_AVATAR">
- </p>
- <input type="hidden" name="OID" value="<tmpl_var name="VALUE_OID">"/>
-
- <input type="file" name="avatar" tabindex="1" size="45"/>
- <br/>
- <input type="submit" value="<tmpl_var name="SEND_AVATAR">" />
- <input type="hidden" name=".cgifields" value="type" />
- </form>
+ <tmpl_var name="AVATAR">
<h2><tmpl_var name="TEXT_DELETE_USER"></h2>
@@ -120,5 +104,3 @@
</p>
</form>
-
-
Added: branches/vhffs_4.1/vhffs-panel/templates/user/prefs_avatar.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/user/prefs_avatar.tmpl 2007-01-18 22:44:59 UTC (rev 404)
+++ branches/vhffs_4.1/vhffs-panel/templates/user/prefs_avatar.tmpl 2007-01-19 00:13:37 UTC (rev 405)
@@ -0,0 +1,16 @@
+ <h2><tmpl_var name="TEXT_AVATAR"></h2>
+ <form method="post" action="../object/upavatar.pl" enctype="multipart/form-data">
+ <p>
+ <h3><tmpl_var name="CURRENT_AVATAR"></h3>
+ <img alt="avatar for your user" src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">"/>
+ </p>
+ <p>
+ <tmpl_var name="EXPLAIN_AVATAR">
+ </p>
+ <input type="hidden" name="OID" value="<tmpl_var name="VALUE_OID">"/>
+
+ <input type="file" name="avatar" tabindex="1" size="45"/>
+ <br/>
+ <input type="submit" value="<tmpl_var name="SEND_AVATAR">" />
+ <input type="hidden" name=".cgifields" value="type" />
+ </form>
Modified: branches/vhffs_4.1/vhffs-panel/user/prefs.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/user/prefs.pl 2007-01-18 22:44:59 UTC (rev 404)
+++ branches/vhffs_4.1/vhffs-panel/user/prefs.pl 2007-01-19 00:13:37 UTC (rev 405)
@@ -97,8 +97,6 @@
$template->param( VALUE_ADDRESS => $user->get_address );
$template->param( VALUE_COUNTRY => $user->get_country );
-$template->param( VALUE_OID => $user->get_oid );
-
$template->param( TEXT_DELETE_USER => gettext("Delete YOUR user") );
$template->param( TEXT_BEFORE_DELETE => gettext("This action is non-reversible. WHEN YOU DELETE IT, YOU CANNOT CANCEL.") );
$template->param( ASK_DELETE_USER => gettext("Are you SURE you want DELETE this user?") );
@@ -106,12 +104,20 @@
$template->param( NO => gettext("No, I'm not sure, I prefer to keep it.") );
$template->param( TEXT_DELETE => gettext("Delete") );
-$template->param( SEND_AVATAR => gettext("Send my avatar") );
-$template->param( CURRENT_AVATAR => gettext("Current avatar") );
-$template->param( TEXT_AVATAR => gettext("Send my avatar") );
-$template->param( EXPLAIN_AVATAR => gettext("The avatar is a pictures that describes you. You can upload an PNG image and use it as avatar. This image will then appear in the public section.") );
+if( $vhffs->get_config->get_panel_avatar() ) {
+ my $ta = new HTML::Template( filename => $templatedir."/user/prefs_avatar.tmpl" );
+ $ta->param( SEND_AVATAR => gettext("Send my avatar") );
+ $ta->param( CURRENT_AVATAR => gettext("Current avatar") );
+ $ta->param( TEXT_AVATAR => gettext("Send my avatar") );
+ $ta->param( EXPLAIN_AVATAR => gettext("The avatar is a pictures that describes you. You can upload an PNG image and use it as avatar. This image will then appear in the public section.") );
+ $ta->param( VALUE_OID => $user->get_oid );
+
+ $template->param( AVATAR => $ta->output );
+}
+
+
# themes
my @themes = Vhffs::Panel::Main::list_themes( $vhffs );
Modified: trunk/vhffs-panel/public/lastusers.pl
===================================================================
--- trunk/vhffs-panel/public/lastusers.pl 2007-01-18 22:44:59 UTC (rev 404)
+++ trunk/vhffs-panel/public/lastusers.pl 2007-01-19 00:13:37 UTC (rev 405)
@@ -43,6 +43,7 @@
use Vhffs::Acl;
use Vhffs::Constants;
use Vhffs::Panel::Main;
+use Vhffs::Conf;
my $vhffs = init Vhffs::Main;
my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
my $template;
@@ -78,9 +79,7 @@
$template->param( TEXT_LASTNAME => gettext("Lastname") );
$template->param( VALUE_LASTNAME => $user->get_lastname );
$template->param( TEXT_GROUPS => gettext("Groups") );
-
-
-
+ $template->param( IMG_AVATAR => "<img src=\"/getavatar.pl?oid=".$user->get_oid."\" alt=\"".$user->get_firstname." avatar\"/>" ) if( $vhffs->get_config->get_panel_avatar() );
$template->param( VALUE_OID => $user->get_oid );
my $output = "";
Modified: trunk/vhffs-panel/public/user.pl
===================================================================
--- trunk/vhffs-panel/public/user.pl 2007-01-18 22:44:59 UTC (rev 404)
+++ trunk/vhffs-panel/public/user.pl 2007-01-19 00:13:37 UTC (rev 405)
@@ -87,6 +87,7 @@
$template->param( TEXT_LASTNAME => gettext("Lastname") );
$template->param( VALUE_LASTNAME => $user->get_lastname );
$template->param( TEXT_GROUPS => gettext("Groups") );
+ $template->param( IMG_AVATAR => "<img src=\"/getavatar.pl?oid=".$user->get_oid."\" alt=\"".$user->get_firstname." avatar\"/>" ) if( $vhffs->get_config->get_panel_avatar() );
$template->param( VALUE_OID => $user->get_oid );
Modified: trunk/vhffs-panel/templates/public/misc/lastusers-part.tmpl
===================================================================
--- trunk/vhffs-panel/templates/public/misc/lastusers-part.tmpl 2007-01-18 22:44:59 UTC (rev 404)
+++ trunk/vhffs-panel/templates/public/misc/lastusers-part.tmpl 2007-01-19 00:13:37 UTC (rev 405)
@@ -1,6 +1,7 @@
<div class="public_user">
<h2><tmpl_var name="TEXT_TITLE"></h2>
-<img src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="<tmpl_var name="VALUE_USERNAME"> avatar"/>
+<!-- <img src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="<tmpl_var name="VALUE_USERNAME"> avatar"/> -->
+<tmpl_var name="IMG_AVATAR">
<ul>
<li>
<tmpl_var name="TEXT_USERNAME">
Modified: trunk/vhffs-panel/templates/public/user.tmpl
===================================================================
--- trunk/vhffs-panel/templates/public/user.tmpl 2007-01-18 22:44:59 UTC (rev 404)
+++ trunk/vhffs-panel/templates/public/user.tmpl 2007-01-19 00:13:37 UTC (rev 405)
@@ -14,7 +14,8 @@
<div class="public_user">
<h1><tmpl_var name="VALUE_USERNAME"></h1>
-<img src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="<tmpl_var name="VALUE_USERNAME"> avatar"/>
+<!-- <img src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">" alt="<tmpl_var name="VALUE_USERNAME"> avatar"/> -->
+<tmpl_var name="IMG_AVATAR">
<p>
<tmpl_var name="TEXT_USERNAME">: <tmpl_var name="VALUE_USERNAME">
<br/>
Modified: trunk/vhffs-panel/templates/user/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/user/prefs.tmpl 2007-01-18 22:44:59 UTC (rev 404)
+++ trunk/vhffs-panel/templates/user/prefs.tmpl 2007-01-19 00:13:37 UTC (rev 405)
@@ -73,25 +73,9 @@
<p class="button" id="buttonModify">
<input type="submit" value="<tmpl_var name="TEXT_SEND">"/>
</p>
-
</form>
- <h2><tmpl_var name="TEXT_AVATAR"></h2>
- <form method="post" action="../object/upavatar.pl" enctype="multipart/form-data">
- <p>
- <h3><tmpl_var name="CURRENT_AVATAR"></h3>
- <img alt="avatar for your user" src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">"/>
- </p>
- <p>
- <tmpl_var name="EXPLAIN_AVATAR">
- </p>
- <input type="hidden" name="OID" value="<tmpl_var name="VALUE_OID">"/>
-
- <input type="file" name="avatar" tabindex="1" size="45"/>
- <br/>
- <input type="submit" value="<tmpl_var name="SEND_AVATAR">" />
- <input type="hidden" name=".cgifields" value="type" />
- </form>
+ <tmpl_var name="AVATAR">
<h2><tmpl_var name="TEXT_DELETE_USER"></h2>
@@ -120,5 +104,3 @@
</p>
</form>
-
-
Added: trunk/vhffs-panel/templates/user/prefs_avatar.tmpl
===================================================================
--- trunk/vhffs-panel/templates/user/prefs_avatar.tmpl 2007-01-18 22:44:59 UTC (rev 404)
+++ trunk/vhffs-panel/templates/user/prefs_avatar.tmpl 2007-01-19 00:13:37 UTC (rev 405)
@@ -0,0 +1,16 @@
+ <h2><tmpl_var name="TEXT_AVATAR"></h2>
+ <form method="post" action="../object/upavatar.pl" enctype="multipart/form-data">
+ <p>
+ <h3><tmpl_var name="CURRENT_AVATAR"></h3>
+ <img alt="avatar for your user" src="/getavatar.pl?oid=<tmpl_var name="VALUE_OID">"/>
+ </p>
+ <p>
+ <tmpl_var name="EXPLAIN_AVATAR">
+ </p>
+ <input type="hidden" name="OID" value="<tmpl_var name="VALUE_OID">"/>
+
+ <input type="file" name="avatar" tabindex="1" size="45"/>
+ <br/>
+ <input type="submit" value="<tmpl_var name="SEND_AVATAR">" />
+ <input type="hidden" name=".cgifields" value="type" />
+ </form>
Modified: trunk/vhffs-panel/user/prefs.pl
===================================================================
--- trunk/vhffs-panel/user/prefs.pl 2007-01-18 22:44:59 UTC (rev 404)
+++ trunk/vhffs-panel/user/prefs.pl 2007-01-19 00:13:37 UTC (rev 405)
@@ -97,8 +97,6 @@
$template->param( VALUE_ADDRESS => $user->get_address );
$template->param( VALUE_COUNTRY => $user->get_country );
-$template->param( VALUE_OID => $user->get_oid );
-
$template->param( TEXT_DELETE_USER => gettext("Delete YOUR user") );
$template->param( TEXT_BEFORE_DELETE => gettext("This action is non-reversible. WHEN YOU DELETE IT, YOU CANNOT CANCEL.") );
$template->param( ASK_DELETE_USER => gettext("Are you SURE you want DELETE this user?") );
@@ -106,12 +104,20 @@
$template->param( NO => gettext("No, I'm not sure, I prefer to keep it.") );
$template->param( TEXT_DELETE => gettext("Delete") );
-$template->param( SEND_AVATAR => gettext("Send my avatar") );
-$template->param( CURRENT_AVATAR => gettext("Current avatar") );
-$template->param( TEXT_AVATAR => gettext("Send my avatar") );
-$template->param( EXPLAIN_AVATAR => gettext("The avatar is a pictures that describes you. You can upload an PNG image and use it as avatar. This image will then appear in the public section.") );
+if( $vhffs->get_config->get_panel_avatar() ) {
+ my $ta = new HTML::Template( filename => $templatedir."/user/prefs_avatar.tmpl" );
+ $ta->param( SEND_AVATAR => gettext("Send my avatar") );
+ $ta->param( CURRENT_AVATAR => gettext("Current avatar") );
+ $ta->param( TEXT_AVATAR => gettext("Send my avatar") );
+ $ta->param( EXPLAIN_AVATAR => gettext("The avatar is a pictures that describes you. You can upload an PNG image and use it as avatar. This image will then appear in the public section.") );
+ $ta->param( VALUE_OID => $user->get_oid );
+
+ $template->param( AVATAR => $ta->output );
+}
+
+
# themes
my @themes = Vhffs::Panel::Main::list_themes( $vhffs );