ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilContainerRenderer Class Reference

Class ilContainerRenderer. More...

+ Collaboration diagram for ilContainerRenderer:

Public Member Functions

 __construct ($a_enable_manage_select_all=false, $a_enable_multi_download=false, $a_active_block_ordering=false, array $a_block_custom_positions=null)
 Constructor. More...
 
 addTypeBlock ($a_type, $a_prefix=null, $a_postfix=null)
 Add type block. More...
 
 hasTypeBlock ($a_type)
 Type block already exists? More...
 
 addCustomBlock ($a_id, $a_caption, $a_actions=null)
 Add custom block. More...
 
 hasCustomBlock ($a_id)
 Custom block already exists? More...
 
 isValidBlock ($a_id)
 Any block with id exists? More...
 
 hideItem ($a_id)
 Mark item id as used, but do not render. More...
 
 removeItem ($a_id)
 Remove item (from any block) More...
 
 hasItem ($a_id)
 Item with id exists? More...
 
 addItemToBlock ($a_block_id, $a_item_type, $a_item_id, $a_item_html, $a_force=false)
 Add item to existing block. More...
 
 addDetailsLevel ($a_level, $a_url, $a_active=false)
 Add details level. More...
 
 resetDetails ()
 Reset/remove all detail levels. More...
 
 setBlockPosition ($a_block_id, $a_pos)
 Set block position. More...
 
 getHTML ()
 Get rendered html (of all blocks) More...
 
 renderSingleTypeBlock ($a_type)
 Get rendered html of single type block. More...
 
 renderSingleCustomBlock ($a_id)
 Get rendered html of single custom block. More...
 
 renderDetails (ilTemplate $a_tpl)
 Render detail level. More...
 

Data Fields

const UNIQUE_SEPARATOR = "-"
 

Protected Member Functions

 processBlockPositions ()
 Process block positions. More...
 
 renderHelperCustomBlock (ilTemplate $a_block_tpl, $a_block_id, $a_is_single=false)
 Render custom block. More...
 
 renderHelperTypeBlock (ilTemplate $a_block_tpl, $a_type, $a_is_single=false)
 Render type block. More...
 
 renderHelperGeneric (ilTemplate $a_block_tpl, $a_block_id, array $a_block, $a_is_single=false)
 Render block. More...
 
 initBlockTemplate ()
 Init template. More...
 
 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. More...
 
 addStandardRow (ilTemplate $a_tpl, $a_html, $a_ref_id=0)
 Render item row. More...
 
 renderSelectAllBlock (ilTemplate $a_tpl)
 Render "select all". More...
 
 addSeparatorRow (ilTemplate $a_tpl)
 Render separator row. More...
 
 resetRowType ()
 Reset internal row type. More...
 
 getDownloadableTypes ()
 Get downloadable repository object types. More...
 

Protected Attributes

 $enable_manage_select_all
 
 $enable_multi_download
 
 $active_block_ordering
 
 $type_blocks = array()
 
 $custom_blocks = array()
 
 $items = array()
 
 $hidden_items = array()
 
 $block_items = array()
 
 $details = array()
 
 $item_ids = array()
 
 $rendered_blocks = array()
 
 $bl_cnt = 0
 
 $cur_row_type
 
 $block_pos = array()
 
 $block_custom_pos = array()
 
 $order_cnt = 0
 

Detailed Description

Class ilContainerRenderer.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilContainerGUI.php 52026 2014-08-05 10:22:06Z smeyer

Definition at line 10 of file class.ilContainerRenderer.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerRenderer::__construct (   $a_enable_manage_select_all = false,
  $a_enable_multi_download = false,
  $a_active_block_ordering = false,
array  $a_block_custom_positions = null 
)

Constructor.

Parameters
bool$a_enable_manage_select_all
bool$a_enable_multi_download
bool$a_active_block_ordering
array$a_block_custom_positions
Returns
self

Definition at line 47 of file class.ilContainerRenderer.php.

48 {
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;
53 }

Member Function Documentation

◆ addCustomBlock()

ilContainerRenderer::addCustomBlock (   $a_id,
  $a_caption,
  $a_actions = null 
)

Add custom block.

Parameters
mixed$a_id
string$a_caption
string$a_actionshtml snippet
Returns
boolean

Definition at line 101 of file class.ilContainerRenderer.php.

102 {
103 if(!$this->hasCustomBlock($a_id))
104 {
105 $this->custom_blocks[$a_id] = array(
106 "caption" => $a_caption
107 ,"actions" => $a_actions
108 );
109 return true;
110 }
111 return false;
112 }
hasCustomBlock($a_id)
Custom block already exists?

References hasCustomBlock().

+ Here is the call graph for this function:

◆ addDetailsLevel()

ilContainerRenderer::addDetailsLevel (   $a_level,
  $a_url,
  $a_active = false 
)

Add details level.

Parameters
int$a_level
string$a_url
bool$a_active

Definition at line 250 of file class.ilContainerRenderer.php.

251 {
252 $this->details[$a_level] = array(
253 "url" => $a_url
254 ,"active" => (bool)$a_active
255 );
256 }

◆ addHeaderRow()

ilContainerRenderer::addHeaderRow ( ilTemplate  $a_tpl,
  $a_type = "",
  $a_text = "",
array  $a_types_in_block = null,
  $a_commands_html = null,
  $a_order_id = null 
)
protected

Render block header.

Parameters
ilTemplate$a_tpl
string$a_type
string$a_text
array$a_types_in_block
string$a_commands_html
int$a_order_id

Definition at line 548 of file class.ilContainerRenderer.php.

549 {
550 global $lng, $ilSetting, $objDefinition;
551
552 $a_tpl->setVariable("CB_ID", ' id="bl_cntr_'.(++$this->bl_cnt).'"');
553
554 if ($this->enable_manage_select_all)
555 {
556 $this->renderSelectAllBlock($a_tpl);
557 }
558 else if ($this->enable_multi_download)
559 {
560 if ($a_type)
561 {
562 $a_types_in_block = array($a_type);
563 }
564 foreach($a_types_in_block as $type)
565 {
566 if (in_array($type, $this->getDownloadableTypes()))
567 {
568 $this->renderSelectAllBlock($a_tpl);
569 break;
570 }
571 }
572 }
573
574 if ($a_text == "" && $a_type != "")
575 {
576 if (!$objDefinition->isPlugin($a_type))
577 {
578 $title = $lng->txt("objs_".$a_type);
579 }
580 else
581 {
582 include_once("./Services/Component/classes/class.ilPlugin.php");
583 $title = ilPlugin::lookupTxt("rep_robj", $a_type, "objs_".$a_type);
584 }
585 }
586 else
587 {
588 $title = $a_text;
589 }
590
591 if ($ilSetting->get("icon_position_in_lists") != "item_rows" &&
592 $a_type != "")
593 {
594 $icon = ilUtil::getImagePath("icon_".$a_type.".svg");
595
596 $a_tpl->setCurrentBlock("container_header_row_image");
597 $a_tpl->setVariable("HEADER_IMG", $icon);
598 $a_tpl->setVariable("HEADER_ALT", $title);
599 }
600 else
601 {
602 $a_tpl->setCurrentBlock("container_header_row");
603 }
604
605 if($a_order_id)
606 {
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);
609 }
610
611 $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
612 $a_tpl->setVariable("CHR_COMMANDS", $a_commands_html);
613 $a_tpl->parseCurrentBlock();
614
615 $a_tpl->touchBlock("container_row");
616
617 $this->resetRowType();
618 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:626
getDownloadableTypes()
Get downloadable repository object types.
resetRowType()
Reset internal row type.
renderSelectAllBlock(ilTemplate $a_tpl)
Render "select all".
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
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)
global $lng
Definition: privfeed.php:40
global $ilSetting
Definition: privfeed.php:40

References $ilSetting, $lng, getDownloadableTypes(), ilUtil\getImagePath(), ilPlugin\lookupTxt(), ilTemplate\parseCurrentBlock(), renderSelectAllBlock(), resetRowType(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilTemplate\touchBlock().

Referenced by renderHelperGeneric().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addItemToBlock()

ilContainerRenderer::addItemToBlock (   $a_block_id,
  $a_item_type,
  $a_item_id,
  $a_item_html,
  $a_force = false 
)

Add item to existing block.

Parameters
mixed$a_block_id
string$a_item_typerepository object type
mixed$a_item_id
string$a_item_htmlhtml snippet
bool$a_forceenable multiple rendering
Returns
boolean

Definition at line 218 of file class.ilContainerRenderer.php.

219 {
220 if($this->isValidBlock($a_block_id) &&
221 $a_item_type != "itgr" &&
222 (!$this->hasItem($a_item_id) || $a_force) &&
223 trim($a_item_html))
224 {
225 // #16563 - item_id (== ref_id) is NOT unique, adding parent block id
226 $uniq_id = $a_block_id.self::UNIQUE_SEPARATOR.$a_item_id;
227
228 $this->items[$uniq_id] = array(
229 "type" => $a_item_type
230 ,"html" => $a_item_html
231 );
232
233 // #18326
234 $this->item_ids[$a_item_id] = true;
235
236 $this->block_items[$a_block_id][] = $uniq_id;
237
238 return true;
239 }
240 return false;
241 }
hasItem($a_id)
Item with id exists?
isValidBlock($a_id)
Any block with id exists?

References hasItem(), and isValidBlock().

+ Here is the call graph for this function:

◆ addSeparatorRow()

ilContainerRenderer::addSeparatorRow ( ilTemplate  $a_tpl)
protected

Render separator row.

Parameters
ilTemplate$a_tpl

Definition at line 674 of file class.ilContainerRenderer.php.

675 {
676 $a_tpl->setCurrentBlock("container_block");
677 $a_tpl->parseCurrentBlock();
678 }

References ilTemplate\parseCurrentBlock(), and ilTemplate\setCurrentBlock().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStandardRow()

ilContainerRenderer::addStandardRow ( ilTemplate  $a_tpl,
  $a_html,
  $a_ref_id = 0 
)
protected

Render item row.

Parameters
ilTemplate$a_tpl
string$a_html
int$a_ref_id

Definition at line 627 of file class.ilContainerRenderer.php.

628 {
629 // :TODO: obsolete?
630 $this->cur_row_type = ($this->cur_row_type == "row_type_1")
631 ? "row_type_2"
632 : "row_type_1";
633
634 if ($a_ref_id > 0)
635 {
636 $a_tpl->setCurrentBlock($this->cur_row_type);
637 $a_tpl->setVariable("ROW_ID", 'id="item_row_'.$a_ref_id.'"');
638 $a_tpl->parseCurrentBlock();
639 }
640 else
641 {
642 $a_tpl->touchBlock($this->cur_row_type);
643 }
644
645 $a_tpl->setCurrentBlock("container_standard_row");
646 $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
647 $a_tpl->parseCurrentBlock();
648
649 $a_tpl->touchBlock("container_row");
650 }

References ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilTemplate\touchBlock().

Referenced by renderHelperGeneric().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTypeBlock()

ilContainerRenderer::addTypeBlock (   $a_type,
  $a_prefix = null,
  $a_postfix = null 
)

Add type block.

Parameters
string$a_typerepository object type
string$a_prefixhtml snippet
string$a_postfixhtml snippet
Returns
boolean

Definition at line 68 of file class.ilContainerRenderer.php.

69 {
70 if($a_type != "itgr" &&
71 !$this->hasTypeBlock($a_type))
72 {
73 $this->type_blocks[$a_type] = array(
74 "prefix" => $a_prefix
75 ,"postfix" => $a_postfix
76 );
77 return true;
78 }
79 return false;
80 }
hasTypeBlock($a_type)
Type block already exists?

References hasTypeBlock().

+ Here is the call graph for this function:

◆ getDownloadableTypes()

ilContainerRenderer::getDownloadableTypes ( )
protected

Get downloadable repository object types.

Returns
array

Definition at line 694 of file class.ilContainerRenderer.php.

695 {
696 return array("fold", "file");
697 }

Referenced by addHeaderRow().

+ Here is the caller graph for this function:

◆ getHTML()

ilContainerRenderer::getHTML ( )

Get rendered html (of all blocks)

Returns
string

Definition at line 290 of file class.ilContainerRenderer.php.

291 {
292 $valid = false;
293
294 $block_tpl = $this->initBlockTemplate();
295
296 foreach($this->processBlockPositions() as $block_id)
297 {
298 if(array_key_exists($block_id, $this->custom_blocks))
299 {
300 if($this->renderHelperCustomBlock($block_tpl, $block_id))
301 {
302 $this->addSeparatorRow($block_tpl);
303 $valid = true;
304 }
305 }
306 if(array_key_exists($block_id, $this->type_blocks))
307 {
308 if($this->renderHelperTypeBlock($block_tpl, $block_id))
309 {
310 $this->addSeparatorRow($block_tpl);
311 $valid = true;
312 }
313 }
314 }
315
316 if($valid)
317 {
318 $this->renderDetails($block_tpl);
319
320 return $block_tpl->get();
321 }
322 }
renderHelperTypeBlock(ilTemplate $a_block_tpl, $a_type, $a_is_single=false)
Render type block.
renderHelperCustomBlock(ilTemplate $a_block_tpl, $a_block_id, $a_is_single=false)
Render custom block.
addSeparatorRow(ilTemplate $a_tpl)
Render separator row.
processBlockPositions()
Process block positions.
renderDetails(ilTemplate $a_tpl)
Render detail level.
$valid

References $valid, addSeparatorRow(), initBlockTemplate(), processBlockPositions(), renderDetails(), renderHelperCustomBlock(), and renderHelperTypeBlock().

+ Here is the call graph for this function:

◆ hasCustomBlock()

ilContainerRenderer::hasCustomBlock (   $a_id)

Custom block already exists?

Parameters
mixede$a_id
Returns
bool

Definition at line 120 of file class.ilContainerRenderer.php.

121 {
122 return array_key_exists($a_id, $this->custom_blocks);
123 }

Referenced by addCustomBlock(), isValidBlock(), and renderHelperCustomBlock().

+ Here is the caller graph for this function:

◆ hasItem()

ilContainerRenderer::hasItem (   $a_id)

Item with id exists?

Parameters
mixed$a_id
Returns
bool

Definition at line 202 of file class.ilContainerRenderer.php.

203 {
204 return (array_key_exists($a_id, $this->item_ids) ||
205 array_key_exists($a_id, $this->hidden_items));
206 }

Referenced by addItemToBlock(), and removeItem().

+ Here is the caller graph for this function:

◆ hasTypeBlock()

ilContainerRenderer::hasTypeBlock (   $a_type)

Type block already exists?

Parameters
string$a_typerepository object type
Returns
bool

Definition at line 88 of file class.ilContainerRenderer.php.

89 {
90 return array_key_exists($a_type, $this->type_blocks);
91 }

Referenced by addTypeBlock(), isValidBlock(), and renderHelperTypeBlock().

+ Here is the caller graph for this function:

◆ hideItem()

ilContainerRenderer::hideItem (   $a_id)

Mark item id as used, but do not render.

Parameters
mixed$a_id

Definition at line 147 of file class.ilContainerRenderer.php.

148 {
149 // see hasItem();
150 $this->hidden_items[$a_id] = true;
151
152 // #16629 - do not remove hidden items from other blocks
153 // $this->removeItem($a_id);
154 }

◆ initBlockTemplate()

ilContainerRenderer::initBlockTemplate ( )
protected

Init template.

Returns
ilTemplate

Definition at line 529 of file class.ilContainerRenderer.php.

530 {
531 // :TODO: obsolete?
532 $this->cur_row_type = "row_type_1";
533
534 return new ilTemplate("tpl.container_list_block.html", true, true,
535 "Services/Container");
536 }
special template class to simplify handling of ITX/PEAR

Referenced by getHTML(), renderSingleCustomBlock(), and renderSingleTypeBlock().

+ Here is the caller graph for this function:

◆ isValidBlock()

ilContainerRenderer::isValidBlock (   $a_id)

Any block with id exists?

Parameters
mixed$a_id
Returns
bool

Definition at line 131 of file class.ilContainerRenderer.php.

132 {
133 return ($this->hasTypeBlock($a_id) ||
134 $this->hasCustomBlock($a_id));
135 }

References hasCustomBlock(), and hasTypeBlock().

Referenced by addItemToBlock(), processBlockPositions(), and setBlockPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processBlockPositions()

ilContainerRenderer::processBlockPositions ( )
protected

Process block positions.

Returns
array block ids

Definition at line 366 of file class.ilContainerRenderer.php.

367 {
368 // manual order
369 if(sizeof($this->block_custom_pos))
370 {
371 $tmp = $this->block_pos;
372 $this->block_pos = array();
373 foreach($this->block_custom_pos as $idx => $block_id)
374 {
375 if($this->isValidBlock($block_id))
376 {
377 $this->block_pos[$block_id] = $idx;
378 }
379 }
380
381 // at least some manual are valid
382 if(sizeof($this->block_pos))
383 {
384 // append missing blocks from default order
385 $last = max($this->block_pos);
386 foreach(array_keys($tmp) as $block_id)
387 {
388 if(!array_key_exists($block_id, $this->block_pos))
389 {
390 $this->block_pos[$block_id] = ++$last;
391 }
392 }
393 }
394 // all manual invalid, use default
395 else
396 {
397 $this->block_pos = $tmp;
398 }
399 }
400
401 // add missing blocks to order
402 $last = sizeof($this->block_pos)
403 ? max($this->block_pos)
404 : 0;
405 foreach(array_keys($this->custom_blocks) as $block_id)
406 {
407 if(!array_key_exists($block_id, $this->block_pos))
408 {
409 $this->block_pos[$block_id] = ++$last;
410 }
411 }
412 foreach(array_keys($this->type_blocks) as $block_id)
413 {
414 if(!array_key_exists($block_id, $this->block_pos))
415 {
416 $this->block_pos[$block_id] = ++$last;
417 }
418 }
419
420 asort($this->block_pos);
421
422 return array_keys($this->block_pos);
423 }

References $block_pos, and isValidBlock().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeItem()

ilContainerRenderer::removeItem (   $a_id)

Remove item (from any block)

Parameters
mixed$a_id

Definition at line 161 of file class.ilContainerRenderer.php.

162 {
163 if(!$this->hasItem($a_id))
164 {
165 return;
166 }
167
168 unset($this->item_ids[$a_id]);
169 unset($this->hidden_items[$a_id]);
170
171 foreach(array_keys($this->items) as $item_id)
172 {
173 if(array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id)
174 {
175 unset($this->items[$item_id]);
176 }
177 }
178
179 foreach($this->block_items as $block_id => $items)
180 {
181 foreach($items as $idx => $item_id)
182 {
183 if(array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id)
184 {
185 unset($this->block_items[$block_id][$idx]);
186 if(!sizeof($this->block_items[$block_id]))
187 {
188 unset($this->block_items[$block_id]);
189 }
190 break;
191 }
192 }
193 }
194 }

References $items, and hasItem().

+ Here is the call graph for this function:

◆ renderDetails()

ilContainerRenderer::renderDetails ( ilTemplate  $a_tpl)

Render detail level.

Parameters
ilTemplate$a_tpl

Definition at line 704 of file class.ilContainerRenderer.php.

705 {
706 global $lng;
707
708 if(sizeof($this->details))
709 {
710 $a_tpl->setCurrentBlock('container_details_row');
711 $a_tpl->setVariable('TXT_DETAILS', $lng->txt('details'));
712 $a_tpl->parseCurrentBlock();
713 }
714 }

References $lng, ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderHelperCustomBlock()

ilContainerRenderer::renderHelperCustomBlock ( ilTemplate  $a_block_tpl,
  $a_block_id,
  $a_is_single = false 
)
protected

Render custom block.

Parameters
ilTemplate$a_block_tpl
mixed$a_block_id
bool$a_is_single
Returns
boolean

Definition at line 433 of file class.ilContainerRenderer.php.

434 {
435 if($this->hasCustomBlock($a_block_id))
436 {
437 return $this->renderHelperGeneric($a_block_tpl, $a_block_id, $this->custom_blocks[$a_block_id], $a_is_single);
438 }
439 return false;
440 }
renderHelperGeneric(ilTemplate $a_block_tpl, $a_block_id, array $a_block, $a_is_single=false)
Render block.

References hasCustomBlock(), and renderHelperGeneric().

Referenced by getHTML(), and renderSingleCustomBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderHelperGeneric()

ilContainerRenderer::renderHelperGeneric ( ilTemplate  $a_block_tpl,
  $a_block_id,
array  $a_block,
  $a_is_single = false 
)
protected

Render block.

Parameters
ilTemplate$a_block_tpl
mixed$a_block_id
array$a_blockblock properties
bool$a_is_single
Returns
boolean

Definition at line 471 of file class.ilContainerRenderer.php.

472 {
473 if(!in_array($a_block_id, $this->rendered_blocks))
474 {
475 $this->rendered_blocks[] = $a_block_id;
476
477 $block_types = array();
478 if(is_array($this->block_items[$a_block_id]))
479 {
480 foreach($this->block_items[$a_block_id] as $item_id)
481 {
482 if(isset($this->items[$item_id]["type"]))
483 {
484 $block_types[] = $this->items[$item_id]["type"];
485 }
486 }
487 }
488
489 // #14610 - manage empty item groups
490 if(is_array($this->block_items[$a_block_id]) ||
491 is_numeric($a_block_id))
492 {
493
494 $order_id = (!$a_is_single && $this->active_block_ordering)
495 ? $a_block_id
496 : null;
497 $this->addHeaderRow($a_block_tpl, $a_block["type"], $a_block["caption"], array_unique($block_types), $a_block["actions"], $order_id);
498
499 if($a_block["prefix"])
500 {
501 $this->addStandardRow($a_block_tpl, $a_block["prefix"]);
502 }
503
504 if(is_array($this->block_items[$a_block_id]))
505 {
506 foreach($this->block_items[$a_block_id] as $item_id)
507 {
508 $this->addStandardRow($a_block_tpl, $this->items[$item_id]["html"], $item_id);
509 }
510 }
511
512 if($a_block["postfix"])
513 {
514 $this->addStandardRow($a_block_tpl, $a_block["postfix"]);
515 }
516
517 return true;
518 }
519 }
520
521 return false;
522 }
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.
addStandardRow(ilTemplate $a_tpl, $a_html, $a_ref_id=0)
Render item row.

References $active_block_ordering, addHeaderRow(), and addStandardRow().

Referenced by renderHelperCustomBlock(), and renderHelperTypeBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderHelperTypeBlock()

ilContainerRenderer::renderHelperTypeBlock ( ilTemplate  $a_block_tpl,
  $a_type,
  $a_is_single = false 
)
protected

Render type block.

Parameters
ilTemplate$a_block_tpl
string$a_typerepository object type
bool$a_is_single
Returns
boolean

Definition at line 450 of file class.ilContainerRenderer.php.

451 {
452 if($this->hasTypeBlock($a_type))
453 {
454 $block = $this->type_blocks[$a_type];
455 $block["type"] = $a_type;
456
457 return $this->renderHelperGeneric($a_block_tpl, $a_type, $block, $a_is_single);
458 }
459 return false;
460 }

References hasTypeBlock(), and renderHelperGeneric().

Referenced by getHTML(), and renderSingleTypeBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderSelectAllBlock()

ilContainerRenderer::renderSelectAllBlock ( ilTemplate  $a_tpl)
protected

Render "select all".

@global ilTemplate $lng

Definition at line 657 of file class.ilContainerRenderer.php.

658 {
659 global $lng;
660
661 $a_tpl->setCurrentBlock("select_all_row");
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);
665 $a_tpl->setVariable("TXT_SELECT_ALL", $lng->txt("select_all"));
666 $a_tpl->parseCurrentBlock();
667 }

References $lng, ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by addHeaderRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderSingleCustomBlock()

ilContainerRenderer::renderSingleCustomBlock (   $a_id)

Get rendered html of single custom block.

Parameters
mixed$a_id
Returns
html

Definition at line 346 of file class.ilContainerRenderer.php.

347 {
348 $block_tpl = $this->initBlockTemplate();
349
350 if($this->renderHelperCustomBlock($block_tpl, $a_id, true))
351 {
352 return $block_tpl->get();
353 }
354 }

References initBlockTemplate(), and renderHelperCustomBlock().

+ Here is the call graph for this function:

◆ renderSingleTypeBlock()

ilContainerRenderer::renderSingleTypeBlock (   $a_type)

Get rendered html of single type block.

Parameters
string$a_typerepository object type
Returns
html

Definition at line 330 of file class.ilContainerRenderer.php.

331 {
332 $block_tpl = $this->initBlockTemplate();
333
334 if($this->renderHelperTypeBlock($block_tpl, $a_type, true))
335 {
336 return $block_tpl->get();
337 }
338 }

References initBlockTemplate(), and renderHelperTypeBlock().

+ Here is the call graph for this function:

◆ resetDetails()

ilContainerRenderer::resetDetails ( )

Reset/remove all detail levels.

Definition at line 261 of file class.ilContainerRenderer.php.

262 {
263 $this->details = array();
264 }

◆ resetRowType()

ilContainerRenderer::resetRowType ( )
protected

Reset internal row type.

Definition at line 683 of file class.ilContainerRenderer.php.

684 {
685 // :TODO: obsolete?
686 $this->cur_row_type = "";
687 }

Referenced by addHeaderRow().

+ Here is the caller graph for this function:

◆ setBlockPosition()

ilContainerRenderer::setBlockPosition (   $a_block_id,
  $a_pos 
)

Set block position.

Parameters
mixed$a_block_id
int$a_pos

Definition at line 277 of file class.ilContainerRenderer.php.

278 {
279 if($this->isValidBlock($a_block_id))
280 {
281 $this->block_pos[$a_block_id] = $a_pos;
282 }
283 }

References isValidBlock().

+ Here is the call graph for this function:

Field Documentation

◆ $active_block_ordering

ilContainerRenderer::$active_block_ordering
protected

Definition at line 15 of file class.ilContainerRenderer.php.

Referenced by renderHelperGeneric().

◆ $bl_cnt

ilContainerRenderer::$bl_cnt = 0
protected

Definition at line 28 of file class.ilContainerRenderer.php.

◆ $block_custom_pos

ilContainerRenderer::$block_custom_pos = array()
protected

Definition at line 33 of file class.ilContainerRenderer.php.

◆ $block_items

ilContainerRenderer::$block_items = array()
protected

Definition at line 22 of file class.ilContainerRenderer.php.

◆ $block_pos

ilContainerRenderer::$block_pos = array()
protected

Definition at line 32 of file class.ilContainerRenderer.php.

Referenced by processBlockPositions().

◆ $cur_row_type

ilContainerRenderer::$cur_row_type
protected

Definition at line 29 of file class.ilContainerRenderer.php.

◆ $custom_blocks

ilContainerRenderer::$custom_blocks = array()
protected

Definition at line 19 of file class.ilContainerRenderer.php.

◆ $details

ilContainerRenderer::$details = array()
protected

Definition at line 23 of file class.ilContainerRenderer.php.

◆ $enable_manage_select_all

ilContainerRenderer::$enable_manage_select_all
protected

Definition at line 13 of file class.ilContainerRenderer.php.

◆ $enable_multi_download

ilContainerRenderer::$enable_multi_download
protected

Definition at line 14 of file class.ilContainerRenderer.php.

◆ $hidden_items

ilContainerRenderer::$hidden_items = array()
protected

Definition at line 21 of file class.ilContainerRenderer.php.

◆ $item_ids

ilContainerRenderer::$item_ids = array()
protected

Definition at line 24 of file class.ilContainerRenderer.php.

◆ $items

ilContainerRenderer::$items = array()
protected

Definition at line 20 of file class.ilContainerRenderer.php.

Referenced by removeItem().

◆ $order_cnt

ilContainerRenderer::$order_cnt = 0
protected

Definition at line 34 of file class.ilContainerRenderer.php.

◆ $rendered_blocks

ilContainerRenderer::$rendered_blocks = array()
protected

Definition at line 27 of file class.ilContainerRenderer.php.

◆ $type_blocks

ilContainerRenderer::$type_blocks = array()
protected

Definition at line 18 of file class.ilContainerRenderer.php.

◆ UNIQUE_SEPARATOR

const ilContainerRenderer::UNIQUE_SEPARATOR = "-"

Definition at line 36 of file class.ilContainerRenderer.php.


The documentation for this class was generated from the following file: