예제 #1
0
 protected function _initColumns()
 {
     parent::_initColumns();
     $this->_columns->add(new Kwf_Grid_Column('id'));
     //shows editDialog
     $this->_columns->add(new Kwf_Grid_Column_Button('properties', ' ', 20))->setButtonIcon('/assets/silkicons/newspaper.png')->setTooltip(trlKwf('Properties'));
     if (is_instance_of(Kwc_Abstract::getSetting($this->_getParam('class'), 'extConfig'), 'Kwc_Directories_Item_Directory_ExtConfigEditButtons')) {
         $extConfigType = 'extConfig';
     } else {
         if (is_instance_of(Kwc_Abstract::getSetting($this->_getParam('class'), 'extConfigControllerIndex'), 'Kwc_Directories_Item_Directory_ExtConfigEditButtons')) {
             $extConfigType = 'extConfigControllerIndex';
         }
     }
     $extConfig = Kwf_Component_Abstract_ExtConfig_Abstract::getInstance($this->_getParam('class'), $extConfigType)->getConfig(Kwf_Component_Abstract_ExtConfig_Abstract::TYPE_DEFAULT);
     $extConfig = $extConfig['items'];
     if (count($extConfig['countDetailClasses']) > 1 && !$this->_getModel()->hasColumn('component')) {
         throw new Kwf_Exception('If you have more than one detail-component your table has to have a column named "component"');
     }
     $i = 0;
     foreach ($extConfig['contentEditComponents'] as $ec) {
         $name = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($ec['componentClass'], 'componentName'));
         $icon = Kwc_Abstract::getSetting($ec['componentClass'], 'componentIcon');
         $icon = new Kwf_Asset($icon);
         $this->_columns->add(new Kwc_Directories_Item_Directory_Trl_ControllerEditButton('edit_' . $i, ' ', 20))->setColumnType('editContent')->setEditComponentClass($ec['componentClass'])->setEditComponent($ec['component'])->setEditType($ec['type'])->setEditIdTemplate($ec['idTemplate'])->setEditComponentIdSuffix($ec['componentIdSuffix'])->setButtonIcon($icon->toString(array('arrow')))->setTooltip(trlKwf('Edit {0}', $name));
         $i++;
     }
 }
예제 #2
0
 protected function _initColumns()
 {
     parent::_initColumns();
     $this->_columns->add(new Kwf_Grid_Column('name', trlKwf('Name'), 200));
     // Not visible
     $this->_columns->add(new Kwf_Grid_Column('total_columns'));
 }
 protected function _initColumns()
 {
     parent::_initColumns();
     $this->_columns->add(new Kwf_Grid_Column_Date('date', trlKwf('Date')));
     $this->_columns->add(new Kwf_Grid_Column('type', trlKwf('Type')));
     $this->_columns->add(new Kwf_Grid_Column('message', trlKwf('Message'), 300));
 }
예제 #4
0
 protected function _initColumns()
 {
     Kwf_Controller_Action_Auto_Kwc_Grid::_initColumns();
     $this->_columns->add(new Kwf_Grid_Column('name', trlKwf('Name'), 200));
     $this->_columns->add(new Kwf_Grid_Column_Visible());
     // Not visible
     $this->_columns->add(new Kwf_Grid_Column('total_columns'));
 }
예제 #5
0
 protected function _initColumns()
 {
     parent::_initColumns();
     if ($this->_showChildComponentGridColumns) {
         $c = Kwc_Abstract::getChildComponentClass($this->_getParam('class'), 'child');
         foreach (Kwc_Admin::getInstance($c)->gridColumns() as $i) {
             $this->_columns->add($i);
         }
     }
     $this->_columns->add(new Kwf_Grid_Column_Visible());
 }
 protected function _initColumns()
 {
     parent::_initColumns();
     $this->_columns->add(new Kwf_Grid_Column_Visible());
     if ($this->_showChildComponentGridColumns) {
         $c = Kwc_Abstract::getChildComponentClass($this->_getParam('class'), 'child');
         foreach (Kwc_Admin::getInstance($c)->gridColumns() as $i) {
             $this->_columns->add($i);
         }
     }
     foreach (Kwf_Component_Data_Root::getInstance()->getPlugins('Kwf_Component_PluginRoot_Interface_GeneratorProperty') as $plugin) {
         $params = $plugin->getGeneratorProperty(Kwf_Component_Generator_Abstract::getInstance($this->_getParam('class'), 'child'));
         if ($params) {
             $editor = new Kwf_Form_Field_Select();
             $editor->setValues($params['values'])->setListWidth(200);
             $this->_columns->add(new Kwf_Grid_Column($params['name'], $params['label']))->setEditor($editor)->setShowDataIndex($params['name'] . '_text')->setData(new Kwf_Component_PluginRoot_GeneratorProperty_Data($plugin));
             $this->_columns->add(new Kwf_Grid_Column($params['name'] . '_text'))->setData(new Kwf_Component_PluginRoot_GeneratorProperty_DataText($plugin));
         }
     }
 }