$open = false; $select = false; $traverse = \runner::stack('traverse'); $models_created = \runner::stack("models_created"); $open = isset($runner->context['open']) ? $runner->context['open'] : false; $debug = 1; ?> <<?php echo $element . $html; ?> > <?php $router = false; if ($open) { $removed = array(); $children = \Routerunner\Bootstrap::children($runner->context['reference']); foreach ($children as $index => $child) { $open = in_array($child['reference'], $traverse['parents_ref']) ? true : false; if ($models_created) { foreach ($models_created as $created_data) { if (in_array($child['reference'], $created_data["parent"])) { $open = true; } } } $override = null; $child_context = array('reference' => $child['reference'], 'model_class' => $child['model_class'], 'table_id' => $child['table_id'], 'route' => $runner->context['route'], 'open' => $open); if (isset($child['label'])) { $override = array('label' => $child['label']); //$child_context['label'] = $child['label']; }
<?php /** * Created by PhpStorm. * User: csibi * Date: 2015.06.11. * Time: 17:03 */ $debug = 1; $selected_class = \bootstrap::get("submenu") == \model::property("id") ? ' selected' : ''; $has_children_class = ''; if (\Routerunner\Bootstrap::children(\model::property("reference"))) { $has_children_class = ' menu-item-has-children'; }
public function __construct() { $this->resource_types = array_merge($this->resource_types, $this->menus, $this->contents); $resources = \Routerunner\Bootstrap::$resources; $this->reference = \Routerunner\Bootstrap::$reference; $this->resource_url = trim(\Routerunner\Bootstrap::$resourceUri, ' /'); $this->url = $this->resource_url; $this->urls = \Routerunner\Bootstrap::$urls; if (count($this->urls)) { $this->url = $this->urls[0]; } $this->pageproperties = $this->pageproperties_default; foreach (\Routerunner\Bootstrap::$metas as $meta_key => $meta_value) { if ($meta_key == "meta" && is_array($meta_value)) { foreach ($meta_value as $row_key => $row_value) { if (!is_array($this->pageproperties[$meta_key])) { $this->pageproperties[$meta_key] = array(); } if ($row_value !== false) { $this->pageproperties[$meta_key][$row_key] = $row_value; } } } elseif ($meta_value !== false) { $this->pageproperties[$meta_key] = $meta_value; } } $this->states = array_merge_recursive($this->states, \Routerunner\Bootstrap::$states); $this->lang = \Routerunner\Bootstrap::$lang; $this->tree = \Routerunner\Bootstrap::$tree; if ($this->tree['children']) { foreach ($this->tree['children'] as $child) { $this->children[$child['reference']] = array($child['table_id'] => $child['model_class']); if (in_array($child['model_class'], $this->contents)) { $this->content_children[$child['reference']] = array($child['table_id'] => $child['model_class']); } elseif (in_array($child['model_class'], $this->menus)) { $this->menu_children[$child['reference']] = array($child['table_id'] => $child['model_class']); } if (!$this->first_child) { $this->first_child = $child; } } if (!$this->content_children && $this->menu_children) { foreach ($this->menu_children as $menu_reference => $menu_table) { if ($menu_children = \Routerunner\Bootstrap::children($menu_reference)) { foreach ($menu_children as $menu_child) { if (in_array($menu_child['model_class'], $this->contents)) { $this->sub_content_children[$menu_child['reference']] = array($menu_child['table_id'] => $menu_child['model_class']); } } } } } } $parents = array(); if (isset($this->tree['parents'])) { $parents = $this->tree['parents']; } $current = false; if (isset($this->tree['current'])) { $current = $this->tree['current']; } elseif (isset($resources[0], $resources[1])) { $this->current = array($resources[0] => $resources[1]); } if ($current && is_array($current)) { unset($current['ind']); $current['lvl'] = 0; $parents[] = $current; } foreach ($parents as $parent) { if (isset($parent['model_class']) && $parent['model_class'] !== "lang") { if (!isset($this->breadcrumb[$parent['model_class']])) { $this->breadcrumb[$parent['model_class']] = $parent['table_id']; } else { if (!is_array($this->breadcrumb[$parent['model_class']])) { $this->breadcrumb[$parent['model_class']] = array($this->breadcrumb[$parent['model_class']]); } $this->breadcrumb[$parent['model_class']][] = $parent['table_id']; } } } if (isset($this->tree['current']['model_class'], $this->tree['current']['table_id'])) { $this->current = array($this->tree['current']['model_class'] => $this->tree['current']['table_id']); } $this->resource = $resources; $this->params = \Routerunner\Bootstrap::$params; }