public function mygetPageContent($args) { $reg_exp = '#<body>(.*?)<\\/body>#si'; if (VBox::isExist('Page')) { $old_page = @VBox::get('Page'); } $pageId = (int) $args[0]; // var_dump($pageId); $page = new Page($pageId); // var_dump($page->checkHidden()); if ($page && !$page->checkHidden()) { $page->dropAllHeaders(); ob_start(); $agregator = new Agregator($pageId); $agregator->process(true); $content = ob_get_contents(); ob_clean(); if (!is_null($old_page)) { VBox::set('Page', $old_page); } if (!isset($args[1]) && preg_match($reg_exp, $content, $matches)) { return $matches[1]; } return $content; } }
public function __construct($localPath, $cacheDir, $cachecount = 5) { $this->dbName = ''; $this->isValidFS = FALSE; $this->localPath = ''; $this->cachePath = ''; $this->cacheLog['error'] = array(); $this->cacheLog['event'] = array(); $this->setLogMode(1); $this->cachecount = $cachecount; // date_default_timezone_set("UTC"); if (VBox::isExist('ConstData')) { $this->_constData = VBox::get('ConstData'); } else { $this->_constData = new ConstData(); VBox::set('ConstData', $this->_constData); } $this->loginPage = VBox::get('ConstData')->getConst('loginPage'); // $this->cachecount = $this->_constData->getConst('cachecount'); if (!file_exists($localPath . $cacheDir . '/')) { mkdir($localPath . $cacheDir . '/', 0775, TRUE); } if (file_exists($localPath . $cacheDir . '/')) { $this->localPath = $localPath; $this->cachePath = $localPath . $cacheDir . '/'; $this->isValidFS = TRUE; } }
public function __construct($pageId = NULL) { if ($access = IniParser::getInstance()->getSection('access')) { if (isset($access['ip'])) { $ips = explode(',', $access['ip']); if (in_array(self::getIp(), $ips)) { if (!defined('WWW2')) { define('WWW2', true); } } } } $this->isCacher = FALSE; if (isset($pageId)) { $this->pageId = $pageId; $this->isCacher = TRUE; } else { @($this->requestURI = '/' . $_GET['request']); } if (!VBox::isExist('ConstData')) { $this->constData = VBox::get('ConstData'); } else { $this->constData = new ConstData(); VBox::set('ConstData', $this->constData); } /* italiano, 14.01.2015 if(!VBox::isExist('Event')) { VBox::set('Event', new Event()); } /* end */ }
public function __construct() { if (VBox::isExist('ConstData')) { $this->dbName = VBox::get('ConstData')->getConst('langsDb') . '.'; } else { /* Exception */ } }
public function __construct() { $this->debug = isset($_GET['t']); $this->locale = isset($_GET['locale']) ? $_GET['locale'] : $_GET['locale']; if (VBox::isExist('purchase_account')) { $this->accaunt = VBox::get('purchase_account'); } }
public function __construct() { if (VBox::isExist('Page')) { $page = VBox::get('Page'); $this->PageId = $page->getPageId(); } else { $this->PageId = 0; } }
public function __construct() { if (VBox::isExist('Page')) { $this->languageId = VBox::get('Page')->languageId; $this->PageId = VBox::get('Page')->getPageId(); } else { $this->languageId = 1; $this->PageId = 1; } }
public function __construct() { if (VBox::isExist('Page')) { $page = VBox::get('Page'); //$this->siteDb = VBox::get('Page')->siteDb; $this->pageId = $page->getPageId(); $this->pageUrl = $page->getPageUrl(); } else { $this->pageId = 0; } }
public function __construct($localPath) { $this->dbName = ''; $this->localPath = $localPath; if (VBox::isExist('ConstData')) { $this->_constData = VBox::get('ConstData'); } else { VBox::set('ConstData', new ConstData()); $this->_constData = VBox::get('ConstData'); } $this->_constData->setConst('request', ''); }
public function __construct() { if (VBox::isExist('Page')) { $this->mLanguage = VBox::get('Page')->language; if (isset(VBox::get('Page')->address['prefix'])) { $this->mAddressPrefix = VBox::get('Page')->address['prefix']; } else { $this->mAddressPrefix = ''; } } else { $this->mLanguage = 'en'; $this->mAddressPrefix = ''; } }
public function __construct() { if (VBox::isExist('Page')) { $this->page = VBox::get('Page'); $this->mLanguage = $this->page->language; if (isset($this->page->address['prefix'])) { $this->mAddressPrefix = $this->page->address['prefix']; } else { $this->mAddressPrefix = ''; } $this->mPageAddress = $this->page->address['uri_address']; $this->PageId = $this->page->getPageId(); } else { $this->mLanguage = 'en'; $this->mAddressPrefix = ''; $this->PageId = 0; } }
public function init($productId) { if (!$this->dbName) { return FALSE; } if (VBox::isExist('Page')) { $this->langId = VBox::get('Page')->languageId; $this->language = VBox::get('Page')->language; } else { return FALSE; } $this->productId = intval($productId); if (1 > $this->productId) { return FALSE; } $this->currencyData = $this->getCurrencyCodes(); return TRUE; }
public function __construct($_key = null) { if (!VBox::isExist('Page') && isset($_POST['page_id'])) { include_once ENGINE_PATH . 'class/classPage.php'; $page = new Page($_POST['page_id']); $this->lstrings = $page->getLocalStrings(); } $this->db = VBox::get('ConstData')->getConst('langsDb'); /* //#1 for NameApi API $array_keys = array( '0b38c46364a919ef3ba2887081286c82-user1', //italiano 'bda2473939f5755ff0fbeabdbc033946-user1', //garbagecat76 'a950795667d63b9e3d37bcd31f7657b1-user1', //Andrew / andrewtest@rambler.ru / 5w25j3x8 'f8284e714c1539a8ebb06ddbb6409ffd-user1', //Svaran ); shuffle($array_keys); $this->key = $array_keys[0]; if(isset($_key)){ $this->key = $_key; } $context = Context::builder() ->apiKey($this->key) ->priority(Priority::REALTIME()) //->textCase(TextCase::TITLE_CASE()) ->build(); if (!isset(self::$service)) { self::$service = new Services\ServiceFactory($context); } // ping API service $pinger = self::$service->systemServices()->pinger(); $this->connected = $pinger->ping(); //#1 end */ }
/** * @author italiano * @date 12.12.2014 * return result globalExt function */ private function _getGlobalExt($string = null) { $string = trim($string); $content = ''; $data = array(); if (isset($string)) { $data = explode(' ', $string); } $class = $method = $func = $args = null; foreach ($data as $value) { list($type, $attr) = explode('=', $value); $attr = trim(str_replace('"', '', $attr)); $type = trim($type); switch ($type) { case "method": $method = $attr; break; case "class": $class = $attr; break; case "func": $func = $attr; break; case "params": $args = explode(',', $attr); break; } } if (isset($method)) { if (isset($this->_alias['globalExt'][$method])) { $class = $this->_alias['globalExt'][$method]['class']; $func = $this->_alias['globalExt'][$method]['func']; } } if (file_exists(LOCAL_PATH . 'application/globalExt/' . $class . '/index.php')) { if (!VBox::isExist($class)) { VBox::set($class, new $class()); } if (isset($func)) { if (isset($args)) { $content = VBox::get($class)->{$func}($args); } else { $content = VBox::get($class)->{$func}(); } } else { if (method_exists(VBox::get($class), 'getResult')) { $func = 'getResult'; $content = VBox::get($class)->{$func}(); } } VBox::clear($class); return $content; } return ''; }
public function printPage() { if ($this->prepared) { $headers = $this->page->getHeaders(); foreach ($headers as $header) { header($header); } $this->smarty->assign('page_title', $this->page->title); $this->smarty->assign('page_id', $this->page->getPageId()); /*added 30.01.2014*/ $this->smarty->assign('page_lang', $this->page->language); $this->smarty->assign('page_meta', $this->page->getMetas()); $this->smarty->assign('page_css', $this->page->getCssList()); $this->smarty->assign('page_js', $this->page->getJSList()); $this->smarty->assign('lstrings', $this->page->getLocalStrings()); //$this->smarty->assign('lstrings', $this->getLstrings()); /* italiano, 04.03.2015 */ $this->smarty->assign('related_pages', $this->page->getRelativePageAddresses()); $this->smarty->assign('page_address', $this->page->address['uri_address']); $this->smarty->assign('page_options', $this->page->options); /* added 18.11.2014, italiano */ if (VBox::get('ConstData')->getConst('realDomain')) { $this->smarty->assign('realDomain', VBox::get('ConstData')->getConst('realDomain')); } if (VBox::get('ConstData')->getConst('use_min')) { /*added 2014-07-29*/ $this->smarty->assign('use_min', VBox::get('ConstData')->getConst('use_min')); } if (VBox::get('ConstData')->getConst('protocol')) { /*added 2014-07-29*/ $this->smarty->assign('protocol', VBox::get('ConstData')->getConst('protocol')); } if (VBox::get('ConstData')->getConst('cachedDomain')) { $this->smarty->assign('cachedDomain', VBox::get('ConstData')->getConst('cachedDomain')); } if (VBox::get('ConstData')->getConst('siteId')) { $this->smarty->assign('siteid', VBox::get('ConstData')->getConst('siteId')); } if ($addMessenger = VBox::get('ConstData')->getConst('addMessenger')) { $this->smarty->assign('is_messenger_on', true); } $blocks = new BlocksData($this->blocks); $blocks->lang = $this->page->language; //added italiano 31.03.2015 $this->smarty->register_object('blocks', $blocks); $this->smarty->register_object('page', $this->page); /*added garbagecat76 23.10.2014*/ // @author italiano, init class Banners 25.11.2014 // [start] if (VBox::isExist('Banners')) { $this->smarty->register_object('banners', VBox::get('Banners')); } // [end] // @author italiano, register_object ClientScript for Smarty 25.11.2014 // [start] /* if(VBox::isExist('ClientScript')) { $this->smarty->register_object('ClientScript', VBox::get('ClientScript')); } */ // [end] // @author italiano, init class AdminSection 10.01.2015 // [start] if (VBox::isExist('AdminSection') && VBox::get('AdminSection')->isEdit()) { VBox::get('AdminSection')->page_id = $this->page->getPageId(); VBox::get('AdminSection')->site_id = VBox::get('ConstData')->getConst('siteId'); VBox::get('AdminSection')->sites = self::getSites(); VBox::get('AdminSection')->localPath = $this->localPath; VBox::get('AdminSection')->blocks = $this->blocks; VBox::get('AdminSection')->template_dir = $this->smarty->template_dir; VBox::get('AdminSection')->localstrings = $this->page->getLocalStrings(); VBox::get('AdminSection')->page_css = $this->page->getCssList(); VBox::get('AdminSection')->page_js = $this->page->getJSList(); } // [end] $maintpl = $this->getMainTpl(); $this->smarty->display($maintpl); if (VBox::isExist('AdminSection')) { VBox::get('AdminSection')->init(); } } }
public function edit() { $host = self::getXadmin(); if (VBox::isExist('ClientScript')) { if (!in_array('jquery.js', $this->page_js)) { VBox::get('ClientScript')->registerScriptFile($args = array('url' => "//{$host}/js/jquery.js")); } VBox::get('ClientScript')->registerScriptFile($args = array('url' => "//{$host}/js/adminSection.js")); VBox::get('ClientScript')->registerCssFile($args = array('url' => "//{$host}/styles/adminSection.css")); VBox::get('ClientScript')->getScriptFiles(); VBox::get('ClientScript')->getCssFiles(); } echo '<div id="adminPanel" class="hidden-xs"><a class="admin-btn-close" href="#">Admin panel </a><div class="inner" style="display:none;">'; echo "<h4><a class=\"link\" href=\"http://" . $host . "/pages/editpage/site/{$this->site_id}/page/{$this->page_id}/\" target=\"_blank\"><strong>Click for edit page</strong></a></h4>"; echo "<h3>Site / Page info</h3>"; echo "<ul class=\"items\">"; echo "<li><b>Site ID / Page ID:</b> {$this->site_id} / {$this->page_id}</li>"; echo "<li><b>Cached domain:</b> " . VBox::get('ConstData')->getConst('cachedDomain') . "</li>"; echo "<li><b>Real domain:</b> " . VBox::get('ConstData')->getConst('realDomain') . "</li>"; echo "<li><b>Use js/css min:</b> " . ((bool) VBox::get('ConstData')->getConst('use_min') ? 'true' : 'false') . "</li>"; echo "</ul>"; echo "<h3>Functions</h3>"; echo "<ul class=\"items\">"; echo "<li>- <a data-type=\"console\" class=\"toggle\" href=\"#\"><span>show</span> consoles</a> <span class=\"count\"></span></li>"; echo "<li>- <a data-type=\"ext\" class=\"toggle\" href=\"#\"><span>show</span> extensions</a></li>"; echo "<li>- <a data-type=\"lstring\" class=\"toggle\" href=\"#\"><span>show</span> lstrings</a></li>"; echo "<li>- <a data-type=\"image\" class=\"toggle\" href=\"#\"><span>show</span> images</a></li>"; echo "<li>- <a data-type=\"link\" class=\"toggle\" href=\"#\"><span>show</span> links</a></li>"; echo "<li>- <a data-type=\"variable\" class=\"toggle\" href=\"#\"><span>show</span> \$vars.variables</a></li>"; echo "<li>- <a data-type=\"js\" class=\"toggle\" href=\"#\"><span>show</span> *.js files</a></li>"; echo "<li>- <a data-type=\"css\" class=\"toggle\" href=\"#\"><span>show</span> *.css files</a></li>"; echo "<h3>Select site for edit</h3>"; echo '<form method="get" action="//' . $host . '/pages/setsite/" target="_blank"><select name="site_id" onchange="this.form.submit()">'; foreach ($this->sites as $site) { if ($this->site_id === $site['s_id']) { $selected = " selected=\"selected\""; } else { $selected = ""; } echo '<option value="' . $site['s_id'] . '"' . $selected . '>' . $site['s_hostname'] . '</option>'; } echo "</select></form>"; echo '</div><div style="clear: both;"></div></div>'; }