<?php ignore_user_abort(1); preg_match('@^(?:www.)?([^/]+)@i', $_SERVER['HTTP_HOST'], $m); define('REAL_HTTP_HOST', $m[1]); require_once 'inc/core.php'; require_once 'conf/init.php'; $TMS = new TMutiSection(); $TDB = new Tmysqllayer(DB_USER, DB_PASS, DB_NAME, DB_HOST); $TPA = new TPageAgregator(); $TMS->registerHandlerObj('D', new DEBUG()); $TMS->registerHandlerObj('E', new ENHANCE()); $TMS->registerHandlerObj('MAIN', new MAIN()); /* * x3_cron implements crons * cron status: * #1-pending * #2-inprogress * #3-finished */ class x3_cron { private $tasks; private static $instance; private $chain; static function getInstance() { if (!self::$instance) { self::$instance = new x3_cron(); } return self::$instance;
function parse_price_tpl($tpl_file, $is_runtime = false) { global $TMS; $tms = new TMutiSection(true); if ($is_runtime) { $TMS->AddFileSection(Common::get_module_tpl($this->_module_name, 'edit_price.html')); } $tms->AddFileSection(Common::get_site_tpl($this->_module_name, $tpl_file)); if ($tms->Extended) { foreach ($tms->Extended['xtr_price'] as $field_name => $ext) { switch ($ext['type']) { case 'IMAGE': case 'INPUT': $TMS->AddReplace($ext['type'], '_field_name', $field_name); $TMS->AddMassReplace($ext['type'], $ext); $TMS->ParseSection($ext['type'], true); break; case 'TEXT': $TMS->AddReplace($ext['type'], '_field_name', $field_name); $TMS->AddMassReplace($ext['type'], $ext); $TMS->ParseSection($ext['type'], true); } } $this->result['fields'] = $TMS->ParseSection('fields'); } }
<?php /*шаблонная система*/ require_once 'conf/init.php'; require_once 'inc/core.php'; //global tpl system $TMS = new TMutiSection(); //global DB layer $TDB = null; require_once '_adm/adm.class.php'; require_once 'inc/xoad/xoad.php'; class x3minstall { var $result = null; function execute($action, $parameters = null) { $this->result = ''; if (is_array($action)) { foreach ($action as $act_name => $act_param) { $this->{$act_name}($act_param); } if ($this->result['error']) { $this->result['errortext'] = implode(' ', $this->result['errortext']); } $this->result = XCODE::win2utf($this->result); } else { return $this->actions($action, $parameters); } } function start_install() {
function parse_content_tpl($params) { global $TMS, $Adm; $tms = new TMutiSection(true); $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'edit_content')), true), true); $tms->AddFileSection(Common::get_site_tpl($this->_module_name, $params['tpl_file'])); if ($tms->Extended) { foreach ($tms->Extended['xtr_content'] as $field_name => $ext) { switch ($ext['type']) { case 'ARTICLE': if ($cnt = $this->_tree->Search('', true, array('obj_type' => array('_CONTENT', '_CONTENTGROUP')))) { while (list($id, $cntObj) = each($cnt)) { if ($cntObj['obj_type'] == '_CONTENT') { $cntNew[$id] = $cnt[$cntObj['ancestor']]['basic'] . '/' . $cntObj['basic']; } } if ($cntNew) { asort($cntNew); $articlesList = XHTML::as_select_opt($cntNew); } } $TMS->AddReplace($ext['type'], '_field_initial', $articlesList); $TMS->AddReplace($ext['type'], '_field_name', $field_name); $TMS->AddMassReplace($ext['type'], $ext); $TMS->parseSection($ext['type'], true); break; case 'IMAGE': case 'TEXT': case 'INPUT': $TMS->AddReplace($ext['type'], '_field_name', $field_name); $TMS->AddMassReplace($ext['type'], $ext); $TMS->parseSection($ext['type'], true); break; } } $this->result['fields'] = $TMS->parseSection('fields'); } }