init() public method

Widget initialization
public init ( )
コード例 #1
0
ファイル: BaseView.php プロジェクト: xexys/xca-backend
 public function init()
 {
     if ($this->templateWidget) {
         $class = isset($this->templateWidget['class']) ? $this->templateWidget['class'] : '\\app\\widgets\\BaseGridViewTemplate';
         $params = isset($this->templateWidget['params']) ? $this->templateWidget['params'] : array();
         $this->template = $this->getController()->widget($class, $params, true);
     }
     parent::init();
 }
コード例 #2
0
 public function init()
 {
     $this->ajaxUpdate = $this->ajaxUpdate();
     $this->bulkMode = $this->bulkActions();
     if ($this->bulkMode !== array() && isset($this->bulkMode['actionButtons'])) {
         if (!isset($this->bulkMode['class'])) {
             $this->bulkMode['class'] = 'bootstrap.widgets.TbBulkActions';
         }
         $this->bulk = Yii::createComponent($this->bulkMode, $this);
         $this->bulk->init();
     }
     parent::init();
 }
コード例 #3
0
 /**
  * Widget initialization
  *
  * @return void
  */
 public function init()
 {
     $this->_modelName = $this->dataProvider->modelClass;
     $this->headlinePosition = empty($this->headlinePosition) ? self::HP_RIGHT : $this->headlinePosition;
     $this->initPageSizes();
     /*
     $this->ajaxUrl = empty($this->ajaxUrl)
                 ? (array) Yii::app()->controller->action->id
                 : $this->ajaxUrl;
     */
     parent::init();
     // live hack before yii 1.1.15 release:
     strtolower($this->ajaxType) != 'post' || ($this->beforeAjaxUpdate = 'function(id, options) {
         options.data = $.extend(options.data, ' . json_encode(array(Yii::app()->getRequest()->csrfTokenName => Yii::app()->getRequest()->csrfToken)) . ');
     }');
 }
コード例 #4
0
 /**
  * Widget initialization
  *
  * @return void
  */
 public function init()
 {
     $this->_modelName = $this->dataProvider->modelClass;
     $this->uid = uniqid($this->_modelName);
     $this->headlinePosition = empty($this->headlinePosition) ? self::HP_RIGHT : $this->headlinePosition;
     $this->initPageSizes();
     $this->ajaxUrl = empty($this->ajaxUrl) ? (array) Yii::app()->getController()->getAction()->getId() : $this->ajaxUrl;
     $this->bulkActions = empty($this->bulkActions) ? ['class' => 'booster.widgets.TbBulkActions', 'align' => 'right', 'actionButtons' => [['id' => 'delete-' . strtolower($this->_modelName), 'buttonType' => 'button', 'context' => 'danger', 'size' => 'small', 'label' => Yii::t('YupeModule.yupe', 'Delete'), 'click' => 'js:function (values) { if(!confirm("' . Yii::t('YupeModule.yupe', 'Do you really want to delete selected elements?') . '")) return false; multiaction' . $this->uid . '("delete", values); }']], 'checkBoxColumnConfig' => ['name' => 'id']] : $this->bulkActions;
     $this->type = empty($this->type) ? 'striped condensed' : $this->type;
     $this->bulkActionAlign = 'left';
     parent::init();
     $this->reinstallDatePickers();
 }
コード例 #5
0
ファイル: CustomGridView.php プロジェクト: sepaker/yupe
 /**
  * Widget initialization
  *
  * @return void
  */
 public function init()
 {
     $this->_modelName = $this->dataProvider->modelClass;
     $this->headlinePosition = empty($this->headlinePosition) ? self::HP_RIGHT : $this->headlinePosition;
     $this->initPageSizes();
     $this->ajaxUrl = empty($this->ajaxUrl) ? (array) Yii::app()->controller->action->id : $this->ajaxUrl;
     $this->bulkActions = empty($this->bulkActions) ? array('actionButtons' => array(array('id' => 'delete-post', 'buttonType' => 'button', 'type' => 'danger', 'size' => 'small', 'label' => Yii::t('YupeModule.yupe', 'Delete'), 'click' => 'js:function(values){ if(!confirm("' . Yii::t('YupeModule.yupe', 'Do you really want to delete selected elements?') . '")) return false; multiaction("delete", values); }')), 'checkBoxColumnConfig' => array('name' => 'id')) : $this->bulkActions;
     $this->type = empty($this->type) ? 'striped condensed' : $this->type;
     $this->bulkActionAlign = 'left';
     // live hack before yii 1.1.15 release:
     strtolower($this->ajaxType) != 'post' || ($this->beforeAjaxUpdate = 'function(id, options) {
         options.data = $.extend(options.data, ' . json_encode(array(Yii::app()->getRequest()->csrfTokenName => Yii::app()->getRequest()->csrfToken)) . ');
     }');
     parent::init();
 }