58 if (in_array($a_orientation,
61 $this->orientation = $a_orientation;
72 return $this->orientation;
82 $this->containerclass = $a_containerclass;
92 return $this->containerclass;
102 $this->icontainerclass = $a_containerclass;
112 return $this->icontainerclass;
122 $this->headerclass = $a_headerclass;
132 return $this->headerclass;
142 $this->active_headerclass = $a_h_class;
152 return $this->active_headerclass;
162 $this->contentclass = $a_contentclass;
172 return $this->contentclass;
182 $this->contentwidth = $a_contentwidth;
192 return $this->contentwidth;
202 $this->contentheight = $a_contentheight;
212 return $this->contentheight;
222 $this->behaviour = $a_val;
232 return $this->behaviour;
242 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
247 $tpl->addJavaScript(
"./Services/Accordion/js/accordion.js",
true, 3);
257 $tpl->addCss(
"./Services/Accordion/css/accordion.css");
263 function addItem($a_header, $a_content, $a_force_open =
false)
265 $this->items[] = array(
"header" => $a_header,
266 "content" => $a_content);
289 self::$accordion_cnt++;
309 $this->addJavascript();
312 $tpl =
new ilTemplate(
"tpl.accordion.html",
true,
true,
"Services/Accordion");
313 foreach ($this->
getItems() as $item)
315 $tpl->setCurrentBlock(
"item");
316 $tpl->setVariable(
"HEADER", $item[
"header"]);
317 $tpl->setVariable(
"CONTENT", $item[
"content"]);
322 $tpl->setVariable(
"OR_SHORT", $or_short);
330 $tpl->setVariable(
"HEIGHT",
"height:".$height.
"px;");
334 $tpl->setVariable(
"HHEIGHT",
"height:".$height.
"px;");
336 $tpl->parseCurrentBlock();
339 $tpl->setVariable(
"CNT", self::$accordion_cnt);
346 include_once(
"./Services/Accordion/classes/class.ilAccordionPropertiesStorage.php");
349 if($this->force_open)
351 $stor->storeProperty($this->
getId(), $ilUser->getId(),
358 $ctab = $stor->getProperty($this->
getId(), $ilUser->getId(),
362 $tpl->setVariable(
"BEHAVIOUR", $ctab);
363 $tpl->setVariable(
"SAVE_URL",
"./ilias.php?baseClass=ilaccordionpropertiesstorage&cmd=setOpenedTab".
364 "&accordion_id=".$this->
getId().
"&user_id=".$ilUser->getId());
370 $tpl->setVariable(
"OR2_SHORT", $or_short);
373 $tpl->setVariable(
"WIDTH", $width);
377 $tpl->setVariable(
"WIDTH",
"null");
381 $tpl->setVariable(
"CWIDTH",
'style="width:'.$width.
'px;"');
384 if ($this->head_class_set)
392 $tpl->setVariable(
"ACTIVE_HEAD_CLASS",
"il_HAccordionHeadActive");
396 $tpl->setVariable(
"ACTIVE_HEAD_CLASS",
"il_VAccordionHeadActive");
getContentWidth()
Get ContentWidth.
getContentHeight()
Get ContentHeight.
setActiveHeaderClass($a_h_class)
Set active header class.
static initAnimation()
Init YUI Animation.
getContainerClass()
Get Container CSS Class.
getOrientation()
Get Orientation.
getActiveHeaderClass()
Get active Header CSS Class.
static initConnection()
Init YUI Connection module.
getHeaderClass()
Get Header CSS Class.
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.
static initDom()
Init YUI Dom.
setContentHeight($a_contentheight)
Set ContentHeight.
getInnerContainerClass()
Get inner Container CSS Class.
static addCss()
Add required css.
setBehaviour($a_val)
Set behaviour "ForceAllOpen" | "FirstOpen" | "OneOpenSession".
special template class to simplify handling of ITX/PEAR
setInnerContainerClass($a_containerclass)
Set inner Container CSS Class.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static initEvent()
Init YUI Event.
getContentClass()
Get Content CSS Class.
setHeaderClass($a_headerclass)
Set Header CSS Class.
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.