function processMainTemplate() { $this->_TMS->MFFields = array(); $this->_TMS->MFReplacement = array(); $pages = xCore::moduleFactory('pages.front'); jsCollector::pushJsDir('main', xConfig::get('PATH', 'TEMPLATES') . '_base/js', 1); $this->globalFields['HOST'] = HOST; $this->globalFields['PAGE'] = $pages->page; $this->globalFields['DOMAIN'] = $pages->domain; $this->globalFields['LANGVERSION'] = $pages->langVersion; $this->globalFields['JS'] = jsCollector::get('main'); /** * Подключение шаблона страницы если она не является страницей на главном шаблоне */ if (!strstr($this->mainTemplate['path'], '_index.html')) { $this->_TMS->AddFileSection(xConfig::get('PATH', 'COMMON_TEMPLATES') . $this->mainTemplate['path']); } if ($this->externalMeta['Title']) { $this->globalFields['Title'] = $this->externalMeta['Title']; } if ($this->externalMeta['Keywords']) { $this->globalFields['Keywords'] = $this->externalMeta['Keywords']; } if ($this->externalMeta['Description']) { $this->globalFields['Description'] = $this->externalMeta['Description']; } global $cache; //догружаем не объявленные секции /* if(!$_COMMON_SITE_CONF['disable_m_caching']) { // $cache_name=md5($_SERVER['REQUEST_URI']).$_SESSION['currency']['id'].'titles.xtx'; // $cache->setCacheFile($cache_name); if($m_cache=$cache->getCache()) { $seodata=unserialize($m_cache); $this->globalFields['Title']=$seodata['Title']; $this->globalFields['Keywords']=$seodata['Keywords']; $this->globalFields['Description']=$seodata['Description']; }else{ // $cache->setCache(serialize(array('Title'=>$this->globalFields['Title'],'Keywords'=>$this->globalFields['Keywords'],'Description'=>$this->globalFields['Description']))); } } */ /** * Подключение главного шаблона для домена */ $this->_TMS->AddFileSection(xConfig::get('PATH', 'COMMON_TEMPLATES') . $pages->domain['basic'] . '/_index.html'); /** * Подключение главного шаблона кроссдоменного */ if (file_exists($mainTemplate = xConfig::get('PATH', 'TEMPLATES') . '/_index.html')) { $this->_TMS->AddFileSection($mainTemplate); } //компонуем модули $this->_TMS->AddMFMassReplace($this->modules_out); //данные ноды в странице $this->globalFields['ARES'] = xConfig::get('PATH', 'WEB_ARES'); $this->_TMS->AddFileSection(xConfig::get('PATH', 'TEMPLATES') . '_base/tpl/connector.html'); $this->_TMS->AddMassReplace('connector', array('xConnector' => XOAD_Client::register(new connector()), 'xoadHeader' => XOAD_Utilities::header(xConfig::get('WEBPATH', 'XOAD')))); $this->globalFields['XFRONT_API'] = $this->_TMS->parseSection('connector'); if ($this->_TMS->SectionNests['MAIN']) { foreach ($this->_TMS->SectionNests['MAIN'] as $section) { $this->_TMS->AddMassReplace($section, $this->globalFields); } } // $this->_TMS->AddMFMassReplace($_COMMON_SITE_CONF); return $this->_TMS->ParseRecurs('MAIN'); }
function getAdminPanelData() { static $apd = array(); if (!$apd) { $apd['version'] = xCore::getVersion(); $apd['charset'] = xConfig::get('GLOBAL', 'site_encoding'); $apd['lisence'] = xCore::getLicense(); if (class_exists('XOAD_Utilities')) { $apd['xoadHeader'] = XOAD_Utilities::header(xConfig::get('WEBPATH', 'XOAD')); } $apd['lang'] = $_SESSION['lang']; $apd['siteByDefault'] = HOST; $apd['XJS'] = xConfig::get('WEBPATH', 'XJS'); } return $apd; }
class Timeout { function Invoke() { sleep(5); return 'OK'; } function Invoke2() { sleep(5); return 'OK'; } } define('XOAD_AUTOHANDLE', true); require_once '../xoad.php'; echo XOAD_Utilities::header('..') . "\n"; ?> <script type="text/javascript"> var obj = <?php echo XOAD_Client::register(new Timeout()); ?> ; function handleError(error) { if (error.code == XOAD_ERROR_TIMEOUT) { alert('Global: Timeout.'); } };
} else { echo $all; } } exit; } } else { xRegistry::set('TPA', $TPA = new tPageAgregator()); if (isset($_GET['action'])) { $TPA->dispatch_action($_GET['action']); } elseif ($page = $TPA->execute_page(xConfig::get('PATH', 'baseUrl'))) { if ($TPA->FED_MODE) { $xConnector = new Connector(); $xConnector_obj = XOAD_Client::register($xConnector, array('url' => '/admin.php')); $TMS->AddFileSection($_PATH['ADM'] . 'tpl/FED.html'); $TMS->AddMassReplace('FED', array('front_obj' => XOAD_Client::register(new front_api()), 'xConnector' => $xConnector_obj, 'xoad_header' => XOAD_Utilities::header($_WEBPATH['XOAD']))); $page = preg_replace(array('#<script[^>]*>.*?</script>#is'), array(''), $page); $page .= $TMS->parseSection('FED'); } $all = $page; if (xConfig::get('GLOBAL', 'enable_page_caching') && !$TPA->DisablePageCaching && !$TPA->FED_MODE) { $cache->toCache($all); } if (xConfig::get('GLOBAL', 'show_debug_info')) { $y = Common::getmicrotime() - $x; $all .= '<!-- ' . $y . ' -->'; } if (xConfig::get('GLOBAL', 'output_html_compress')) { $all = Common::compress_output($all); } echo $all;
{ if ($a == 0) { return false; } $this->result /= $a; return true; } public function Clear() { $this->result = 0; return true; } } define('XOAD_AUTOHANDLE', true); require_once '../../xoad.php'; echo XOAD_Utilities::header('../..'); ?> <input type="text" id="operationValue" value="1" style="font: normal 0.8em tahoma, verdana, arial, serif; width: 10em;" /> <span id="operationResult" style="font: normal 0.8em tahoma, verdana, arial, serif;"></span> <br /> <button onclick="add()" style="font: normal 1em tahoma, verdana, arial, serif; width: 2em;">+</button> <button onclick="sub()" style="font: normal 1em tahoma, verdana, arial, serif; width: 2em;">-</button> <button onclick="mul()" style="font: normal 1em tahoma, verdana, arial, serif; width: 2em;">*</button> <button onclick="div()" style="font: normal 1em tahoma, verdana, arial, serif; width: 2em;">/</button> <br />
if ($_module->_tree) { $_module->_tree->WriteNodeParam(1, 'Name', $module['alias'] . '(' . $_SERVER["HTTP_HOST"] . ')'); } $this->result['modules'][] = 'Модуль ' . $module['name'] . " инициализирован\r\n"; } } } } } function xoadGetMeta() { XOAD_Client::mapMethods($this, array('execute')); XOAD_Client::publicMethods($this, array('execute')); } } $TMS->AddFileSection('install/install.html'); session_start(); $inst = new x3minstall(); if ($_REQUEST['xoadCall']) { ob_start(); if (XOAD_Server::runServer()) { $all = ob_get_contents(); ob_end_clean(); echo $all; exit; } } else { $TMS->AddReplace('main', 'xoadHeader', XOAD_Utilities::header("http://" . $_SERVER["HTTP_HOST"] . '/inc/xoad/')); $TMS->AddReplace('main', 'xObject', XOAD_Client::register($inst)); echo $inst->start_install($data); }