protected function gen_select()
 {
     //si on est en création de cadre
     if (!$this->id) {
         $this->parameters = array();
     }
     $select = "<select name='" . $this->get_form_value_name($this->cms_module_common_selector_type_editorial_type) . "' \n\t\t\tonchange=\"cms_type_fields(this.value);\" >\n\t\t";
     $types = new cms_editorial_types($this->cms_module_common_selector_type_editorial_type);
     $select .= $types->get_selector_options($this->parameters["type_editorial"]);
     $select .= "</select>\n\t\t<script type='text/javascript'>\n\t\t\tfunction cms_type_fields(id_type){\n\t\t\t\tdojo.xhrGet({\n\t\t\t\t\turl : '" . $this->get_ajax_link(array($this->class_name . "_hash[]" => $this->hash)) . "&id_type='+id_type,\n\t\t\t\t\thandelAs : 'text/html',\n\t\t\t\t\tload : function(data){\n\t\t\t\t\t\tdojo.byId('type_editorial_fields').innerHTML = data;\n\t\t\t\t\t}\n\t\t\t\t});\t\t\t\t\t\t\n\t\t\t}\n\t\t</script>";
     return $select;
 }
         $publications_states = new cms_editorial_publications_states();
         $selector = "\n\t\t\t\t\t\t<select name=\"form_" . $field . "\">\n\t\t\t\t\t\t\t" . $publications_states->get_selector_options($field_values[$i]) . "\n\t\t\t\t\t\t</select>";
         $deflt_user .= "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\t\n\t\t\t\t\t\t<div class='colonne_suite'>\t\t\t\n\t\t\t\t\t\t\t{$selector}\n\t\t\t\t\t\t</div></div>\n";
     }
 } elseif ($field == "deflt_cms_article_type") {
     if ($cms_active && SESSrights & CMS_AUTH) {
         $types = new cms_editorial_types('article');
         $types->get_types();
         $selector = "\n\t\t\t\t\t\t<select name=\"form_" . $field . "\">\n\t\t\t\t\t\t\t" . $types->get_selector_options($field_values[$i]) . "\n\t\t\t\t\t\t</select>";
         $deflt_user .= "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\t\n\t\t\t\t\t\t<div class='colonne_suite'>\t\t\t\n\t\t\t\t\t\t\t{$selector}\n\t\t\t\t\t\t</div></div>\n";
     }
 } elseif ($field == "deflt_cms_section_type") {
     if ($cms_active && SESSrights & CMS_AUTH) {
         $types = new cms_editorial_types('section');
         $types->get_types();
         $selector = "\n\t\t\t\t\t\t<select name=\"form_" . $field . "\">\n\t\t\t\t\t\t\t" . $types->get_selector_options($field_values[$i]) . "\n\t\t\t\t\t\t</select>";
         $deflt_user .= "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\t\n\t\t\t\t\t\t<div class='colonne_suite'>\t\t\t\n\t\t\t\t\t\t\t{$selector}\n\t\t\t\t\t\t</div></div>\n";
     }
 } elseif ($field == "deflt_scan_request_status") {
     if ($pmb_scan_request_activate) {
         $request_status_instance = new scan_request_status();
         $selector = "\n\t\t\t\t\t\t<select name=\"form_" . $field . "\">\n\t\t\t\t\t\t\t" . $request_status_instance->get_selector_options($field_values[$i]) . "\n\t\t\t\t\t\t</select>";
         $deflt_user .= "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\t\n\t\t\t\t\t\t<div class='colonne_suite'>\t\t\t\n\t\t\t\t\t\t\t{$selector}\n\t\t\t\t\t\t</div></div>\n";
     }
 } else {
     $deflt_table = substr($field, 6);
     if ($deflt_table == "integration_notice_statut") {
         $deflt_table = "notice_statut";
     }
     switch ($field) {
         case "deflt_entites":
Beispiel #3
0
 protected function get_type_field()
 {
     global $cms_editorial_type_field;
     $types = new cms_editorial_types($this->type);
     $types->get_types();
     if (count($types->types)) {
         $cms_editorial_type_field = str_replace("!!type!!", $this->type, $cms_editorial_type_field);
         return str_replace("!!cms_editorial_form_type_options!!", $types->get_selector_options($this->num_type), $cms_editorial_type_field);
     } else {
         return "";
     }
 }
    /** Fonctions: */
    public static function get_watch_form()
    {
        global $docwatch_watch_form_tpl, $msg;
        $marc_select = new marc_select("doctype", 'record_types');
        $cms_editorial_article = new cms_editorial_types('article');
        $cms_editorial_section = new cms_editorial_types('section');
        $cms_section = new cms_section();
        $cms_article = new cms_article();
        $cms_publication_state = new cms_editorial_publications_states();
        $status = $cms_publication_state->get_selector_options();
        $record_part = gen_plus("record_options", encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_options_record']), '<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_record_default_type']) . '</label>
				</div>
				<div class="row">' . str_replace('<select', '<select data-dojo-type="dijit/form/Select" style="width:auto"', $marc_select->display) . '</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_record_default_status']) . '</label>
				</div>
				<div class="row">		
					<select  id="record_status" data-dojo-type="dijit/form/Select" style="width:auto" name="record_status">' . self::get_record_status() . '</select>
				</div>');
        $article_part = gen_plus("article_options", encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_options_article']), '<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_article_default_content_type']) . '</label>
				</div>
				<div class="row">
					<select  id="article_type" data-dojo-type="dijit/form/Select" style="width:auto" name="article_type">' . $cms_editorial_article->get_selector_options() . '</select>
				</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_article_default_publication_status']) . '</label>
				</div>
				<div class="row">
					<select  id="article_status" data-dojo-type="dijit/form/Select" style="width:auto" name="article_status">' . $status . '</select>
				</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_article_default_parent']) . '</label>
				</div>
				<div class="row">
					<select  id="article_parent" data-dojo-type="dijit/form/Select" style="width:auto" name="article_parent">' . $cms_article->get_parent_selector() . '</select>
				</div>');
        $section_part = gen_plus("section_options", encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_options_section']), '<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_section_default_content_type']) . '</label>
				</div>
				<div class="row">
					<select  id="section_type" data-dojo-type="dijit/form/Select" style="width:auto" name="section_type">' . $cms_editorial_section->get_selector_options() . '</select>
				</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_section_default_publication_status']) . '</label>
				</div>
				<div class="row">
					<select  id="section_status" data-dojo-type="dijit/form/Select" style="width:auto" name="section_status">' . $status . '</select>
				</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_section_default_parent']) . '</label>
				</div>
				<div class="row">
					<select  id="section_parent" data-dojo-type="dijit/form/Select" style="width:auto" name="section_parent">' . $cms_section->get_parent_selector() . '</select>
				</div>');
        $form = $docwatch_watch_form_tpl;
        $form = str_replace('!!users_checkboxes!!', self::generate_users(), $form);
        $form = str_replace('!!options_record!!', $record_part, $form);
        $form = str_replace('!!options_article!!', $article_part, $form);
        $form = str_replace('!!options_section!!', $section_part, $form);
        return $form;
    }