developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #811: admin_menu.diff

File admin_menu.diff, 2.7 KB (added by Lipki, 13 years ago)
  • jelix-admin-modules/master_admin/templates/zone_admin_menu.tpl

     
    11{foreach $menuitems as $bloc}
    2 {if count($bloc->childItems)}
    3 <div class="menu-bloc" id="menu-bloc-{$bloc->id}">
    4     {if $bloc->label}<h3>{$bloc->label|eschtml}</h3>{/if}
    5     <ul>{foreach $bloc->childItems as $item}
    6         <li{if $item->id == $selectedMenuItem} class="selected"{/if}{if $item->icon} style="background-image:url({$item->icon});"{/if}><a href="{$item->link|eschtml}">{$item->label|eschtml}</a></li>
    7     {/foreach}</ul>
    8 </div>
    9 {/if}
     2    {if count($bloc->childItems)}
     3        <div class="menu-bloc" id="menu-bloc-{$bloc->id}">
     4            {if $bloc->label}<h3>{$bloc->label|eschtml}</h3>{/if}
     5            <ul>{foreach $bloc->childItems as $item}
     6                <li {if $item->id == $selectedMenuItem} class="selected"{/if}
     7                    {if $item->icon} style="background-image:url({$item->icon});"{/if}>
     8                    {if $item->type == 'zone'} {$item->content} {else}
     9                        <a href="{$item->content|eschtml}">{$item->label|eschtml}</a> {/if}
     10                </li>
     11            {/foreach}</ul>
     12        </div>
     13    {/if}
    1014{/foreach}
     15 No newline at end of file
  • jelix-admin-modules/master_admin/zones/admin_menu.zone.php

     
    1212    public $id = '';
    1313    public $parentId = '';
    1414    public $label = '';
    15     public $link = '';
     15    public $content = '';
     16    public $type = 'act';
    1617    public $order = 0;
    1718    public $icon = '';
    1819   
    1920    public $childItems = array();
    2021   
    21     public function __construct($id, $label, $link, $order=0, $parentId='') {
     22    public function __construct($id, $label, $content, $order=0, $parentId='', $type = 'act') {
    2223        $this->id = $id;
    2324        $this->parentId = $parentId;
    2425        $this->label = $label;
    25         $this->link = $link;
     26        $this->content = $content;
     27        $this->type = $type;
    2628        $this->order = $order;
     29       
    2730    }
    2831   
    2932    public function copyFrom($item) {
    3033        $this->label = $item->label;
    31         $this->link = $item->link;
     34        $this->content = $item->content;
     35        $this->type = $type;
    3236        $this->order = $item->order;
    3337        $this->icon = $item->icon;
    3438        $this->childItems = array_merge($item->childItems, $this->childItems);