27 static $owl_path =
"./Services/Accordion/lib/owl.carousel.2.0.0-beta.2.4";
66 if (in_array($a_orientation,
69 $this->orientation = $a_orientation;
80 return $this->orientation;
90 $this->containerclass = $a_containerclass;
100 return $this->containerclass;
110 $this->icontainerclass = $a_containerclass;
120 return $this->icontainerclass;
130 $this->headerclass = $a_headerclass;
140 return $this->headerclass;
150 $this->active_headerclass = $a_h_class;
160 return $this->active_headerclass;
170 $this->contentclass = $a_contentclass;
180 return $this->contentclass;
190 $this->contentwidth = $a_contentwidth;
200 return $this->contentwidth;
210 $this->contentheight = $a_contentheight;
220 return $this->contentheight;
230 $this->behaviour = $a_val;
240 return $this->behaviour;
250 $this->use_session_storage = $a_val;
270 $this->allow_multi_opened = $a_val;
290 $this->show_all_element = $a_val;
310 $this->hide_all_element = $a_val;
331 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
334 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
337 foreach (self::getLocalJavascriptFiles() as $f)
339 $tpl->addJavaScript($f,
true, 3);
350 foreach (self::getLocalCssFiles() as $f)
362 "./Services/Accordion/js/accordion.js",
363 self::$owl_path.self::$owl_js_path
373 "./Services/Accordion/css/accordion.css",
374 self::$owl_path.self::$owl_css_path
383 $this->items[] =
array(
"header" => $a_header,
384 "content" =>
$a_content,
"force_open" => $a_force_open);
407 self::$accordion_cnt++;
427 $this->addJavascript();
430 $tpl =
new ilTemplate(
"tpl.accordion.html",
true,
true,
"Services/Accordion");
431 foreach ($this->
getItems() as $item)
433 $tpl->setCurrentBlock(
"item");
434 $tpl->setVariable(
"HEADER", $item[
"header"]);
435 $tpl->setVariable(
"CONTENT", $item[
"content"]);
443 $tpl->setVariable(
"HIDE_CONTENT_CLASS",
"ilAccHideContent");
446 $tpl->setVariable(
"OR_SHORT", $or_short);
454 $tpl->setVariable(
"HEIGHT",
"height:".$height.
"px;");
458 $tpl->setVariable(
"HHEIGHT",
"height:".$height.
"px;");
460 $tpl->parseCurrentBlock();
471 include_once(
"./Services/Accordion/classes/class.ilAccordionPropertiesStorage.php");
474 $ctab = $stor->getProperty($this->
getId(), $ilUser->getId(),
476 $ctab_arr = explode(
";", $ctab);
478 foreach ($this->force_open as $fo)
480 if (!in_array($fo, $ctab_arr))
485 $ctab = implode(
";", $ctab_arr);
492 $options[
"save_url"] =
"./ilias.php?baseClass=ilaccordionpropertiesstorage&cmd=setOpenedTab".
493 "&accordion_id=".$this->getId().
"&user_id=".$ilUser->getId();
499 $options[
"toggle_class"] =
'il_HAccordionToggleDef';
500 $options[
"toggle_act_class"] =
'il_HAccordionToggleActiveDef';
501 $options[
"content_class"] =
'il_HAccordionContentDef';
505 $options[
"toggle_class"] =
'il_VAccordionToggleDef';
506 $options[
"toggle_act_class"] =
'il_VAccordionToggleActiveDef';
507 $options[
"content_class"] =
'il_VAccordionContentDef';
521 $tpl->setVariable(
"CWIDTH",
'style="width:'.$width.
'px;"');
524 if ($this->head_class_set)
532 $options[
"active_head_class"] =
"il_HAccordionHeadActive";
536 $options[
"active_head_class"] =
"il_VAccordionHeadActive";
541 $options[
"id"] =
'accordion_'.$this->getId().
'_'.self::$accordion_cnt;
546 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
getContentWidth()
Get ContentWidth.
static getLocalCssFiles()
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.
static getLocalJavascriptFiles()
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.
Create styles array
The data for the language used.
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.