protected function generateGuis($guiController)
 {
     $activeTab = $this->getParam("activeTab");
     $needTabs = $this->getParam("needTabs");
     $gui = new $guiController($this->nodeData);
     $nodeId = $this->nodeData['tree_id'];
     $classMethods = get_class_methods($gui);
     $tabsHeader = '<ul class="tabs">';
     $addAccess = K_access::accessTree($nodeId, array('add', 'addremove'), true);
     $i = 0;
     foreach ($classMethods as $methodName) {
         if (strpos($methodName, 'GUI') !== false && $gui->{$methodName}() !== false) {
             $tabName = substr($methodName, 0, -3);
             // var_dump( $this->tabAction($tabName));
             //  var_dump( K_access::accessTree($nodeId,$this->tabAction($tabName)));
             if ($addAccess || K_access::accessTree($nodeId, $this->tabAction($tabName))) {
                 $i++;
                 if (empty($needTabs) || in_array($tabName, $needTabs)) {
                     echo '<div class="gui-block tab_content ' . $tabName . '" id="tab' . ($i + 1) . '" >' . $gui->{$methodName}() . '</div>';
                     $tabsHeader .= '<li ' . ($tabName == $activeTab ? 'class="activeTab"' : '') . '><a href="#tab' . ($i + 1) . '" id="tab-' . $tabName . '", >' . (isset($gui->tabs[substr($methodName, 0, -3)]) ? $gui->tabs[substr($methodName, 0, -3)] : '---') . '</a></li>';
                 }
             }
             if ($i == 0) {
                 $this->putAjax("<div style='margin:15px'>Для этого пункта доступен только просмотр");
             }
         }
     }
     $tabsHeader .= '</ul>';
     echo $tabsHeader;
 }
Beispiel #2
0
     if (!K_access::accessTree($key, array('add', 'addremove'), true)) {
         $this->putAjax('{ "status" : false}');
     }
 } else {
     if (!K_access::accessTree($key, array('addremove'), true)) {
         $this->putAjax('{ "status" : false}');
     }
 }
 if ($baseKey == 1 && ($position == 'after' || $position == 'before') || $key == 1 || $baseKey == $key) {
 } else {
     if ($copy) {
         $returnJson = K_CupTree::сNode($key, $pasteKey);
         $returnJson['status'] = 1;
         echo json_encode($returnJson);
     } else {
         //рессурс ноды до перемещения
         $nodeParentsArr = K_Tree::getParents($key);