aboutsummaryrefslogtreecommitdiffstats
path: root/profile.php
diff options
context:
space:
mode:
authorflop25 <flop25@piwigo.org>2014-08-15 16:14:43 +0000
committerflop25 <flop25@piwigo.org>2014-08-15 16:14:43 +0000
commit416233c2e467ff2bae8de82367f53fcae6f677f7 (patch)
treebfdf8779fdcf83346ec8cc8a817639d58024ca44 /profile.php
parent557fccb9a10f41329ff16061b1395397771d3960 (diff)
bug:3122
removed admin files profile.tpl and profile_content.tpl, integrated in configuration.tpl take into account default_user_id with a message prefix for template var, to avoid overwriting of already existing vars especially in admin panel git-svn-id: http://piwigo.org/svn/trunk@29221 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'profile.php')
-rw-r--r--profile.php39
1 files changed, 23 insertions, 16 deletions
diff --git a/profile.php b/profile.php
index 29490b902..372f5cc2e 100644
--- a/profile.php
+++ b/profile.php
@@ -69,11 +69,14 @@ SELECT '.implode(',', $fields).'
$title= l10n('Your Gallery Customization');
$page['body_id'] = 'theProfilePage';
$template->set_filename('profile', 'profile.tpl');
+ $template->set_filename('profile_content', 'profile_content.tpl');
load_profile_in_template(
get_root_url().'profile.php', // action
make_index_url(), // for redirect
$userdata );
+ $template->assign_var_from_handle('PROFILE_CONTENT', 'profile_content');
+
// include menubar
@@ -289,13 +292,18 @@ function save_profile_from_post($userdata, &$errors)
return true;
}
-
-function load_profile_in_template($url_action, $url_redirect, $userdata)
+/**
+ * Assign template variables, from arguments
+ * Used to build profile edition pages
+ *
+ * @param string $url_action
+ * @param string $url_redirect
+ * @param array $userdata
+ */
+function load_profile_in_template($url_action, $url_redirect, $userdata, $template_prefixe=null)
{
global $template, $conf;
- $template->set_filename('profile_content', 'profile_content.tpl');
-
$template->assign('radio_options',
array(
'true' => l10n('Yes'),
@@ -303,17 +311,17 @@ function load_profile_in_template($url_action, $url_redirect, $userdata)
$template->assign(
array(
- 'USERNAME'=>stripslashes($userdata['username']),
- 'EMAIL'=>@$userdata['email'],
- 'ALLOW_USER_CUSTOMIZATION'=>$conf['allow_user_customization'],
- 'ACTIVATE_COMMENTS'=>$conf['activate_comments'],
- 'NB_IMAGE_PAGE'=>$userdata['nb_image_page'],
- 'RECENT_PERIOD'=>$userdata['recent_period'],
- 'EXPAND' =>$userdata['expand'] ? 'true' : 'false',
- 'NB_COMMENTS'=>$userdata['show_nb_comments'] ? 'true' : 'false',
- 'NB_HITS'=>$userdata['show_nb_hits'] ? 'true' : 'false',
- 'REDIRECT' => $url_redirect,
- 'F_ACTION'=>$url_action,
+ $template_prefixe.'USERNAME'=>stripslashes($userdata['username']),
+ $template_prefixe.'EMAIL'=>@$userdata['email'],
+ $template_prefixe.'ALLOW_USER_CUSTOMIZATION'=>$conf['allow_user_customization'],
+ $template_prefixe.'ACTIVATE_COMMENTS'=>$conf['activate_comments'],
+ $template_prefixe.'NB_IMAGE_PAGE'=>$userdata['nb_image_page'],
+ $template_prefixe.'RECENT_PERIOD'=>$userdata['recent_period'],
+ $template_prefixe.'EXPAND' =>$userdata['expand'] ? 'true' : 'false',
+ $template_prefixe.'NB_COMMENTS'=>$userdata['show_nb_comments'] ? 'true' : 'false',
+ $template_prefixe.'NB_HITS'=>$userdata['show_nb_hits'] ? 'true' : 'false',
+ $template_prefixe.'REDIRECT' => $url_redirect,
+ $template_prefixe.'F_ACTION'=>$url_action,
));
$template->assign('template_selection', $userdata['theme']);
@@ -338,6 +346,5 @@ function load_profile_in_template($url_action, $url_redirect, $userdata)
trigger_notify( 'load_profile_in_template', $userdata );
$template->assign('PWG_TOKEN', get_pwg_token());
- $template->assign_var_from_handle('PROFILE_CONTENT', 'profile_content');
}
?>