Changeset 29221 for trunk/profile.php


Ignore:
Timestamp:
Aug 15, 2014, 6:14:43 PM (10 years ago)
Author:
flop25
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/profile.php

    r28587 r29221  
    7070  $page['body_id'] = 'theProfilePage';
    7171  $template->set_filename('profile', 'profile.tpl');
     72  $template->set_filename('profile_content', 'profile_content.tpl');
    7273
    7374  load_profile_in_template(
     
    7576    make_index_url(), // for redirect
    7677    $userdata );
     78  $template->assign_var_from_handle('PROFILE_CONTENT', 'profile_content');
     79
    7780
    7881 
     
    290293}
    291294
    292 
    293 function load_profile_in_template($url_action, $url_redirect, $userdata)
     295/**
     296 * Assign template variables, from arguments
     297 * Used to build profile edition pages
     298 *
     299 * @param string $url_action
     300 * @param string $url_redirect
     301 * @param array $userdata
     302 */
     303function load_profile_in_template($url_action, $url_redirect, $userdata, $template_prefixe=null)
    294304{
    295305  global $template, $conf;
    296 
    297   $template->set_filename('profile_content', 'profile_content.tpl');
    298306
    299307  $template->assign('radio_options',
     
    304312  $template->assign(
    305313    array(
    306       'USERNAME'=>stripslashes($userdata['username']),
    307       'EMAIL'=>@$userdata['email'],
    308       'ALLOW_USER_CUSTOMIZATION'=>$conf['allow_user_customization'],
    309       'ACTIVATE_COMMENTS'=>$conf['activate_comments'],
    310       'NB_IMAGE_PAGE'=>$userdata['nb_image_page'],
    311       'RECENT_PERIOD'=>$userdata['recent_period'],
    312       'EXPAND' =>$userdata['expand'] ? 'true' : 'false',
    313       'NB_COMMENTS'=>$userdata['show_nb_comments'] ? 'true' : 'false',
    314       'NB_HITS'=>$userdata['show_nb_hits'] ? 'true' : 'false',
    315       'REDIRECT' => $url_redirect,
    316       'F_ACTION'=>$url_action,
     314      $template_prefixe.'USERNAME'=>stripslashes($userdata['username']),
     315      $template_prefixe.'EMAIL'=>@$userdata['email'],
     316      $template_prefixe.'ALLOW_USER_CUSTOMIZATION'=>$conf['allow_user_customization'],
     317      $template_prefixe.'ACTIVATE_COMMENTS'=>$conf['activate_comments'],
     318      $template_prefixe.'NB_IMAGE_PAGE'=>$userdata['nb_image_page'],
     319      $template_prefixe.'RECENT_PERIOD'=>$userdata['recent_period'],
     320      $template_prefixe.'EXPAND' =>$userdata['expand'] ? 'true' : 'false',
     321      $template_prefixe.'NB_COMMENTS'=>$userdata['show_nb_comments'] ? 'true' : 'false',
     322      $template_prefixe.'NB_HITS'=>$userdata['show_nb_hits'] ? 'true' : 'false',
     323      $template_prefixe.'REDIRECT' => $url_redirect,
     324      $template_prefixe.'F_ACTION'=>$url_action,
    317325      ));
    318326
     
    339347
    340348  $template->assign('PWG_TOKEN', get_pwg_token());
    341   $template->assign_var_from_handle('PROFILE_CONTENT', 'profile_content');
    342349}
    343350?>
Note: See TracChangeset for help on using the changeset viewer.