Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
BaseController Class Reference
Inheritance diagram for BaseController:
BulkController CommentController Controller FriendsController LanguageController MailsendingController ManageController ManageController PreviewController ReleaseController RendererController SCBaseController SiteController WidgetsTestsController

Public Member Functions

 getClient ()
 getAssetsPath ()
 getViewFile ($viewName)
 getJs ($path)
 renderMail ($view, $title=null, $data, $return=true)
 redirect ($url, $terminate=true, $statusCode=302)
 createWidget ($className, $properties=array())

Public Attributes

 $layout = '//layouts/gportal'
 $mailLayout = '//layouts/mail'

Protected Member Functions

 beforeAction ($action)

Detailed Description

Gentics Portal.Node PHP Author & Copyright (c) by Gentics Software GmbH sales.nosp@m.@gen.nosp@m.tics..nosp@m.com http://www.gentics.com Licenses can be found in the LICENSE.txt file in the root-folder of this installation You must not use this software without a valid license agreement.

Base controller for all controllers in application

Definition at line 12 of file BaseController.php.

Member Function Documentation

BaseController::createWidget (   $className,
  $properties = array() 
)

Overridden parent method. Add possibility to load widget classes from /custom folder

Parameters
string$classNameclass name (can be in path alias format)
array$propertiesinitial property values
Returns
CWidget the fully initialized widget instance.

Definition at line 129 of file BaseController.php.

{
if (isset(Yii::app()->params['customWidgets']) && Yii::app()->params['customWidgets'] == true) {
$pattern = '/^(.*?modules\.)?(.*)$/';
$replacement = 'custom.modules.${2}';
$custClassName = preg_replace($pattern, $replacement, $className);
if (file_exists(Yii::getPathOfAlias($custClassName).'.php')) {
$className = $custClassName;
}
}
return parent::createWidget($className,$properties);
}
BaseController::getAssetsPath ( )

CAssetManager is a Web application component that manages private files (called assets) and makes them accessible by Web clients. It achieves this goal by copying assets to a Web-accessible directory and returns the corresponding URL for accessing them.

Exceptions
CException
Returns
string the root directory storing the published asset files. Defaults to 'WebRoot/assets'.

Definition at line 49 of file BaseController.php.

{
if (is_null($this->_assetsPath)) {
$assetsPath = ($this->module !== null) ? $this->module->name . '/assets' : Yii::app()->controller->client->contentPath;
if (($assetsPath = realpath($assetsPath)) === false || !is_dir($assetsPath) || !is_writable($assetsPath)) {
throw new CException(
Yii::t('yii', 'CAssetManager.basePath "{path}" is invalid. Please make sure the directory exists and is writable by the Web server process.', array('{path}' => $assetsPath))
);
}
$this->_assetsPath = Yii::app()->assetManager->publish($assetsPath, false, -1, false);
}
return $this->_assetsPath;
}
BaseController::getClient ( )

Temporary dummy method

Returns
object with configuration info

Definition at line 29 of file BaseController.php.

{
// parse domain
// get configuration for this domain
// return configuration object for domain
$this->_clientParams = new stdClass;
$this->_clientParams->username = Yii::app()->params['client']['username'];
$this->_clientParams->contentPath = Yii::app()->params['storageFolder'] . DIRECTORY_SEPARATOR . $this->_clientParams->username;
return $this->_clientParams;
}
BaseController::getViewFile (   $viewName)

Overridden parent method. Add possibility to load view files from /custom folder

Parameters
string$viewNamename of view
Returns
bool|string

Definition at line 70 of file BaseController.php.

{
$viewFile = parent::getViewFile($viewName);
if (isset(Yii::app()->params['customViews']) && Yii::app()->params['customViews'] == true) {
$customSection = realpath(Yii::getPathOfAlias('site.custom'));
$commonSection = realpath(Yii::getPathOfAlias('site.common'));
$frontendSection = realpath(Yii::getPathOfAlias('site.frontend'));
$customView = str_replace(array($commonSection, $frontendSection), $customSection, $viewFile);
if (file_exists($customView)) {
return $customView;
}
}
return $viewFile;
}

The documentation for this class was generated from the following file: