54 $this->class_tab=
"tabs";
55 $this->class_tab_main=
"tabs";
56 $this->class_tab_selected=
"tabs_selected";
58 $this->class_anchor=
"";
60 $this->class_content_div=
"";
61 $this->class_comment=
"tabs";
134 $this->class_anchor=$anchor_class;
174 if (! in_array(
$mode,[
'tab',
'row',
'accordeon'] )) {
175 throw new Exception(_(
"OUTPUTHTML070 Mode invalide"));
178 if (
$mode ==
"row") {
190 throw new \Exception(
"OH186.unknow mode [$mode]");
201 $this->a_tabs[]=clone $p_html_tab;
251 $nb=count($this->a_tabs);
253 if (
$mode==
"accordeon") {
262 if ( $this->a_tabs[
$i]->get_id() != $p_not_hidden) {
263 $r .= sprintf(
"$('div%s').hide();",$this->a_tabs[
$i]->get_id() );
264 $r .= sprintf(
"$('tab%s').className='%s';",$this->a_tabs[
$i]->get_id(),$this->class_tab );
266 $r .= sprintf(
"$('div%s').show();",$p_not_hidden );
267 $r .= sprintf(
"$('tab%s').className='%s';",$p_not_hidden ,$this->class_tab_selected);
271 if ( $this->a_tabs[
$i]->get_id() != $p_not_hidden) {
272 $r .= sprintf(
"Effect.BlindUp('div%s',{duration : 0.7});",$this->a_tabs[
$i]->get_id() );
273 $r .= sprintf(
"$('tab%s').className='%s';",$this->a_tabs[
$i]->get_id(),$this->class_tab );
275 $r .= sprintf(
"Effect.SlideDown('div%s',{duration : 0.7});",$p_not_hidden );
276 $r .= sprintf(
"$('tab%s').className='%s';",$p_not_hidden ,$this->class_tab_selected);
280 throw new \Exception(
"OH283.unknow mode [$mode]");
291 printf (
'<span class="%s"> %s </span>',
293 $this->a_tabs[$p_index]->get_comment()
303 $nb=count($this->a_tabs);
308 printf(
'<div class="%s">',$this->class_div);
309 printf (
'<ul class="%s">',$this->class_tab_main);
313 printf (
'<li id="tab%s" class="%s">',
314 $this->a_tabs[
$i]->get_id(),$this->class_tab);
318 printf (
'<a class="%s" id="%s" href="%s">',
320 $this->a_tabs[
$i]->get_id(),
321 $this->a_tabs[
$i]->get_link());
322 printf (
'<span class="title_%s"> %s </span>',
324 $this->a_tabs[
$i]->get_title()
330 printf(
'<a class="%s" id="%s" onclick="%s">',
332 $this->a_tabs[
$i]->get_id(),
333 $this->a_tabs[
$i]->get_link());
334 printf (
'<span class="title_%s"> %s </span>',
336 $this->a_tabs[
$i]->get_title()
339 echo $this->a_tabs[
$i]->get_title();
345 if (
$mode !=
'accordeon') {
346 printf(
'<a class="%s" onclick="%s">', $this->class_anchor,
$script);
351 printf (
'<span class="title_%s"> %s </span>',
353 $this->a_tabs[
$i]->get_title()
361 throw new Exception(
'OUTPUTHTMLTAB01');
375 if (
$mode==
"tab" ) {
393 printf(
'<div id="div%s" style="display:none;clear:both" class="%s">',
394 $this->a_tabs[$p_index]->get_id(),
396 echo $this->a_tabs[$p_index]->get_content();
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
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)