108 $this->class_tab=
"tabs";
109 $this->class_tab_main=
"tabs";
110 $this->class_tab_selected=
"tabs_selected";
112 $this->class_anchor=
"";
114 $this->class_content_div=
"";
115 $this->class_comment=
"tabs";
188 $this->class_anchor=$anchor_class;
228 if (! in_array(
$mode,[
'tab',
'row',
'accordeon'] )) {
229 throw new Exception(
_(
"OUTPUTHTML070 Mode invalide"));
232 if (
$mode ==
"row") {
244 throw new \Exception(
"OH186.unknow mode [$mode]");
255 $this->a_tabs[]=clone $p_html_tab;
305 $nb=count($this->a_tabs);
307 if (
$mode==
"accordeon") {
316 if ( $this->a_tabs[
$i]->get_id() != $p_not_hidden) {
317 $r .= sprintf(
"$('div%s').hide();",$this->a_tabs[
$i]->get_id() );
318 $r .= sprintf(
"$('tab%s').className='%s';",$this->a_tabs[
$i]->get_id(),$this->class_tab );
320 $r .= sprintf(
"$('div%s').show();",$p_not_hidden );
321 $r .= sprintf(
"$('tab%s').className='%s';",$p_not_hidden ,$this->class_tab_selected);
325 if ( $this->a_tabs[
$i]->get_id() != $p_not_hidden) {
326 $r .= sprintf(
"Effect.BlindUp('div%s',{duration : 0.7});",$this->a_tabs[
$i]->get_id() );
327 $r .= sprintf(
"$('tab%s').className='%s';",$this->a_tabs[
$i]->get_id(),$this->class_tab );
329 $r .= sprintf(
"Effect.SlideDown('div%s',{duration : 0.7});",$p_not_hidden );
330 $r .= sprintf(
"$('tab%s').className='%s';",$p_not_hidden ,$this->class_tab_selected);
334 throw new \Exception(
"OH283.unknow mode [$mode]");
345 printf (
'<span class="%s"> %s </span>',
347 $this->a_tabs[$p_index]->get_comment()
357 $nb=count($this->a_tabs);
362 printf(
'<div class="%s">',$this->class_div);
363 printf (
'<ul class="%s">',$this->class_tab_main);
367 printf (
'<li id="tab%s" class="%s">',
368 $this->a_tabs[
$i]->get_id(),$this->class_tab);
372 printf (
'<a class="%s" id="%s" href="%s">',
374 $this->a_tabs[
$i]->get_id(),
375 $this->a_tabs[
$i]->get_link());
376 printf (
'<span class="title_%s"> %s </span>',
378 $this->a_tabs[
$i]->get_title()
384 printf(
'<a class="%s" id="%s" onclick="%s">',
386 $this->a_tabs[
$i]->get_id(),
387 $this->a_tabs[
$i]->get_link());
388 printf (
'<span class="title_%s"> %s </span>',
390 $this->a_tabs[
$i]->get_title()
393 echo $this->a_tabs[
$i]->get_title();
399 if (
$mode !=
'accordeon') {
400 printf(
'<a class="%s" onclick="%s">', $this->class_anchor,
$script);
405 printf (
'<span class="title_%s"> %s </span>',
407 $this->a_tabs[
$i]->get_title()
415 throw new Exception(
'OUTPUTHTMLTAB01');
429 if (
$mode==
"tab" ) {
447 printf(
'<div id="div%s" style="display:none;clear:both" class="%s">',
448 $this->a_tabs[$p_index]->get_id(),
450 echo $this->a_tabs[$p_index]->get_content();
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
_("actif, passif,charge,...")
static toggle_hide($p_id, $p_id_to_hide)
hide or display an element, to be used for an accordon
get_class_div()
CSS class for the DIV containing the UL.
set_class_tab($class_tab)
set the CSS class of tabs, default is tabs
add(Html_Tab $p_html_tab)
Add Html_Tab.
$class_content_div
CSS class for the DIV containing the UL default empty.
$class_tab_selected
for class_tab_selected
get_class_tab_selected()
get the CSS class of tabs_selected
get_mode()
get the mode , possible value are row or tabs , with mode = row , the class_content_div is set to row
set_class_tab_main($class_tab_main)
set the CSS class for the UL element
set_class_comment($class_comment)
CSS class for the comment default "tabs".
get_class_anchor()
CSS class for the A tag (anchor)
get_class_tab_main()
get the CSS class for the UL element
set_class_anchor($anchor_class)
CSS class for the A tag (anchor)
get_class_comment()
CSS class for the comment default "tabs".
set_class_tab_selected($class_tab_selected)
set the CSS class of tabs, default is tabs_selected
$a_tabs
array of html tabs
print_comment($p_index)
When printing row , a comment is written if not empty,.
build_js($p_not_hidden)
Build the javascript to change the class name of the selected tab, hide other div and show the select...
$class_div
CSS class for the A tag (anchor) default empty.
get_class_tab()
get the CSS class of tabs
$class_anchor
CSS class for the UL tag.
set_class_div($class_div)
CSS class for the DIV containing the UL.
output()
print the html + javascript code of the tabs and the div
set_mode($mode)
set the mode , possible values : row , tabs or accordeon
set_class_content_div($class_content_div)
CSS class for the DIV with content (default empty)
$class_comment
CSS class for the DIV with content, default empty.
get_class_content_div()
CSS class for the DIV with content (default empty)
if( $delta< 0) elseif( $delta==0)