Exemplo n.º 1
0
 function genere_simple($depliable = 1, $what = 'ISBD')
 {
     global $msg;
     global $cart_aff_case_traitement;
     global $opac_url_base;
     global $opac_notice_enrichment;
     global $opac_show_social_network;
     global $icon_doc, $biblio_doc, $tdoc;
     global $allow_tag;
     // l'utilisateur a-t-il le droit d'ajouter un tag
     global $allow_sugg;
     // l'utilisateur a-t-il le droit de faire une suggestion
     global $opac_avis_display_mode;
     global $opac_allow_simili_search;
     if (!$this->notice_id) {
         return;
     }
     $this->double_ou_simple = 1;
     $this->notice_childs = $this->genere_notice_childs();
     // préparation de la case à cocher pour traitement panier
     if ($cart_aff_case_traitement) {
         $case_a_cocher = "<input type='checkbox' value='!!id!!' name='notice[]'/>&nbsp;";
     } else {
         $case_a_cocher = "";
     }
     if ($this->cart_allowed) {
         $basket = "<a href=\"cart_info.php?id=" . $this->notice_id . "&header=" . rawurlencode(strip_tags($this->notice_header)) . "\" target=\"cart_info\" class=\"img_basket\"><img src='" . $opac_url_base . "images/basket_small_20x20.gif' align='absmiddle' border='0' title=\"" . $msg['notice_title_basket'] . "\" alt=\"" . $msg['notice_title_basket'] . "\" /></a>";
     } else {
         $basket = "";
     }
     //add tags
     if ($this->tag_allowed == 1 || $this->tag_allowed == 2 && $_SESSION["user_code"] && $allow_tag) {
         $img_tag .= "<a href='#' onclick=\"open('addtags.php?noticeid={$this->notice_id}','ajouter_un_tag','width=350,height=150,scrollbars=yes,resizable=yes'); return false;\"><img src='" . $opac_url_base . "images/tag.png' align='absmiddle' border='0' title=\"" . $msg['notice_title_tag'] . "\" alt=\"" . $msg['notice_title_tag'] . "\"></a>";
     }
     //Avis
     if ($opac_avis_display_mode == 0 && ($this->avis_allowed && $this->avis_allowed != 2 || $_SESSION["user_code"] && $this->avis_allowed == 2)) {
         $img_tag .= $this->affichage_avis($this->notice_id);
     }
     //Suggestions
     if ($this->sugg_allowed == 2 || $_SESSION["user_code"] && $this->sugg_allowed == 1 && $allow_sugg) {
         $img_tag .= $this->affichage_suggestion($this->notice_id);
     }
     if ($this->no_header) {
         $icon = "";
     } else {
         $icon = $icon_doc[$this->notice->niveau_biblio . $this->notice->typdoc];
     }
     if ($opac_notice_enrichment) {
         $enrichment = new enrichment();
         if ($enrichment->active[$this->notice->niveau_biblio . $this->notice->typdoc]) {
             $source_enrichment = implode(",", $enrichment->active[$this->notice->niveau_biblio . $this->notice->typdoc]);
         } else {
             if ($enrichment->active[$this->notice->niveau_biblio]) {
                 $source_enrichment = implode(",", $enrichment->active[$this->notice->niveau_biblio]);
             }
         }
     }
     if ($depliable) {
         $template = "\r\n\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\r\n\t\t\t\t{$case_a_cocher}\r\n\t    \t\t<img  class='img_" . $this->notice->typdoc . "' src=\"./getgif.php?nomgif=plus\" name=\"imEx\" id=\"el!!id!!Img\" title=\"" . $msg['expandable_notice'] . "\" border=\"0\" onClick=\"expandBase('el!!id!!', true); return false;\" hspace=\"3\" />";
         if ($icon) {
             $info_bulle_icon = str_replace("!!niveau_biblio!!", $biblio_doc[$this->notice->niveau_biblio], $msg["info_bulle_icon"]);
             $info_bulle_icon = str_replace("!!typdoc!!", $tdoc->table[$this->notice->typdoc], $info_bulle_icon);
             //$template.="<img  src=\"".$opac_url_base."images/$icon\" alt='".$info_bulle_icon."' title='".$info_bulle_icon."'/>";
         }
         $template .= "\t\t\r\n\t\t\t\t<span class=\"notice-heada\" draggable=\"yes\" dragtype=\"notice\" id=\"drag_noti_!!id!!\">!!heada!!</span>" . $this->notice_header_doclink . "\r\n\t    \t\t<br />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div id=\"el!!id!!Child\" class=\"notice-child\" style=\"margin-bottom:6px;display:none;\" " . ($source_enrichment ? "enrichment='" . $source_enrichment . "'" : "") . ">\r\n\t    \t\t";
     } else {
         $template = "<div id=\"el!!id!!Parent\" class=\"parent\">\r\n\t    \t\t{$case_a_cocher}";
         //			if ($icon) {
         //    			$info_bulle_icon=str_replace("!!niveau_biblio!!",$biblio_doc[$this->notice->niveau_biblio],$msg["info_bulle_icon"]);
         //    			$info_bulle_icon=str_replace("!!typdoc!!",$tdoc->table[$this->notice->typdoc],$info_bulle_icon);
         //    			$template.="<img src=\"".$opac_url_base."images/$icon\" alt='".$info_bulle_icon."' title='".$info_bulle_icon."'/>";
         //    		}
         $template .= "<span class=\"notice-heada\" draggable=\"yes\" dragtype=\"notice\" id=\"drag_noti_!!id!!\">!!heada!!</span>" . $this->notice_header_doclink;
     }
     $template .= "!!CONTENU!!\r\n\t\t\t\t\t!!SUITE!!</div>";
     if ($opac_show_social_network) {
         if ($this->notice_header_without_html == "") {
             $this->do_header_without_html();
         }
         $template_in .= "\r\n\t\t\t\t<div id='el!!id!!addthis' class='addthis_toolbox addthis_default_style ' \r\n\t\t\t\t\taddthis:url='" . $opac_url_base . "fb.php?title=" . rawurlencode(strip_tags($this->notice_header_without_html)) . "&url=" . rawurlencode($this->permalink) . "'>\r\n\t\t\t\t</div>";
     }
     if ($img_tag) {
         $li_tags = "<li id='tags!!id!!' class='onglet_tags'>{$img_tag}</li>";
     }
     if ($basket || $img_tag || $opac_notice_enrichment) {
         $template_in .= "\r\n\t\t\t\t<ul id='onglets_isbd_public!!id!!' class='onglets_isbd_public'>";
         if ($basket) {
             $template_in .= "<li id='baskets!!id!!' class='onglet_basket'>{$basket}</li>";
         }
         if ($opac_notice_enrichment) {
             if ($what == 'ISBD') {
                 $template_in .= "<li id='onglet_isbd!!id!!' class='isbd_public_active'><a href='#' title=\"" . $msg['ISBD_info'] . "\" onclick=\"show_what('ISBD', '!!id!!'); return false;\">" . $msg['ISBD'] . "</a></li>";
             } else {
                 $template_in .= "<li id='onglet_public!!id!!' class='isbd_public_active'><a href='#' title=\"" . $msg['Public_info'] . "\" onclick=\"show_what('PUBLIC', '!!id!!'); return false;\">" . $msg['Public'] . "</a></li>";
             }
         }
         $template_in .= "\r\n\t  \t\t\t{$li_tags}\r\n\t\t\t<!-- onglets_perso_list -->\r\n\t\t\t</ul>\r\n\t\t\t<div class='row'></div>";
     }
     if ($what == 'ISBD') {
         $template_in .= "\t\t    \t\r\n\t\t\t\t<div id='div_isbd!!id!!' style='display:block;'>!!ISBD!!</div>\r\n\t  \t\t\t<div id='div_public!!id!!' style='display:none;'>!!PUBLIC!!</div>";
     } else {
         $template_in .= "\r\n\t\t    \t<div id='div_public!!id!!' style='display:block;'>!!PUBLIC!!</div>\r\n\t\t\t\t<div id='div_isbd!!id!!' style='display:none;'>!!ISBD!!</div>";
     }
     $template_in .= "\r\n\t\t\t<!-- onglets_perso_content -->";
     if ($opac_avis_display_mode == 1 && ($this->avis_allowed && $this->avis_allowed != 2 || $_SESSION["user_code"] && $this->avis_allowed == 2)) {
         $this->affichage_avis_detail = $this->avis_detail();
     }
     // Serials : différence avec les monographies on affiche [périodique] et [article] devant l'ISBD
     if ($this->notice->niveau_biblio == 's') {
         $template_in = str_replace('!!ISBD!!', "<span class='fond-mere'>[" . $msg['isbd_type_perio'] . "]</span>&nbsp;<a href='index.php?lvl=notice_display&id=" . $this->notice_id . "'><i>" . $msg["see_bull"] . "</i></a>&nbsp;!!ISBD!!", $template_in);
         $template_in = str_replace('!!PUBLIC!!', "<span class='fond-mere'>[" . $msg['isbd_type_perio'] . "]</span>&nbsp;<a href='index.php?lvl=notice_display&id=" . $this->notice_id . "'><i>" . $msg["see_bull"] . "</i></a>&nbsp;!!PUBLIC!!", $template_in);
     } elseif ($this->notice->niveau_biblio == 'a') {
         $template_in = str_replace('!!ISBD!!', "<span class='fond-article'>[" . $msg['isbd_type_art'] . "]</span>&nbsp;!!ISBD!!", $template_in);
         $template_in = str_replace('!!PUBLIC!!', "<span class='fond-article'>[" . $msg['isbd_type_art'] . "]</span>&nbsp;!!PUBLIC!!", $template_in);
     } elseif ($this->notice->niveau_biblio == 'b') {
         $template_in = str_replace('!!ISBD!!', "<span class='fond-article'>[" . $msg['isbd_type_bul'] . "]</span>&nbsp;!!ISBD!!", $template_in);
         $template_in = str_replace('!!PUBLIC!!', "<span class='fond-article'>[" . $msg['isbd_type_bul'] . "]</span>&nbsp;!!PUBLIC!!", $template_in);
     }
     $template_in .= $this->get_serialcirc_form_actions();
     $template_in = str_replace('!!ISBD!!', $this->notice_isbd, $template_in);
     $template_in = str_replace('!!PUBLIC!!', $this->notice_public, $template_in);
     $template_in = str_replace('!!id!!', $this->notice_id, $template_in);
     $this->do_image($template_in, $depliable);
     $this->result = str_replace('!!id!!', $this->notice_id, $template);
     if ($this->notice_header_doclink) {
         $this->result = str_replace('!!heada!!', $this->notice_header_without_doclink, $this->result);
     } elseif ($this->notice_header) {
         $this->result = str_replace('!!heada!!', $this->notice_header, $this->result);
     } else {
         $this->result = str_replace('!!heada!!', '', $this->result);
     }
     $this->result = str_replace('!!CONTENU!!', $template_in, $this->result);
     if ($opac_allow_simili_search) {
         $this->affichage_simili_search_head = facettes::similitude_head($this->notice_id);
     }
     if ($this->affichage_resa_expl || $this->notice_childs || $this->affichage_avis_detail || $this->affichage_simili_search_head) {
         $this->result = str_replace('!!SUITE!!', $this->notice_childs . $this->affichage_resa_expl . $this->affichage_avis_detail . $this->affichage_simili_search_head, $this->result);
     } else {
         $this->result = str_replace('!!SUITE!!', '', $this->result);
     }
 }