32 public static $owl_path =
"./libs/bower/bower_components/owl.carousel/dist";
43 $this->
user = $DIC->user();
78 $this->orientation = $a_orientation;
89 return $this->orientation;
99 $this->containerclass = $a_containerclass;
109 return $this->containerclass;
119 $this->icontainerclass = $a_containerclass;
129 return $this->icontainerclass;
139 $this->headerclass = $a_headerclass;
149 return $this->headerclass;
159 $this->active_headerclass = $a_h_class;
169 return $this->active_headerclass;
179 $this->contentclass = $a_contentclass;
189 return $this->contentclass;
199 $this->contentwidth = $a_contentwidth;
209 return $this->contentwidth;
219 $this->contentheight = $a_contentheight;
229 return $this->contentheight;
239 $this->behaviour = $a_val;
249 return $this->behaviour;
259 $this->use_session_storage = $a_val;
279 $this->allow_multi_opened = $a_val;
299 $this->show_all_element = $a_val;
319 $this->hide_all_element = $a_val;
339 if ($main_tpl != null) {
345 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
348 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
351 foreach (self::getLocalJavascriptFiles() as $f) {
352 $tpl->addJavaScript($f,
true, 3);
365 foreach (self::getLocalCssFiles() as $f) {
376 "./Services/Accordion/js/accordion.js",
377 self::$owl_path . self::$owl_js_path
387 "./Services/Accordion/css/accordion.css",
388 self::$owl_path . self::$owl_css_path
397 $this->items[] =
array(
"header" => $a_header,
398 "content" =>
$a_content,
"force_open" => $a_force_open);
420 self::$accordion_cnt++;
437 $this->addJavascript();
440 $tpl =
new ilTemplate(
"tpl.accordion.html",
true,
true,
"Services/Accordion");
441 foreach ($this->
getItems() as $item) {
442 $tpl->setCurrentBlock(
"item");
443 $tpl->setVariable(
"HEADER", $item[
"header"]);
444 $tpl->setVariable(
"CONTENT", $item[
"content"]);
451 $tpl->setVariable(
"HIDE_CONTENT_CLASS",
"ilAccHideContent");
454 $tpl->setVariable(
"OR_SHORT", $or_short);
461 $tpl->setVariable(
"HEIGHT",
"height:" . $height .
"px;");
464 $tpl->setVariable(
"HHEIGHT",
"height:" . $height .
"px;");
466 $tpl->parseCurrentBlock();
476 include_once(
"./Services/Accordion/classes/class.ilAccordionPropertiesStorage.php");
479 $ctab = $stor->getProperty(
484 $ctab_arr = explode(
";", $ctab);
486 foreach ($this->force_open as $fo) {
487 if (!in_array($fo, $ctab_arr)) {
491 $ctab = implode(
";", $ctab_arr);
498 $options[
"save_url"] =
"./ilias.php?baseClass=ilaccordionpropertiesstorage&cmd=setOpenedTab" .
499 "&accordion_id=" . $this->
getId() .
"&user_id=" .
$ilUser->getId();
504 $options[
"toggle_class"] =
'il_HAccordionToggleDef';
505 $options[
"toggle_act_class"] =
'il_HAccordionToggleActiveDef';
506 $options[
"content_class"] =
'il_HAccordionContentDef';
508 $options[
"toggle_class"] =
'il_VAccordionToggleDef';
509 $options[
"toggle_act_class"] =
'il_VAccordionToggleActiveDef';
510 $options[
"content_class"] =
'il_VAccordionContentDef';
520 $tpl->setVariable(
"CWIDTH",
'style="width:' . $width .
'px;"');
523 if ($this->head_class_set) {
527 $options[
"active_head_class"] =
"il_HAccordionHeadActive";
529 $options[
"active_head_class"] =
"il_VAccordionHeadActive";
534 $options[
"id"] =
'accordion_' . $this->
getId() .
'_' . self::$accordion_cnt;
539 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
getContentWidth()
Get ContentWidth.
static getLocalCssFiles()
getContentHeight()
Get ContentHeight.
setActiveHeaderClass($a_h_class)
Set active header class.
getContainerClass()
Get Container CSS Class.
static initConnection(ilTemplate $a_main_tpl=null)
Init YUI Connection module.
getOrientation()
Get Orientation.
getActiveHeaderClass()
Get active Header CSS Class.
setAllowMultiOpened($a_val)
Set allow multi opened.
if(!array_key_exists('StateId', $_REQUEST)) $id
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 getLocalJavascriptFiles()
static addJavaScript(ilTemplate $main_tpl=null)
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.
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.
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
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.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
__construct()
Constructor.