Ignore:
Timestamp:
Dec 6, 2008, 3:28:54 AM (15 years ago)
Author:
patdenice
Message:
  • Add a "Bound Template" column for template extensions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/extend_for_templates.php

    r2712 r2923  
    103103    'tags.tpl'                   => 'tags',
    104104    'upload.tpl'                 => 'upload',);
    105   $flip_templates = array_flip($eligible_templates);
     105
     106$flip_templates = array_flip($eligible_templates);
     107
     108$available_templates = array_merge(
     109  array('N/A' => '----------'),
     110  get_dirs(PHPWG_ROOT_PATH.'template'));
     111
    106112// +-----------------------------------------------------------------------+
    107113// |                            selected templates                         |
     
    119125    $url_keyword = $_POST['url'][$i];
    120126    if ($url_keyword == '----------') $url_keyword = 'N/A';
     127    $bound_tpl = $_POST['bound'][$i];
     128    if ($bound_tpl == '----------') $bound_tpl = 'N/A';
    121129    if ($handle != 'N/A')
    122130    {
    123       $replacements[$newtpl] = array($handle, $url_keyword);
     131      $replacements[$newtpl] = array($handle, $url_keyword, $bound_tpl);
    124132    }
    125133    $i++;
     
    151159foreach ($new_extensions as $file)
    152160{
    153   $tpl_extension[$file] = array('N/A', 'N/A');
     161  $tpl_extension[$file] = array('N/A', 'N/A', 'N/A');
    154162}
    155163
     
    168176  $handle = $conditions[0];
    169177  $url_keyword = $conditions[1];
     178  $bound_tpl = $conditions[2];
    170179  { 
    171180  $template->append('extents',
    172181    array(
    173       'replacer'      => $file,
    174       'url_parameter' => $relevant_parameters,
    175       'original_tpl'  => array_keys($eligible_templates),
    176       'selected_tpl'  => $flip_templates[$handle],
    177       'selected_url'  => $url_keyword,)
     182      'replacer'       => $file,
     183      'url_parameter'  => $relevant_parameters,
     184      'original_tpl'   => array_keys($eligible_templates),
     185      'bound_tpl'          => $available_templates,
     186      'selected_tpl'   => $flip_templates[$handle],
     187      'selected_url'   => $url_keyword,
     188      'selected_bound' => $bound_tpl,)
    178189      );
    179190  }
Note: See TracChangeset for help on using the changeset viewer.