3require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
 
   63    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)
 
   67        $this->lng = 
$DIC->language();
 
   69        $this->obj_definition = 
$DIC[
"objDefinition"];
 
   70        $this->enable_manage_select_all = (bool) $a_enable_manage_select_all;
 
   71        $this->enable_multi_download = (bool) $a_enable_multi_download;
 
   72        $this->active_block_ordering = (bool) $a_active_block_ordering;
 
   73        $this->block_custom_pos = $a_block_custom_positions;
 
   93            $this->type_blocks[
$a_type] = array(
 
   95                ,
"postfix" => $a_postfix
 
  110        return array_key_exists(
$a_type, $this->type_blocks);
 
  121    public function addCustomBlock($a_id, $a_caption, $a_actions = 
null, $a_data = array())
 
  124            $this->custom_blocks[$a_id] = array(
 
  125                "caption" => $a_caption
 
  126                ,
"actions" => $a_actions
 
  142        return array_key_exists($a_id, $this->custom_blocks);
 
  170        $this->hidden_items[$a_id] = 
true;
 
  187        unset($this->item_ids[$a_id]);
 
  188        unset($this->hidden_items[$a_id]);
 
  190        foreach (array_keys($this->items) as $item_id) {
 
  191            if (array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id) {
 
  192                unset($this->items[$item_id]);
 
  196        foreach ($this->block_items as $block_id => 
$items) {
 
  197            foreach (
$items as $idx => $item_id) {
 
  198                if (array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id) {
 
  199                    unset($this->block_items[$block_id][$idx]);
 
  200                    if (!
sizeof($this->block_items[$block_id])) {
 
  201                        unset($this->block_items[$block_id]);
 
  217        return (array_key_exists($a_id, $this->item_ids) ||
 
  218            array_key_exists($a_id, $this->hidden_items));
 
  231    public function addItemToBlock($a_block_id, $a_item_type, $a_item_id, $a_item_html, $a_force = 
false)
 
  234            $a_item_type != 
"itgr" &&
 
  235            (!$this->
hasItem($a_item_id) || $a_force) &&
 
  236            trim($a_item_html)) {
 
  238            $uniq_id = $a_block_id . self::UNIQUE_SEPARATOR . $a_item_id;
 
  240            $this->items[$uniq_id] = array(
 
  241                "type" => $a_item_type
 
  242                ,
"html" => $a_item_html
 
  246            $this->item_ids[$a_item_id] = 
true;
 
  248            $this->block_items[$a_block_id][] = $uniq_id;
 
  263        $this->details[$a_level] = array(
 
  265            ,
"active" => (
bool) $a_active
 
  274        $this->details = array();
 
  291            $this->block_pos[$a_block_id] = $a_pos;
 
  307            if (array_key_exists($block_id, $this->custom_blocks)) {
 
  313            if (array_key_exists($block_id, $this->type_blocks)) {
 
  324            return $block_tpl->get();
 
  339            return $block_tpl->get();
 
  354            return $block_tpl->get();
 
  371        if (is_array($this->block_custom_pos) && 
sizeof($this->block_custom_pos)) {
 
  373            $this->block_pos = array();
 
  374            foreach ($this->block_custom_pos as $idx => $block_id) {
 
  376                    $this->block_pos[$block_id] = $idx;
 
  381            if (
sizeof($this->block_pos)) {
 
  383                $last = max($this->block_pos);
 
  384                foreach (array_keys($tmp) as $block_id) {
 
  385                    if (!array_key_exists($block_id, $this->block_pos)) {
 
  386                        $this->block_pos[$block_id] = ++$last;
 
  392                $this->block_pos = $tmp;
 
  398            ? max($this->block_pos)
 
  400        foreach (array_keys($this->custom_blocks) as $block_id) {
 
  401            if (!array_key_exists($block_id, $this->block_pos)) {
 
  402                $this->block_pos[$block_id] = ++$last;
 
  405        foreach (array_keys($this->type_blocks) as $block_id) {
 
  406            if (!array_key_exists($block_id, $this->block_pos)) {
 
  407                $this->block_pos[$block_id] = ++$last;
 
  411        asort($this->block_pos);
 
  413        return array_keys($this->block_pos);
 
  427            return $this->
renderHelperGeneric($a_block_tpl, $a_block_id, $this->custom_blocks[$a_block_id], $a_is_single);
 
  443            $block = $this->type_blocks[
$a_type];
 
  462        if (!in_array($a_block_id, $this->rendered_blocks)) {
 
  463            $this->rendered_blocks[] = $a_block_id;
 
  465            $block_types = array();
 
  466            if (is_array($this->block_items[$a_block_id])) {
 
  467                foreach ($this->block_items[$a_block_id] as $item_id) {
 
  468                    if (isset($this->items[$item_id][
"type"])) {
 
  469                        $block_types[] = $this->items[$item_id][
"type"];
 
  475            if (is_array($this->block_items[$a_block_id]) ||
 
  476                is_numeric($a_block_id)) {
 
  480                $this->
addHeaderRow($a_block_tpl, $a_block[
"type"], $a_block[
"caption"], array_unique($block_types), $a_block[
"actions"], $order_id, $a_block[
"data"]);
 
  482                if ($a_block[
"prefix"]) {
 
  486                if (is_array($this->block_items[$a_block_id])) {
 
  487                    foreach ($this->block_items[$a_block_id] as $item_id) {
 
  488                        $this->
addStandardRow($a_block_tpl, $this->items[$item_id][
"html"], $item_id);
 
  492                if ($a_block[
"postfix"]) {
 
  511        $this->cur_row_type = 
"row_type_1";
 
  514            "tpl.container_list_block.html",
 
  531    protected function addHeaderRow(
ilTemplate $a_tpl, 
$a_type = 
"", $a_text = 
"", array $a_types_in_block = 
null, $a_commands_html = 
null, $a_order_id = 
null, $a_data = array())
 
  537        $a_tpl->
setVariable(
"CB_ID", 
' id="bl_cntr_' . (++$this->bl_cnt) . 
'"');
 
  539        if ($this->enable_manage_select_all) {
 
  541        } elseif ($this->enable_multi_download) {
 
  543                $a_types_in_block = array(
$a_type);
 
  545            foreach ($a_types_in_block as 
$type) {
 
  553        if ($a_text == 
"" && 
$a_type != 
"") {
 
  554            if (!$objDefinition->isPlugin(
$a_type)) {
 
  557                include_once(
"./Services/Component/classes/class.ilPlugin.php");
 
  565        include_once(
"./Modules/ItemGroup/classes/class.ilItemGroupBehaviour.php");
 
  566        if (is_array($a_data)) {
 
  567            foreach ($a_data as $k => $v) {
 
  579        if (
$ilSetting->get(
"icon_position_in_lists") != 
"item_rows" &&
 
  591            $a_tpl->
setVariable(
"BLOCK_HEADER_ORDER_NAME", 
"position[blocks][" . $a_order_id . 
"]");
 
  592            $a_tpl->
setVariable(
"BLOCK_HEADER_ORDER_NUM", (++$this->order_cnt)*10);
 
  596        $a_tpl->
setVariable(
"CHR_COMMANDS", $a_commands_html);
 
  614        $this->cur_row_type = ($this->cur_row_type == 
"row_type_1")
 
  620            $a_tpl->
setVariable(
"ROW_ID", 
'id="item_row_' . $a_ref_id . 
'"');
 
  643        $a_tpl->
setVariable(
"CHECKBOXNAME", 
"bl_cb_" . $this->bl_cnt);
 
  644        $a_tpl->
setVariable(
"SEL_ALL_PARENT", 
"bl_cntr_" . $this->bl_cnt);
 
  645        $a_tpl->
setVariable(
"SEL_ALL_PARENT", 
"bl_cntr_" . $this->bl_cnt);
 
  667        $this->cur_row_type = 
"";
 
  677        return array(
"fold", 
"file");
 
  689        if (
sizeof($this->details)) {
 
An exception for terminatinating execution or to throw for unit testing.
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.
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)
addHeaderRow(ilTemplate $a_tpl, $a_type="", $a_text="", array $a_types_in_block=null, $a_commands_html=null, $a_order_id=null, $a_data=array())
Render block header.
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.
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?
addCustomBlock($a_id, $a_caption, $a_actions=null, $a_data=array())
Add custom block.
__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 getRepoPluginObjectByType($type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin.
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)