public function get_form() { $form = parent::get_form(); $form .= "\n\t\t\t<div class='row'>\n\t\t\t\t<div class='colonne3'>\n\t\t\t\t\t<label for=''>" . $this->format_text($this->msg['cms_module_common_selector_type_editorial_label']) . "</label>\n\t\t\t\t</div>\n\t\t\t\t<div class='colonne-suite'>"; $form .= $this->gen_select(); $form .= "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div id='type_editorial_fields'>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<div class='colonne3'>\n\t\t\t\t\t\t<label for=''>" . $this->format_text($this->msg['cms_module_common_selector_type_editorial_fields_label']) . "</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='colonne-suite'> \n\t\t\t\t\t\t<select name='" . $this->get_form_value_name("select_field") . "' >"; $fields = new cms_editorial_parametres_perso($this->parameters["type_editorial"]); $form .= $fields->get_selector_options($this->parameters["type_editorial_field"]); $form .= "\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>"; return $form; }
public function execute_ajax() { global $id_type; $response = array(); $fields = new cms_editorial_parametres_perso($id_type); $select = "\n\t\t<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for=''>" . $this->format_text($this->msg['cms_module_common_selector_type_editorial_fields_label']) . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne-suite'> \n\t\t\t\t<select name='" . $this->get_form_value_name("select_field") . "' >"; $select .= $fields->get_selector_options($this->parameters["type_editorial_field"]); $select .= "\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t</div>"; $response['content'] = $select; $response['content-type'] = 'text/html'; return $response; }
public function get_selector_options($selected = 0) { global $msg, $charset; $options = $type = ""; //les champs génériques... $query = "select editorial_type_element from cms_editorial_types where id_editorial_type=" . $this->num_type; $result = mysql_query($query); if (mysql_num_rows($result)) { $type = mysql_result($result, 0, 0); $generic_type = $this->get_generic_type($type); if ($generic_type) { $generic = new cms_editorial_parametres_perso($generic_type, $this->base_url); $options .= $generic->get_selector_options($selected); } } if (strpos($type, "generic") !== false) { $options .= "\n\t\t\t<option value='0'" . (!$selected ? "selected='selected'" : "") . ">" . $msg['cms_editorial_form_type_field_choice'] . "</option>"; } foreach ($this->t_fields as $id => $field) { $options .= "\n\t\t\t<option value='" . $id . "'" . ($id == $selected ? "selected='selected'" : "") . ">" . htmlentities($field["TITRE"], ENT_QUOTES, $charset) . "</option>"; } return $options; }
public function execute_ajax() { global $calendar, $id_type; $response = array(); $fields = new cms_editorial_parametres_perso($id_type); $select = "\n\t\t<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='cms_module_agenda_calendar_start_date'>" . $this->format_text($this->msg['cms_module_agenda_calendar_start_date']) . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne-suite'> \n\t\t\t\t<select name='cms_module_agenda_calendar_start_date' >"; $select .= $fields->get_selector_options($this->managed_datas['module']['calendars'][$calendar]['start_date']); $select .= "\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='cms_module_agenda_calendar_end_date'>" . $this->format_text($this->msg['cms_module_agenda_calendar_end_date']) . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne-suite'> \n\t\t\t\t<select name='cms_module_agenda_calendar_end_date' >"; $select .= $fields->get_selector_options($this->managed_datas['module']['calendars'][$calendar]['end_date']); $select .= "\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t</div>"; $response['content'] = $select; $response['content-type'] = 'text/html'; return $response; }