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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.