Example #1
0
 protected function doBuild(PageContext $ctxt, PageBuilderContext $builderCtxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams)
 {
     //1. ЗАГОЛОВОК
     $builderCtxt->setTitle($this->basicPage->getTitle());
     //2. JAVASCRIPT
     $jsParams['postId'] = $ctxt->getPostId();
     $jsParams['rubricId'] = $ctxt->getRubricId();
     $jsParams['postType'] = $ctxt->getPostType();
     $jsParams['isPostsListPage'] = $ctxt->isPostsListPage();
     $jsParams['isRubricPage'] = $ctxt->isRubricPage();
     $jsParams['isPostPage'] = $ctxt->isPostPage();
     //Разборы, пройденные пользователем
     $passed = TrainManager::inst()->getUserPassedLessons();
     $jsParams['passedLessons'] = empty($passed) ? null : $passed;
     //Структура проекта
     $jsParams['structure'] = NavigationManager::inst()->getStructure();
     $builderCtxt->setJsParams($jsParams);
     //Параметры, зависимые от страницы
     $builderCtxt->setJsParams($this->basicPage->getJsParams());
     //3. SMARTY RESOURCES
     $builderCtxt->setSmartyParams4Resources($this->basicPage->getSmartyParams4Resources());
     //4. GET SMARTY PARAMS FOR TPL
     $smartyParams['host'] = ServerArrayAdapter::HTTP_HOST();
     $smartyParams['content'] = BasicPagesManager::inst()->getResourcesLinks($this->basicPage->getIdent(), ContentHelper::getContent($this->basicPage));
     return $smartyParams;
 }
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include_once 'core/NavigationManager.php';
$nav = new NavigationManager();
$nav->navigate();
Example #3
0
    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';
$replace = 'href="'.$url.'/$1"';
$data =  preg_replace($pattern, $replace, $nav_output);

$pattern = '/href\s?=\s?"((?!http)[\w\d\.\/?= -]*)"/i';
$replace = 'href="'.$url.'/$1"';
$data =  preg_replace($pattern, $replace, $data);
Example #4
0
$CALLED_FILE = __FILE__;
$DATE = date('Y-m-d H.i.s');
$sm = Secundomer::startedInst();
$HOST = getCmdParam(1);
//postupayu.ru
$USE_SCENARIOS = getCmdParam(2) == 1;
//true/false
$REQUESTS_CNT = 5;
//Кол-во запросов
$DM = DirManager::inst(__DIR__);
dolog("Started, DATE: {$DATE}, HOST: {$HOST}, USE_SCENARIOS={$USE_SCENARIOS}, REQUESTS_CNT={$REQUESTS_CNT}.");
/*
 * Загружаем ссылки
 */
$HREFS = array();
foreach (NavigationManager::inst()->getRealHrefs() as $a) {
    $data = simplexml_load_string($a);
    $href = '' . $data['href'];
    $content = '' . $data[0];
    if ($href && $content) {
        $HREFS[$href] = $content;
    }
}
dolog('Hrefs list: ' . print_r($HREFS, true));
if (empty($HREFS)) {
    exit;
}
$TOTAL = 0;
function doTest()
{
    global $HOST;