public function __construct(array $array, Am_Table_WithData $table) { parent::__construct($array); $this->config_key = $table->getCustomFieldsConfigKey(); $this->table = $table->getName(true); $this->pk = $table->getKeyField(); }
public function createDemoHistoryGrid() { $records = $this->getDi()->store->getBlob('import-records'); $records = $records ? unserialize($records) : array(); $ds = new Am_Grid_DataSource_Array($records); $ds->setOrder('date', true); $grid = new Am_Grid_Editable('_h', ___('Import History'), $ds, $this->_request, $this->view); $grid->setPermissionId(Am_Auth_Admin::PERM_IMPORT); $grid->addField(new Am_Grid_Field_Date('date', ___('Date'), false, '', null, '10%'))->setFormatDate(); $urlTpl = REL_ROOT_URL . '/admin-users?' . http_build_query(array('_u_search' => array('import' => array('id' => '__ID__')))); $urlTpl = str_replace('__ID__', '{id}', $urlTpl); $grid->addField('id', '#', false, '', null, '10%')->addDecorator(new Am_Grid_Field_Decorator_Link($urlTpl)); $grid->addField(new Am_Grid_Field('title', ___('Title'), false, '', array($this, 'renderGridTitle'))); $grid->actionsClear(); $grid->actionAdd(new Am_Grid_Action_ImportDel()); return $grid; }
public function createDemoHistoryGrid() { $records = $this->getDi()->store->getBlob('import-records'); $records = $records ? unserialize($records) : array(); $ds = new Am_Grid_DataSource_Array($records); $ds->setOrder('date', true); $grid = new Am_Grid_Editable('_h', ___('Import History'), $ds, $this->_request, $this->view); $grid->setPermissionId(Am_Auth_Admin::PERM_IMPORT); $grid->addField(new Am_Grid_Field_Date('date', ___('Date'), false, '', null, '10%'))->setFormatDate(); $grid->addField('id', '#'); $grid->addField(new Am_Grid_Field('title', ___('Title'), false, '', array($this, 'renderGridTitle'), '90%')); $grid->actionsClear(); $grid->actionAdd(new Am_Grid_Action_ImportDel()); return $grid; }
public function __construct($language) { $this->tDataSource = $this->createTDataSource(); $this->language = $language; $translationData = $this->tDataSource->getTranslationData($this->language, TranslationDataSource_Abstract::FETCH_MODE_ALL); return parent::__construct(self::prepareArray($translationData)); }