示例#1
0
 /**
  * show the categories
  *
  * @global array module language array
  */
 function showCategories()
 {
     global $_ARRAYLANG;
     $catId = !empty($_REQUEST['catId']) ? intval($_REQUEST['catId']) : 0;
     $this->_pageTitle = $_ARRAYLANG['TXT_BLOCK_CATEGORIES'];
     $this->_objTpl->loadTemplateFile('module_block_categories.html');
     $this->_objTpl->setVariable(array('TXT_BLOCK_CATEGORIES' => $_ARRAYLANG['TXT_BLOCK_CATEGORIES'], 'TXT_BLOCK_CATEGORIES_MANAGE' => $_ARRAYLANG['TXT_BLOCK_CATEGORIES_MANAGE'], 'TXT_BLOCK_CATEGORIES_ADD' => $_ARRAYLANG['TXT_BLOCK_CATEGORIES_ADD'], 'TXT_BLOCK_FUNCTIONS' => $_ARRAYLANG['TXT_BLOCK_FUNCTIONS'], 'TXT_BLOCK_NAME' => $_ARRAYLANG['TXT_BLOCK_NAME'], 'TXT_BLOCK_CATEGORY_SEPERATOR' => $_ARRAYLANG['TXT_BLOCK_CATEGORY_SEPERATOR'], 'TXT_BLOCK_PLACEHOLDER' => $_ARRAYLANG['TXT_BLOCK_PLACEHOLDER'], 'TXT_BLOCK_SEPERATOR' => $_ARRAYLANG['TXT_BLOCK_SEPERATOR'], 'TXT_BLOCK_NONE' => $_ARRAYLANG['TXT_BLOCK_NONE'], 'TXT_BLOCK_PARENT' => $_ARRAYLANG['TXT_BLOCK_PARENT'], 'TXT_BLOCK_SELECT_ALL' => $_ARRAYLANG['TXT_BLOCK_SELECT_ALL'], 'TXT_BLOCK_DESELECT_ALL' => $_ARRAYLANG['TXT_BLOCK_DESELECT_ALL'], 'TXT_BLOCK_SUBMIT_SELECT' => $_ARRAYLANG['TXT_BLOCK_SUBMIT_SELECT'], 'TXT_BLOCK_SUBMIT_DELETE' => $_ARRAYLANG['TXT_BLOCK_SUBMIT_DELETE'], 'TXT_BLOCK_NO_CATEGORIES_FOUND' => $_ARRAYLANG['TXT_BLOCK_NO_CATEGORIES_FOUND'], 'TXT_BLOCK_OPERATION_IRREVERSIBLE' => $_ARRAYLANG['TXT_BLOCK_OPERATION_IRREVERSIBLE'], 'BLOCK_CATEGORIES_PARENT_DROPDOWN' => $this->_getCategoriesDropdown(), 'DIRECTORY_INDEX' => CONTREXX_DIRECTORY_INDEX, 'CSRF_KEY' => \Cx\Core\Csrf\Controller\Csrf::key(), 'CSRF_CODE' => \Cx\Core\Csrf\Controller\Csrf::code()));
     $arrCategories = $this->_getCategories(true);
     if (count($arrCategories) == 0) {
         $this->_objTpl->touchBlock('noCategories');
         return;
     }
     $this->_objTpl->hideBlock('noCategories');
     $this->_parseCategories($arrCategories[0]);
     //first array contains all root categories (parent id 0)
 }
<?php

header("content-type: application/javascript");
if (strpos(dirname(__FILE__), 'customizing') === false) {
    $contrexx_path = dirname(dirname(dirname(__FILE__)));
} else {
    // this files resides within the customizing directory, therefore we'll have to strip
    // out one directory more than usually
    $contrexx_path = dirname(dirname(dirname(dirname(__FILE__))));
}
require_once $contrexx_path . '/core/Core/init.php';
$cx = init('minimal');
$sessionObj = \cmsSession::getInstance();
$_SESSION->cmsSessionStatusUpdate('backend');
$CSRF = '&' . \Cx\Core\Csrf\Controller\Csrf::key() . '=' . \Cx\Core\Csrf\Controller\Csrf::code();
$langId = !empty($_GET['langId']) ? $_GET['langId'] : null;
$pageId = !empty($_GET['pageId']) ? $_GET['pageId'] : null;
//'&' must not be htmlentities, used in javascript
$defaultBrowser = ASCMS_PATH_OFFSET . ASCMS_BACKEND_PATH . '/' . CONTREXX_DIRECTORY_INDEX . '?cmd=FileBrowser&standalone=true&langId=' . $langId . $CSRF;
$linkBrowser = ASCMS_PATH_OFFSET . ASCMS_BACKEND_PATH . '/' . CONTREXX_DIRECTORY_INDEX . '?cmd=FileBrowser&standalone=true&langId=' . $langId . '&type=webpages' . $CSRF;
//get the main domain
$domainRepository = new \Cx\Core\Net\Model\Repository\DomainRepository();
$mainDomain = $domainRepository->getMainDomain()->getName();
//find the right css files and put it into the wysiwyg
$em = $cx->getDb()->getEntityManager();
$componentRepo = $em->getRepository('Cx\\Core\\Core\\Model\\Entity\\SystemComponent');
$wysiwyg = $componentRepo->findOneBy(array('name' => 'Wysiwyg'));
$pageRepo = $em->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');
\Cx\Core\Setting\Controller\Setting::init('Wysiwyg', 'config', 'Yaml');
$skinId = 0;
if (!empty($pageId) && $pageId != 'new') {