Пример #1
0
         if ($v['type'] == 'article') {
             $rslt[] = array('id' => $v['id'], 'text' => $v['title'], 'children' => $v['rgt'] - $v['lft'] > 1, 'type' => 'article', 'icon' => 'file');
         } else {
             $rslt[] = array('id' => $v['id'], 'text' => $v['title'], 'children' => $v['rgt'] - $v['lft'] > 1, 'icon' => 'folder');
         }
     }
     break;
 case "get_content":
     $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : 0;
     $page = isset($_GET['page']) && $_GET['page'] > 0 ? $_GET['page'] : 1;
     $node = explode(':', $node);
     $opt = array('with_path' => true, 'with_children' => true, 'page_children' => $page, 'with_tag' => true);
     if ($page > 1) {
         unset($opt['with_path']);
     }
     $nodes = $fs->get_nodes($node, $opt);
     echo json_encode($nodes);
     die;
     $rslt = array('nodes' => $nodes);
     /*
     				if(count($node) > 1) {
     					$rslt = array('content' => 'Multiple selected');
     				}
     				else {
     					$temp = $fs->get_node((int)$node[0], array('with_path' => true));
     					$rslt = array('content' => 'Selected: /' . implode('/',array_map(function ($v) { return $v['title']; }, $temp['path'])). '/'.$temp['title']);
     				}*/
     break;
 case 'set_node':
     $id = isset($_POST['id']) && $_POST['id'] !== '#' ? $_POST['id'] : 0;
     if (!$id) {