PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
helpSystem
/
modules
/
client
/
components
<?php /** * HelpWidget 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 */ /** * HelpWidget extends from Cwidget * This will return help link **/ class HelpWidget extends CWidget{ public $title = "Help"; // default link title public $header = "Help"; public $topicId = 0; // If we need to load a specific topic public $sectionId = 1; // current section public $wrapperClass = ''; // out div class public $linkClass = ''; // class for help link protected $_assetsUrl; public $headerBackGroundColor; // background color /** * main function */ public function run(){ // load the view from views/helpLink $this->registerJSCSS(); if($this->headerBackGroundColor) { $this->registerHeaderBackgroundCSS($this->headerBackGroundColor); } $this->render("helpLink", array('title'=>$this->title, 'wrapperClass'=>$this->wrapperClass, 'linkClass'=>$this->linkClass, 'topicId'=>$this->topicId, 'sectionId'=>$this->sectionId, 'header'=>$this->header, 'assetUrl'=>$this->_assetsUrl, )); } /** * Update the header background color */ protected function registerHeaderBackgroundCSS($color) { Yii::app()->clientScript->registerCss('helpBoxBgColor', '.helphead{ background:'.$color.' !important; }' ); } /** * Registers the client JavaScript. */ protected function registerJSCSS() { /** @var CClientScript $cs */ $cs = Yii::app()->getClientScript(); $cs->registerCoreScript('jquery.ui'); $cs->registerCssFile($cs->getCoreScriptUrl(). '/jui/css/base/jquery-ui.css'); $cs->registerCssFile($this->getAssetsUrl().'/css/core_helpSystem.css'); $cs->registerScriptFile($this->getAssetsUrl().'/js/jquery.ui.touch-punch.js'); $cs->registerScriptFile($this->getAssetsUrl().'/js/HelpSystem.ui.HelpBox.js'); } /** * Returns the URL to the published assets folder. * @return string the URL */ protected function getAssetsUrl() { if (isset($this->_assetsUrl)) return $this->_assetsUrl; else { $assetsPath = Yii::getPathOfAlias('application.extensions.helpSystem.modules.client.assets'); $assetsUrl = Yii::app()->assetManager->publish($assetsPath); return $this->_assetsUrl = $assetsUrl; } } }
[+]
..
[+]
views
[-] HelpWidget.php
[edit]
[-] HelpClientUtil.php
[edit]