Dotclear


Ignore:
Timestamp:
12/13/12 08:48:15 (13 years ago)
Author:
JcDenis
Branch:
twig
Message:
  • dcMenu is now "Twig compliant"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/class.dc.admincontext.php

    r1061 r1064  
    117117     { 
    118118          return array( 
    119                '__'           => new Twig_Function_Function("__", array('is_safe' => array('html'))), 
    120                'page_menu' => new Twig_Function_Method($this, 'pageMenu', array('is_safe' => array('html'))) 
     119               '__'           => new Twig_Function_Function("__", array('is_safe' => array('html'))) 
     120               //,'page_menu' => new Twig_Function_Method($this, 'pageMenu', array('is_safe' => array('html'))) 
    121121          ); 
    122122     } 
     
    134134          $this->getCurrentBlog(); 
    135135          $this->getCurrentUser(); 
     136          $this->getMenus(); 
    136137           
    137138          # Additional globals 
     
    200201     { 
    201202          $this->protected_globals['page_title'] = $title; 
    202      } 
    203       
    204      /** 
    205      pageMenu 
    206      */ 
    207      public function pageMenu() 
    208      { 
    209           $menu =& $GLOBALS['_menu']; 
    210           foreach ($menu as $k => $v) { 
    211                echo $menu[$k]->draw(); 
    212           } 
    213203     } 
    214204      
     
    308298               ); 
    309299     } 
     300      
     301     protected function getMenus() 
     302     { 
     303          global $_menu; 
     304           
     305          $this->protected_globals['menus'] = array(); 
     306           
     307          if (!isset($_menu)) { 
     308               return; 
     309          } 
     310           
     311          foreach($_menu as $m) { 
     312               $this->protected_globals['menus'][] = array( 
     313                    'id'           => $m->getID(), 
     314                    'title'        => $m->getTitle(), 
     315                    'separator'    => $m->getSeparator(), 
     316                    'items'        => $m->getItems() 
     317               ); 
     318          } 
     319     } 
    310320} 
    311321?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map