function actionAdmin($sName = '') { $GLOBALS['iAdminPage'] = 1; require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php'; $sUri = $this->_oConfig->getUri(); check_logged(); if (!@isAdmin()) { send_headers_page_changed(); login_form("", 1); exit; } //--- Process actions ---// $mixedResultSettings = ''; if (isset($_POST['save']) && isset($_POST['cat'])) { $mixedResultSettings = $this->setSettings($_POST); } //--- Process actions ---// $aDetailsBox = $this->getDetailsForm(BX_PMT_ADMINISTRATOR_ID); $aPendingOrdersBox = $this->getOrdersBlock(BX_PMT_ORDERS_TYPE_PENDING, BX_PMT_ADMINISTRATOR_ID); $aProcessedOrdersBox = $this->getOrdersBlock(BX_PMT_ORDERS_TYPE_PROCESSED, BX_PMT_ADMINISTRATOR_ID); $aSubscriptionOrdersBox = $this->getOrdersBlock(BX_PMT_ORDERS_TYPE_SUBSCRIPTION, BX_PMT_ADMINISTRATOR_ID); $sContent = ''; $sContent .= $this->_oTemplate->getJsCode('orders', true); $sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_settings'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $this->getSettingsForm($mixedResultSettings)))); $sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_details'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $aDetailsBox[0]))); $sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_pending_orders'), $aPendingOrdersBox[0]); $sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_processed_orders'), $aProcessedOrdersBox[0]); $sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_subscription_orders'), $aSubscriptionOrdersBox[0]); $sContent .= $this->getMoreWindow(); $sContent .= $this->getManualOrderWindow(); $this->_oTemplate->addAdminJs(array('orders.js', '_orders.js')); $this->_oTemplate->addAdminCss(array('orders.css', '_orders.css')); $aParams = array('title' => array('page' => _t($this->_sLangsPrefix . 'pcpt_administration')), 'content' => array('page_main_code' => $sContent)); $this->_oTemplate->getPageCodeAdmin($aParams); }
function getBlockCode_Wide() { $sUploadErr = ''; if (isset($_FILES['image'])) { $sUploadErr = $this->_oMain->_uploadImage() ? '' : _t('_bx_ava_upload_error'); if (!$sUploadErr) { send_headers_page_changed(); } } $aVars = array('avatar' => $GLOBALS['oFunctions']->getMemberThumbnail($this->_oMain->_iProfileId), 'bx_if:allow_upload' => array('condition' => $this->_oMain->isAllowedAdd(), 'content' => array('action' => $this->_oConfig->getBaseUri(), 'upload_error' => $sUploadErr)), 'bx_if:allow_crop' => array('condition' => $this->_oMain->isAllowedAdd(), 'content' => array('crop_tool' => $this->_oMain->serviceCropTool(array('dir_image' => BX_AVA_DIR_TMP . $this->_oMain->_iProfileId . BX_AVA_EXT, 'url_image' => BX_AVA_URL_TMP . $this->_oMain->_iProfileId . BX_AVA_EXT . '?' . time())))), 'bx_if:display_premoderation_notice' => array('condition' => getParam('autoApproval_ifProfile') != 'on', 'content' => array())); return array($this->_oTemplate->parseHtmlByName('block_wide', $aVars), array(), array(), false); }
function actionGetPagePageBlocks($sPage = '') { send_headers_page_changed(); if (!isAdmin()) { $this->_oTemplate->displayAccessDenied(); } header('Content-Type: text/html; charset=utf-8'); if (empty($sPage)) { return $this->_oTemplate->_getAvailablePages($this->_oDb->getAvailablePages()); } else { $aColumns = $this->_oDb->getPageBlocks($sPage); return $this->_oTemplate->_getPageBlocks($aColumns); } }
<?php /** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ */ require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php'; bx_import('Module', $aModule); global $_page; global $_page_cont; $iIndex = 9; $_page['name_index'] = $iIndex; $_page['header'] = _t('_bx_pageac'); if (!@isAdmin()) { send_headers_page_changed(); login_form("", 1); exit; } $oModule = new BxPageACModule($aModule); $_page_cont[$iIndex]['page_main_code'] = $oModule->_oTemplate->getTabs(); PageCodeAdmin();
/** * Output XML data * * @param XmlNode $xmlNode */ function sendData($xmlNode) { header("Content-type: application/xml"); send_headers_page_changed(); echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n"; echo $xmlNode->getXMLText(); }
function actionAdmin() { $GLOBALS['iAdminPage'] = 1; require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php'; check_logged(); if (!@isAdmin()) { send_headers_page_changed(); login_form("", 1); exit; } //--- Process actions ---// $mixedResultSettings = ''; if (isset($_POST['save']) && isset($_POST['cat'])) { $mixedResultSettings = $this->setSettings($_POST); } if (isset($_POST['feedback-approve'])) { $this->_actPublish($_POST['feedback-ids'], true); } else { if (isset($_POST['feedback-reject'])) { $this->_actPublish($_POST['feedback-ids'], false); } else { if (isset($_POST['feedback-delete'])) { $this->_actDelete($_POST['feedback-ids']); } } } //--- Process actions ---// $sFilterValue = ''; if (isset($_GET['feedback-filter'])) { $sFilterValue = process_db_input($_GET['feedback-filter'], BX_TAGS_STRIP); } $sContent = DesignBoxAdmin(_t('_feedback_bcaption_settings'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $this->getSettingsForm($mixedResultSettings)))); $sContent .= DesignBoxAdmin(_t('_feedback_bcaption_view_admin'), $this->serviceAdminBlock(0, 0, $sFilterValue)); $aParams = array('title' => array('page' => _t('_feedback_pcaption_admin')), 'content' => array('page_main_code' => $sContent)); $this->_oTemplate->getPageCodeAdmin($aParams); }
function actionAdmin($sName = '') { $GLOBALS['iAdminPage'] = 1; require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php'; $sUri = $this->_oConfig->getUri(); check_logged(); if (!@isAdmin()) { send_headers_page_changed(); login_form("", 1); exit; } //--- Process actions ---// $mixedResultSettings = ''; if (isset($_POST['save']) && isset($_POST['cat'])) { $mixedResultSettings = $this->setSettings($_POST); } if (isset($_POST[$sUri . '-publish'])) { $this->_actPublish($_POST[$sUri . '-ids'], true); } else { if (isset($_POST[$sUri . '-unpublish'])) { $this->_actPublish($_POST[$sUri . '-ids'], false); } else { if (isset($_POST[$sUri . '-featured'])) { $this->_actFeatured($_POST[$sUri . '-ids'], true); } else { if (isset($_POST[$sUri . '-unfeatured'])) { $this->_actFeatured($_POST[$sUri . '-ids'], false); } else { if (isset($_POST[$sUri . '-delete'])) { $this->_actDelete($_POST[$sUri . '-ids']); } } } } } //--- Process actions ---// //--- Get New/Edit form ---// $sPostForm = ''; if (!empty($sName)) { $sPostForm = $this->serviceEditBlock(process_db_input($sName, BX_TAGS_STRIP)); } else { if (isset($_POST['id'])) { $sPostForm = $this->serviceEditBlock((int) $_POST['id']); } else { $sPostForm = $this->servicePostBlock(); } } //--- Get New/Edit form ---// $sFilterValue = ''; if (isset($_GET[$sUri . '-filter'])) { $sFilterValue = process_db_input($_GET[$sUri . '-filter'], BX_TAGS_STRIP); } $sContent = DesignBoxAdmin(_t('_' . $sUri . '_bcaption_settings'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $this->getSettingsForm($mixedResultSettings)))); $sContent .= DesignBoxAdmin(_t('_' . $sUri . '_bcaption_post'), $sPostForm); $sContent .= DesignBoxAdmin(_t('_' . $sUri . '_bcaption_all'), $this->serviceAdminBlock(0, 0, $sFilterValue)); $aParams = array('title' => array('page' => _t('_' . $sUri . '_pcaption_admin')), 'content' => array('page_main_code' => $sContent)); $this->_oTemplate->getPageCodeAdmin($aParams); }
function BxDolPageViewAdmin($sDBTable, $sCacheFile) { $this->sDBTable = $sDBTable; $this->sCacheFile = $sCacheFile; $sPage = process_pass_data(isset($_REQUEST['Page']) ? trim($_REQUEST['Page']) : ''); $this->getPages(); if (strlen($sPage)) { /* @var $this->oPage BxDolPVAPage */ $this->oPage = new BxDolPVAPage($sPage, $this); } $this->checkAjaxMode(); if ($this->bAjaxMode and $this->oPage) { $this->sPage_db = addslashes($this->oPage->sName); switch ($_REQUEST['action']) { case 'load': header('Content-type:text/javascript'); send_headers_page_changed(); echo $this->oPage->getJSON(); break; case 'saveColsWidths': if (is_array($_POST['widths'])) { $this->saveColsWidths($_POST['widths']); $this->createCache(); } break; case 'saveBlocks': if (is_array($_POST['columns'])) { $this->saveBlocks($_POST['columns']); $this->createCache(); } break; case 'loadEditForm': if ($iBlockID = (int) $_POST['id']) { $this->showPropForm($iBlockID); } break; case 'saveItem': if ((int) $_POST['id']) { $this->saveItem($_POST); $this->createCache(); } break; case 'deleteBlock': if ($iBlockID = (int) $_REQUEST['id']) { $this->deleteBlock($iBlockID); $this->createCache(); } break; case 'checkNewBlock': if ($iBlockID = (int) $_REQUEST['id']) { $this->checkNewBlock($iBlockID); } break; case 'savePageWidth': if ($sPageWidth = process_pass_data($_POST['width'])) { $this->savePageWidth($sPageWidth); $this->createCache(); if ($this->oPage->sName == 'index') { if ($sPageWidth == '100%') { setParam('promoWidth', '960'); } else { setParam('promoWidth', (int) $sPageWidth); } ResizeAllPromos(); } } break; case 'saveOtherPagesWidth': if ($sWidth = $_REQUEST['width']) { setParam('main_div_width', $sWidth); echo 'OK'; } break; case 'resetPage': $this->resetPage(); $this->createCache(); break; } exit; } else { $this->showMainPage(); } }
/** * redirect to the correct url after switching skin ot language * only correct modules urls are supported */ function redirectIfNecessary($aSkip = array()) { $sCurrentUrl = $_SERVER['PHP_SELF'] . '?' . bx_encode_url_params($_GET, $aSkip); if (!preg_match('/modules\\/index.php\\?r=(\\w+)(.*)/', $sCurrentUrl, $m)) { return false; } $sStandardLink = 'modules/?r=' . $m[1] . '/'; $sPermalink = $this->permalink($sStandardLink); if (false !== strpos($sCurrentUrl, $sPermalink)) { return false; } header("HTTP/1.1 301 Moved Permanently"); header('Location:' . BX_DOL_URL_ROOT . $sPermalink . rtrim(trim(urldecode($m[2]), '/'), '&')); send_headers_page_changed(); return true; }
function BxDolPageViewAdmin($sDBTable, $sCacheFile) { $GLOBALS['oAdmTemplate']->addJsTranslation(array('_adm_pbuilder_Reset_page_warning', '_adm_pbuilder_Column_non_enough_width_warn', '_adm_pbuilder_Column_delete_confirmation', '_adm_pbuilder_Add_column', '_adm_pbuilder_Want_to_delete', '_delete')); $this->sDBTable = $sDBTable; $this->sCacheFile = $sCacheFile; // special actions (without creating page) if (isset($_REQUEST['action_sys'])) { switch ($_REQUEST['action_sys']) { case 'loadNewPageForm': header('Content-Type: text/html; charset=utf-8'); echo $this->showNewPageForm(); break; case 'createNewPage': header('Content-Type:text/javascript'); echo json_encode($this->createUserPage()); break; } exit; } $sPage = process_pass_data(isset($_REQUEST['Page']) ? trim(urldecode($_REQUEST['Page'])) : ''); $this->getPages(); if (strlen($sPage) && in_array($sPage, $this->aPages)) { $this->oPage = new BxDolPVAPage($sPage, $this); } $this->checkAjaxMode(); if (!empty($_REQUEST['action']) && $this->oPage) { $this->sPage_db = addslashes($this->oPage->sName); switch ($_REQUEST['action']) { case 'load': header('Content-type:text/javascript'); send_headers_page_changed(); echo $this->oPage->getJSON(); break; case 'saveColsWidths': if (is_array($_POST['widths'])) { $this->saveColsWidths($_POST['widths']); $this->createCache(); } break; case 'saveBlocks': if (is_array($_POST['columns'])) { $this->saveBlocks($_POST['columns']); $this->createCache(); } break; case 'loadEditForm': $iBlockID = (int) $_POST['id']; if ($iBlockID) { header('Content-type:text/html;charset=utf-8'); echo $this->showPropForm($iBlockID); } break; case 'saveItem': if ((int) $_POST['id']) { $this->saveItem($_POST); $this->createCache((int) $_POST['id']); } break; case 'deleteCustomPage': header('Content-type:text/html;charset=utf-8'); $sPage = isset($_POST['Page']) ? $_POST['Page'] : ''; if (!$sPage) { echo _t('_Error Occured'); } else { //remove page from page builder $this->deleteCustomPage($sPage); } break; case 'deleteBlock': if ($iBlockID = (int) $_REQUEST['id']) { $this->deleteBlock($iBlockID); $this->createCache(); } break; case 'checkNewBlock': if ($iBlockID = (int) $_REQUEST['id']) { $this->checkNewBlock($iBlockID); } break; case 'savePageWidth': if ($sPageWidth = process_pass_data($_POST['width'])) { $this->savePageWidth($sPageWidth); $this->createCache(); } break; case 'saveOtherPagesWidth': if ($sWidth = $_REQUEST['width']) { setParam('main_div_width', $sWidth); echo 'OK'; } break; case 'resetPage': $this->resetPage(); $this->createCache(); break; } } if ($this->bAjaxMode) { exit; } $sMainPageContent = $this->showBuildZone(); global $_page, $_page_cont; $iNameIndex = 0; $_page = array('name_index' => $iNameIndex, 'css_name' => array('pageBuilder.css', 'forms_adv.css'), 'js_name' => array('jquery.ui.core.min.js', 'jquery.ui.widget.min.js', 'jquery.ui.mouse.min.js', 'jquery.ui.sortable.min.js', 'jquery.ui.slider.min.js', 'jquery.cookie.min.js', 'BxDolPageBuilder.js'), 'header' => _t('_adm_pbuilder_title'), 'header_text' => _t('_adm_pbuilder_box_title')); $_page_cont[$iNameIndex]['page_main_code'] = $sMainPageContent; PageCodeAdmin(); }
function actionAdmin() { $GLOBALS['iAdminPage'] = 1; require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php'; $sUri = $this->_oConfig->getUri(); check_logged(); if (!@isAdmin()) { send_headers_page_changed(); login_form("", 1); exit; } //--- Process actions ---// $mixedResultSettings = ''; if (isset($_POST['save']) && isset($_POST['cat'])) { $mixedResultSettings = $this->setSettings($_POST); } //--- Process actions ---// $sContent = DesignBoxAdmin(_t('_' . $sUri . '_bcaption_settings'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $this->getSettingsForm($mixedResultSettings)))); $aParams = array('title' => array('page' => _t('_membership_pcaption_admin')), 'content' => array('page_main_code' => $sContent)); $this->_oTemplate->getPageCodeAdmin($aParams); }