62 if (in_array($a_orientation,
65 $this->orientation = $a_orientation;
76 return $this->orientation;
86 $this->containerclass = $a_containerclass;
96 return $this->containerclass;
106 $this->icontainerclass = $a_containerclass;
116 return $this->icontainerclass;
126 $this->headerclass = $a_headerclass;
136 return $this->headerclass;
146 $this->active_headerclass = $a_h_class;
156 return $this->active_headerclass;
166 $this->contentclass = $a_contentclass;
176 return $this->contentclass;
186 $this->contentwidth = $a_contentwidth;
196 return $this->contentwidth;
206 $this->contentheight = $a_contentheight;
216 return $this->contentheight;
226 $this->behaviour = $a_val;
236 return $this->behaviour;
246 $this->use_session_storage = $a_val;
266 $this->allow_multi_opened = $a_val;
286 $this->show_all_element = $a_val;
306 $this->hide_all_element = $a_val;
327 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
330 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
332 $tpl->addJavaScript(
"./Services/Accordion/js/accordion.js",
true, 3);
342 $tpl->addCss(
"./Services/Accordion/css/accordion.css");
348 function addItem($a_header, $a_content, $a_force_open =
false)
350 $this->items[] = array(
"header" => $a_header,
351 "content" => $a_content,
"force_open" => $a_force_open);
374 self::$accordion_cnt++;
394 $this->addJavascript();
397 $tpl =
new ilTemplate(
"tpl.accordion.html",
true,
true,
"Services/Accordion");
398 foreach ($this->
getItems() as $item)
400 $tpl->setCurrentBlock(
"item");
401 $tpl->setVariable(
"HEADER", $item[
"header"]);
402 $tpl->setVariable(
"CONTENT", $item[
"content"]);
410 $tpl->setVariable(
"HIDE_CONTENT_CLASS",
"ilAccHideContent");
413 $tpl->setVariable(
"OR_SHORT", $or_short);
421 $tpl->setVariable(
"HEIGHT",
"height:".$height.
"px;");
425 $tpl->setVariable(
"HHEIGHT",
"height:".$height.
"px;");
427 $tpl->parseCurrentBlock();
438 include_once(
"./Services/Accordion/classes/class.ilAccordionPropertiesStorage.php");
441 $ctab = $stor->getProperty($this->
getId(), $ilUser->getId(),
443 $ctab_arr = explode(
";", $ctab);
445 foreach ($this->force_open as $fo)
447 if (!in_array($fo, $ctab_arr))
452 $ctab = implode(
";", $ctab_arr);
459 $options[
"save_url"] =
"./ilias.php?baseClass=ilaccordionpropertiesstorage&cmd=setOpenedTab".
460 "&accordion_id=".$this->getId().
"&user_id=".$ilUser->getId();
466 $options[
"toggle_class"] =
'il_HAccordionToggleDef';
467 $options[
"toggle_act_class"] =
'il_HAccordionToggleActiveDef';
468 $options[
"content_class"] =
'il_HAccordionContentDef';
472 $options[
"toggle_class"] =
'il_VAccordionToggleDef';
473 $options[
"toggle_act_class"] =
'il_VAccordionToggleActiveDef';
474 $options[
"content_class"] =
'il_VAccordionContentDef';
488 $tpl->setVariable(
"CWIDTH",
'style="width:'.$width.
'px;"');
491 if ($this->head_class_set)
499 $options[
"active_head_class"] =
"il_HAccordionHeadActive";
503 $options[
"active_head_class"] =
"il_VAccordionHeadActive";
508 $options[
"id"] =
'accordion_'.$this->getId().
'_'.self::$accordion_cnt;
513 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
getContentWidth()
Get ContentWidth.
static initjQueryUI()
Init jQuery UI (see included_components.txt for included components)
getContentHeight()
Get ContentHeight.
setActiveHeaderClass($a_h_class)
Set active header class.
getContainerClass()
Get Container CSS Class.
getOrientation()
Get Orientation.
getActiveHeaderClass()
Get active Header CSS Class.
static initConnection()
Init YUI Connection module.
setAllowMultiOpened($a_val)
Set allow multi opened.
getHeaderClass()
Get Header CSS Class.
getAllowMultiOpened()
Get allow multi opened.
getHTML()
Get accordion html.
addItem($a_header, $a_content, $a_force_open=false)
Add item.
static addJavaScript()
Add javascript files that are necessary to run accordion.
setContentClass($a_contentclass)
Set Content CSS Class.
getShowAllElement()
Get show all element.
setContentHeight($a_contentheight)
Set ContentHeight.
setUseSessionStorage($a_val)
Set use session storage.
getHideAllElement()
Get hide all element.
getInnerContainerClass()
Get inner Container CSS Class.
static encode($mixed, $suppress_native=false)
static addCss()
Add required css.
if(!is_array($argv)) $options
setBehaviour($a_val)
Set behaviour "ForceAllOpen" | "FirstOpen" | "AllClosed".
setHideAllElement($a_val)
Set hide all element.
setShowAllElement($a_val)
Set show all element.
special template class to simplify handling of ITX/PEAR
setInnerContainerClass($a_containerclass)
Set inner Container CSS Class.
getContentClass()
Get Content CSS Class.
setHeaderClass($a_headerclass)
Set Header CSS Class.
getUseSessionStorage()
Get use session storage.
setContentWidth($a_contentwidth)
Set ContentWidth.
setOrientation($a_orientation)
Set Orientation.
Accordion user interface class.
Saves (mostly asynchronously) user properties of accordions.
setContainerClass($a_containerclass)
Set Container CSS Class.
getBehaviour()
Get behaviour.
__construct()
Constructor.