separator_parameter = $msg[$label_code]; } protected function get_parameter_id($type_param, $sstype_param) { $query = "SELECT id_param FROM parametres WHERE type_param='".addslashes($type_param)."' AND sstype_param='".addslashes($sstype_param)."'"; return pmb_mysql_result(pmb_mysql_query($query), 0, 'id_param'); } protected function get_parameter($type_param, $sstype_param, $label_code='', $values=array()) { global $msg; $parameter = array ( "id" => $this->get_parameter_id($type_param, $sstype_param), "type_param" => $type_param, "sstype_param" => $sstype_param, "name" => $type_param."_".$sstype_param, "label" => (!empty($label_code) ? $msg[$label_code] : ''), "valeur_param" => $this->get_parameter_value($type_param."_".$sstype_param), "values" => $values, "section" => (!empty($this->separator_parameter) ? $this->separator_parameter : '') ); return (object) $parameter; } protected function add_parameter($type_param, $sstype_param, $label_code='', $values=array()) { $this->add_object($this->get_parameter($type_param, $sstype_param, $label_code, $values)); } protected function get_name_cell_edition($object, $property) { if($property == 'valeur_param') { return $this->objects_type."_".$object->name; } else { return parent::get_name_cell_edition($object, $property); } } protected function get_options_cell_edition($object, $property) { //on est sur un objet type paramètre if($property == 'valeur_param' && !empty($object->values)) { return $object->values; } } public function get_parameter_value($name) { global ${$name}; return ${$name}; } /** * Initialisation de la pagination par défaut */ protected function init_default_pager() { parent::init_default_pager(); $this->pager['nb_per_page'] = 100; } /** * Initialisation des colonnes disponibles */ protected function init_available_columns() { $this->available_columns = array('main_fields' => $this->get_main_fields_from_sub() ); } protected function init_default_columns() { foreach ($this->available_columns['main_fields'] as $name=>$label) { $this->add_column($name); } } protected function init_default_settings() { parent::init_default_settings(); $this->set_setting_display('search_form', 'visible', false); $this->set_setting_display('search_form', 'export_icons', false); $this->set_setting_display('query', 'human', false); $this->set_setting_column('default', 'align', 'left'); } /** * Construction dynamique de la fonction JS de tri */ protected function get_js_sort_script_sort() { $display = parent::get_js_sort_script_sort(); $display = str_replace('!!categ!!', static::$categ, $display); $display = str_replace('!!sub!!', static::$sub, $display); $display = str_replace('!!action!!', 'list', $display); return $display; } protected function get_cell_visible_flag($object, $property) { $method_name = "get_".$property; if (is_object($object) && !empty($object->{$property}) || (method_exists($object, $method_name) && !empty($object->{$method_name}()))) { return "