id_tpl=$id_tpl+0; $this->fetch_data(); } protected function fetch_data(){ if(!$this->id_tpl)return false; $this->noti_tpl=new notice_tpl_gen($this->id_tpl); } public function get_onglet_header(){ //print ($this->noti_tpl->name); return($this->noti_tpl->name); } public function get_onglet_content($id_notice){ $tpl= $this->noti_tpl->build_notice($id_notice); return $tpl; } } // class end class notice_onglets { public function __construct($ids){ global $opac_notices_format_onglets; if(!$ids)$ids=$opac_notices_format_onglets; $this->ids=$ids; } public function insert_onglets($id_notice,$retour_aff){ $id_notice+=0; $onglets_title=""; $onglets_content=""; if($this->ids){ $onglets=explode(",", $this->ids); foreach($onglets as $id_tpl){ $notice_onglet=new notice_onglet($id_tpl); $title=$notice_onglet->get_onglet_header(); $onglet_title="
  • ".$title."
  • "; $content=$notice_onglet->get_onglet_content($id_notice); $onglet_content=" "; // Si pas de titre ou de contenu rien ne s'affiche. if($title && $onglet_content){ $onglets_title.=$onglet_title; $onglets_content.=$onglet_content; } } } $retour_aff=str_replace('', $onglets_title, $retour_aff); $retour_aff=str_replace('', $onglets_content, $retour_aff); return $retour_aff; } } // class end