diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-01-25 02:18:56 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-01-25 02:18:56 +0000 |
commit | 80020dd7564f25f4af5d994df5690b1088456b41 (patch) | |
tree | 9f588b38e69054be1c5c4e01b899117c1863cc93 | |
parent | 4472ba6ed4b6e079c6f98968354a3527f8af8ec8 (diff) |
- user profiles available from admin page
- user creation from admin page with email (bug 514)
- some language cleanup
- small template enhancements
- php syntax corrections (my mistake)
git-svn-id: http://piwigo.org/svn/trunk@1753 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | admin/profile.php | 46 | ||||
-rw-r--r-- | admin/user_list.php | 28 | ||||
-rw-r--r-- | include/template.php | 19 | ||||
-rw-r--r-- | language/en_UK.iso-8859-1/admin.lang.php | 5 | ||||
-rw-r--r-- | language/fr_FR.iso-8859-1/admin.lang.php | 5 | ||||
-rw-r--r-- | profile.php | 258 | ||||
-rw-r--r-- | register.php | 6 | ||||
-rw-r--r-- | template/yoga/admin/profile.tpl | 5 | ||||
-rw-r--r-- | template/yoga/admin/user_list.tpl | 30 | ||||
-rw-r--r-- | template/yoga/icon/edit_s.png | bin | 0 -> 585 bytes | |||
-rw-r--r-- | template/yoga/profile.tpl | 112 | ||||
-rw-r--r-- | template/yoga/profile_content.tpl | 113 |
12 files changed, 347 insertions, 280 deletions
diff --git a/admin/profile.php b/admin/profile.php new file mode 100644 index 000000000..0cf36e42c --- /dev/null +++ b/admin/profile.php @@ -0,0 +1,46 @@ +<?php +// +-----------------------------------------------------------------------+ +// | PhpWebGallery - a PHP based picture gallery | +// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | +// +-----------------------------------------------------------------------+ +// | branch : BSF (Best So Far) +// | file : $Id$ +// | last update : $Date$ +// | last modifier : $Author$ +// | revision : $Revision$ +// +-----------------------------------------------------------------------+ +// | This program is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU General Public License as published by | +// | the Free Software Foundation | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +if( !defined("PHPWG_ROOT_PATH") ) die ("Hacking attempt!"); + +$edit_user = build_user( $_GET['user_id'], false ); + +include_once(PHPWG_ROOT_PATH.'profile.php'); + + +save_profile_from_post( $edit_user, $errors); + +load_profile_in_template( + get_root_url().'admin.php?page=profile&user_id='.$edit_user['id'], + get_root_url().'admin.php?page=user_list', + $edit_user + ); +$page['errors'] = array_merge( $page['errors'], $errors); + +$template->set_filename('profile', 'admin/profile.tpl'); +$template->assign_var_from_handle('ADMIN_CONTENT', 'profile'); +?> diff --git a/admin/user_list.php b/admin/user_list.php index 69d46e6d2..84efc057f 100644 --- a/admin/user_list.php +++ b/admin/user_list.php @@ -193,7 +193,8 @@ $page['direction_items'] = array( if (isset($_POST['submit_add'])) { - $page['errors'] = register_user($_POST['login'], $_POST['password'], ''); + $page['errors'] = register_user( + $_POST['login'], $_POST['password'], $_POST['email']); if (count($page['errors']) == 0) { @@ -455,25 +456,6 @@ else $template->assign_vars( array( - 'L_AUTH_USER'=>$lang['permuser_only_private'], - 'L_GROUP_ADD_USER' => $lang['group_add_user'], - 'L_STATUS'=>$lang['user_status'], - 'L_ORDER_BY' => $lang['order_by'], - 'L_ACTIONS' => $lang['actions'], - 'L_PROPERTIES' => $lang['properties'], - 'L_PERMISSIONS' => $lang['permissions'], - 'L_USERS_LIST' => $lang['title_liste_users'], - 'L_NB_IMAGE_LINE' => $lang['nb_image_per_row'], - 'L_NB_LINE_PAGE' => $lang['nb_row_per_page'], - 'L_TEMPLATE' => $lang['theme'], - 'L_RECENT_PERIOD' => $lang['recent_period'], - 'L_EXPAND' => $lang['auto_expand'], - 'L_SHOW_NB_COMMENTS' => $lang['show_nb_comments'], - 'L_MAXWIDTH' => $lang['maxwidth'], - 'L_MAXHEIGHT' => $lang['maxheight'], - 'L_DELETE' => $lang['user_delete'], - 'L_DELETE_HINT' => $lang['user_delete_hint'], - 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=user_list', 'F_ADD_ACTION' => $base_url, @@ -773,8 +755,8 @@ $template->assign_vars(array('NAVBAR' => $navbar)); // | user list | // +-----------------------------------------------------------------------+ -$profile_url = PHPWG_ROOT_PATH.'admin.php?page=profile&user_id='; -$perm_url = PHPWG_ROOT_PATH.'admin.php?page=user_perm&user_id='; +$profile_url = get_root_url().'admin.php?page=profile&user_id='; +$perm_url = get_root_url().'admin.php?page=user_perm&user_id='; foreach ($page['filtered_users'] as $num => $local_user) { @@ -814,7 +796,7 @@ foreach ($page['filtered_users'] as $num => $local_user) 'CLASS' => ($num % 2 == 1) ? 'row2' : 'row1', 'ID' => $local_user['id'], 'CHECKED' => $checked, - 'U_MOD' => $profile_url.$local_user['id'], + 'U_PROFILE' => $profile_url.$local_user['id'], 'U_PERM' => $perm_url.$local_user['id'], 'USERNAME' => $local_user['username'], 'STATUS' => $lang['user_status_'.$local_user['status']].(($local_user['adviser'] == 'true') ? ' ['.$lang['adviser'].']' : ''), diff --git a/include/template.php b/include/template.php index 276464a22..d5e296edd 100644 --- a/include/template.php +++ b/include/template.php @@ -102,6 +102,14 @@ class Template { } /** + * Sets the template filename for handle. + */ + function set_filename($handle, $filename) + { + return $this->set_filenames( array($handle=>$filename) ); + } + + /** * Sets the template filenames for handles. $filename_array should be a * hash of handle => filename pairs. */ @@ -115,7 +123,16 @@ class Template { reset($filename_array); while(list($handle, $filename) = each($filename_array)) { - $this->files[$handle] = $this->make_filename($filename); + if (is_null($filename)) + { + unset( $this->files[$handle] ); + } + else + { + $this->files[$handle] = $this->make_filename($filename); + } + unset($this->compiled_code[$handle]); + unset($this->uncompiled_code[$handle]); } return true; diff --git a/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php index 918812495..c60681709 100644 --- a/language/en_UK.iso-8859-1/admin.lang.php +++ b/language/en_UK.iso-8859-1/admin.lang.php @@ -251,7 +251,6 @@ $lang['group "%s" updated'] = 'group "%s" updated'; $lang['group'] = 'group'; $lang['group_add_error1'] = 'The name of a group must not contain " or \' or be empty.'; $lang['group_add_error2'] = 'This name is already used by another group.'; -$lang['group_add_user']= 'Add user'; $lang['group_id URL parameter is missing'] = 'group_id URL parameter is missing'; $lang['groups'] = 'Groups'; $lang['history'] = 'History'; @@ -336,11 +335,9 @@ $lang['nbm_user_not_change_enabled_true'] = 'User %s [%s] not added to the subsc $lang['nbm_user_x_added'] = 'User %s [%s] added.'; $lang['nbm_warning_subscribe_unsubcribe'] = 'Warning: subscribing or unsubcribing will send mails to users'; $lang['no_write_access'] = 'no write access'; -$lang['order_by'] = 'order by'; $lang['path'] = 'path'; $lang['permissions'] = 'Permissions'; $lang['permuser_info'] = 'Only private categories are listed. Private/Public category status can be set in screen "Categories > Public / Private"'; -$lang['permuser_only_private'] = 'Only private categories are shown'; $lang['private'] = 'private'; $lang['properties'] = 'Properties'; $lang['public'] = 'public'; @@ -478,8 +475,6 @@ $lang['update_wrong_dirname_info'] = 'The name of directories and files must be $lang['update_wrong_dirname_short'] = 'wrong filename'; $lang['upload'] = 'Upload'; $lang['user "%s" added'] = 'user "%s" added'; -$lang['user_delete'] = 'Delete user'; -$lang['user_delete_hint'] = 'Click here to delete this user. Warning! This operation cannot be undone!'; $lang['user_id URL parameter is missing'] = 'user_id URL parameter is missing'; $lang['user_status'] = 'User status'; $lang['user_status_admin'] = 'Administrator'; diff --git a/language/fr_FR.iso-8859-1/admin.lang.php b/language/fr_FR.iso-8859-1/admin.lang.php index f378ffceb..70abaac55 100644 --- a/language/fr_FR.iso-8859-1/admin.lang.php +++ b/language/fr_FR.iso-8859-1/admin.lang.php @@ -251,7 +251,6 @@ $lang['group "%s" updated'] = 'groupe "%s" mis à jour'; $lang['group'] = 'groupe'; $lang['group_add_error1'] = 'Le nom du groupe ne doit pas contenir " or \' et ne doit pas être vide.'; $lang['group_add_error2'] = 'Ce nom est déjà utilisé par un autre groupe.'; -$lang['group_add_user']= 'Ajouter un utilisateur'; $lang['group_id URL parameter is missing'] = 'Le paramètre d\'URL "group_id" est manquant'; $lang['groups'] = 'Groupes'; $lang['history'] = 'Historique'; @@ -336,11 +335,9 @@ $lang['nbm_user_not_change_enabled_true'] = 'L\'utilisateur %s [%s] n\'a pas été $lang['nbm_user_x_added'] = 'Utilisateur %s [%s] ajouté.'; $lang['nbm_warning_subscribe_unsubcribe'] = 'Attention, l\'inscription ou la désincription entraine l\'envoi de mails aux utilisateurs concernés'; $lang['no_write_access'] = 'pas d\'accès en écriture'; -$lang['order_by'] = 'trier selon'; $lang['path'] = 'chemin'; $lang['permissions'] = 'Permissions'; $lang['permuser_info'] = 'Seules les catégories privées sont listées.'; -$lang['permuser_only_private'] = 'Seules les catégories privées sont listées.'; $lang['private'] = 'privée'; $lang['properties'] = 'Propriétés'; $lang['public'] = 'publique'; @@ -478,8 +475,6 @@ $lang['update_wrong_dirname_info'] = 'Le nom des répertoires et des fichiers ne $lang['update_wrong_dirname_short'] = 'nom de fichier erroné'; $lang['upload'] = 'Ajout'; $lang['user "%s" added'] = 'utilisateur "%s" ajouté'; -$lang['user_delete'] = 'Supprimer utilisateur'; -$lang['user_delete_hint'] = 'Cliquer ici pour supprimer cet utilisateur. Attention : cette opération ne peut pas être annulée !'; $lang['user_id URL parameter is missing'] = 'le paramètre d\'URL "user_id" manque'; $lang['user_status'] = 'Statut de l\'utilisateur'; $lang['user_status_admin'] = 'Administrateur'; diff --git a/profile.php b/profile.php index 5284dbe78..df2d46ae3 100644 --- a/profile.php +++ b/profile.php @@ -30,56 +30,94 @@ // | initialization | // +-----------------------------------------------------------------------+ -define('PHPWG_ROOT_PATH','./'); -include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); +if (!defined('PHPWG_ROOT_PATH')) +{//direct script access + define('PHPWG_ROOT_PATH','./'); + include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); -// +-----------------------------------------------------------------------+ -// | Check Access and exit when user status is not ok | -// +-----------------------------------------------------------------------+ -check_status(ACCESS_CLASSIC); + // +-----------------------------------------------------------------------+ + // | Check Access and exit when user status is not ok | + // +-----------------------------------------------------------------------+ + check_status(ACCESS_CLASSIC); + + $userdata = $user; + + save_profile_from_post($userdata, $errors); -$userdata = $user; + $title= $lang['customize_page_title']; + $page['body_id'] = 'theProfilePage'; + include(PHPWG_ROOT_PATH.'include/page_header.php'); + + load_profile_in_template( + get_root_url().'profile.php', // action + make_index_url(), // for redirect + $userdata ); + + $template->assign_var('U_RETURN', make_index_url() ); + + // +-----------------------------------------------------------------------+ + // | errors display | + // +-----------------------------------------------------------------------+ + if (count($errors) != 0) + { + $template->assign_block_vars('errors',array()); + foreach ($errors as $error) + { + $template->assign_block_vars('errors.error', array('ERROR'=>$error)); + } + } + $template->set_filename('profile', 'profile.tpl'); + $template->parse('profile'); + include(PHPWG_ROOT_PATH.'include/page_tail.php'); +} //------------------------------------------------------ update & customization -$errors = array(); -if (isset($_POST['validate'])) +function save_profile_from_post(&$userdata, &$errors) { + global $conf; + $errors = array(); + + if (!isset($_POST['validate'])) + { + return; + } + $int_pattern = '/^\d+$/'; if (empty($_POST['nb_image_line']) or (!preg_match($int_pattern, $_POST['nb_image_line']))) { - array_push($errors, $lang['nb_image_line_error']); + $errors[] = l10n('nb_image_line_error'); } if (empty($_POST['nb_line_page']) or (!preg_match($int_pattern, $_POST['nb_line_page']))) { - array_push($errors, $lang['nb_line_page_error']); + $errors[] = l10n('nb_line_page_error'); } if ($_POST['maxwidth'] != '' and (!preg_match($int_pattern, $_POST['maxwidth']) or $_POST['maxwidth'] < 50)) { - array_push($errors, $lang['maxwidth_error']); + $errors[] = l10n('maxwidth_error'); } if ($_POST['maxheight'] and (!preg_match($int_pattern, $_POST['maxheight']) or $_POST['maxheight'] < 50)) { - array_push($errors, $lang['maxheight_error']); + $errors[] = l10n('maxheight_error'); } // periods must be integer values, they represents number of days if (!preg_match($int_pattern, $_POST['recent_period']) or $_POST['recent_period'] <= 0) { - array_push($errors, $lang['periods_error']); + $errors[] = l10n('periods_error') ; } $mail_error = validate_mail_address($_POST['mail_address']); if (!empty($mail_error)) { - array_push($errors, $mail_error); + $errors[] = $mail_error; } if (!empty($_POST['use_new_pwd'])) @@ -87,21 +125,22 @@ if (isset($_POST['validate'])) // password must be the same as its confirmation if ($_POST['use_new_pwd'] != $_POST['passwordConf']) { - array_push($errors, - l10n('New password confirmation does not correspond')); + $errors[] = l10n('New password confirmation does not correspond'); } - // changing password requires old password - $query = ' -SELECT '.$conf['user_fields']['password'].' AS password - FROM '.USERS_TABLE.' - WHERE '.$conf['user_fields']['id'].' = \''.$userdata['id'].'\' -;'; - list($current_password) = mysql_fetch_row(pwg_query($query)); - - if ($conf['pass_convert']($_POST['password']) != $current_password) - { - array_push($errors, l10n('Current password is wrong')); + if ( !defined('IN_ADMIN') ) + {// changing password requires old password + $query = ' + SELECT '.$conf['user_fields']['password'].' AS password + FROM '.USERS_TABLE.' + WHERE '.$conf['user_fields']['id'].' = \''.$userdata['id'].'\' + ;'; + list($current_password) = mysql_fetch_row(pwg_query($query)); + + if ($conf['pass_convert']($_POST['password']) != $current_password) + { + $errors[] = l10n('Current password is wrong'); + } } } @@ -151,113 +190,96 @@ SELECT '.$conf['user_fields']['password'].' AS password array($data)); // redirection - redirect(make_index_url()); + redirect($_POST['redirect']); } } -// +-----------------------------------------------------------------------+ -// | page header and options | -// +-----------------------------------------------------------------------+ - -$title= $lang['customize_page_title']; -$page['body_id'] = 'theProfilePage'; -include(PHPWG_ROOT_PATH.'include/page_header.php'); - -$url_action = PHPWG_ROOT_PATH.'profile.php'; - -//----------------------------------------------------- template initialization -$template->set_filenames(array('profile_body'=>'profile.tpl')); -$expand = ($userdata['expand'] == 'true') ? 'EXPAND_TREE_YES':'EXPAND_TREE_NO'; -$nb_comments = -($userdata['show_nb_comments'] == 'true') ? 'NB_COMMENTS_YES':'NB_COMMENTS_NO'; - -$template->assign_vars( - array( - 'USERNAME'=>$userdata['username'], - 'USERID'=>$userdata['id'], - 'EMAIL'=>@$userdata['email'], - 'NB_IMAGE_LINE'=>$userdata['nb_image_line'], - 'NB_ROW_PAGE'=>$userdata['nb_line_page'], - 'RECENT_PERIOD'=>$userdata['recent_period'], - 'MAXWIDTH'=>@$userdata['maxwidth'], - 'MAXHEIGHT'=>@$userdata['maxheight'], - - $expand=>'checked="checked"', - $nb_comments=>'checked="checked"', +function load_profile_in_template($url_action, $url_redirect, $userdata) +{ + global $template; - 'U_RETURN' => make_index_url(), + $template->set_filename('profile_content', 'profile_content.tpl'); - 'F_ACTION'=>$url_action, - )); + $expand = ($userdata['expand'] == 'true') ? 'EXPAND_TREE_YES':'EXPAND_TREE_NO'; -$blockname = 'template_option'; + $nb_comments = + ($userdata['show_nb_comments'] == 'true') ? 'NB_COMMENTS_YES':'NB_COMMENTS_NO'; -foreach (get_pwg_themes() as $pwg_template) -{ - if (isset($_POST['submit'])) - { - $selected = $_POST['template']==$pwg_template ? 'selected="selected"' : ''; - } - else if ($userdata['template'].'/'.$userdata['theme'] == $pwg_template) - { - $selected = 'selected="selected"'; - } - else - { - $selected = ''; - } - - $template->assign_block_vars( - $blockname, + $template->assign_vars( array( - 'VALUE'=> $pwg_template, - 'CONTENT' => $pwg_template, - 'SELECTED' => $selected + 'USERNAME'=>$userdata['username'], + 'USERID'=>$userdata['id'], + 'EMAIL'=>@$userdata['email'], + 'NB_IMAGE_LINE'=>$userdata['nb_image_line'], + 'NB_ROW_PAGE'=>$userdata['nb_line_page'], + 'RECENT_PERIOD'=>$userdata['recent_period'], + 'MAXWIDTH'=>@$userdata['maxwidth'], + 'MAXHEIGHT'=>@$userdata['maxheight'], + + $expand=>'checked="checked"', + $nb_comments=>'checked="checked"', + + 'REDIRECT' => $url_redirect, + + 'F_ACTION'=>$url_action, )); -} -$blockname = 'language_option'; + $blockname = 'template_option'; -foreach (get_languages() as $language_code => $language_name) -{ - if (isset($_POST['submit'])) - { - $selected = $_POST['language']==$language_code ? 'selected="selected"':''; - } - else if ($userdata['language'] == $language_code) - { - $selected = 'selected="selected"'; - } - else + foreach (get_pwg_themes() as $pwg_template) { - $selected = ''; + if (isset($_POST['submit'])) + { + $selected = $_POST['template']==$pwg_template ? 'selected="selected"' : ''; + } + else if ($userdata['template'].'/'.$userdata['theme'] == $pwg_template) + { + $selected = 'selected="selected"'; + } + else + { + $selected = ''; + } + + $template->assign_block_vars( + $blockname, + array( + 'VALUE'=> $pwg_template, + 'CONTENT' => $pwg_template, + 'SELECTED' => $selected + )); } - $template->assign_block_vars( - $blockname, - array( - 'VALUE'=> $language_code, - 'CONTENT' => $language_name, - 'SELECTED' => $selected - )); -} + $blockname = 'language_option'; -// +-----------------------------------------------------------------------+ -// | errors display | -// +-----------------------------------------------------------------------+ -if (count($errors) != 0) -{ - $template->assign_block_vars('errors',array()); - foreach ($errors as $error) + foreach (get_languages() as $language_code => $language_name) { - $template->assign_block_vars('errors.error', array('ERROR'=>$error)); + if (isset($_POST['submit'])) + { + $selected = $_POST['language']==$language_code ? 'selected="selected"':''; + } + else if ($userdata['language'] == $language_code) + { + $selected = 'selected="selected"'; + } + else + { + $selected = ''; + } + + $template->assign_block_vars( + $blockname, + array( + 'VALUE'=> $language_code, + 'CONTENT' => $language_name, + 'SELECTED' => $selected + )); } + if ( !defined('IN_ADMIN') ) + { + $template->assign_block_vars( 'not_admin', array() ); + } + $template->assign_var_from_handle('PROFILE_CONTENT', 'profile_content'); } -// +-----------------------------------------------------------------------+ -// | html code display | -// +-----------------------------------------------------------------------+ -$template->assign_block_vars('profile',array()); -$template->parse('profile_body'); -include(PHPWG_ROOT_PATH.'include/page_tail.php'); ?> diff --git a/register.php b/register.php index aeb98fbd9..0218119fa 100644 --- a/register.php +++ b/register.php @@ -2,10 +2,10 @@ // +-----------------------------------------------------------------------+ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | -// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ // | branch : BSF (Best So Far) -// | file : $RCSfile$ +// | file : $Id$ // | last update : $Date$ // | last modifier : $Author$ // | revision : $Revision$ @@ -60,7 +60,7 @@ if (isset($_POST['submit'])) { include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); $username = $_POST['login']; - $admin_url = get_absolute_root_url(). + $admin_url = get_absolute_root_url() .'admin.php?page=user_list&username='.$username; $content = diff --git a/template/yoga/admin/profile.tpl b/template/yoga/admin/profile.tpl new file mode 100644 index 000000000..5de3efd5a --- /dev/null +++ b/template/yoga/admin/profile.tpl @@ -0,0 +1,5 @@ +<div class="titrePage"> + <h2>{lang:Profile}</h2> +</div> + +{PROFILE_CONTENT} diff --git a/template/yoga/admin/user_list.tpl b/template/yoga/admin/user_list.tpl index fc7c26a04..08b981882 100644 --- a/template/yoga/admin/user_list.tpl +++ b/template/yoga/admin/user_list.tpl @@ -10,6 +10,7 @@ <legend>{lang:Add a user}</legend> <label>{lang:Username} <input type="text" name="login" maxlength="50" size="20" /></label> <label>{lang:Password} <input type="text" name="password" /></label> + <label>{lang:Email address} <input type="text" name="email" /></label> <input type="submit" name="submit_add" value="{lang:submit}" {TAG_INPUT_ENABLED} /> </fieldset> </form> @@ -69,11 +70,11 @@ <tr class="throw"> <th> </th> <th>{lang:Username}</th> - <th>{L_STATUS}</th> + <th>{lang:user_status}</th> <th>{lang:Email address}</th> <th>{lang:Groups}</th> - <th>{L_PROPERTIES}</th> - <th>{L_ACTIONS}</th> + <th>{lang:properties}</th> + <th>{lang:actions}</th> </tr> <!-- BEGIN user --> <tr class="{user.CLASS}"> @@ -84,7 +85,8 @@ <td>{user.GROUPS}</td> <td>{user.PROPERTIES}</td> <td style="text-align:center;"> - <a href="{user.U_PERM}"><img src="{themeconf:icon_dir}/permissions.png" class="button" style="border:none" alt="{L_PERMISSIONS}" title="{L_PERMISSIONS}" /></a> + <a href="{user.U_PERM}"><img src="{themeconf:icon_dir}/permissions.png" class="button" style="border:none" alt="{lang:permissions}" title="{lang:permissions}" /></a> + <a href="{user.U_PROFILE}"><img src="{themeconf:icon_dir}/edit_s.png" class="button" style="border:none" alt="{lang:Profile}" title="{lang:Profile}" /></a> </td> </tr> <!-- END user --> @@ -104,7 +106,7 @@ <table> <tr> - <td>{L_STATUS}</td> + <td>{lang:Status}</td> <td> <label><input type="radio" name="status_action" value="leave" checked="checked" /> {lang:leave}</label> <label><input type="radio" name="status_action" value="set" id="status_action_set" /> {lang:set to}</label> @@ -165,7 +167,7 @@ <!-- Properties --> <fieldset> - <legend>{L_PROPERTIES}</legend> + <legend>{lang:properties}</legend> <table> @@ -190,7 +192,7 @@ <table> <tr> - <td>{L_NB_IMAGE_LINE}</td> + <td>{lang:nb_image_per_row}</td> <td> <label><input type="radio" name="nb_image_line_action" value="leave" checked="checked" /> {lang:leave}</label> <label><input type="radio" name="nb_image_line_action" value="set" id="nb_image_line_action_set" /> {lang:set to}</label> @@ -200,7 +202,7 @@ </tr> <tr> - <td>{L_NB_LINE_PAGE}</td> + <td>{lang:nb_row_per_page}</td> <td> <label><input type="radio" name="nb_line_page_action" value="leave" checked="checked" /> {lang:leave}</label> <label><input type="radio" name="nb_line_page_action" value="set" id="nb_line_page_action_set" /> {lang:set to}</label> @@ -210,7 +212,7 @@ </tr> <tr> - <td>{L_TEMPLATE}</td> + <td>{lang:theme}</td> <td> <label><input type="radio" name="template_action" value="leave" checked="checked" /> {lang:leave}</label> <label><input type="radio" name="template_action" value="set" id="template_action_set" /> {lang:set to}</label> @@ -236,7 +238,7 @@ </tr> <tr> - <td>{L_RECENT_PERIOD}</td> + <td>{lang:recent_period}</td> <td> <label><input type="radio" name="recent_period_action" value="leave" checked="checked" /> {lang:leave}</label> <label><input type="radio" name="recent_period_action" value="set" id="recent_period_action_set" /> {lang:set to}</label> @@ -246,7 +248,7 @@ </tr> <tr> - <td>{L_EXPAND}</td> + <td>{lang:auto_expand}</td> <td> <label><input type="radio" name="expand" value="leave" checked="checked" /> {lang:leave}</label> / {lang:set to} @@ -256,7 +258,7 @@ </tr> <tr> - <td>{L_SHOW_NB_COMMENTS}</td> + <td>{lang:show_nb_comments}</td> <td> <label><input type="radio" name="show_nb_comments" value="leave" checked="checked" /> {lang:leave}</label> / {lang:set to} @@ -266,7 +268,7 @@ </tr> <tr> - <td>{L_MAXWIDTH}</td> + <td>{lang:maxwidth}</td> <td> <label><input type="radio" name="maxwidth_action" value="leave" checked="checked" /> {lang:leave}</label> <label><input type="radio" name="maxwidth_action" value="unset" /> {lang:unset}</label> @@ -278,7 +280,7 @@ <tr> - <td>{L_MAXHEIGHT}</td> + <td>{lang:maxheight}</td> <td> <label><input type="radio" name="maxheight_action" value="leave" checked="checked" /> {lang:leave}</label> <label><input type="radio" name="maxheight_action" value="unset" /> {lang:unset}</label> diff --git a/template/yoga/icon/edit_s.png b/template/yoga/icon/edit_s.png Binary files differnew file mode 100644 index 000000000..e4951d22f --- /dev/null +++ b/template/yoga/icon/edit_s.png diff --git a/template/yoga/profile.tpl b/template/yoga/profile.tpl index 1b2037d71..f48a711c1 100644 --- a/template/yoga/profile.tpl +++ b/template/yoga/profile.tpl @@ -17,115 +17,5 @@ <h2>{lang:Profile}</h2> </div> -<form method="post" name="profile" action="{F_ACTION}" id="profile" class="properties"> - - <fieldset> - <legend>{lang:register_title}</legend> - <input type="hidden" name="userid" value="{USERID}" /> - <ul> - <li> - <span class="property">{lang:Username}</span> - {USERNAME} - </li> - <li> - <span class="property"> - <label for="mail_address">{lang:Email address}</label> - </span> - <input type="text" name="mail_address" id="mail_address" value="{EMAIL}"> - </li> - <li> - <span class="property"> - <label for="password">{lang:Password}</label> - </span> - <input type="password" name="password" id="password" value=""> - </li> - <li> - <span class="property"> - <label for="use_new_pwd">{lang:new_password}</label> - </span> - <input type="password" name="use_new_pwd" id="use_new_pwd" value=""> - </li> - <li> - <span class="property"> - <label for="passwordConf">{lang:Confirm Password}</label> - </span> - <input type="password" name="passwordConf" id="passwordConf" value=""> - </li> - </ul> - </fieldset> - - <fieldset> - <legend>{lang:preferences}</legend> - - <ul> - <li> - <span class="property"> - <label for="nb_image_line">{lang:nb_image_per_row}</label> - </span> - <input type="text" size="3" maxlength="2" name="nb_image_line" id="nb_image_line" value="{NB_IMAGE_LINE}"> - </li> - <li> - <span class="property"> - <label for="nb_line_page">{lang:nb_row_per_page}</label> - </span> - <input type="text" size="3" maxlength="2" name="nb_line_page" id="nb_line_page" value="{NB_ROW_PAGE}" > - </li> - <li> - <span class="property"> - <label for="template">{lang:theme}</label> - </span> - <select name="template" id="template"> - <!-- BEGIN template_option --> - <option value="{template_option.VALUE}" {template_option.SELECTED}>{template_option.CONTENT}</option> - <!-- END template_option --> - </select> - </li> - <li> - <span class="property"> - <label for="language">{lang:language}</label> - </span> - <select name="language" id="language"> - <!-- BEGIN language_option --> - <option value="{language_option.VALUE}" {language_option.SELECTED}>{language_option.CONTENT}</option> - <!-- END language_option --> - </select> - </li> - <li> - <span class="property"> - <label for="recent_period">{lang:recent_period}</label> - </span> - <input type="text" size="3" maxlength="2" name="recent_period" id="recent_period" value="{RECENT_PERIOD}"> - </li> - <li> - <span class="property">{lang:auto_expand}</span> - <label><input type="radio" name="expand" value="true" {EXPAND_TREE_YES}> {lang:yes}</label> - <label><input type="radio" name="expand" value="false" {EXPAND_TREE_NO}> {lang:no}</label> - </li> - <li> - <span class="property">{lang:show_nb_comments}</span> - <label><input type="radio" name="show_nb_comments" value="true" {NB_COMMENTS_YES}> {lang:yes}</label> - <label><input type="radio" name="show_nb_comments" value="false" {NB_COMMENTS_NO}> {lang:no}</label> - </li> - <li> - <span class="property"> - <label for="maxwidth">{lang:maxwidth}</label> - </span> - <input type="text" size="4" maxlength="4" name="maxwidth" id="maxwidth" value="{MAXWIDTH}"> - </li> - <li> - <span class="property"> - <label for="maxheight">{lang:maxheight}</label> - </span> - <input type="text" size="4" maxlength="4" name="maxheight" id="maxheight" value="{MAXHEIGHT}"> - </li> - </ul> - </fieldset> - - <p class="bottomButtons"> - <input type="submit" name="validate" value="{lang:submit}"> - <input type="reset" name="reset" value="{lang:reset}" class="reset"> - </p> - -</form> - +{PROFILE_CONTENT} </div> <!-- content --> diff --git a/template/yoga/profile_content.tpl b/template/yoga/profile_content.tpl new file mode 100644 index 000000000..e738e59c6 --- /dev/null +++ b/template/yoga/profile_content.tpl @@ -0,0 +1,113 @@ +<form method="post" name="profile" action="{F_ACTION}" id="profile" class="properties"> + + <fieldset> + <legend>{lang:register_title}</legend> + <input type="hidden" name="userid" value="{USERID}" /> + <input type="hidden" name="redirect" value="{REDIRECT}" /> + <ul> + <li> + <span class="property">{lang:Username}</span> + {USERNAME} + </li> + <li> + <span class="property"> + <label for="mail_address">{lang:Email address}</label> + </span> + <input type="text" name="mail_address" id="mail_address" value="{EMAIL}"> + </li> +<!-- BEGIN not_admin --> + <li> + <span class="property"> + <label for="password">{lang:Password}</label> + </span> + <input type="password" name="password" id="password" value=""> + </li> +<!-- END not_admin --> + <li> + <span class="property"> + <label for="use_new_pwd">{lang:new_password}</label> + </span> + <input type="password" name="use_new_pwd" id="use_new_pwd" value=""> + </li> + <li> + <span class="property"> + <label for="passwordConf">{lang:Confirm Password}</label> + </span> + <input type="password" name="passwordConf" id="passwordConf" value=""> + </li> + </ul> + </fieldset> + + <fieldset> + <legend>{lang:preferences}</legend> + + <ul> + <li> + <span class="property"> + <label for="nb_image_line">{lang:nb_image_per_row}</label> + </span> + <input type="text" size="3" maxlength="2" name="nb_image_line" id="nb_image_line" value="{NB_IMAGE_LINE}"> + </li> + <li> + <span class="property"> + <label for="nb_line_page">{lang:nb_row_per_page}</label> + </span> + <input type="text" size="3" maxlength="2" name="nb_line_page" id="nb_line_page" value="{NB_ROW_PAGE}" > + </li> + <li> + <span class="property"> + <label for="template">{lang:theme}</label> + </span> + <select name="template" id="template"> + <!-- BEGIN template_option --> + <option value="{template_option.VALUE}" {template_option.SELECTED}>{template_option.CONTENT}</option> + <!-- END template_option --> + </select> + </li> + <li> + <span class="property"> + <label for="language">{lang:language}</label> + </span> + <select name="language" id="language"> + <!-- BEGIN language_option --> + <option value="{language_option.VALUE}" {language_option.SELECTED}>{language_option.CONTENT}</option> + <!-- END language_option --> + </select> + </li> + <li> + <span class="property"> + <label for="recent_period">{lang:recent_period}</label> + </span> + <input type="text" size="3" maxlength="2" name="recent_period" id="recent_period" value="{RECENT_PERIOD}"> + </li> + <li> + <span class="property">{lang:auto_expand}</span> + <label><input type="radio" name="expand" value="true" {EXPAND_TREE_YES}> {lang:yes}</label> + <label><input type="radio" name="expand" value="false" {EXPAND_TREE_NO}> {lang:no}</label> + </li> + <li> + <span class="property">{lang:show_nb_comments}</span> + <label><input type="radio" name="show_nb_comments" value="true" {NB_COMMENTS_YES}> {lang:yes}</label> + <label><input type="radio" name="show_nb_comments" value="false" {NB_COMMENTS_NO}> {lang:no}</label> + </li> + <li> + <span class="property"> + <label for="maxwidth">{lang:maxwidth}</label> + </span> + <input type="text" size="4" maxlength="4" name="maxwidth" id="maxwidth" value="{MAXWIDTH}"> + </li> + <li> + <span class="property"> + <label for="maxheight">{lang:maxheight}</label> + </span> + <input type="text" size="4" maxlength="4" name="maxheight" id="maxheight" value="{MAXHEIGHT}"> + </li> + </ul> + </fieldset> + + <p class="bottomButtons"> + <input type="submit" name="validate" value="{lang:submit}"> + <input type="reset" name="reset" value="{lang:reset}" class="reset"> + </p> + +</form> |