예제 #1
0
 /**
  * Builds HTML from tree or list $nodes
  * @param array $nodes Must be the result of a "get_ready_to_display_[tree|list]" method.
  * @param boolean $return_array Whether to return an array or a string of html nodes.
  */
 protected static function get_html_tree($nodes, $return_array = false)
 {
     $html = $return_array ? array() : '';
     if (!is_array($nodes)) {
         $nodes = array($nodes);
     }
     $template_name = !empty($_POST['tree_template']) ? $_POST['tree_template'] : 'tree_display';
     $tree_template_file = dirname(__FILE__) . '/../templates/' . ApmOptions::get_option('panel_page_template_name') . '/' . $template_name . '.php';
     if (file_exists($tree_template_file)) {
         require_once dirname(__FILE__) . '/../lib/custom_columns.php';
         if ($return_array) {
             $nodes_list = $nodes;
             foreach ($nodes_list as $node) {
                 $nodes = array($node);
                 ob_start();
                 require $tree_template_file;
                 $node_html = ob_get_contents();
                 ob_end_clean();
                 $html[$node->apm_id] = trim($node_html);
             }
         } else {
             ob_start();
             require $tree_template_file;
             $html = trim(ob_get_contents());
             ob_end_clean();
         }
     } else {
         self::add_error(__("Template not found", ApmConfig::i18n_domain) . ' : [' . $tree_template_file . ']');
     }
     return $html;
 }
예제 #2
0
 *  
 * We arrive here via the "template_redirect" hook in the main advanced_page_manager class.
 *  
 * @package APM
 */
header('Content-Type: text/html; charset=UTF-8');
require_once dirname(__FILE__) . "/api_ajax.php";
ApmApiAjax::check_admin_user_connected();
//Check the AJAX nonce
check_ajax_referer('apm_ajax_request');
if (isset($_POST['apm_action'])) {
    $action = $_POST['apm_action'];
    require_once dirname(__FILE__) . "/tree_ajax.php";
    require_once dirname(__FILE__) . "/list_ajax.php";
    require_once dirname(__FILE__) . "/nodes_ajax.php";
    if (ApmOptions::get_option('queries_watcher_on') == true) {
        $queries_watcher_file = dirname(__FILE__) . "/../lib/queries_watcher.php";
        if (file_exists($queries_watcher_file)) {
            require_once $queries_watcher_file;
            ApmQueriesWatcher::start();
        }
    }
    if (method_exists('ApmTreeAjax', $action)) {
        ApmTreeAjax::$action();
    } else {
        if (method_exists('ApmListAjax', $action)) {
            ApmListAjax::$action();
        } else {
            if (method_exists('ApmNodesAjax', $action)) {
                ApmNodesAjax::$action();
            }
 /**
  * Loads the "All pages" template 
  */
 public static function bo_panel_template()
 {
     ApmBoContext::set_current_page_infos($_GET['page']);
     $template_file = dirname(__FILE__) . "/templates/" . ApmOptions::get_option('panel_page_template_name') . "/browse.php";
     if (file_exists($template_file)) {
         require_once dirname(__FILE__) . '/lib/custom_columns.php';
         require_once $template_file;
     } else {
         self::show_error(__('Template not found', ApmConfig::i18n_domain) . ' : [' . $template_file . ']');
     }
 }
예제 #4
0
?>
><?php 
_e('Activated', ApmConfig::i18n_domain);
?>
</option>
									</select>
								</td>
							</tr>
							<tr>
								<td><?php 
_e('Display lost pages in the "All pages" panel', ApmConfig::i18n_domain);
?>
</td>
								<td>
									<?php 
$display_lost_pages = ApmOptions::get_option('display_lost_pages');
?>
									<select name="display_lost_pages">
										<option value="0" <?php 
echo $display_lost_pages ? '' : 'selected="selected"';
?>
><?php 
_e('Deactivated', ApmConfig::i18n_domain);
?>
</option>
										<option value="1" <?php 
echo $display_lost_pages ? 'selected="selected"' : '';
?>
><?php 
_e('Activated', ApmConfig::i18n_domain);
?>
예제 #5
0
    _e('Search results for', ApmConfig::i18n_domain);
    ?>
<strong>&laquo;&raquo;</strong></span></h2>
	<?php 
} else {
    ?>
		<h2><?php 
    _e('Marked Pages', ApmConfig::i18n_domain);
    ?>
</h2>
	<?php 
}
?>

	<?php 
if (ApmOptions::get_option('display_lost_pages') && ($lost_pages = ApmOptions::get_lost_pages())) {
    ?>
		<div id="browse_lost_pages" class="updated">
			<?php 
    $nb_lost_pages = count($lost_pages);
    ?>
			<h3><?php 
    echo $nb_lost_pages;
    ?>
 page<?php 
    echo $nb_lost_pages > 1 ? 's' : '';
    ?>
 hors arborescence :</h3>
		    <table>
			<?php 
    foreach ($lost_pages as $page) {