".$this->format_text($this->msg['cms_module_agenda_type_choice'])." ";
$query = "select id_editorial_type, editorial_type_label from cms_editorial_types where editorial_type_element = 'article' order by 2 asc";
$result = mysql_query($query);
if(mysql_num_rows($result)){
while($row = mysql_fetch_object($result)){
$form.="
id_editorial_type ? "selected='selected'" : "").">".$this->format_text($row->editorial_type_label)." ";
}
}
$form.="
";
//date évènement
$form.="
";
return $form;
}
function save_manage_form(){
global $calendar;
global $calendar_delete;
global $cms_module_agenda_calendar_name;
global $cms_module_agenda_calendar_color;
global $cms_module_agenda_calendar_type;
global $cms_module_agenda_calendar_start_date;
global $cms_module_agenda_calendar_end_date;
$params = $this->managed_datas['module'];
if($calendar_delete){
unset($params['calendars'][$calendar_delete]);
}else{
if($calendar == "new"){
$calendar = "calendar".(cms_module_agenda::get_max_calendar_id($params['calendars'])+1);
}
$params['calendars'][$calendar] = array(
'name' => stripslashes($cms_module_agenda_calendar_name),
'color' => stripslashes($cms_module_agenda_calendar_color),
'type' => stripslashes($cms_module_agenda_calendar_type),
'start_date' => stripslashes($cms_module_agenda_calendar_start_date),
'end_date' => stripslashes($cms_module_agenda_calendar_end_date)
);
}
return $params;
}
protected function get_max_calendar_id($datas){
$max = 0;
if(count($datas)){
foreach ($datas as $key => $val){
$key = str_replace("calendar","",$key)*1;
if($key>$max) $max = $key;
}
}
return $max;
}
public function execute_ajax(){
global $calendar,$id_type;
$response = array();
$fields = new cms_editorial_parametres_perso($id_type);
$select="
".$this->format_text($this->msg['cms_module_agenda_calendar_start_date'])."
";
$select.= $fields->get_selector_options($this->managed_datas['module']['calendars'][$calendar]['start_date']);
$select.= "
".$this->format_text($this->msg['cms_module_agenda_calendar_end_date'])."
";
$select.= $fields->get_selector_options($this->managed_datas['module']['calendars'][$calendar]['end_date']);
$select.= "
";
$response['content'] = $select;
$response['content-type'] = 'text/html';
return $response;
}
}