/** * Debug function : to display tree nodes marks infos */ public static function get_marked() { $marked_pages = array(); if (ApmAddons::addon_is_on('flagged_pages')) { $marked = new ApmMarkedNodes(); $marked_pages = $marked->get_marked_nodes(); } return $marked_pages; }
/** * Loads the template for the plugin options panel */ public static function bo_options_panel_template() { ApmOptions::handle_actions(); ApmAddons::handle_actions(); require_once dirname(__FILE__) . "/templates/core/bo_options_panel.php"; }
private static function order_by_marked($apm_ids, $order, $marked_apm_ids = array()) { if (!ApmAddons::addon_is_on('flagged_pages')) { return $apm_ids; } if (empty($marked_apm_ids)) { $apm_marked = new ApmMarkedNodes(); $marked_apm_ids = array_keys($apm_marked->get_marked_nodes()); } $marked = array(); $not_marked = array(); foreach ($apm_ids as $apm_id) { if (in_array($apm_id, $marked_apm_ids)) { $marked[] = $apm_id; } else { $not_marked[] = $apm_id; } } $apm_ids = $order == 'ASC' ? array_merge($not_marked, $marked) : array_merge($marked, $not_marked); return $apm_ids; }
<div class="inside"> <form action="<?php echo $base_url; ?> " method="post"> <?php wp_nonce_field(ApmOptions::save_options_nonce); ?> <input type="hidden" name="apm_options_action" value="<?php echo ApmAddons::$posted_options_action; ?> " /> <div class="form-table-wrapper"> <table class="form-table"> <?php $addons = ApmAddons::get_addons(); ?> <?php foreach ($addons as $addon) { ?> <tr> <td width="30%"><?php echo $addon['name']; ?> </td> <td> <select name="<?php echo $addon['option_name']; ?> "> <option value="0" <?php
public function delete($nodes_to_delete) { if (is_numeric($nodes_to_delete)) { $nodes_to_delete = array($nodes_to_delete); } foreach ($nodes_to_delete as $k => $node) { if (!array_key_exists($node, $this->nodes_data)) { unset($nodes_to_delete[$k]); } else { unset($this->nodes_data[$node]); } } if (ApmAddons::addon_is_on('flagged_pages')) { ApmMarkedNodes::delete_multiple($nodes_to_delete); } }
/** * Modified version of wp-admin/includes/meta-boxes.php::page_attributes_meta_box() */ $post_type_object = get_post_type_object($post->post_type); if ($post->post_type == 'page') { $is_page_in_apm_tree = Apm::get_page_is_in_apm_tree(); if ($is_page_in_apm_tree) { $marked = Apm::get_page_flag(); $marked = $marked > 0; $page_tree_positions = Apm::get_page_tree_positions(); $page_apm_id = Apm::get_page_apm_id(); ?> <?php if (ApmAddons::addon_is_on('flagged_pages')) { ?> <div id="apm_flag_links_wrapper"> <a href="#" id="apm_unflag_page" style="<?php echo $marked ? '' : 'display:none'; ?> " rel="<?php echo $page_apm_id; ?> "><img src="<?php echo plugin_dir_url(dirname(dirname(__FILE__))); ?> img/red_tag.png" alt="<?php _e('Page flagged : click here to unflag', ApmConfig::i18n_domain); ?> " title="<?php
private static function check_activated_addons_loaded() { if (self::$activated_addons === null) { self::$activated_addons = self::get_addons(true); } }