parameters['load_articles_data'])) $this->parameters['load_articles_data'] = 1;
$form = parent::get_form();
$form .= "
";
return $form;
}
/*
* Sauvegarde du formulaire, revient à remplir la propriété parameters et appeler la méthode parente...
*/
public function save_form(){
global $selector_choice;
global $cms_module_common_datasource_section_load_articles_data;
$this->parameters= array();
$this->parameters['selector'] = $selector_choice;
$this->parameters['load_articles_data'] = (int) $cms_module_common_datasource_section_load_articles_data;
return parent::save_form();
}
/*
* Récupération des données de la source...
*/
public function get_datas(){
//on commence par récupérer l'identifiant retourné par le sélecteur...
$selector = $this->get_selected_selector();
if($selector){
$section_id = $selector->get_value();
$section_ids = $this->filter_datas("sections",array($section_id));
if(isset($section_ids[0]) && $section_ids[0]){
$section = new cms_section($section_ids[0]);
$links = [
"article" => $this->get_constructed_link("article", "!!id!!"),
"section" => $this->get_constructed_link("section", "!!id!!")
];
if(!isset($this->parameters['load_articles_data'])) $this->parameters['load_articles_data'] = 1;
$return = $section->format_datas($links);
return $return;
}
}
return false;
}
public function get_format_data_structure(){
return cms_section::get_format_data_structure(true, true, true, true);
}
}