sortable = true; $this->limitable = false; } /* * On défini les sélecteurs utilisable pour cette source de donnée */ public function get_available_selectors(){ return array( "cms_module_common_selector_sections", "cms_module_common_selector_sections_by_parent_and_cp" ); } /* * On défini les critères de tri utilisable pour cette source de donnée */ protected function get_sort_criterias() { return array ( "publication_date", "id_section", "section_title", "section_order" ); } /* * Récupération des données de la source... */ public function get_datas(){ $selector = $this->get_selected_selector(); if ($selector) { $return = array(); if (count($selector->get_value()) > 0) { foreach ($selector->get_value() as $value) { $return[] = $value; } } $return = $this->filter_datas("sections",$return); if(count($return)){ $query = "select id_section,if(section_start_date != '0000-00-00 00:00:00',section_start_date,section_creation_date) as publication_date from cms_sections where id_section in (".implode(",",$return).")"; if ($this->parameters["sort_by"] != "") { $query .= " order by ".$this->parameters["sort_by"]; if ($this->parameters["sort_order"] != "") $query .= " ".$this->parameters["sort_order"]; } $result = mysql_query($query); if(mysql_num_rows($result)){ $return = array(); while($row=mysql_fetch_object($result)){ $return[] = $row->id_section; } } } return $return; } return false; } }