class_is_indexed($params->sub)){ return ""; } global $msg,$charset,$base_path,$ontology_tpl; $title = ''; $classes = $controler->get_classes(); foreach($classes as $class){ if($class->pmb_name == $params->sub){ $title.= $controler->get_label($class->pmb_name); } } $onchange_scheme_list_selector = ''; $name_scheme_list_selector = 'concept_scheme'; $id_scheme_list_selector = 'id_concept_scheme'; $form = $ontology_tpl['search_form']; $form = str_replace('!!search_form_action!!', $base_path.'/'.$controler->get_base_resource().'categ='.$params->categ.'&sub='.$params->sub.'&id=&action=search', $form); $form = str_replace('!!search_form_last_link!!', $base_path.'/'.$controler->get_base_resource().'categ='.$params->categ.'&sub='.$params->sub.'&id=&action=last', $form); $form = str_replace('!!search_form_title!!', $title, $form); if(isset($msg['onto_'.$controler->get_onto_name().'_add_'.$params->sub])){ $add_msg = $msg['onto_'.$controler->get_onto_name().'_add_'.$params->sub]; }else{ $add_msg = sprintf($msg['onto_common_add'], $controler->get_label($params->sub)); } $form = str_replace('!!search_form_user_input!!',stripslashes(htmlentities($params->user_input,ENT_QUOTES,$charset)),$form); $form = str_replace('!!search_form_add_value_onclick!!','document.location=\'./'.$controler->get_base_resource().'categ='.$params->categ.'&sub='.$params->sub.'&id=&action=edit&concept_scheme='.implode(",",$params->concept_scheme).'&parent_id='.$params->parent_id.'\'', $form); $form = str_replace('!!search_form_add_value!!',htmlentities($add_msg,ENT_QUOTES,$charset), $form); return $form; } /** * * Renvoie le formulaire de recherche pour le selecteur d'autorité * * @param onto_common_controler $controler * @param onto_param $params */ public static function get_search_form_selector($controler,$params){ global $sel_search_form,$jscript,$range_link_form; global $list_range_links_form; global $sel_no_available_search_form; global $msg; global $pmb_popup_form_display_mode; if($params->objs){ $property=$controler->get_onto_property_from_pmb_name($params->objs); $element = $property->range[$params->range]; $type = $controler->get_class_pmb_name($element); }else { $type = $params->element; $element = $controler->get_class_uri($params->element); } $form = ""; if($controler->get_searcher_class_name($element)){ $search = $sel_search_form; $search = str_replace("!!base_url!!", $params->base_url, $search); $search = str_replace("!!deb_rech!!", stripslashes($params->deb_rech), $search); $form.= $search; }else{ $form = $sel_no_available_search_form; } if (is_object($property) && count($property->range) > 1) { $range_links_form = ""; foreach ($property->range as $i => $uri_class) { $current_range_link_form = $range_link_form; $current_range_link_form = str_replace("!!class!!", (($params->range == $i) ? "class='selected'" : ""), $current_range_link_form); $current_range_link_form = str_replace("!!href!!", $params->base_url."&range=".$i, $current_range_link_form); $current_range_link_form = str_replace("!!libelle!!", $controler->get_class_label($uri_class), $current_range_link_form); $range_links_form.= $current_range_link_form; } $range_links = str_replace("!!range_links_form!!", $range_links_form, $list_range_links_form); $form.= $range_links; } if(isset($msg['onto_'.$controler->get_onto_name().'_add_'.$type])){ $add_msg = $msg['onto_'.$controler->get_onto_name().'_add_'.$type]; }else{ $add_msg = sprintf($msg['onto_common_add'],$controler->get_label($type)); } $form = str_replace("!!add_button_label!!", $add_msg, $form); //TODO formulaire d'ajout générique... if($pmb_popup_form_display_mode == 2) { $onclick = "document.location=\"".$params->base_url."&range=".$params->range."&action=edit\""; } else { $onclick = "document.location=\"".$params->base_url."&range=".$params->range."&action=selector_add\""; } $form = str_replace("!!add_button_onclick!!", $onclick, $form); $form.= $jscript; return $form; } /** * Renvoie l'affichage html de la liste pour le selecteur d'autorité * * @param onto_common_controler $controler * @param onto_param $params * * @return string $form */ public static function get_list_selector($controler,$params){ global $msg,$charset,$element_form,$list_form,$lang; $multiple_range = false; if($params->objs){ $property=$controler->get_onto_property_from_pmb_name($params->objs); if(count($property->range)>1){ $multiple_range = true; } $element = $property->range[$params->range]; }else { $element = $controler->get_class_uri($params->element); } $elements = $controler->get_list_elements($params); $elements_form = ""; $list = $list_form; if($elements["nb_total_elements"]){ foreach($elements['elements'] as $uri => $item){ $current_element_form = $element_form; $current_element_form = str_replace("!!caller!!", $params->caller, $current_element_form); $current_element_form = str_replace("!!element!!", $params->element, $current_element_form); $current_element_form = str_replace("!!order!!", (!empty($params->order) ? $params->order : 0), $current_element_form); $current_element_form = str_replace("!!uri!!", ($params->return_concept_id ? onto_common_uri::get_id($uri) : $uri), $current_element_form); $current_element_form = str_replace("!!range!!", $element ? $element : $controler->get_class_uri($params->sub), $current_element_form); $current_element_form = str_replace("!!callback!!", $params->callback, $current_element_form); $item_label = (isset($item[$lang]) ? $item[$lang] : $item['default']); $current_element_form = str_replace("!!item_libelle!!", htmlentities($item_label,ENT_QUOTES,$charset), $current_element_form); if($multiple_range){ $item_label = "[".$controler->get_class_label($element)."] ".$item_label; } $current_element_form = str_replace("!!item!!", addslashes($item_label), $current_element_form); $elements_form.= $current_element_form; } $list = str_replace("!!elements_form!!", $elements_form, $list); $list = str_replace("!!aff_pagination!!", aff_pagination($params->base_url.(isset($params->deb_rech) ? '&deb_rech='.$params->deb_rech : ''),$elements['nb_total_elements'],$elements['nb_onto_element_per_page'], $params->page, 10, true, true ), $list); }else{ $list = $msg["1915"]; } return $list; } /** * Renvoie l'affichage html de la liste * * @param onto_common_controler $controler * @param onto_param $params */ public static function get_list($controler,$params){ global $msg,$charset,$ontology_tpl,$lang; $elements = $controler->get_list_elements($params); $list="