Ejemplo n.º 1
0
 /**
  * Retourne la liste des assertions contenant l'item susceptible d'être supprimé
  * @param onto_common_controler $controler
  * @param onto_param $params
  * @param onto_assertion $assertions
  * @return string
  */
 public static function get_list_assertions($controler, $params, $assertions)
 {
     global $ontology_tpl;
     $list = $ontology_tpl["list_assertions"];
     $list_content = "";
     foreach ($assertions as $assertion) {
         /* @var $assertion onto_assertion */
         $current_assertion = $ontology_tpl["list_assertions_line"];
         $current_assertion = str_replace("!!assertion_subject!!", $controler->get_data_label($assertion->get_subject()), $current_assertion);
         $current_assertion = str_replace("!!assertion_predicate!!", $controler->get_label($assertion->get_predicate()), $current_assertion);
         $current_assertion = str_replace("!!assertion_object!!", $controler->get_data_label($assertion->get_object()), $current_assertion);
         $list_content .= $current_assertion;
     }
     $list = str_replace("!!list_content!!", $list_content, $list);
     $list = str_replace("!!href_cancel!!", "./" . $controler->get_base_resource() . "categ=" . $params->categ . "&sub=" . $params->sub . "&id=" . $params->id . "&action=edit", $list);
     $list = str_replace("!!href_continue!!", "./" . $controler->get_base_resource() . "categ=" . $params->categ . "&sub=" . $params->sub . "&id=" . $params->id . "&action=delete", $list);
     return $list;
 }
 /**
  * Renvoie l'affichage html de la liste hierarchisée
  * 
  * @param onto_common_controler $controler
  * @param onto_param $params
  */
 public static function get_list($controler, $params)
 {
     global $msg, $charset, $base_path, $ontology_tpl, $lang;
     $elements = $controler->get_list_elements($params);
     $list = "<h3>" . $elements['nb_total_elements'] . " " . $msg['onto_skos_concept_nb_results'] . "</h3>" . $ontology_tpl['skos_concept_list'];
     $list = str_replace("!!list_header!!", htmlentities($msg['103'], ENT_QUOTES, $charset), $list);
     $list = str_replace("!!list_header_utilisation!!", htmlentities($msg['voir_notices_assoc'], ENT_QUOTES, $charset), $list);
     $list_content = '';
     foreach ($elements['elements'] as $uri => $item) {
         $id = onto_common_uri::get_id($uri);
         if ($controler->has_narrower($uri, $params)) {
             $line = $ontology_tpl['skos_concept_list_line_folder'];
             $line = str_replace("!!list_line_folder_href!!", $base_path . "/" . $controler->get_base_resource() . "categ=" . $params->categ . "&sub=" . $params->sub . "&action=list&parent_id=" . $id . "&concept_scheme=" . $params->concept_scheme, $line);
         } else {
             $line = $ontology_tpl['skos_concept_list_line_doc'];
         }
         if ($params->categ == 'concepts') {
             $line = str_replace("!!list_line_link_see!!", $base_path . "/" . $controler->get_base_resource() . "categ=see&sub=" . $params->sub . "&id=" . $id, $line);
         }
         $line = str_replace("!!list_line_href!!", $base_path . "/" . $controler->get_base_resource() . "categ=" . $params->categ . "&sub=" . $params->sub . "&action=edit&id=" . $id . "&parent_id=" . $params->parent_id . "&concept_scheme=" . $params->concept_scheme, $line);
         $line = str_replace("!!list_line_libelle!!", htmlentities(isset($item[substr($lang, 0, 2)]) ? $item[substr($lang, 0, 2)] : $item['default'], ENT_QUOTES, $charset), $line);
         $concept = new concept($id);
         $line = str_replace("!!list_line_nb_utilisations!!", count($concept->get_indexed_notices()), $line);
         $line = str_replace("!!list_line_nb_utilisations_href!!", $base_path . "/catalog.php?categ=search&mode=0&etat=aut_search&aut_type=concept&aut_id=" . $id, $line);
         $list_content .= $line;
     }
     $list = str_replace("!!list_content!!", $list_content, $list);
     $list = str_replace("!!list_pagination!!", aff_pagination("./" . $controler->get_base_resource() . "categ=" . $params->categ . "&sub=" . $params->sub . "&action=" . $params->action . "&concept_scheme=" . $params->concept_scheme . "&parent_id=" . $params->parent_id . "&user_input=" . $params->user_input, $elements['nb_total_elements'], $elements['nb_onto_element_per_page'], $params->page, 10, true, true), $list);
     return $list;
 }