コード例 #1
0
ファイル: nodes_ajax.php プロジェクト: CrankMaster336/FFW-TR
 public static function nodes_unmark_all()
 {
     parent::$json_data += array('unmarked_nodes' => array());
     $unmarked_nodes = ApmTreeData::unmark_all_current_user_nodes();
     parent::$json_data['unmarked_nodes'] = $unmarked_nodes;
     parent::send_json();
 }
コード例 #2
0
 /**
  * Delete plugin database footprint on unsinstall
  */
 public static function uninstall()
 {
     ApmTreeData::delete_database_data();
     ApmAddons::delete_database_data();
 }
コード例 #3
0
ファイル: tree_data.php プロジェクト: erkmen/wpstartersetup
 /**
  * Insert a given page in the APM tree
  * @param object $post
  */
 public static function insert_page_from_outside($page)
 {
     $tree = new ApmTreeData();
     $tree->load_last_tree();
     if (!$tree->is_wp_page_in_tree($page->ID) && in_array($page->post_status, ApmConfig::$allowed_post_status)) {
         $parent_id = empty($page->post_parent) ? ApmTreeData::root_id : $page->post_parent;
         $insert_infos = $tree->get_new_page_insert_infos_from_sibling($parent_id, $page->menu_order);
         $tree->add_new_node($insert_infos['action'], $insert_infos['index_node'], 'page', $page->ID);
     }
 }
コード例 #4
0
ファイル: options.php プロジェクト: CrankMaster336/FFW-TR
 private static function check_tree_loaded()
 {
     $tree_db = ApmTreeDb::get_last_tree();
     if (empty($tree_db)) {
         $tree = new ApmTreeData();
         $tree->load_last_tree();
         //Will load the tree from WP entities
     }
 }
コード例 #5
0
ファイル: tree_ajax.php プロジェクト: CrankMaster336/FFW-TR
 /**
  * Loads a subtree given its root.
  * Not used yet TODO: see if we remove this function 
  */
 public static function tree_load_sub_tree()
 {
     parent::$json_data += array('sub_tree' => '', 'node_to_replace' => '', 'sub_tree_nodes' => array());
     $root_node = isset($_POST['root_node']) && is_numeric($_POST['root_node']) ? $_POST['root_node'] : ApmTreeData::root_id;
     $tree = new ApmTreeData();
     $tree->load_last_tree();
     //Set the "tree_nodes" variable retrieved and used in the following included template:
     $sub_tree_nodes = $tree->get_ready_to_display_tree($root_node);
     parent::$json_data['sub_tree'] = self::get_html_tree($sub_tree_nodes);
     parent::$json_data['node_to_replace_by_subtree'] = $root_node;
     parent::$json_data['sub_tree_nodes'] = array_keys($sub_tree_nodes);
     parent::send_json();
 }