Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
RightsModule Class Reference

Public Member Functions

 init ()
 registerScripts ()
 getAssetsUrl ()
 getAuthorizer ()
 getInstaller ()
 getGenerator ()
 getVersion ()

Public Attributes

 $superuserName = 'Admin'
 $authenticatedName = 'Authenticated'
 $userClass = 'User'
 $userIdColumn = 'id'
 $userNameColumn = 'username'
 $enableBizRule = true
 $enableBizRuleData = false
 $displayDescription = true
 $flashSuccessKey = 'RightsSuccess'
 $flashErrorKey = 'RightsError'
 $install = false
 $baseUrl = '/rights'
 $layout = 'rights.views.layouts.main'
 $appLayout = 'application.views.layouts.main'
 $cssFile
 $debug = false

Detailed Description

Rights module class file.

Author
Christoffer Niska cnisk.nosp@m.a@li.nosp@m.ve.co.nosp@m.m
Version
1.3.0

DO NOT CHANGE THE DEFAULT CONFIGURATION VALUES!

You may overload the module configuration values in your rights-module configuration like so:

'modules'=>array( 'rights'=>array( 'userNameColumn'=>'name', 'flashSuccessKey'=>'success', 'flashErrorKey'=>'error', ), ),

Definition at line 22 of file RightsModule.php.

Member Function Documentation

RightsModule::getAssetsUrl ( )

Publishes the module assets path.

Returns
string the base URL that contains all published asset files of Rights.

Definition at line 173 of file RightsModule.php.

Referenced by registerScripts().

{
if( $this->_assetsUrl===null )
{
$assetsPath = Yii::getPathOfAlias('rights.assets');
// We need to republish the assets if debug mode is enabled.
if( $this->debug===true )
$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath, true, -1, true);
else
$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath, true);
}
return $this->_assetsUrl;
}
RightsModule::getAuthorizer ( )
Returns
RightsAuthorizer the authorizer component.

Definition at line 192 of file RightsModule.php.

{
return $this->getComponent('authorizer');
}
RightsModule::getGenerator ( )
Returns
RightsGenerator the generator component.

Definition at line 208 of file RightsModule.php.

{
return $this->getComponent('generator');
}
RightsModule::getInstaller ( )
Returns
RightsInstaller the installer component.

Definition at line 200 of file RightsModule.php.

{
return $this->getComponent('installer');
}
RightsModule::getVersion ( )
Returns
the current version.

Definition at line 216 of file RightsModule.php.

{
return '1.3.0';
}
RightsModule::init ( )

Initializes the "rights" module.

Definition at line 95 of file RightsModule.php.

{
// Set required classes for import.
$this->setImport(array(
'rights.components.*',
'rights.components.behaviors.*',
'rights.components.dataproviders.*',
'rights.controllers.*',
'rights.models.*',
'common.extensions.eauth.*',
'common.extensions.eauth.services.*',
));
// Set the required components.
$this->setComponents(array(
'authorizer'=>array(
'class'=>'RAuthorizer',
'superuserName'=>$this->superuserName,
),
'generator'=>array(
'class'=>'RGenerator',
),
));
// Normally the default controller is Assignment.
$this->defaultController = 'assignment';
// Set the installer if necessary.
if( $this->install===true )
{
$this->setComponents(array(
'installer'=>array(
'class'=>'RInstaller',
'superuserName'=>$this->superuserName,
'authenticatedName'=>$this->authenticatedName,
'guestName'=>Yii::app()->user->guestName,
'defaultRoles'=>Yii::app()->authManager->defaultRoles,
),
));
// When installing we need to set the default controller to Install.
$this->defaultController = 'install';
}
}
RightsModule::registerScripts ( )

Registers the necessary scripts.

Definition at line 143 of file RightsModule.php.

References getAssetsUrl().

{
// Get the url to the module assets
$assetsUrl = $this->getAssetsUrl();
// Register the necessary scripts
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');
$cs->registerCoreScript('jquery.ui');
$cs->registerScriptFile($assetsUrl.'/js/rights.js');
$cs->registerCssFile($assetsUrl.'/css/core.css');
// Make sure we want to register a style sheet.
if( $this->cssFile!==false )
{
// Default style sheet is used unless one is provided.
if( $this->cssFile===null )
$this->cssFile = $assetsUrl.'/css/default.css';
else
$this->cssFile = Yii::app()->request->baseUrl.$this->cssFile;
// Register the style sheet
$cs->registerCssFile($this->cssFile);
}
}

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