コード例 #1
0
     if ($treeroot) {
         $route[] = $treeroot["model_class"] . '/' . $treeroot["table_id"];
     }
     if (isset($post['route']) && is_array($post['route'])) {
         $treeroot_index = false;
         foreach ($post['route'] as $post_route_index => $post_route) {
             if ($post_route && ($post_route == $treeroot["model_class"] || strpos($post_route, $treeroot["model_class"] . '/') !== false)) {
                 $treeroot_index = $post_route_index;
                 break;
             }
         }
         if ($treeroot_index && count($post['route']) > $treeroot_index) {
             $route = array_merge($route, array_slice($post['route'], $treeroot_index + 1));
         }
     }
     $tree = \Routerunner\Bootstrap::getTree($post["current"]);
     $current = $tree["current"];
     //$route[] = $current["model_class"];
 }
 if ($treeroot && isset($treeroot["reference"])) {
     $treeroot = $treeroot["reference"];
 } else {
     $treeroot = $lang;
 }
 $context = array('reference' => isset($post["reference"]) && $post["reference"] ? $post["reference"] : $treeroot, 'model_class' => '', 'table_id' => 0, 'route' => $route ? $route : array(''), 'open' => true);
 if (isset($post['reference'], $post['model_class'], $post['table_id']) && $post['reference'] && $post['model_class'] && $post['table_id']) {
     $context['reference'] = $post['reference'];
     $context['model_class'] = $post['model_class'];
     $context['table_id'] = $post['table_id'];
     $context['route'] = $route;
 }