Changeset 2469


Ignore:
Timestamp:
Aug 9, 2008, 11:27:58 PM (16 years ago)
Author:
grum
Message:

updating files for the Menu class (test_menu)

+ fixes "Links" translation bug

updating files for the AMenuManager plugin

+ enhance links template

updating common classes grum_plugins_classes-2
(needed for the AMenuManager plugin)

+ clearing the code

updating the calendar_base.class.php
the 'get_nav_bar_from_items' method was returning a hard coded html string
now replaced by a template file (calendar_nav.tpl)

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/calendar_base.class.php

    r2299 r2469  
    138138                                  $show_empty=false, $labels=null)
    139139  {
    140     global $conf, $page;
    141 
    142     $nav_bar = '';
     140    global $conf, $page, $template;
     141
     142    $nav_bar_datas=array();
    143143
    144144    if ($conf['calendar_show_empty'] and $show_empty and !empty($labels) )
     
    163163      if ($nb_images==-1)
    164164      {
    165         $nav_bar .= '<span class="'.$class_prefix.'Empty">';
    166         $nav_bar .= $label;
     165        $tmp_datas=array(
     166          'classname' => $class_prefix."Empty",
     167          'label'=> $label
     168        );
    167169      }
    168170      else
    169171      {
    170         $nav_bar .= '<span class="'.$class_prefix.'">';
    171172        $url = duplicate_index_url(
    172173          array('chronology_date'=>array_merge($date_components,array($item))),
    173174          array( 'start' )
    174175            );
    175         $nav_bar .= '<a href="'.$url.'">';
    176         $nav_bar .= $label;
    177         $nav_bar .= '</a>';
     176        $tmp_datas=array(
     177          'classname' => $class_prefix,
     178          'label'=> $label,
     179          'url' => $url
     180        );
    178181      }
    179182      if ($nb_images > 0)
    180183      {
    181         $nav_bar .= '('.$nb_images.')';
    182       }
    183       $nav_bar.= '</span>';
     184        $tmp_datas['nb_images']=$nb_images;
     185      }
     186      $nav_bar_datas[]=$tmp_datas;
     187     
    184188    }
    185189
     
    187191          count($date_components)<count($this->calendar_levels)-1 )
    188192    {
    189       $label = l10n('calendar_any');
    190       $nav_bar .= '<span class="'.$class_prefix.'">';
    191193      $url = duplicate_index_url(
    192194        array('chronology_date'=>array_merge($date_components,array('any'))),
    193195        array( 'start' )
    194196          );
    195       $nav_bar .= '<a href="'.$url.'">';
    196       $nav_bar .= $label;
    197       $nav_bar .= '</a>';
    198       $nav_bar.= '</span>';
    199     }
    200     return $nav_bar;
     197      $nav_bar_datas[]=array(
     198        'label' => l10n('calendar_any'),
     199        'classname' => $class_prefix,
     200        'url' => $url
     201      );
     202    }
     203
     204    $template->set_filenames( array( 'nav_bar' => 'calendar_navbar.tpl',));
     205    $template->assign('datas', $nav_bar_datas);
     206    return($template->parse('nav_bar', true));
    201207  }
    202208
  • trunk/plugins/AMenuManager/menu_templates/menubar_links.tpl

    r2466 r2469  
    55{/if}
    66<dd>
    7   <ul>
     7  <ul {if $section.ITEMS.icons=='y'}style="padding-left:4px;list-style:none;"{/if}>
    88    {foreach from=$section.ITEMS.LINKS item=link}
    99      <li>
  • trunk/plugins/test_menu/menu_templates/menubar_identification.tpl

    r2466 r2469  
    3636  <label>
    3737    {'Username'|@translate}
    38     <input type="text" name="username" size="15" value="">
     38    <input type="text" name="username" size="15" value="" id="iusername">
    3939  </label>
    4040
    4141  <label>
    4242    {'Password'|@translate}
    43     <input type="password" name="password" size="15">
     43    <input type="password" name="password" size="15" id="ipassword">
    4444  </label>
    4545
     
    4747  <label>
    4848    {'remember_me'|@translate}
    49     <input type="checkbox" name="remember_me" value="1">
     49    <input type="checkbox" name="remember_me" value="1" id="iremember_me">
    5050  </label>
    5151  {/if}
  • trunk/plugins/test_menu/menubar.inc.php

    r2468 r2469  
    287287
    288288
    289 $section = new Section('mbLinks', 'links', MENU_TEMPLATES_PATH.'menubar_links.tpl');
     289$section = new Section('mbLinks', 'Links', MENU_TEMPLATES_PATH.'menubar_links.tpl');
    290290$section->set_items($datas['links']);
    291291$menu->add($section->get());
Note: See TracChangeset for help on using the changeset viewer.