Ignore:
Timestamp:
Mar 2, 2008, 6:30:18 PM (16 years ago)
Author:
rub
Message:

0000810: Use of new template engine [smarty]

Migration of c13y template
It's the first step with simple migration, on next step more display action on tpl.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/check_integrity.class.php

    r2238 r2241  
    193193      {
    194194        $can_select = false;
    195 
    196         $template->assign_block_vars('c13y',
    197           array(
    198            'CLASS' => ($i % 2 == 1) ? 'row2' : 'row1',
     195        $c13y_display = array(
    199196           'ID' => $c13y['id'],
    200            'ANOMALY' => $c13y['anomaly']
    201           ));
    202 
     197           'ANOMALY' => $c13y['anomaly'],
     198           'show_ignore_msg' => false,
     199           'show_correction_success_fct' => false,
     200           'correction_error_fct' => '',
     201           'show_correction_fct' => false,
     202           'correction_error_fct' => '',
     203           'show_correction_bad_fct' => false,
     204           'correction_msg' => ''
     205          );
    203206
    204207        if (isset($c13y['ignored']))
     
    206209          if ($c13y['ignored'])
    207210          {
    208             $template->assign_block_vars('c13y.ignore_msg', array());
     211            $c13y_display['show_ignore_msg'] = true;
    209212          }
    210213          else
     
    221224              if ($c13y['corrected'])
    222225              {
    223                 $template->assign_block_vars('c13y.correction_success_fct', array());
     226                $c13y_display['show_correction_success_fct'] = true;
    224227              }
    225228              else
    226229              {
    227                 $template->assign_block_vars('c13y.correction_error_fct',
    228                   array('WIKI_FOROM_LINKS' => $this->get_htlm_links_more_info()));
     230                $c13y_display['correction_error_fct'] = $this->get_htlm_links_more_info();
    229231              }
    230232            }
    231233            else if ($c13y['is_callable'])
    232234            {
    233               $template->assign_block_vars('c13y.correction_fct', array());
    234               $template->assign_block_vars('c13y_link_check_automatic_correction.c13y_do_check', array('ID' => $c13y['id']));
     235              $c13y_display['show_correction_fct'] = true;
     236              $template->append('c13y_do_check', $c13y['id']);
    235237              $submit_automatic_correction = true;
    236238              $can_select = true;
     
    238240            else
    239241            {
    240               $template->assign_block_vars('c13y.correction_bad_fct', array());
     242              $c13y_display['show_correction_bad_fct'] = true;
    241243              $can_select = true;
    242244            }
     
    247249          }
    248250
    249           if (!empty($c13y['correction_fct']) and !empty($c13y['correction_msg']))
    250           {
    251             $template->assign_block_vars('c13y.br', array());
    252           }
    253 
    254251          if (!empty($c13y['correction_msg']) and !isset($c13y['corrected']))
    255252          {
    256             $template->assign_block_vars('c13y.correction_msg',
    257               array(
    258                'DATA' => nl2br($c13y['correction_msg'])
    259               ));
    260           }
    261         }
    262 
     253            $c13y_display['correction_msg'] = $c13y['correction_msg'];
     254          }
     255        }
     256
     257        $c13y_display['can_select'] = $can_select;
    263258        if ($can_select)
    264259        {
    265           $template->assign_block_vars('c13y.can_select', array());
    266260          $submit_ignore = true;
    267261        }
     262       
     263        $template->append('c13y_list', $c13y_display);
    268264      }
    269265
    270       if ($submit_automatic_correction)
    271       {
    272         $template->assign_block_vars('c13y_submit_automatic_correction', array());
    273       }
    274 
    275       if ($submit_ignore)
    276       {
    277         $template->assign_block_vars('c13y_link_check_uncheck', array());
    278         $template->assign_block_vars('c13y_submit_ignore', array());
    279       }
    280 
    281       $template->concat_var('ADMIN_CONTENT', $template->parse('check_integrity', true) );
     266      $template->assign('c13y_show_submit_automatic_correction', $submit_automatic_correction);
     267      $template->assign('c13y_show_submit_ignore', $submit_ignore);
     268
     269      $template->assign_var_from_handle('ADMIN_CONTENT', 'check_integrity');
    282270    }
    283271  }
Note: See TracChangeset for help on using the changeset viewer.