本文整理汇总了PHP中Cx\Core\Core\Controller\Cx类的典型用法代码示例。如果您正苦于以下问题:PHP Cx类的具体用法?PHP Cx怎么用?PHP Cx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Cx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadThumbnails
public function loadThumbnails()
{
/**
* @var $cx \Cx\Core\Core\Controller\Cx
*/
$pdo = $this->cx->getDb()->getPdoConnection();
$sth = $pdo->query('SELECT id,name, size, 100 as quality, CONCAT(".thumb_",name) as value FROM `' . DBPREFIX . 'settings_thumbnail`');
self::$thumbnails = $sth->fetchAll();
}
示例2: getComponent
/**
* Get a component controller object
*
* @param string $name component name
* @return \Cx\Core\Core\Model\Entity\SystemComponentController
* The requested component controller or null if no such component exists
*/
public function getComponent($name)
{
if (empty($name)) {
return null;
}
$componentRepo = $this->cx->getDb()->getEntityManager()->getRepository('Cx\\Core\\Core\\Model\\Entity\\SystemComponent');
$component = $componentRepo->findOneBy(array('name' => $name));
if (!$component) {
return null;
}
return $component->getSystemComponentController();
}
示例3: preResolve
/**
* Do something before resolving is done
*
* @param \Cx\Core\Routing\Url $request The URL object for this request
*/
public function preResolve(\Cx\Core\Routing\Url $request)
{
if (\Cx\Core\Core\Controller\Cx::instanciate()->getMode() == \Cx\Core\Core\Controller\Cx::MODE_BACKEND) {
$sessionObj = $this->getSession();
$sessionObj->cmsSessionStatusUpdate('backend');
}
}
示例4: initDefaultCategoryImage
protected function initDefaultCategoryImage()
{
$this->defaultCategoryImage['src'] = \Cx\Core\Core\Controller\Cx::instanciate()->getClassLoader()->getWebFilePath(\Cx\Core\Core\Controller\Cx::instanciate()->getModuleFolderName() . '/Downloads/View/Media/no_picture.gif');
$imageSize = getimagesize(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBasePath() . $this->defaultCategoryImage['src']);
$this->defaultCategoryImage['width'] = $imageSize[0];
$this->defaultCategoryImage['height'] = $imageSize[1];
}
示例5: __construct
private function __construct()
{
global $objInit;
$backOrFrontend = $objInit->mode;
// TODO: Unused
// global $objFWUser;
// $langId;
if ($backOrFrontend == "frontend") {
$langId = $objInit->getFrontendLangId();
} else {
//backend
$langId = $objInit->getBackendLangId();
}
$langCode = FWLanguage::getLanguageCodeById($langId);
$this->setVariable(array('path' => ASCMS_PATH_OFFSET . '/' . $langCode . '/', 'basePath' => ASCMS_PATH_OFFSET . '/', 'cadminPath' => \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteBackendPath() . '/', 'mode' => $objInit->mode, 'language' => $langCode, 'csrf' => \Cx\Core\Csrf\Controller\Csrf::code()), 'contrexx');
//let i18n set it's variables
$i18n = new ContrexxJavascriptI18n($langCode);
$i18n->variablesTo($this);
//determine the correct jquery ui css' path.
//the user might have overridden the default css in the theme, so look out for this too.
$jQUiCssPath = 'themes/' . $objInit->getCurrentThemesPath() . '/jquery-ui.css';
//customized css would be here
if ($objInit->mode != 'frontend' || !file_exists(ASCMS_DOCUMENT_ROOT . '/' . $jQUiCssPath)) {
//use standard css
$jQUiCssPath = 'lib/javascript/jquery/ui/css/jquery-ui.css';
}
$this->setVariable(array('jQueryUiCss' => $jQUiCssPath), 'contrexx-ui');
}
示例6: testSubdirectoryCheck
/**
* Test the subdirectory check in the filesystem class
*/
public function testSubdirectoryCheck()
{
$cx = Cx::instanciate();
$this->assertTrue(MediaSourceManager::isSubdirectory($cx->getWebsitePath() . '/images', 'files/'));
$this->assertFalse(MediaSourceManager::isSubdirectory($cx->getWebsitePath() . '/media', 'files/'));
$this->assertFalse(MediaSourceManager::isSubdirectory($cx->getWebsitePath() . '/images', 'media5/'));
}
示例7: getPage
/**
* Get the requested Page.
*
* @access public
*/
public function getPage()
{
$_GET['act'] = empty($_GET['act']) ? '' : $_GET['act'];
switch ($_GET['act']) {
case 'lostpw':
$this->showPasswordLost();
break;
case 'resetpw':
$this->showPasswordReset();
break;
case 'verify':
$this->verifyUserAccount();
break;
case 'captcha':
$this->getCaptcha();
break;
default:
$this->showLogin();
break;
}
$this->objTemplate->setVariable('CONTREXX_CHARSET', CONTREXX_CHARSET);
$endcode = $this->objTemplate->get();
// replace links from before contrexx 3
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
$ls = new \LinkSanitizer($cx, $cx->getCodeBaseOffsetPath() . $cx->getBackendFolderName() . '/', $endcode);
$endcode = $ls->replace();
echo $endcode;
exit;
}
示例8: __construct
function __construct($path)
{
$this->cx = \Cx\Core\Core\Controller\Cx::instanciate();
if (!$path) {
throw new \InvalidArgumentException("Path shouldn't be empty: Given: " . $path);
}
$this->rootPath = rtrim($path, '/');
}
示例9: __construct
/**
* Constructor
*/
function __construct($name)
{
$this->imagePath = \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesMediaDirPath() . '/';
$this->imageWebPath = \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesMediaDirWebPath() . '/';
parent::__construct('.', $name);
parent::getFrontendLanguages();
parent::getSettings();
}
示例10: renderElement
protected function renderElement($title, $level, $hasChilds, $lang, $path, $current, $page)
{
$width = $level * 25;
$spacer = "<img src='" . ASCMS_CORE_MODULE_FOLDER . "/Sitemap/View/Media/spacer.gif' width='{$width}' height='12' alt='' />";
$linkTarget = $page->getLinkTarget();
$this->template->setVariable(array('STYLE' => self::cssPrefix . '_' . $level, 'SPACER' => $spacer, 'NAME' => $title, 'TARGET' => empty($linkTarget) ? '_self' : $linkTarget, 'URL' => \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath() . $this->virtualLanguageDirectory . $path));
$this->template->parse('sitemap');
}
示例11: postInit
/**
* postInit
*
* @param \Cx\Core\Core\Controller\Cx $cx
*
* @return null
*/
public function postInit(\Cx\Core\Core\Controller\Cx $cx)
{
$componentController = $this->getComponent('MultiSite');
if (!$componentController) {
return;
}
\Cx\Core\Setting\Controller\Setting::init('MultiSite', 'config', 'FileSystem');
if (\Cx\Core\Setting\Controller\Setting::getValue('mode', 'MultiSite') != \Cx\Core_Modules\MultiSite\Controller\ComponentController::MODE_WEBSITE) {
return;
}
$updateFile = $cx->getWebsiteTempPath() . '/Update/' . \Cx\Core_Modules\Update\Model\Repository\DeltaRepository::PENDING_DB_UPDATES_YML;
if (!file_exists($updateFile)) {
return;
}
$componentController->setCustomerPanelDomainAsMainDomain();
$updateController = $this->getController('Update');
$updateController->applyDelta();
}
示例12: __construct
/**
* Constructor
*/
function __construct($name)
{
global $_ARRAYLANG, $_CORELANG, $objTemplate, $_CONFIG;
$this->act = !empty($_GET['act']) ? $_GET['act'] : '';
$this->limit = $_CONFIG['corePagingLimit'];
$this->offset = !empty($_GET['pos']) ? $_GET['pos'] : 0;
parent::__construct(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseModulePath() . '/MediaDir/View/Template/Backend', $name);
parent::getFrontendLanguages();
}
示例13: preResolve
/**
* Do something before resolving is done
*
* @param \Cx\Core\Routing\Url $request The URL object for this request
*/
public function preResolve(\Cx\Core\Routing\Url $request)
{
global $sessionObj;
if (\Cx\Core\Core\Controller\Cx::instanciate()->getMode() == \Cx\Core\Core\Controller\Cx::MODE_BACKEND) {
if (empty($sessionObj)) {
$sessionObj = \cmsSession::getInstance();
}
$_SESSION->cmsSessionStatusUpdate('backend');
}
}
示例14: __construct
/**
* PHP5 constructor
*
* @global array
* @global array
* @global HTML_Teplate_Sigma
*/
function __construct()
{
global $_ARRAYLANG, $_CORELANG, $objTemplate;
$this->_objTpl = new \Cx\Core\Html\Sigma(ASCMS_MODULE_PATH . '/Market/View/Template/Backend');
\Cx\Core\Csrf\Controller\Csrf::add_placeholder($this->_objTpl);
$this->_objTpl->setErrorHandling(PEAR_ERROR_DIE);
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
$this->mediaPath = $cx->getWebsiteMediaMarketPath() . '/';
$this->mediaWebPath = $cx->getWebsiteMediaMarketWebPath() . '/';
$this->settings = $this->getSettings();
}
示例15: initDefaultCategoryImage
protected function initDefaultCategoryImage()
{
$this->defaultCategoryImage['src'] = ASCMS_DOWNLOADS_IMAGES_WEB_PATH . '/no_picture.gif';
if (file_exists(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteDocumentRootPath() . $this->defaultCategoryImage['src'])) {
$imageSize = getimagesize(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteDocumentRootPath() . $this->defaultCategoryImage['src']);
} else {
$imageSize = getimagesize(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseDocumentRootPath() . $this->defaultCategoryImage['src']);
}
$this->defaultCategoryImage['width'] = $imageSize[0];
$this->defaultCategoryImage['height'] = $imageSize[1];
}