PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
helpSystem
/
modules
/
admin
<?php /** * AdminModule class file. * @author Digital Mesh <info@digitalmesh.com> * @copyright Copyright © Digital Mesh 2013- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License * @package HelpSystem */ /** * This module handles the admin side of HelpSystem module */ class AdminModule extends CWebModule { /** * @property integer $topicPageLimit * @property integer $maxButtonCount * @property string $_adminasset */ public $topicPageLimit = 10; //No. of records in one page public $maxButtonCount = 5; //No. of pagination buttons public $_adminasset; //asset path public function init() { // this method is called when the module is being created // you may place code here to customize the module or the application // import the module-level models and components $this->setImport(array( 'helpSystem.modules.admin.models.*', 'helpSystem.modules.admin.components.*', )); $this->registerCss(); $this->registerJs(); } public function beforeControllerAction($controller, $action) { if(parent::beforeControllerAction($controller, $action)) { // this method is called before any module controller action is performed // you may place customized code here return true; } else return false; } /** * Register all css Files */ private function registerCss(){ $cs = Yii::app()->clientScript; $cs->registerCssFile($this->getAdminAsset().'/css/core_helpSystemAdmin.css'); } /** * Register all js code snippets */ private function registerJs(){ Yii::app()->clientScript->registerScript("formDisable", "function disableSubmit(form, data, hasError) { if(!hasError) { $('.saveButton').attr('disabled', 'disabled'); $('.commonForm').submit(); } return true; }",CClientScript::POS_HEAD); } /** * Returns the URL to the published assets folder. * @return string the URL */ public function getAdminAsset() { if (isset($this->_adminasset)) return $this->_adminasset; else { $assetsPath = Yii::getPathOfAlias('application.extensions.helpSystem.modules.admin.assets'); $assetsUrl = Yii::app()->assetManager->publish($assetsPath); return $this->_adminasset = $assetsUrl; } } }
[+]
..
[-] AdminModule.php
[edit]
[+]
assets
[+]
models
[+]
components
[+]
views
[+]
controllers