예제 #1
0
    print $cached_output;
    exit;
}
$intro_id = isset($_GET['intro_id']) && $_GET['intro_id'] ? intval($_GET['intro_id']) : false;
$position = isset($_GET['position']) && $_GET['position'] ? $_GET['position'] : false;
$format = isset($_GET['format']) && $_GET['format'] ? $_GET['format'] : false;
if (!$position) {
    trigger_error('no position requested for ' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
    exit;
}
require_once 'AMP/BaseTemplate.php';
$current_page =& AMPContent_Page::instance();
require_once 'AMP/Content/Template.inc.php';
require_once 'AMP/Content/Nav/Manager.inc.php';
$template = new AMPContent_Template(AMP_Registry::getDbcon(), $current_page->getTemplateId());
if (!$template->hasData()) {
    return false;
}
$header =& AMP_get_header();
$standard_js = $header->_HTML_javaScripts();
$template->setPage($current_page);
$template->globalizeNavLayout();
$nav_manager = new NavigationManager($template, $current_page);
$nav_output = $nav_manager->output(strtoupper(substr($position, 0, 1)));
$new_js = $header->_HTML_javascripts();
$nav_js = array_diff(split("\n", $new_js), split("\n", $standard_js));
$nav_output = $nav_output . join("\n", $nav_js);
/*
$url = AMP_SITE_URL;

$pattern = '/href\s?=\s?\'((?!http)[\w\d\.\/?= -]*)\'/i';
예제 #2
0
 /**
  * set the Template for use on the current page 
  * 
  * @param   integer     $template_id    The database id of the Template to use 
  * @access  public
  * @since   3.5.3
  * @return  void
  */
 function setTemplate($template_id)
 {
     require_once 'AMP/Content/Template.inc.php';
     $template = new AMPContent_Template($this->_page->dbcon, $template_id);
     if (!$template->hasData()) {
         return false;
     }
     $template->setPage($this->_page);
     $this->_template =& $template;
     $template->globalizeNavLayout();
 }