/** * Retrieves nodes id of the list defined by the given filter. * This allows to retrieve ALL (ie without pagination) nodes ids for a list. * @see ApmListData::load_with_filters() to see available filters */ public static function list_get_all_nodes() { parent::$json_data += array('list_nodes' => 0); if (!empty($_POST['filters'])) { $list = new ApmListData(); $list_nodes = $list->get_list_nodes_with_filters($_POST['filters']); parent::$json_data['list_nodes'] = $list_nodes; } else { parent::add_error('At least one filter must be provided!'); } parent::send_json(); }
/** * Opens (unfolds) the necessary nodes to access to a given node, and * returns the HTML of the first unfolded node and its children. */ public static function tree_find_node() { parent::$json_data += array('node_to_find' => '', 'node_to_replace' => '', 'tree_to_replace_node_with' => '', 'tree_nodes' => array()); $tree = new ApmTreeData(); $tree->load_last_tree(); $node_to_find = $_POST['node_to_find']; parent::$json_data['node_to_find'] = $node_to_find; $node_to_replace = $tree->open_the_way_to_node($node_to_find); if ($node_to_replace !== false) { parent::$json_data['node_to_replace'] = $node_to_replace; $tree_nodes = $tree->get_ready_to_display_tree($node_to_replace); parent::$json_data['tree_nodes'] = array_keys($tree_nodes); parent::$json_data['tree_to_replace_node_with'] = self::get_html_tree($tree_nodes); } else { parent::add_error("Node [{$node_to_find}] not found"); } parent::send_json(); }