3 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
48 public function __construct($a_enable_manage_select_all =
false, $a_enable_multi_download =
false, $a_active_block_ordering =
false,
array $a_block_custom_positions = null)
50 $this->enable_manage_select_all = (bool)$a_enable_manage_select_all;
51 $this->enable_multi_download = (bool)$a_enable_multi_download;
52 $this->active_block_ordering = (bool)$a_active_block_ordering;
53 $this->block_custom_pos = $a_block_custom_positions;
76 ,
"postfix" => $a_postfix
91 return array_key_exists(
$a_type, $this->type_blocks);
106 $this->custom_blocks[$a_id] =
array(
107 "caption" => $a_caption
108 ,
"actions" => $a_actions
123 return array_key_exists($a_id, $this->custom_blocks);
151 $this->hidden_items[$a_id] =
true;
169 unset($this->item_ids[$a_id]);
170 unset($this->hidden_items[$a_id]);
172 foreach(array_keys($this->items) as $item_id)
174 if(array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id)
176 unset($this->items[$item_id]);
180 foreach($this->block_items as $block_id =>
$items)
182 foreach(
$items as $idx => $item_id)
184 if(array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id)
186 unset($this->block_items[$block_id][$idx]);
187 if(!
sizeof($this->block_items[$block_id]))
189 unset($this->block_items[$block_id]);
205 return (array_key_exists($a_id, $this->item_ids) ||
206 array_key_exists($a_id, $this->hidden_items));
219 public function addItemToBlock($a_block_id, $a_item_type, $a_item_id, $a_item_html, $a_force =
false)
222 $a_item_type !=
"itgr" &&
223 (!$this->
hasItem($a_item_id) || $a_force) &&
227 $uniq_id = $a_block_id.self::UNIQUE_SEPARATOR.$a_item_id;
229 $this->items[$uniq_id] =
array(
230 "type" => $a_item_type
231 ,
"html" => $a_item_html
235 $this->item_ids[$a_item_id] =
true;
237 $this->block_items[$a_block_id][] = $uniq_id;
252 $this->details[$a_level] =
array(
254 ,
"active" => (
bool)$a_active
263 $this->details =
array();
281 $this->block_pos[$a_block_id] = $a_pos;
298 if(array_key_exists($block_id, $this->custom_blocks))
306 if(array_key_exists($block_id, $this->type_blocks))
320 return $block_tpl->get();
336 return $block_tpl->get();
352 return $block_tpl->get();
369 if(
sizeof($this->block_custom_pos))
372 $this->block_pos =
array();
373 foreach($this->block_custom_pos as $idx => $block_id)
377 $this->block_pos[$block_id] = $idx;
382 if(
sizeof($this->block_pos))
385 $last = max($this->block_pos);
386 foreach(array_keys($tmp) as $block_id)
388 if(!array_key_exists($block_id, $this->block_pos))
390 $this->block_pos[$block_id] = ++$last;
397 $this->block_pos = $tmp;
403 ? max($this->block_pos)
405 foreach(array_keys($this->custom_blocks) as $block_id)
407 if(!array_key_exists($block_id, $this->block_pos))
409 $this->block_pos[$block_id] = ++$last;
412 foreach(array_keys($this->type_blocks) as $block_id)
414 if(!array_key_exists($block_id, $this->block_pos))
416 $this->block_pos[$block_id] = ++$last;
420 asort($this->block_pos);
422 return array_keys($this->block_pos);
437 return $this->
renderHelperGeneric($a_block_tpl, $a_block_id, $this->custom_blocks[$a_block_id], $a_is_single);
454 $block = $this->type_blocks[
$a_type];
473 if(!in_array($a_block_id, $this->rendered_blocks))
475 $this->rendered_blocks[] = $a_block_id;
477 $block_types =
array();
478 if(is_array($this->block_items[$a_block_id]))
480 foreach($this->block_items[$a_block_id] as $item_id)
482 if(isset($this->items[$item_id][
"type"]))
484 $block_types[] = $this->items[$item_id][
"type"];
490 if(is_array($this->block_items[$a_block_id]) ||
491 is_numeric($a_block_id))
497 $this->
addHeaderRow($a_block_tpl, $a_block[
"type"], $a_block[
"caption"], array_unique($block_types), $a_block[
"actions"], $order_id);
499 if($a_block[
"prefix"])
504 if(is_array($this->block_items[$a_block_id]))
506 foreach($this->block_items[$a_block_id] as $item_id)
508 $this->
addStandardRow($a_block_tpl, $this->items[$item_id][
"html"], $item_id);
512 if($a_block[
"postfix"])
532 $this->cur_row_type =
"row_type_1";
534 return new ilTemplate(
"tpl.container_list_block.html",
true,
true,
535 "Services/Container");
552 $a_tpl->
setVariable(
"CB_ID",
' id="bl_cntr_'.(++$this->bl_cnt).
'"');
554 if ($this->enable_manage_select_all)
558 else if ($this->enable_multi_download)
564 foreach($a_types_in_block as $type)
574 if ($a_text ==
"" &&
$a_type !=
"")
576 if (!$objDefinition->isPlugin(
$a_type))
582 include_once(
"./Services/Component/classes/class.ilPlugin.php");
592 if ($ilSetting->get(
"icon_position_in_lists") !=
"item_rows" &&
608 $a_tpl->
setVariable(
"BLOCK_HEADER_ORDER_NAME",
"position[blocks][".$a_order_id.
"]");
609 $a_tpl->
setVariable(
"BLOCK_HEADER_ORDER_NUM", (++$this->order_cnt)*10);
613 $a_tpl->
setVariable(
"CHR_COMMANDS", $a_commands_html);
631 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
638 $a_tpl->
setVariable(
"ROW_ID",
'id="item_row_'.$a_ref_id.
'"');
663 $a_tpl->
setVariable(
"CHECKBOXNAME",
"bl_cb_".$this->bl_cnt);
664 $a_tpl->
setVariable(
"SEL_ALL_PARENT",
"bl_cntr_".$this->bl_cnt);
665 $a_tpl->
setVariable(
"SEL_ALL_PARENT",
"bl_cntr_".$this->bl_cnt);
666 $a_tpl->
setVariable(
"TXT_SELECT_ALL", $lng->txt(
"select_all"));
687 $this->cur_row_type =
"";
697 return array(
"fold",
"file");
709 if(
sizeof($this->details))
712 $a_tpl->
setVariable(
'TXT_DETAILS', $lng->txt(
'details'));
getDownloadableTypes()
Get downloadable repository object types.
renderSingleCustomBlock($a_id)
Get rendered html of single custom block.
addSeparatorRow(ilTemplate $a_tpl)
Render separator row.
addCustomBlock($a_id, $a_caption, $a_actions=null)
Add custom block.
addStandardRow(ilTemplate $a_tpl, $a_html, $a_ref_id=0)
Render item row.
addTypeBlock($a_type, $a_prefix=null, $a_postfix=null)
Add type block.
$enable_manage_select_all
hasItem($a_id)
Item with id exists?
renderDetails(ilTemplate $a_tpl)
Render detail level.
setVariable($variable, $value='')
Sets a variable value.
addHeaderRow(ilTemplate $a_tpl, $a_type="", $a_text="", array $a_types_in_block=null, $a_commands_html=null, $a_order_id=null)
Render block header.
__construct($a_enable_manage_select_all=false, $a_enable_multi_download=false, $a_active_block_ordering=false, array $a_block_custom_positions=null)
Constructor.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
touchBlock($block)
overwrites ITX::touchBlock.
special template class to simplify handling of ITX/PEAR
initBlockTemplate()
Init template.
resetDetails()
Reset/remove all detail levels.
renderHelperCustomBlock(ilTemplate $a_block_tpl, $a_block_id, $a_is_single=false)
Render custom block.
static getRepoPluginObjectByType($type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin...
Create styles array
The data for the language used.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
isValidBlock($a_id)
Any block with id exists?
hasTypeBlock($a_type)
Type block already exists?
hasCustomBlock($a_id)
Custom block already exists?
hideItem($a_id)
Mark item id as used, but do not render.
renderHelperGeneric(ilTemplate $a_block_tpl, $a_block_id, array $a_block, $a_is_single=false)
Render block.
renderSingleTypeBlock($a_type)
Get rendered html of single type block.
removeItem($a_id)
Remove item (from any block)
addDetailsLevel($a_level, $a_url, $a_active=false)
Add details level.
renderHelperTypeBlock(ilTemplate $a_block_tpl, $a_type, $a_is_single=false)
Render type block.
Class ilContainerRenderer.
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
processBlockPositions()
Process block positions.
resetRowType()
Reset internal row type.
renderSelectAllBlock(ilTemplate $a_tpl)
Render "select all".
setBlockPosition($a_block_id, $a_pos)
Set block position.
addItemToBlock($a_block_id, $a_item_type, $a_item_id, $a_item_html, $a_force=false)
Add item to existing block.
getHTML()
Get rendered html (of all blocks)