Changeset 2286 for trunk/admin


Ignore:
Timestamp:
Mar 20, 2008, 1:35:36 AM (17 years ago)
Author:
rvelices
Message:
  • admin/notification_by_mail goes smarty - THE LAST ONE :-) :-)
  • get rid of user_list warnings
  • some code reorganisation in template class + explode modifier
  • minor template and language changes in search.tpl and cat_modify.tpl
Location:
trunk/admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r2223 r2286  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | file          : $Id$
     
    209209
    210210// Navigation path
    211 $url = PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id=';
    212 
    213211$navigation = get_cat_display_name_cache(
    214212  $category['uppercats'],
    215   PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='
     213  get_root_url().'admin.php?page=cat_modify&cat_id='
    216214  );
    217215
    218 $form_action = PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='.$_GET['cat_id'];
     216$form_action = get_root_url().'admin.php?page=cat_modify&cat_id='.$_GET['cat_id'];
    219217
    220218//----------------------------------------------------- template initialization
    221219$template->set_filename( 'categories', 'admin/cat_modify.tpl');
    222220
    223 $base_url = PHPWG_ROOT_PATH.'admin.php?page=';
     221$base_url = get_root_url().'admin.php?page=';
    224222$cat_list_url = $base_url.'cat_list';
    225223
     
    237235
    238236    'status_values'     => array('public','private'),
    239     'false_true'        => array('false', 'true'),
    240     'no_yes'            => array('no','yes'),
    241237
    242238    'CAT_STATUS'        => $category['status'],
     
    257253        ? '' : stripslashes($_POST['mail_content']),
    258254    'U_CHILDREN' => $cat_list_url.'&parent_id='.$category['id'],
    259     'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=cat_modify',
     255    'U_HELP' => get_root_url().'popuphelp.php?page=cat_modify',
    260256
    261257    'F_ACTION' => $form_action,
     
    368364    $row = mysql_fetch_array(pwg_query($query));
    369365    $src = get_thumbnail_url($row);
    370     $url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify';
     366    $url = get_root_url().'admin.php?page=picture_modify';
    371367    $url.= '&image_id='.$category['representative_picture_id'];
    372368
  • trunk/admin/include/check_integrity.class.php

    r2269 r2286  
    260260          $submit_ignore = true;
    261261        }
    262        
     262
    263263        $template->append('c13y_list', $c13y_display);
    264264      }
     
    267267      $template->assign('c13y_show_submit_ignore', $submit_ignore);
    268268
    269       $template->concat_var('ADMIN_CONTENT', $template->parse('check_integrity', true));
     269      $template->concat('ADMIN_CONTENT', $template->parse('check_integrity', true));
    270270
    271271    }
  • trunk/admin/notification_by_mail.php

    r2285 r2286  
    583583);
    584584
    585 $template->assign_vars
     585$template->assign
    586586(
    587587  array
     
    629629  }
    630630
    631   $template->assign_block_vars
    632   (
    633     'repost',
    634       array
    635       (
    636         'REPOST_SUBMIT_NAME' => $repost_submit_name
    637       )
    638     );
     631  $template->assign('REPOST_SUBMIT_NAME', $repost_submit_name);
    639632}
    640633
     
    643636  case 'param' :
    644637  {
    645     $template->assign_block_vars(
     638    $template->assign(
    646639      $page['mode'],
    647640      array(
    648         'SEND_HTML_MAIL_YES' => ($conf['nbm_send_html_mail'] ? 'checked="checked"' : ''),
    649         'SEND_HTML_MAIL_NO' => (!$conf['nbm_send_html_mail'] ? 'checked="checked"' : ''),
     641        'SEND_HTML_MAIL' => $conf['nbm_send_html_mail'],
    650642        'SEND_MAIL_AS' => $conf['nbm_send_mail_as'],
    651         'SEND_DETAILED_CONTENT_YES' => ($conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''),
    652         'SEND_DETAILED_CONTENT_NO' => (!$conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''),
     643        'SEND_DETAILED_CONTENT' => $conf['nbm_send_detailed_content'],
    653644        'COMPLEMENTARY_MAIL_CONTENT' => $conf['nbm_complementary_mail_content'],
    654         'SEND_RECENT_POST_DATES_YES' => ($conf['nbm_send_recent_post_dates'] ? 'checked="checked"' : ''),
    655         'SEND_RECENT_POST_DATES_NO' => (!$conf['nbm_send_recent_post_dates'] ? 'checked="checked"' : '')
     645        'SEND_RECENT_POST_DATES' => $conf['nbm_send_recent_post_dates'],
    656646        ));
    657647    break;
     
    660650  case 'subscribe' :
    661651  {
    662     $template->assign_block_vars(
    663       $page['mode'],
    664       array(
    665         ));
    666 
    667     $template->assign_vars(
     652    $template->assign( $page['mode'], true );
     653
     654    $template->assign(
    668655      array(
    669656        'L_CAT_OPTIONS_TRUE' => l10n('nbm_subscribe_col'),
     
    701688        'category_option_true_selected' => $opt_true_selected,
    702689        'category_option_false'         => $opt_false,
    703         'category_option_true_selected' => $opt_false_selected,
     690        'category_option_false_selected' => $opt_false_selected,
    704691        )
    705692    );
     693    $template->assign_var_from_handle('DOUBLE_SELECT', 'double_select');
    706694    break;
    707695  }
     
    709697  case 'send' :
    710698  {
    711     $template->assign_block_vars($page['mode'], array());
     699    $tpl_var = array('users'=> array() );
    712700
    713701    $data_users = do_action_send_mail_notification('list_to_send');
    714702
    715     if  (count($data_users) == 0)
    716     {
    717       $template->assign_block_vars($page['mode'].'.send_empty', array());
    718     }
    719     else
    720     {
    721       $template->assign_block_vars(
    722         $page['mode'].'.send_data',
    723         array(
    724           'CUSTOMIZE_MAIL_CONTENT' => isset($_POST['send_customize_mail_content']) ? stripslashes($_POST['send_customize_mail_content']) : $conf['nbm_complementary_mail_content']
    725           ));
    726 
    727       foreach ($data_users as $num => $nbm_user)
     703    $tpl_var['CUSTOMIZE_MAIL_CONTENT'] =
     704      isset($_POST['send_customize_mail_content'])
     705        ? stripslashes($_POST['send_customize_mail_content'])
     706        : $conf['nbm_complementary_mail_content'];
     707
     708    if  (count($data_users))
     709    {
     710      foreach ($data_users as $nbm_user)
    728711      {
    729712        if (
     
    732715            )
    733716        {
    734           $template->assign_block_vars(
    735             $page['mode'].'.send_data.user_send_mail',
     717          $tpl_var['users'][] =
    736718            array(
    737               'CLASS' => ($num % 2 == 1) ? 'nbm_user2' : 'nbm_user1',
    738719              'ID' => $nbm_user['check_key'],
    739720              'CHECKED' =>  ( // not check if not selected,  on init select<all
     
    744725              'EMAIL' => get_email_address_as_display_text($nbm_user['mail_address']),
    745726              'LAST_SEND'=> $nbm_user['last_send']
    746               ));
    747         }
    748       }
    749     }
    750 
     727              );
     728        }
     729      }
     730    }
     731    $template->assign($page['mode'], $tpl_var);
    751732    break;
    752733  }
     
    756737// | Sending html code                                                     |
    757738// +-----------------------------------------------------------------------+
    758 $template->assign_var_from_handle('DOUBLE_SELECT', 'double_select');
    759739$template->assign_var_from_handle('ADMIN_CONTENT', 'notification_by_mail');
    760740
  • trunk/admin/user_list.php

    r2253 r2286  
    441441
    442442  redirect(
    443     PHPWG_ROOT_PATH.
     443    get_root_url().
    444444    'admin.php'.
    445445    get_query_string_diff(array(), false)
     
    484484$template->assign(
    485485  array(
    486     'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=user_list',
     486    'U_HELP' => get_root_url().'popuphelp.php?page=user_list',
    487487
    488488    'F_ADD_ACTION' => $base_url,
    489489    'F_USERNAME' => @htmlentities($_GET['username']),
    490     'F_FILTER_ACTION' => PHPWG_ROOT_PATH.'admin.php'
     490    'F_FILTER_ACTION' => get_root_url().'admin.php'
    491491    ));
    492492
     
    525525if (isset($_POST['pref_submit']))
    526526{
    527 //  echo '<pre>'; print_r($_POST); echo '</pre>';
    528527  $template->assign(
    529528    array(
    530       'ADVISER_YES' => 'true' == (isset($_POST['adviser']) and $_POST['adviser']) ? 'checked="checked"' : '',
    531       'ADVISER_NO' => 'false' == (isset($_POST['adviser']) and $_POST['adviser']) ? 'checked="checked"' : '',
    532529      'NB_IMAGE_LINE' => $_POST['nb_image_line'],
    533530      'NB_LINE_PAGE' => $_POST['nb_line_page'],
     
    535532      'MAXHEIGHT' => $_POST['maxheight'],
    536533      'RECENT_PERIOD' => $_POST['recent_period'],
    537       'EXPAND_YES' => 'true' == $_POST['expand'] ? 'checked="checked"' : '',
    538       'EXPAND_NO' => 'false' == $_POST['expand'] ? 'checked="checked"' : '',
    539       'SHOW_NB_COMMENTS_YES' => 'true' == $_POST['show_nb_comments'] ? 'checked="checked"' : '',
    540       'SHOW_NB_COMMENTS_NO' => 'false' == $_POST['show_nb_comments'] ? 'checked="checked"' : '',
    541       'SHOW_NB_HITS_YES' => 'true' == $_POST['show_nb_hits'] ? 'checked="checked"' : '',
    542       'SHOW_NB_HITS_NO' => 'false' == $_POST['show_nb_hits'] ? 'checked="checked"' : '',
    543       'ENABLED_HIGH_YES' => 'true' == $_POST['enabled_high'] ? 'checked="checked"' : '',
    544       'ENABLED_HIGH_NO' => 'false' == $_POST['enabled_high'] ? 'checked="checked"' : '',
    545      
    546       'STATUS_ACTION_SET' => 'set' == $_POST['status_action'] ? 'checked="checked"' : '',
    547       'LEVEL_ACTION_SET' => 'set' == $_POST['level_action'] ? 'checked="checked"' : '',
    548       'NB_IMAGE_LINE_ACTION_SET' => 'set' == $_POST['nb_image_line_action'] ? 'checked="checked"' : '',
    549       'NB_LINE_PAGE_ACTION_SET' => 'set' == $_POST['nb_line_page_action'] ? 'checked="checked"' : '',
    550       'TEMPLATE_ACTION_SET' => 'set' == $_POST['template_action'] ? 'checked="checked"' : '',
    551       'LANGUAGE_ACTION_SET' => 'set' == $_POST['language_action'] ? 'checked="checked"' : '',
    552       'RECENT_PERIOD_ACTION_SET' => 'set' == $_POST['recent_period_action'] ? 'checked="checked"' : '',
    553       'MAXWIDTH_ACTION_SET' => 'set' == $_POST['maxwidth_action'] ? 'checked="checked"' : '',
    554       'MAXHEIGHT_ACTION_SET' => 'set' == $_POST['maxheight_action'] ? 'checked="checked"' : '',
    555534      ));
    556535}
     
    646625}
    647626
     627// allow plugins to fill template var plugin_user_list_column_titles and
     628// plugin_columns/plugin_actions for each user in the list
    648629$visible_user_list = trigger_event('loc_visible_user_list', $visible_user_list);
    649630
    650 foreach ($visible_user_list as $num => $local_user)
     631foreach ($visible_user_list as $local_user)
    651632{
    652633  $groups_string = preg_replace(
     
    697678      'GROUPS' => $groups_string,
    698679      'PROPERTIES' => implode( ', ', $properties),
     680      'plugin_columns' => isset($local_user['plugin_columns']) ? $local_user['plugin_columns'] : array(),
     681      'plugin_actions' => isset($local_user['plugin_actions']) ? $local_user['plugin_actions'] : array(),
    699682      )
    700683    );
    701   trigger_action('loc_append_user_list', $local_user);
    702684}
    703685
Note: See TracChangeset for help on using the changeset viewer.