bootstrap = true; $this->table = 'room_type_selling_object'; $this->className = 'RoomTypeSellingObject'; $this->identifier = 'id_room_type_selling_object'; $this->lang = true; $this->context = Context::getContext(); $this->toolbar_title = $this->l('Stay Type Selling Objects'); parent::__construct(); $this->fields_list = array( 'id_room_type_selling_object' => array( 'title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs', ), 'name' => array( 'title' => $this->l('Name'), 'align' => 'left', ), 'active' => array( 'title' => $this->l('Status'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, ), ); $this->addRowAction('edit'); $this->addRowAction('delete'); $this->bulk_actions = array( 'delete' => array( 'text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash', ), ); } public function initPageHeaderToolbar() { if (!$this->display || $this->display == 'list') { $this->page_header_toolbar_btn['new_room_selling_type'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, 'desc' => $this->l('Add new Selling Object', null, null, false), 'icon' => 'process-icon-new', ); } parent::initPageHeaderToolbar(); } public function renderForm() { if (!$this->loadObject(true)) { return; } $this->fields_form = array( 'legend' => array( 'title' => $this->l('Stay Type Selling Object'), 'icon' => 'icon-tags', ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'lang' => true, 'required' => true, 'hint' => $this->l('Displayed name for this stay type selling object.'), ), array( 'type' => 'switch', 'label' => $this->l('Status'), 'name' => 'active', 'is_bool' => true, 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled'), ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'), ), ), ), ), 'submit' => array( 'title' => $this->l('Save'), ), ); return parent::renderForm(); } }