47        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)
 
   49                $this->enable_manage_select_all = (bool)$a_enable_manage_select_all;
 
   50                $this->enable_multi_download = (bool)$a_enable_multi_download;                          
 
   51                $this->active_block_ordering = (bool)$a_active_block_ordering;                  
 
   52                $this->block_custom_pos = $a_block_custom_positions;
 
   68        public function addTypeBlock($a_type, $a_prefix = 
null, $a_postfix = 
null)
 
   70                if($a_type != 
"itgr" &&
 
   73                        $this->type_blocks[$a_type] = array(
 
   75                                ,
"postfix" => $a_postfix
 
   90                return array_key_exists($a_type, $this->type_blocks);
 
  105                        $this->custom_blocks[$a_id] = array(
 
  106                                "caption" => $a_caption
 
  107                                ,
"actions" => $a_actions
 
  122                return array_key_exists($a_id, $this->custom_blocks);
 
  150                $this->hidden_items[$a_id] = 
true;              
 
  168                unset($this->item_ids[$a_id]);          
 
  169                unset($this->hidden_items[$a_id]);              
 
  171                foreach(array_keys($this->items) as $item_id)
 
  173                        if(array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id)
 
  175                                unset($this->items[$item_id]);
 
  179                foreach($this->block_items as $block_id => 
$items)
 
  181                        foreach(
$items as $idx => $item_id)
 
  183                                if(array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id)
 
  185                                        unset($this->block_items[$block_id][$idx]);
 
  186                                        if(!
sizeof($this->block_items[$block_id]))
 
  188                                                unset($this->block_items[$block_id]);
 
  204                return (array_key_exists($a_id, $this->item_ids) ||
 
  205                        array_key_exists($a_id, $this->hidden_items));
 
  218        public function addItemToBlock($a_block_id, $a_item_type, $a_item_id, $a_item_html, $a_force = 
false)
 
  221                        $a_item_type != 
"itgr" &&
 
  222                        (!$this->
hasItem($a_item_id) || $a_force) &&
 
  226                        $uniq_id = $a_block_id.self::UNIQUE_SEPARATOR.$a_item_id;                       
 
  228                        $this->items[$uniq_id] = array(
 
  229                                "type" => $a_item_type
 
  230                                ,
"html" => $a_item_html
 
  234                        $this->item_ids[$a_item_id] = 
true;
 
  236                        $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];
 
  455                        $block[
"type"] = $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");
 
  548        protected function addHeaderRow(
ilTemplate $a_tpl, $a_type = 
"", $a_text = 
"", array $a_types_in_block = 
null, $a_commands_html = 
null, $a_order_id = 
null)
 
  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)
 
  562                                $a_types_in_block = array($a_type);
 
  564                        foreach($a_types_in_block as $type)
 
  574                if ($a_text == 
"" && $a_type != 
"")
 
  576                        if (!$objDefinition->isPlugin($a_type))
 
  578                                $title = 
$lng->txt(
"objs_".$a_type);
 
  582                                include_once(
"./Services/Component/classes/class.ilPlugin.php");
 
  591                if (
$ilSetting->get(
"icon_position_in_lists") != 
"item_rows" &&
 
  607                        $a_tpl->
setVariable(
"BLOCK_HEADER_ORDER_NAME", 
"position[blocks][".$a_order_id.
"]");
 
  608                        $a_tpl->
setVariable(
"BLOCK_HEADER_ORDER_NUM", (++$this->order_cnt)*10);
 
  611                $a_tpl->
setVariable(
"BLOCK_HEADER_CONTENT", $title);
 
  612                $a_tpl->
setVariable(
"CHR_COMMANDS", $a_commands_html);                  
 
  630                $this->cur_row_type = ($this->cur_row_type == 
"row_type_1")
 
  637                        $a_tpl->
setVariable(
"ROW_ID", 
'id="item_row_'.$a_ref_id.
'"');
 
  662                $a_tpl->
setVariable(
"CHECKBOXNAME", 
"bl_cb_".$this->bl_cnt);
 
  663                $a_tpl->
setVariable(
"SEL_ALL_PARENT", 
"bl_cntr_".$this->bl_cnt);
 
  664                $a_tpl->
setVariable(
"SEL_ALL_PARENT", 
"bl_cntr_".$this->bl_cnt);
 
  686                $this->cur_row_type = 
"";
 
  696                return array(
"fold", 
"file");
 
  708                if(
sizeof($this->details))
 
setVariable($variable, $value='')
Sets a variable value.
Class ilContainerRenderer.
removeItem($a_id)
Remove item (from any block)
$enable_manage_select_all
getDownloadableTypes()
Get downloadable repository object types.
renderHelperGeneric(ilTemplate $a_block_tpl, $a_block_id, array $a_block, $a_is_single=false)
Render block.
renderHelperTypeBlock(ilTemplate $a_block_tpl, $a_type, $a_is_single=false)
Render type block.
resetRowType()
Reset internal row type.
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.
addTypeBlock($a_type, $a_prefix=null, $a_postfix=null)
Add type block.
addItemToBlock($a_block_id, $a_item_type, $a_item_id, $a_item_html, $a_force=false)
Add item to existing block.
initBlockTemplate()
Init template.
renderSingleCustomBlock($a_id)
Get rendered html of single custom block.
addDetailsLevel($a_level, $a_url, $a_active=false)
Add details level.
hideItem($a_id)
Mark item id as used, but do not render.
getHTML()
Get rendered html (of all blocks)
hasCustomBlock($a_id)
Custom block already exists?
hasTypeBlock($a_type)
Type block already exists?
renderHelperCustomBlock(ilTemplate $a_block_tpl, $a_block_id, $a_is_single=false)
Render custom block.
addStandardRow(ilTemplate $a_tpl, $a_html, $a_ref_id=0)
Render item row.
addCustomBlock($a_id, $a_caption, $a_actions=null)
Add custom block.
hasItem($a_id)
Item with id exists?
renderSingleTypeBlock($a_type)
Get rendered html of single type block.
renderSelectAllBlock(ilTemplate $a_tpl)
Render "select all".
setBlockPosition($a_block_id, $a_pos)
Set block position.
addSeparatorRow(ilTemplate $a_tpl)
Render separator row.
processBlockPositions()
Process block positions.
resetDetails()
Reset/remove all detail levels.
renderDetails(ilTemplate $a_tpl)
Render detail level.
isValidBlock($a_id)
Any block with id exists?
__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 lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
special template class to simplify handling of ITX/PEAR
touchBlock($block)
overwrites ITX::touchBlock.
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)