public function init()
 {
     $this->viewButtonLabel = '<i class="glyphicon glyphicon-search" title="' . Yii::t('EBootstrap', 'View') . '"></i>';
     $this->updateButtonLabel = '<i class="glyphicon glyphicon-pencil" title="' . Yii::t('EBootstrap', 'Update') . '"></i>';
     $this->deleteButtonLabel = '<i class="glyphicon glyphicon-trash" title="' . Yii::t('EBootstrap', 'Delete') . '"></i>';
     parent::init();
 }
Exemple #2
0
 public function init()
 {
     $this->viewButtonImageUrl = Yii::app()->request->baseUrl . '/css/img/fsi-icons/zoom.png';
     $this->updateButtonImageUrl = Yii::app()->request->baseUrl . '/css/img/btn/i-edit.png';
     $this->deleteButtonImageUrl = Yii::app()->request->baseUrl . '/css/img/btn/i-cancel.png';
     return parent::init();
 }
Exemple #3
0
 public function init()
 {
     $this->deleteButtonImageUrl = '/images/icons/cross.png';
     //$this->updateButtonImageUrl = '/images/icons/page_white_edit.png';
     //$this->viewButtonImageUrl = '/images/icons/page_white_magnify.png';
     $this->updateButtonImageUrl = '/images/icons/pencil.png';
     $this->viewButtonImageUrl = '/images/icons/magnifier.png';
     $this->htmlOptions = array('style' => 'text-align:center;');
     parent::init();
 }
 public function init()
 {
     parent::init();
     if ($this->name === null) {
         $this->sortable = false;
     }
     if ($this->name === null && $this->value === null) {
         throw new CException(Yii::t('zii', 'Either "name" or "value" must be specified for CDataColumn.'));
     }
 }
Exemple #5
0
 public function init()
 {
     if (empty($this->deleteConfirmation)) {
         $this->deleteConfirmation = Lang::t('DELETE_CONFIRM');
     }
     if (empty($this->header)) {
         $this->header = 'Actions';
     }
     $this->htmlOptions['class'] = isset($this->htmlOptions['class']) ? $this->htmlOptions['class'] . ' button-column' : 'button-column';
     parent::init();
 }
Exemple #6
0
 public function init()
 {
     if (isset(Yii::app()->cms->currentSectionId)) {
         if ($this->updateButtonUrl == 'Yii::app()->controller->createUrl("update",array("id"=>$data->primaryKey))') {
             $this->updateButtonUrl = 'Yii::app()->controller->createUrl("update",array("id"=>$data->primaryKey,"section_id"=>Yii::app()->cms->currentSectionId))';
         }
         if ($this->deleteButtonUrl == 'Yii::app()->controller->createUrl("delete",array("id"=>$data->primaryKey))') {
             $this->deleteButtonUrl = 'Yii::app()->controller->createUrl("delete",array("id"=>$data->primaryKey,"section_id"=>Yii::app()->cms->currentSectionId))';
         }
     }
     return parent::init();
 }
 public function init()
 {
     if ($this->viewButtonImageUrl === null) {
         $this->viewButtonImageUrl = Yii::app()->request->baseUrl . '/images/admin/view.png';
     }
     if ($this->updateButtonImageUrl === null) {
         $this->updateButtonImageUrl = Yii::app()->request->baseUrl . '/images/admin/edit.png';
     }
     if ($this->deleteButtonImageUrl === null) {
         $this->deleteButtonImageUrl = Yii::app()->request->baseUrl . '/images/admin/delete.png';
     }
     parent::init();
 }
Exemple #8
0
 /**
  * Initialization
  */
 public function init()
 {
     if ($this->imagePath === null) {
         $this->imagePath = $this->publish();
     }
     $movePath = '';
     if ($this->controller) {
         $movePath .= $this->controller . '/';
     }
     $this->buttons['moveup']['url'] = 'array("' . $movePath . 'move", "method" => "up", "id" => $data->id)';
     $this->buttons['moveup']['imageUrl'] = $this->imagePath . '/up.png';
     $this->buttons['movedown']['url'] = 'array("' . $movePath . 'move", "method" => "down", "id" => $data->id)';
     $this->buttons['movedown']['imageUrl'] = $this->imagePath . '/down.png';
     parent::init();
 }
 public function init()
 {
     $themeUrl = Yii::app()->theme->baseUrl;
     $ctrl = Yii::app()->controller->id;
     $act = Yii::app()->controller->action->id;
     $this->deleteConfirmation = Yii::t('ui', 'Do you really want to delete this item?');
     $this->afterDelete = 'function(link,success,data){ if(success){ alertify.log("Record Deleted","success",7000); } }';
     if ($ctrl == 'i18n' && $act == 'admin') {
         $this->template = '{filter} {update} {delete}';
     } else {
         $this->template = '{update} {delete}';
     }
     $this->viewButtonImageUrl = $themeUrl . '/images/view16x16.png';
     $this->updateButtonImageUrl = $themeUrl . '/images/update16x16.png';
     $this->deleteButtonImageUrl = $themeUrl . '/images/delete16x16.png';
     return parent::init();
 }
Exemple #10
0
 /**
  * Initialize the column.
  * Override the view and update buttons
  */
 public function init()
 {
     if ($this->viewDialogEnabled) {
         $this->initViewButton();
         $this->renderViewDialogWidget();
     }
     if ($this->updateDialogEnabled) {
         $this->initUpdateButton();
         $this->renderUpdateDialogWidget();
     }
     parent::init();
 }
Exemple #11
0
 /**
  * Initialization
  */
 public function init()
 {
     $this->buttons = CMap::mergeArray($this->buttons, array('view' => array('imageUrl' => '/images/admin/view_grid.png'), 'update' => array('imageUrl' => '/images/admin/edit.png'), 'delete' => array('imageUrl' => '/images/admin/del.png')));
     parent::init();
 }
    public function init()
    {
        //initializ variables
        $_customJS = null;
        $_beforeAjax = null;
        $_click = null;
        $_visible = null;
        $_options = null;
        $_imageUrl = null;
        //define defaults
        $_optionsDefault = array('class' => 'clear', 'id' => 'cbcwr_clear', 'style' => 'text-align:center;display:block;');
        // handle custom JS setup
        if (!empty($this->onClick_BeforeClear)) {
            $_customJS = $this->onClick_BeforeClear . ';';
        }
        if (!empty($this->onClick_AfterClear)) {
            $_beforeAjax = $this->onClick_AfterClear . ";\r\n";
        }
        // turn custom setup into representative output
        $_click = "js:function() {{$_customJS} return cbcwr_clearFields() }";
        $_visible = is_bool($this->clearVisible) ? $this->clearVisible ? 'true' : 'false' : $this->clearVisible;
        if (empty($this->clearHtmlOptions)) {
            $this->clearHtmlOptions = array();
        }
        $_options = @array_merge($_optionsDefault, $this->clearHtmlOptions);
        if (!empty($this->imageUrl)) {
            $_imageUrl = $this->imageUrl;
        } else {
            $_imageUrl = $this->grid->baseScriptUrl . '/delete.png';
        }
        if (!empty($this->url)) {
            $_url = $this->url;
        } else {
            $_url = 'Yii::app()->controller->createUrl(Yii::app()->controller->action->ID,array("clearFilters"=>1))';
        }
        if (!empty($this->label)) {
            $_label = Yii::t('app', $this->label);
        } else {
            $_label = Yii::t('app', 'Clear Filters');
        }
        // define the button structure to be used
        $this->_clearButton = array('label' => $_label, 'url' => $_url, 'imageUrl' => $_imageUrl, 'options' => $_options, 'click' => $_click, 'visible' => $_visible);
        $this->buttons = CMap::mergeArray($this->buttons, array('clear' => $this->_clearButton));
        $this->_templateB = $this->template;
        $this->template .= "{clear}";
        $script = <<<HTMLEND
\$.fn.clearFields = \$.fn.clearInputs = function() {
    return this.each(function() {
        var t = this.type, tag = this.tagName.toLowerCase();
        if (t == 'text' || t == 'password' || tag == 'textarea') {
            this.value = '';
        }
        else if (t == 'checkbox' || t == 'radio') {
            this.checked = false;
        }
        else if (tag == 'select') {
            this.selectedIndex = -1;
        }
    });
};
        
function cbcwr_clearFields() {
    try
    {    
        \$('#{$this->grid->id} :input').clearFields(); // this will clear all input in the current grid
        {$_beforeAjax} \$('#{$this->grid->id} .{$this->grid->filterCssClass} :input').first().trigger('change');// to submit the form
        return false;
    }
    catch(cbwr_err)
    {
        return false;
    }
}
HTMLEND;
        Yii::app()->clientScript->registerScript(__CLASS__ . 'clearFields', $script, CClientScript::POS_HEAD);
        // call parent to initialize other buttons
        parent::init();
    }
 public function init()
 {
     parent::init();
 }