$fieldset_data['extra_settings'] = array('owner_table' => 'customer_type', 'owner_key' => 'customer_type_id', 'owner_id' => $customer_type_id, 'layout' => 'table_row'); } echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); $form_actions = array('class' => 'action_bar action_bar_center', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save')), array('ignore' => !(int) $customer_type_id, 'type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete')), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $module->link_open_customer_type(false) . "';"))); echo module_form::generate_form_actions($form_actions); ?> </form> <?php } else { $customer_types = module_customer::get_customer_types(); $header = array('title' => _l('Customer Types'), 'type' => 'h2', 'main' => true, 'button' => array()); $header['button'] = array('url' => module_customer::link_open_customer_type('new'), 'title' => _l('Add New Type'), 'type' => 'add'); print_heading($header); /** START TABLE LAYOUT **/ $table_manager = module_theme::new_table_manager(); $columns = array(); $columns['customer_type'] = array('title' => _l('Customer Type'), 'callback' => function ($data) { echo module_customer::link_open_customer_type($data['customer_type_id'], true, $data); }, 'cell_class' => 'row_action'); $columns['menu_position'] = array('title' => _l('Menu Position')); $table_manager->set_id('customer_type_list'); $table_manager->set_columns($columns); $table_manager->set_rows($customer_types); $table_manager->pagination = true; $table_manager->print_table(); /** END TABLE LAYOUT **/ }