Ejemplo n.º 1
0
 /**
  * Initialize the JNotify Widget
  */
 public function init()
 {
     $this->registerClientScripts();
     $this->themeUrl = Yii::app()->themeManager->baseUrl;
     $this->theme = Yii::app()->theme->name;
     parent::init();
 }
Ejemplo n.º 2
0
 /**
  * Renders the open tag of the draggable element.
  * This method also registers the necessary javascript code.
  */
 public function init()
 {
     parent::init();
     $id = $this->getId();
     $this->htmlOptions['id'] = $id;
     $options = empty($this->options) ? '' : CJavaScript::encode($this->options);
     Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').draggable({$options});");
     echo CHtml::openTag($this->tagName, $this->htmlOptions) . "\n";
 }
Ejemplo n.º 3
0
 /**
  * Publishes the required assets
  */
 public function init()
 {
     parent::init();
     if (!isset($this->htmlOptions['id']) && !isset($this->fileKey)) {
         $this->htmlOptions['id'] = \CHtml::modelName($this->model);
     } elseif (!isset($this->htmlOptions['id']) && isset($this->fileKey)) {
         $this->htmlOptions['id'] = \CHtml::modelName($this->model) . $this->fileKey;
     }
     if (!isset($this->htmlOptions['enctype'])) {
         $this->htmlOptions['enctype'] = 'multipart/form-data';
     }
 }
Ejemplo n.º 4
0
 /**
 * Initializes the widget.
 * This method registers all needed client scripts
 */
 public function init()
 {
     parent::init();
     $this->baseUrl = CHtml::asset(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets');
     $url = $this->cssFile !== false ? $this->cssFile : $this->baseUrl . '/css/juiBlockUI.css';
     $blockUI = YII_DEBUG ? '/js/jquery.blockUI.js' : '/js/jquery.blockUI.min.js';
     $cs = Yii::app()->getClientScript();
     $cs->registerScriptFile($this->baseUrl . $blockUI);
     if ($this->useExternalStylesheet) {
         $cs->registerCssFile($url);
         $this->addScriptLines(array('$.blockUI.defaults.css = {}'));
     }
 }
Ejemplo n.º 5
0
 /**
  * Renders the open tag of the resizable element.
  * This method also registers the necessary javascript code.
  */
 public function init()
 {
     parent::init();
     $id = $this->getId();
     if (isset($this->htmlOptions['id'])) {
         $id = $this->htmlOptions['id'];
     } else {
         $this->htmlOptions['id'] = $id;
     }
     $options = CJavaScript::encode($this->options);
     Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').resizable({$options});");
     echo CHtml::openTag($this->tagName, $this->htmlOptions) . "\n";
 }
Ejemplo n.º 6
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     //get comments module
     $commentsModule = Yii::app()->getModule('comments');
     //get model config for comments module
     $this->_config = $commentsModule->getModelConfig($this->model);
     if (count($this->_config) > 0) {
         $this->registeredOnly = isset($this->_config['registeredOnly']) ? $this->_config['registeredOnly'] : $this->registeredOnly;
         $this->useCaptcha = isset($this->_config['useCaptcha']) ? $this->_config['useCaptcha'] : $this->useCaptcha;
         $this->postCommentAction = isset($this->_config['postCommentAction']) ? $this->_config['postCommentAction'] : $this->postCommentAction;
     }
     $this->registerScripts();
 }
 /**
  * Renders the open tag of the dialog.
  * This method also registers the necessary javascript code.
  */
 public function init()
 {
     parent::init();
     $cs = Yii::app()->getClientScript();
     $scriptUrl = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.modules.dashboard.assets'));
     $cs->registerCssFile($scriptUrl . '/jgrowl/jquery.jgrowl.css');
     $cs->registerScriptFile($scriptUrl . '/jgrowl/jquery.jgrowl.js');
     $cs->registerScriptFile($scriptUrl . '/js/json2.js');
     $cs->registerCssFile($scriptUrl . '/css/dashboard.css');
     $cs->registerScriptFile($scriptUrl . '/js/dashboard.js');
     $param['baseUrl'] = Yii::app()->createUrl('dashboard/default') . '/';
     $param = CJavaScript::encode($param);
     $js = "jQuery.dashboard({$param});";
     $cs->registerScript(__CLASS__ . '#dashboard', $js);
     $id = $this->getId();
     if (isset($this->htmlOptions['id'])) {
         $id = $this->htmlOptions['id'];
     } else {
         $this->htmlOptions['id'] = $id;
     }
     echo CHtml::openTag($this->tagName, $this->htmlOptions) . "\n";
     $this->render('dashboard', array('portlets' => $this->portlets, 'allPortlets' => $this->allPortlets));
 }
Ejemplo n.º 8
0
    /**
     * Renders the open tag of the dialog.
     * This method also registers the necessary javascript code.
     */
    public function init()
    {
        //js part
        Yii::app()->clientScript->registerScript('ui_dialog_ace_extend', ' 
				$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
					_title: function(title) {
						var $title = this.options.title || " "
						if( ("title_html" in this.options) && this.options.title_html == true )
							title.html($title);
						else title.text($title);
					}
				}));

            ');
        $ace_link = Yii::app()->assetManager->publish(Yii::app()->params['ace_assets'], false, -1, false);
        // forceCopy
        $this->scriptUrl = $ace_link . '/js';
        //$this->scriptFile = array('jquery.ui.touch-punch.min.js'); // don't need it yet
        $this->themeUrl = $ace_link;
        $this->theme = 'css';
        //$this->cssFile = 'jquery-ui-1.10.3.full.min.css';
        parent::init();
        //set id
        $id = $this->getId();
        if (isset($this->htmlOptions['id'])) {
            $id = $this->htmlOptions['id'];
        } else {
            $this->htmlOptions['id'] = $id;
        }
        $this->registreSelector();
        //options
        $this->options['title'] = $this->createTilte();
        $this->options['title_html'] = true;
        $options = CJavaScript::encode($this->options);
        Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').dialog({$options});");
        echo CHtml::openTag($this->tagName, $this->htmlOptions) . "\n";
    }
Ejemplo n.º 9
0
 public function init()
 {
     assert('!empty($this->layoutType)');
     assert('!empty($this->uniqueLayoutId)');
     assert('!empty($this->moduleId)');
     assert('!empty($this->saveUrl)');
     assert('is_bool($this->collapsible)');
     assert('is_bool($this->movable)');
     assert('in_array($this->layoutType, array("100", "50,50", "75,25"))');
     // Not Coding Standard
     $this->themeUrl = Yii::app()->baseUrl . '/themes';
     $this->theme = Yii::app()->theme->name;
     $this->registerJuiPortletsScripts();
     parent::init();
 }
Ejemplo n.º 10
0
 public function init()
 {
     parent::init();
     echo CHtml::tag('ul', CMap::mergeArray(array('id' => $this->id), $this->htmlOptions));
 }
Ejemplo n.º 11
0
 /**
  * 初始化
  * @see CJuiWidget::init()
  */
 public function init()
 {
     $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
     $this->baseUrl = Yii::app()->getAssetManager()->publish($path);
     $this->themeUrl = $this->scriptUrl = $this->baseUrl;
     parent::init();
     $this->htmlOptions['id'] = $this->id;
     $this->htmlOptions['class'] .= ' tree';
     if ($this->iconsCss) {
         $this->cssFile[] = 'zTreeIcons.css';
     }
     if ($this->treeNodeKey !== null) {
         $this->options['treeNodeKey'] = $this->treeNodeKey;
     }
     if ($this->treeNodeParentKey !== null) {
         $this->options['treeNodeParentKey'] = $this->treeNodeParentKey;
     }
     $this->options['isSimpleData'] = $this->isSimpleData;
     if ($this->width !== null) {
         $this->backgroundHtmlOptions['style'] .= " width:{$this->width}px;";
     }
     if ($this->height !== null) {
         $this->backgroundHtmlOptions['style'] .= " height:{$this->height}px;";
     }
     if ($this->backgroundId['id'] === null) {
         $this->backgroundId = isset($this->backgroundHtmlOptions['id']) ? $this->backgroundHtmlOptions['id'] : $this->id . 'background';
     }
     $this->backgroundHtmlOptions['id'] = $this->backgroundId;
 }
Ejemplo n.º 12
0
 public function init()
 {
     parent::init();
 }
 /**
  *  Initialize the class
  */
 public function init()
 {
     assert('$this->designerLayoutAttributes instanceof DesignerLayoutAttributes');
     assert('is_bool($this->canAddRows)');
     assert('is_bool($this->canMoveRows)');
     assert('is_bool($this->canRemoveRows)');
     assert('is_bool($this->canAddPanels)');
     assert('is_bool($this->canModifyPanelSettings)');
     assert('is_bool($this->canRemovePanels)');
     assert('is_bool($this->canMovePanels)');
     assert('is_bool($this->canModifyCellSettings)');
     assert('is_bool($this->canMergeAndSplitCells)');
     assert('is_bool($this->mergeRowAndAttributePlacement)');
     assert('is_int($this->maxCellsPerRow)');
     assert('is_bool($this->showRequiredAttributeSpan)');
     assert('!empty($this->viewMetadata["global"]["panels"])');
     if ($this->canMoveRows == false) {
         assert('!$this->canAddRows');
     }
     if ($this->canMovePanels == false) {
         assert('!$this->canAddPanels');
     }
     $this->registerScripts();
     parent::init();
 }
Ejemplo n.º 14
0
 /**
  * Initializes everything
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->registerScripts();
 }
 public function init()
 {
     parent::init();
     $this->getSessionTimeout();
     $this->countdown = 60;
     $this->title = Zurmo::t('Core', 'Your Zurmo session is about to expire?', LabelUtil::getTranslationParamsForAllModules());
     $this->message = Zurmo::t('Core', 'You will be logged out in {0} seconds.');
     $this->question = Zurmo::t('Core', 'Do you want to stay signed in?');
     $this->keepAliveButtonText = Zurmo::t('Core', 'Yes, Keep me signed in');
     $this->signOutButtonText = Zurmo::t('Core', 'No, Sign me out');
     $this->keepAliveUrl = Yii::app()->request->url;
     $this->logoutUrl = Yii::app()->baseUrl . '/index.php/zurmo/default/logout';
     $this->logoutRedirectUrl = Yii::app()->baseUrl . '/index.php/zurmo/default/logout';
     $this->countdownCookieName = 'Countdown_' . Yii::app()->request->getHostInfo() . Yii::app()->baseUrl;
     $cs = Yii::app()->getClientScript();
     $baseScriptUrl = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.core.widgets.assets'));
     $cs->registerScriptFile($baseScriptUrl . '/sessionTimeout/timeout-dialog.js', ClientScript::POS_HEAD);
 }
Ejemplo n.º 16
0
 public function init()
 {
     $this->attachBehaviors($this->behaviors());
     parent::init();
 }
Ejemplo n.º 17
0
 public function init()
 {
     $this->cache_id = get_class($this);
     $this->attachBehaviors($this->behaviors());
     parent::init();
 }