Ejemplo n.º 1
0
 /**
  *
  * @return void
  */
 public function _parent_menu($panel, $parent = NULL, $pDepth = 0)
 {
     $out = array();
     if ($parent) {
         $mt = new Model_Menu($parent);
         $found = $mt->children();
     } else {
         $mt = Model_Menu::getInstance();
         $params = array('parent' => 0, 'panel' => $panel);
         $found = $mt->find($params, 'sort_by');
     }
     foreach ($found as $m) {
         $out[$m->identity() . '_' . $panel] = $this->_pm_prefix($pDepth) . $m->label;
         foreach ($this->_parent_menu($panel, $m->identity(), $pDepth + 1) as $k => $v) {
             $out[$k] = $v;
         }
     }
     return $out;
 }
Ejemplo n.º 2
0
 /**
  *
  * @param Model_Menu $pMenu
  * @return array
  */
 public function _menu_ini(Model_Menu $pMenu)
 {
     $out = $pMenu->toArray();
     unset($out['parent']);
     unset($out['id']);
     unset($out['path']);
     foreach (array('href', 'callback_class', 'parameters') as $param) {
         if (!$out[$param]) {
             unset($out[$param]);
         }
     }
     foreach ($pMenu->children() as $i => $child) {
         $data = $this->_menu_ini($child);
         $data['sort_by'] = $i + 1;
         $out['pages'][$child->name] = $data;
     }
     return $out;
 }