function getFeedPage() { if (isset($_GET['cmd']) && $_GET['cmd'] == "newsML") { $this->_showNewsML(); } else { $this->showNews(); } return $this->_objTpl->get(); }
/** * Set the backend page * @access public * @global object $objTemplate * @global array $_ARRAYLANG */ function getPage() { global $objTemplate; \Permission::checkAccess(151, 'static'); $_GET['act'] = isset($_GET['act']) ? $_GET['act'] : ''; switch ($_GET['act']) { case 'settings': $this->settings(); break; default: $this->setMotives(); } $objTemplate->setVariable(array('CONTENT_OK_MESSAGE' => $this->strOkMessage, 'CONTENT_STATUS_MESSAGE' => $this->strErrMessage, 'ADMIN_CONTENT' => $this->_objTpl->get(), 'CONTENT_TITLE' => $this->_pageTitle)); $this->act = $_REQUEST['act']; $this->setNavigation(); return $this->_objTpl->get(); }
/** * Get content page * @access public */ function getPage() { $_GET['cmd'] = isset($_GET['cmd']) ? $_GET['cmd'] : ''; switch ($_GET['cmd']) { case 'preview': $this->preview(); break; case 'send': $this->send(); break; case 'show': $this->showEcard(); break; default: //case '': $this->showEcards(); break; } return $this->_objTpl->get(); }
/** * Render the option field in the backend. * * @param Sigma $template */ public function renderOptionField($template) { $subTemplate = new Sigma(); $subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/AreaOption.html'); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $this->active ? 'checked' : ''); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName); $template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get()); $template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'area'); $template->parse('option'); }
/** * Do the requested action * @return string parsed content */ function getJobsPage() { global $objTemplate; if (!isset($_GET['act'])) { $_GET['act'] = ''; } switch ($_GET['act']) { case 'add': $this->add(); // $this->overview(); break; case 'edit': $this->edit(); break; case 'delete': $this->delete(); $this->overview(); break; case 'update': $this->update(); $this->overview(); break; case 'cat': $this->manageCategories(); break; case 'loc': $this->manageLocations(); break; case 'delcat': $this->deleteCat(); $this->manageCategories(); break; case 'delloc': $this->deleteLoc(); $this->manageLocations(); break; case 'changeStatus': $this->changeStatus(); $this->overview(); break; case 'settings': $this->settings(); break; default: $this->overview(); } $objTemplate->setVariable(array('CONTENT_TITLE' => $this->pageTitle, 'CONTENT_OK_MESSAGE' => $this->strOkMessage, 'CONTENT_STATUS_MESSAGE' => $this->strErrMessage, 'ADMIN_CONTENT' => $this->_objTpl->get())); $this->act = $_REQUEST['act']; $this->setNavigation(); }
/** * Reads $_GET['cmd'] and selects (depending on the value) an action */ function getPage() { if (isset($_GET['act'])) { if ($_GET['act'] == "shadowbox") { $this->shadowbox(); } } if (!isset($_GET['cmd'])) { $_GET['cmd'] = ''; } else { $this->curCmd = $_GET['cmd']; } if (isset($_GET['cid'])) { $this->showCategory($_GET['cid']); } elseif (isset($_GET['id'])) { $this->showDetails($_GET['id']); } elseif ($this->curCmd == 'search') { $this->showSearch(isset($_POST['term']) ? contrexx_stripslashes($_POST['term']) : ''); } else { $this->showCategoryOverview(); } return $this->_objTpl->get(); }
/** * Render the option field in the backend. * * @param Sigma $template */ public function renderOptionField($template) { global $_ARRAYLANG; $subTemplate = new Sigma(); $subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/ColorOption.html'); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $this->color); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName); if ($this->choice) { $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_CHOICE', json_encode($this->choice)); } \ContrexxJavascript::getInstance()->setVariable(array('select' => $_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_SELECT'], 'colorError' => $_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_COLOR_WRONG_FORMAT'], 'cancel' => $_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_CANCEL']), 'TemplateEditor'); $template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get()); $template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'color'); $template->parse('option'); }
/** * Render the option field in the backend. * * @param Sigma $template */ public function renderOptionField($template) { global $_ARRAYLANG; $subTemplate = new Sigma(); $subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/ImageOption.html'); $subTemplate->setGlobalVariable($_ARRAYLANG); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $this->url); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName); $mediaBrowser = new MediaBrowser(); $mediaBrowser->setOptions(array('views' => 'uploader,filebrowser', 'startView' => 'filebrowser')); $mediaBrowser->setCallback('callback_' . $this->name); $subTemplate->setVariable('MEDIABROWSER_BUTTON', $mediaBrowser->getXHtml($_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_CHOOSE_PICTURE'])); $template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get()); $template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'img'); $template->parse('option'); }
/** * Get content page * @access public */ function getPage() { if (!isset($_GET['cmd'])) { $_GET['cmd'] = ''; } if (isset($_GET['standalone']) && !empty($_GET['standalone'])) { $this->_showMap(); } elseif (isset($_GET['img'])) { $this->_showImageViewer(); } else { switch ($_GET['cmd']) { case 'map': $this->_loadIFrame(); break; case 'quickSearch': $this->_quickSearch(); break; case 'detailSearch': $this->_detailSearch(); break; case 'immolist': $this->_showImmoList(); break; case 'showmapoverview': $this->_showMap(); break; case 'showObj': $this->_showObject(); break; case 'interest': $this->_showInterestForm(); break; case 'submitContact': $this->_addContact(); break; case 'getPDF': $this->_getPDF(); break; default: $this->_showOverview(); } } return $this->_objTpl->get(); }
function getFeedPage() { global $_ARRAYLANG, $objTemplate; if (!isset($_GET['act'])) { $_GET['act'] = ''; } switch ($_GET['act']) { case 'edit': $this->_objTpl->loadTemplateFile('module_feed_edit.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_FEED_EDIT_NEWS_FEED']; $this->showEdit(); break; case 'category': $this->_objTpl->loadTemplateFile('module_feed_category.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_FEED_CATEGORIES']; $this->showCategory(); break; case 'catedit': $this->_objTpl->loadTemplateFile('module_feed_category_edit.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_FEED_EDIT_CATEGORIES']; $this->showCatEdit(); break; case 'newsML': $this->_objNewsML = new NewsML(true); $this->_showNewsML(); break; case 'settings': $this->_objTpl->loadTemplateFile('module_feed_settings.html'); $this->pageTitle = $_ARRAYLANG['TXT_FEED_SETTINGs']; $this->_showSettings(); break; default: $this->_objTpl->loadTemplateFile('module_feed.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_FEED_NEWS_FEED']; $this->showNews(); } $objTemplate->setVariable(array('CONTENT_TITLE' => $this->pageTitle, 'CONTENT_OK_MESSAGE' => isset($_SESSION['strOkMessage']) ? $_SESSION['strOkMessage'] : '', 'CONTENT_STATUS_MESSAGE' => isset($_SESSION['strErrMessage']) ? $_SESSION['strErrMessage'] : '')); unset($_SESSION['strOkMessage']); unset($_SESSION['strErrMessage']); $this->act = $_REQUEST['act']; $this->setNavigation(); $objTemplate->setVariable('ADMIN_CONTENT', $this->_objTpl->get()); }
function getPage() { global $objTemplate; if (!isset($_GET['act'])) { $_GET['act'] = ''; } switch ($_GET['act']) { case 'save_form': $this->_saveForm(); break; case 'product_edit': $this->_product_edit(); break; case 'product_copy': $this->_product_copy(); break; case 'products': $this->_products(); break; case 'settings': $this->_settings(); break; case 'order_edit': $this->_order_edit(); break; case 'orders': $this->_orders(); break; case 'detail': $this->_ProductDetail(); break; case 'reservationproduct': $this->chooseReservationProduct(); break; default: $this->_orders(); } $this->objTemplate->setGlobalVariable('ASCMS_BACKEND_PATH', ASCMS_BACKEND_PATH); $objTemplate->setVariable(array('CONTENT_TITLE' => $this->_pageTitle, 'CONTENT_OK_MESSAGE' => $this->_strOkMessage, 'CONTENT_STATUS_MESSAGE' => $this->_strErrMessage, 'ADMIN_CONTENT' => $this->objTemplate->get())); $this->act = isset($_REQUEST['act']) ? $_REQUEST['act'] : ''; $this->setNavigation(); }
/** * Render the option field in the backend. * * @param Sigma $template */ public function renderOptionField($template) { global $_LANGID; $subTemplate = new Sigma(); $subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/SelectOption.html'); foreach ($this->choice as $value => $choice) { $subTemplate->setVariable('CHOICE_NAME', isset($choice[$_LANGID]) ? $choice[$_LANGID] : (isset($choice[2]) ? $choice[2] : $value)); $subTemplate->setVariable('CHOICE_VALUE', $value); if ($value == $this->activeChoice) { $subTemplate->setVariable('CHOICE_ACTIVE', 'selected'); } $subTemplate->parse('choices'); } $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $this->activeChoice); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName); $template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get()); $template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'select'); $template->parse('option'); }
/** * DEPRECATED and OBSOLETE. Use parse_products_blocks(). * * Sets up a Product list in the given template string with all Products * taken from the Category with the given ID * * Changes the $_REQUEST array temporarily and calls * {@see view_product_overview()}, then restores the original request. * On failure, the empty string is returned. * @param string $content The template string * @param integer $category_id The Category ID * @return string The filled template string * on success, the empty string * otherwise */ static function get_products_block($content, $category_id) { global $objInit, $_ARRAYLANG; $_ARRAYLANG += $objInit->loadLanguageData('Shop'); if (!\Cx\Core\Setting\Controller\Setting::init('Shop', 'config')) { return false; } $original_REQUEST =& $_REQUEST; self::$objTemplate = new \Cx\Core\Html\Sigma(); self::$objTemplate->setTemplate($content); // You might add more parameters here! $_REQUEST = array('catId' => $category_id); $result = self::view_product_overview(); $_REQUEST =& $original_REQUEST; if (!$result) { return ''; // You might want the original $content back, maybe? } $content = self::$objTemplate->get(); return $content; }
/** * Reads $this->cmd and selects (depending on the value) an action * */ public function getPage() { \Cx\Core\Csrf\Controller\Csrf::add_code(); switch ($this->cmd) { case 'download_file': $this->download(); exit; break; case 'delete_file': $this->deleteDownload(); $this->overview(); break; case 'delete_category': $this->deleteCategory(); $this->overview(); break; default: $this->overview(); break; } $this->parseMessages(); return $this->objTemplate->get(); }
/** * @param Sigma $template */ public function preFinalize(Sigma $template) { if (count($this->mediaBrowserInstances) == 0) { return; } else { global $_ARRAYLANG; /** * @var $init \InitCMS */ $init = \Env::get('init'); $init->loadLanguageData('MediaBrowser'); foreach ($_ARRAYLANG as $key => $value) { if (preg_match("/TXT_FILEBROWSER_[A-Za-z0-9]+/", $key)) { \ContrexxJavascript::getInstance()->setVariable($key, $value, 'mediabrowser'); } } $thumbnailsTemplate = new Sigma(); $thumbnailsTemplate->loadTemplateFile($this->cx->getCoreModuleFolderName() . '/MediaBrowser/View/Template/Thumbnails.html'); $thumbnailsTemplate->setVariable('TXT_FILEBROWSER_THUMBNAIL_ORIGINAL_SIZE', sprintf($_ARRAYLANG['TXT_FILEBROWSER_THUMBNAIL_ORIGINAL_SIZE'])); foreach (UploaderConfiguration::getInstance()->getThumbnails() as $thumbnail) { $thumbnailsTemplate->setVariable(array('THUMBNAIL_NAME' => sprintf($_ARRAYLANG['TXT_FILEBROWSER_THUMBNAIL_' . strtoupper($thumbnail['name']) . '_SIZE'], $thumbnail['size']), 'THUMBNAIL_ID' => $thumbnail['id'], 'THUMBNAIL_SIZE' => $thumbnail['size'])); $thumbnailsTemplate->parse('thumbnails'); } \ContrexxJavascript::getInstance()->setVariable('thumbnails_template', $thumbnailsTemplate->get(), 'mediabrowser'); \JS::activate('mediabrowser'); \JS::registerJS('core_modules/MediaBrowser/View/Script/mediabrowser.js'); } }
/** * Set up the shop admin page */ function getPage() { global $objTemplate, $_ARRAYLANG; //\DBG::activate(DBG_ERROR_FIREPHP|DBG_LOG); if (!isset($_GET['act'])) { $_GET['act'] = ''; } switch ($_GET['act']) { case 'mailtemplate_overview': case 'mailtemplate_edit': $_GET['tpl'] = 'mail'; // No break on purpose // No break on purpose case 'settings': $this->view_settings(); break; case 'categories': case 'category_edit': // Includes PDF pricelists $this->view_categories(); break; case 'products': case 'activate_products': case 'deactivate_products': $this->view_products(); break; case 'delProduct': case 'deleteProduct': self::$pageTitle = $_ARRAYLANG['TXT_PRODUCT_CATALOG']; $this->delete_product(); $this->view_products(); break; case 'orders': $this->view_order_overview(); break; case 'orderdetails': $this->view_order_details(); break; case 'editorder': $this->view_order_details(true); break; case 'delorder': // Redirects back to Order overview $this->delete_order(); break; case 'delcustomer': $this->delete_customer(); $this->view_customers(); break; case 'customer_activate': case 'customer_deactivate': $this->customer_activate(); $this->view_customers(); break; case 'customers': self::$pageTitle = $_ARRAYLANG['TXT_CUSTOMERS_PARTNERS']; $this->view_customers(); break; case 'customerdetails': self::$pageTitle = $_ARRAYLANG['TXT_CUSTOMER_DETAILS']; $this->view_customer_details(); break; case 'neweditcustomer': $this->view_customer_edit(); break; case 'statistics': self::$pageTitle = $_ARRAYLANG['TXT_STATISTIC']; Orders::view_statistics(self::$objTemplate); break; case 'import': $this->_import(); break; case 'manufacturer': $this->view_manufacturers(); break; default: $this->view_order_overview(); break; } \Message::show(); \Cx\Core\Csrf\Controller\Csrf::add_placeholder(self::$objTemplate); $objTemplate->setVariable(array('CONTENT_TITLE' => self::$pageTitle, 'ADMIN_CONTENT' => self::$objTemplate->get())); $this->act = isset($_REQUEST['act']) ? $_REQUEST['act'] : ''; $this->setNavigation(); }
/** * Get the rendered mediabrowser button * * @param string $buttonName * * @return string */ function getXHtml($buttonName = "MediaBrowser") { $button = new Sigma(); $button->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/MediaBrowser/View/Template/MediaBrowserButton.html'); $button->setVariable(array('MEDIABROWSER_BUTTON_NAME' => $buttonName, 'MEDIABROWSER_BUTTON_OPTIONS' => $this->getOptionsString())); return $button->get(); }
function getContainer() { $path = $this->cx->getCodeBaseCoreModulePath() . '/Uploader/View/Template/Backend/Uploader' . $this->options['uploader-type'] . '.html'; $template = new Sigma(); $template->loadTemplateFile($path); $template->setVariable(array('UPLOADER_ID' => $this->id, 'UPLOADER_CODE' => file_get_contents($this->cx->getCodeBaseCoreModulePath() . '/Uploader/View/Template/Backend/Uploader.html'))); return $template->get(); }
/** * @param Sigma $template */ public function preFinalize(Sigma $template) { if (count($this->mediaBrowserInstances) == 0) { return; } global $_ARRAYLANG; /** * @var $init \InitCMS */ $init = \Env::get('init'); $init->loadLanguageData('MediaBrowser'); foreach ($_ARRAYLANG as $key => $value) { if (preg_match("/TXT_FILEBROWSER_[A-Za-z0-9]+/", $key)) { \ContrexxJavascript::getInstance()->setVariable($key, $value, 'mediabrowser'); } } $thumbnailsTemplate = new Sigma(); $thumbnailsTemplate->loadTemplateFile($this->cx->getCoreModuleFolderName() . '/MediaBrowser/View/Template/Thumbnails.html'); $thumbnailsTemplate->setVariable('TXT_FILEBROWSER_THUMBNAIL_ORIGINAL_SIZE', sprintf($_ARRAYLANG['TXT_FILEBROWSER_THUMBNAIL_ORIGINAL_SIZE'])); foreach ($this->cx->getMediaSourceManager()->getThumbnailGenerator()->getThumbnails() as $thumbnail) { $thumbnailsTemplate->setVariable(array('THUMBNAIL_NAME' => sprintf($_ARRAYLANG['TXT_FILEBROWSER_THUMBNAIL_' . strtoupper($thumbnail['name']) . '_SIZE'], $thumbnail['size']), 'THUMBNAIL_ID' => $thumbnail['id'], 'THUMBNAIL_SIZE' => $thumbnail['size'])); $thumbnailsTemplate->parse('thumbnails'); } \ContrexxJavascript::getInstance()->setVariable('thumbnails_template', $thumbnailsTemplate->get(), 'mediabrowser'); \ContrexxJavascript::getInstance()->setVariable('chunk_size', min(floor((\FWSystem::getMaxUploadFileSize() - 1000000) / 1000000), 20) . 'mb', 'mediabrowser'); \ContrexxJavascript::getInstance()->setVariable('languages', \FWLanguage::getActiveFrontendLanguages(), 'mediabrowser'); \ContrexxJavascript::getInstance()->setVariable('language', \FWLanguage::getLanguageCodeById(\FWLanguage::getDefaultLangId()), 'mediabrowser'); \JS::activate('mediabrowser'); \JS::registerJS('core_modules/MediaBrowser/View/Script/MediaBrowser.js'); }
/** * Parses the main template in order to finish request * @todo Remove usage of globals * @global type $themesPages * @global null $moduleStyleFile * @global array $_CONFIG * @global type $subMenuTitle * @global type $_CORELANG * @global type $plainCmd * @global type $cmd */ protected function finalize() { global $themesPages, $moduleStyleFile, $_CONFIG, $subMenuTitle, $_CORELANG, $plainCmd, $cmd; if ($this->mode == self::MODE_FRONTEND) { // parse system $parsingTime = $this->stopTimer(); $this->template->setVariable('PARSING_TIME', $parsingTime); $this->parseGlobalPlaceholders($themesPages['sidebar']); $this->template->setVariable(array('SIDEBAR_FILE' => $themesPages['sidebar'], 'JAVASCRIPT_FILE' => $themesPages['javascript'], 'BUILDIN_STYLE_FILE' => $themesPages['buildin_style'], 'DATE_YEAR' => date('Y'), 'DATE_MONTH' => date('m'), 'DATE_DAY' => date('d'), 'DATE_TIME' => date('H:i'), 'BUILDIN_STYLE_FILE' => $themesPages['buildin_style'], 'JAVASCRIPT_LIGHTBOX' => '<script type="text/javascript" src="lib/lightbox/javascript/mootools.js"></script> <script type="text/javascript" src="lib/lightbox/javascript/slimbox.js"></script>', 'JAVASCRIPT_MOBILE_DETECTOR' => '<script type="text/javascript" src="lib/mobiledetector.js"></script>')); if (!empty($moduleStyleFile)) { $this->template->setVariable('STYLE_FILE', "<link rel=\"stylesheet\" href=\"{$moduleStyleFile}\" type=\"text/css\" media=\"screen, projection\" />"); } if (!$this->resolvedPage->getUseSkinForAllChannels() && isset($_GET['pdfview']) && intval($_GET['pdfview']) == 1) { $pageTitle = $this->resolvedPage->getTitle(); $extenstion = empty($pageTitle) ? null : '.pdf'; $objPDF = new \Cx\Core_Modules\Pdf\Model\Entity\PdfDocument(); $objPDF->SetTitle($pageTitle . $extenstion); $objPDF->setContent($this->template->get()); $objPDF->Create(); exit; } // fetch the parsed webpage $this->template->setVariable('JAVASCRIPT', 'javascript_inserting_here'); $endcode = $this->template->get(); /** * Get all javascripts in the code, replace them with nothing, and register the js file * to the javascript lib. This is because we don't want something twice, and there could be * a theme that requires a javascript, which then could be used by a module too and therefore would * be loaded twice. */ /* Finds all uncommented script tags, strips them out of the HTML and * stores them internally so we can put them in the placeholder later * (see JS::getCode() below) */ \JS::findJavascripts($endcode); /* * Proposal: Use this * $endcode = preg_replace_callback('/<script\s.*?src=(["\'])(.*?)(\1).*?\/?>(?:<\/script>)?/i', array('JS', 'registerFromRegex'), $endcode); * and change JS::registerFromRegex to use index 2 */ // i know this is ugly, but is there another way $endcode = str_replace('javascript_inserting_here', \JS::getCode(), $endcode); // do a final replacement of all those node-urls ({NODE_<ID>_<LANG>}- placeholders) that haven't been captured earlier $endcode = preg_replace('/\\[\\[([A-Z0-9_-]+)\\]\\]/', '{\\1}', $endcode); \LinkGenerator::parseTemplate($endcode); // remove the meta tag X-UA-Compatible if the user agent ist neighter internet explorer nor chromeframe if (!preg_match('/(msie|chromeframe)/i', $_SERVER['HTTP_USER_AGENT'])) { $endcode = preg_replace('/<meta.*?X-UA-Compatible.*?>/i', '', $endcode); } // replace links from before contrexx 3 $ls = new \LinkSanitizer($this, $this->getCodeBaseOffsetPath() . \Env::get('virtualLanguageDirectory') . '/', $endcode); $this->endcode = $ls->replace(); } else { // backend meta navigation if ($this->template->blockExists('backend_metanavigation')) { // parse language navigation if ($this->template->blockExists('backend_language_navigation') && $this->template->blockExists('backend_language_navigation_item')) { $backendLanguage = \FWLanguage::getActiveBackendLanguages(); if (count($backendLanguage) > 1) { $this->template->setVariable('TXT_LANGUAGE', $_CORELANG['TXT_LANGUAGE']); foreach ($backendLanguage as $language) { $languageUrl = \Env::get('init')->getUriBy('setLang', $language['id']); $this->template->setVariable(array('LANGUAGE_URL' => contrexx_raw2xhtml($languageUrl), 'LANGUAGE_NAME' => $language['name'], 'LANGUAGE_CSS' => \Env::get('init')->getBackendLangId() == $language['id'] ? 'active' : '')); $this->template->parse('backend_language_navigation_item'); } $this->template->parse('backend_language_navigation'); } else { $this->template->hideBlock('backend_language_navigation'); } } $this->template->touchBlock('backend_metanavigation'); } // page parsing $parsingTime = $this->stopTimer(); // var_dump($parsingTime); /*echo ($finishTime[0] - $startTime[0]) . '<br />'; if (!isset($_SESSION['asdf1']) || isset($_GET['reset'])) { $_SESSION['asdf1'] = 0; $_SESSION['asdf2'] = 0; } echo $_SESSION['asdf1'] . '<br />'; if ($_SESSION['asdf1'] > 0) { echo $_SESSION['asdf2'] / $_SESSION['asdf1']; } $_SESSION['asdf1']++; $_SESSION['asdf2'] += ($finishTime[0] - $startTime[0]);//*/ $objAdminNav = new \adminMenu($plainCmd); $objAdminNav->getAdminNavbar(); $this->template->setVariable(array('SUB_MENU_TITLE' => $subMenuTitle, 'FRONTEND_LANG_MENU' => \Env::get('init')->getUserFrontendLangMenu(), 'TXT_GENERATED_IN' => $_CORELANG['TXT_GENERATED_IN'], 'TXT_SECONDS' => $_CORELANG['TXT_SECONDS'], 'TXT_LOGOUT_WARNING' => $_CORELANG['TXT_LOGOUT_WARNING'], 'PARSING_TIME' => $parsingTime, 'LOGGED_NAME' => htmlentities($this->getUser()->objUser->getProfileAttribute('firstname') . ' ' . $this->getUser()->objUser->getProfileAttribute('lastname'), ENT_QUOTES, CONTREXX_CHARSET), 'TXT_LOGGED_IN_AS' => $_CORELANG['TXT_LOGGED_IN_AS'], 'TXT_LOG_OUT' => $_CORELANG['TXT_LOG_OUT'], 'MODULE_INDEX' => MODULE_INDEX, 'JAVASCRIPT' => \JS::getCode(), 'CX_EDITION' => $_CONFIG['coreCmsEdition'], 'CX_VERSION' => $_CONFIG['coreCmsVersion'], 'CX_CODE_NAME' => $_CONFIG['coreCmsCodeName'], 'CX_STATUS' => $_CONFIG['coreCmsStatus'], 'CX_RELEASE_DATE' => date(ASCMS_DATE_FORMAT_DATE, $_CONFIG['coreCmsReleaseDate']), 'CX_NAME' => $_CONFIG['coreCmsName'])); // Style parsing if (file_exists($this->codeBaseAdminTemplatePath . '/css/' . $cmd . '.css')) { // check if there's a css file in the core section $this->template->setVariable('ADD_STYLE_URL', $this->codeBaseAdminTemplateWebPath . '/css/' . $cmd . '.css'); $this->template->parse('additional_style'); } elseif (file_exists($this->codeBaseModulePath . '/' . $cmd . '/template/backend.css')) { // of maybe in the current module directory $this->template->setVariable('ADD_STYLE_URL', $this->codeBaseModuleWebPath . '/' . $cmd . '/template/backend.css'); $this->template->parse('additional_style'); } elseif (file_exists($this->codeBaseCoreModulePath . '/' . $cmd . '/template/backend.css')) { // or in the core module directory $this->template->setVariable('ADD_STYLE_URL', $this->codeBaseCoreModuleWebPath . '/' . $cmd . '/template/backend.css'); $this->template->parse('additional_style'); } else { $this->template->hideBlock('additional_style'); } /*echo '<pre>'; print_r($_SESSION); /*echo '<b>Overall time: ' . (microtime(true) - $timeAtStart) . 's<br />'; echo 'Max RAM usage: ' . formatBytes(memory_get_peak_usage()) . '<br />'; echo 'End RAM usage: ' . formatBytes(memory_get_usage()) . '<br /></b>';*/ $endcode = $this->template->get(); // replace links from before contrexx 3 $ls = new \LinkSanitizer($this, $this->getCodeBaseOffsetPath() . $this->getBackendFolderName() . '/', $endcode); $this->endcode = $ls->replace(); } \DBG::log("(Cx: {$this->id}) Request parsing completed after {$parsingTime}"); }
/** * Set the backend page * @access public * @global object $objTemplate * @global array $_ARRAYLANG */ public function getPage() { global $objTemplate, $_ARRAYLANG, $_LANGID; \Permission::checkAccess(141, 'static'); if (!isset($_REQUEST['act'])) { $_REQUEST['act'] = ''; } $this->act = $_REQUEST['act']; if (!empty($_REQUEST['parent_id'])) { $this->parentCategoryId = intval($_REQUEST['parent_id']); } elseif (!empty($_REQUEST['downloads_category_parent_id'])) { $this->parentCategoryId = intval($_REQUEST['downloads_category_parent_id']); } else { $this->parentCategoryId = 0; } switch ($_REQUEST['act']) { case 'get': $this->getDownload($_LANGID); break; case 'delete_group': $this->deleteGroup(); $this->loadGroupNavigation(); $this->groups(); $this->parseGroupNavigation(); break; case 'switch_group_status': $this->switchGroupStatus(); $this->loadGroupNavigation(); $this->groups(); $this->parseGroupNavigation(); break; case 'groups': $this->loadGroupNavigation(); $this->groups(); $this->parseGroupNavigation(); break; case 'group': $this->loadGroupNavigation(); $this->group(); $this->parseGroupNavigation(); break; case 'delete_category': $this->deleteCategory(); $this->loadCategoryNavigation(); $this->categories(); $this->parseCategoryNavigation(); break; case 'switch_category_status': $this->switchCategoryStatus(); $this->loadCategoryNavigation(); $this->categories(); $this->parseCategoryNavigation(); break; case 'categories': $this->loadCategoryNavigation(); $this->categories(); $this->parseCategoryNavigation(); break; case 'category': $this->loadCategoryNavigation(); $this->category(); $this->parseCategoryNavigation(); break; case 'downloads': $this->loadDownloadNavigation(); $this->downloads(); $this->parseDownloadNavigation(); break; case 'download': $this->loadDownloadNavigation(); $this->download(); $this->parseDownloadNavigation(); break; case 'delete_download': $this->loadDownloadNavigation(); $this->deleteDownload(); $this->downloads(); $this->parseDownloadNavigation(); break; case 'switch_download_status': $this->switchDownloadStatus(); if (!empty($_GET['parent_id'])) { $this->loadCategoryNavigation(); $this->categories(); $this->parseCategoryNavigation(); } else { $this->loadDownloadNavigation(); $this->downloads(); $this->parseDownloadNavigation(); } break; case 'unlink_download': $this->unlinkDownloadFromCategory(); $this->loadCategoryNavigation(); $this->categories(); $this->parseCategoryNavigation(); break; case 'add_new_download_to_category': $this->loadDownloadNavigation(); $this->download(); $this->parseDownloadNavigation(); break; case 'add_downloads_to_category': if ($this->addDownloadsToCategory()) { $this->loadCategoryNavigation(); $this->categories(); $this->parseCategoryNavigation(); } break; case 'settings': $this->settings(); break; case 'overview': default: $this->overview(); break; } $objTemplate->setVariable(array('CONTENT_TITLE' => $this->_pageTitle, 'CONTENT_OK_MESSAGE' => implode("<br />\n", $this->arrStatusMsg['ok']), 'CONTENT_STATUS_MESSAGE' => implode("<br />\n", $this->arrStatusMsg['error']), 'ADMIN_CONTENT' => $this->objTemplate->get())); $this->setNavigation(); }
/** * Render the option field in the backend. * * @param Sigma $template */ public function renderOptionField($template) { global $_ARRAYLANG; $subTemplate = new Sigma(); $subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/ImagesSeriesOption.html'); $subTemplate->setGlobalVariable($_ARRAYLANG); foreach ($this->urls as $id => $url) { $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $url); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_ID', $id); $subTemplate->parse('images'); } $mediaBrowser = new MediaBrowser(); $mediaBrowserId = $this->name . '_mediabrowser'; $mediaBrowser->setOptions(array('id' => $mediaBrowserId)); $mediaBrowser->setOptions(array('views' => 'uploader,filebrowser', 'startview' => 'filebrowser')); $mediaBrowser->setCallback('callback_' . $this->name); $subTemplate->setVariable('MEDIABROWSER_BUTTON', $mediaBrowser->getXHtml($_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_ADD_PICTURE'])); $subTemplate->setVariable('MEDIABROWSER_ID', $mediaBrowserId); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name); $subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName); //Get last key end($this->urls); $key = key($this->urls); $key = $key != null ? $key : '0'; $subTemplate->setVariable('TEMPLATEEDITOR_LASTID', $key); $template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get()); $template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'img series'); $template->parse('option'); }
/** * @param string $buttonName * * @return string */ function getXHtml($buttonName = "Upload") { $path = $this->cx->getCodeBaseCoreModulePath() . '/Uploader/View/Template/Backend/Uploader' . $this->options['uploader-type'] . '.html'; $template = new Sigma(); $template->loadTemplateFile($path); $template->setVariable(array('UPLOADER_ID' => $this->id, 'UPLOADER_CODE' => file_get_contents($this->cx->getCodeBaseCoreModulePath() . '/Uploader/View/Template/Backend/Uploader.html'))); if ($this->options['uploader-type'] == self::UPLOADER_TYPE_INLINE) { $this->addClass('uploader-button-hidden'); } return '<button ' . $this->getOptionsString() . ' disabled>' . $buttonName . '</button>' . $template->get(); }