38         $this->
ctrl = $DIC->ctrl();
    39         $this->tpl = $DIC[
"tpl"];
    40         $this->
lng = $DIC->language();
    41         $this->obj_definition = $DIC[
"objDefinition"];
    42         $tree = $DIC->repositoryTree();
    44         $this->rep_tree = $tree;
    46         $this->container_domain = $DIC->container()->internal()->domain();
    54         $next_class = $this->
ctrl->getNextClass($this);
    57         $cmd = $this->
ctrl->getCmd();
    59         switch ($next_class) {
    71     public function edit(
bool $a_insert = 
false): void
    76         $html = $form->getHTML();
    92         $form->setFormAction($ilCtrl->getFormAction($this));
    94             $form->setTitle($this->
lng->txt(
"cont_insert_resources"));
    96             $form->setTitle($this->
lng->txt(
"cont_update_resources"));
   101         $childs = $this->rep_tree->getChilds(
$ref_id);
   103         $type_counts = array();
   104         $item_groups = array();
   105         foreach ($childs as 
$c) {
   108             $key = ($objDefinition->getGroupOfObj($c[
"type"]) != 
"")
   109                 ? $objDefinition->getGroupOfObj($c[
"type"])
   111             $type_counts[$key] = ($type_counts[$key] ?? 0) + 1;
   112             if ($c[
"type"] == 
"itgr") {
   113                 $item_groups[$c[
"ref_id"]] = $c[
"title"];
   119         $form->addItem($radg);
   120         if (!$a_insert && $this->content_obj->getMainType() == 
"ItemGroup") {
   123             $radg->setValue(
"by_type");
   134             $radg->addOption($op_itemgroup);
   137         $radg->addOption($op_type);
   141             $this->
lng->txt(
"cont_type"),
   146         $sub_objs = $objDefinition->getGroupedRepositoryObjectTypes($obj_type);
   148         foreach ($sub_objs as $k => $so) {
   149             $cnt = (
int) ($type_counts[$k] ?? 0);
   153             if (!$objDefinition->isPlugin($k)) {
   155                     $types[$k] = $this->
lng->txt(
"objs_" . $k) . 
" (" . $cnt . 
")";
   159                 $types[$k] = $pl->txt(
"objs_" . $k) . 
" (" . $cnt . 
")";
   162         $type_prop->setOptions($types);
   163         $selected = ($a_insert)
   165             : $this->content_obj->getResourceListType();
   166         $type_prop->setValue($selected);
   167         $op_type->addSubItem($type_prop);
   171             $options = $item_groups;
   174             $selected = ($a_insert)
   176                 : $this->content_obj->getItemGroupRefId();
   177             $op_itemgroup->addSubItem($si);
   179                 $radg->setValue(
"itgr");
   187             $radg->addOption($op_lobj);
   188             if (!$a_insert && $this->content_obj->getResourceListType() === 
"_lobj") {
   196             $radg->addOption($op_other);
   197             if (!$a_insert && $this->content_obj->getResourceListType() === 
"_other") {
   204             $form->addCommandButton(
"create", 
$lng->
txt(
"save"));
   205             $form->addCommandButton(
"cancelCreate", 
$lng->
txt(
"cancel"));
   207             $form->addCommandButton(
"update_resources", 
$lng->
txt(
"save"));
   208             $form->addCommandButton(
"cancelUpdate", 
$lng->
txt(
"cancel"));
   233         $view_manager = $this->container_domain->content()->view(
$container);
   234         return $view_manager;
   240             if ($part instanceof \
ILIAS\Container\Content\ItemGroupBlocks) {
   250             if ($part instanceof \
ILIAS\Container\Content\OtherBlock) {
   260             if ($part instanceof \
ILIAS\Container\Content\ObjectivesBlock) {
   270             if ($part instanceof \
ILIAS\Container\Content\TypeBlocks) {
   280         $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
   282         if ($this->request->getString(
"res_type") === 
"_other") {
   283             $this->content_obj->setResourceListType(
"_other");
   284         } elseif ($this->request->getString(
"res_type") === 
"_lobj") {
   285             $this->content_obj->setResourceListType(
"_lobj");
   286         } elseif ($this->request->getString(
"res_type") !== 
"itgr") {
   287             $this->content_obj->setResourceListType(
   288                 $this->request->getString(
"type")
   291             $this->content_obj->setItemGroupRefId(
   292                 $this->request->getString(
"itgr")
   295         $this->updated = $this->pg_obj->update();
   296         if ($this->updated === 
true) {
   297             $this->
ctrl->returnToParent($this, 
"jump" . $this->hier_id);
   305         if ($this->request->getString(
"res_type") === 
"_other") {
   306             $this->content_obj->setResourceListType(
"_other");
   307         } elseif ($this->request->getString(
"res_type") === 
"_lobj") {
   308             $this->content_obj->setResourceListType(
"_lobj");
   309         } elseif ($this->request->getString(
"res_type") !== 
"itgr") {
   310             $this->content_obj->setResourceListType(
   311                 $this->request->getString(
"type")
   314             $this->content_obj->setItemGroupRefId(
   315                 $this->request->getString(
"itgr")
   318         $this->updated = $this->pg_obj->update();
   319         if ($this->updated === 
true) {
   320             $this->
ctrl->returnToParent($this, 
"jump" . $this->hier_id);
   322             $this->pg_obj->addHierIDs();
   338         $item_presentation_manager = $DIC->container()->internal()
   346         $block_sequence = $item_presentation_manager->getItemBlockSequence();
   347         foreach ($block_sequence->getBlocks() as $block) {
   348             if (($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock)) {
   365         $lng = $DIC->language();
   373         $item_presentation_manager = $DIC->container()->internal()
   380         $block_sequence = $item_presentation_manager->getItemBlockSequence();
   382         foreach ($block_sequence->getBlocks() as $block) {
   384             $tpl = 
new ilTemplate(
"tpl.resource_block.html", 
true, 
true, 
"components/ILIAS/COPage");
   387             if (!($block->getBlock() instanceof \ILIAS\Container\Content\ObjectivesBlock) &&
   388                 count($block->getItemRefIds()) > 0) {
   389                 foreach ($block->getItemRefIds() as 
$ref_id) {
   390                     $data = $item_presentation_manager->getRawDataByRefId(
$ref_id);
   391                     if ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
   392                         if (
$data[
"type"] === 
"itgr" || in_array(
$ref_id, $item_ref_ids)) {
   432             } elseif (count($block->getObjectiveIds()) > 0) {
   433                 foreach ($block->getObjectiveIds() as $objective_id) {
   470             if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock) {
   471                 $type = $block->getId();
   473                 $a_content = str_replace(
"[list-" . $type . 
"]", 
$tpl->
get(), $a_content);
   474             } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
   475                 $type = $block->getId();
   477                 $a_content = str_replace(
"[list-" . $type . 
"]", 
$tpl->
get(), $a_content);
   478             } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
   479                 $id = $block->getId();
   483                 $a_content = str_replace(
"[item-group-" . $id . 
"]", 
$tpl->
get(), $a_content);
   484             } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectivesBlock) {
   485                 $id = $block->getId();
   487                 $a_content = str_replace(
"[list-_lobj]", 
$tpl->
get(), $a_content);
   488             } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
   489                 $id = $block->getId();
   491                 $a_content = str_replace(
"[list-_other]", 
$tpl->
get(), $a_content);
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item. 
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
Interface Observer  Contains several chained tasks and infos about them. 
 
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string. 
 
loadLanguageModule(string $a_module)
Load language module. 
 
setVariable(string $variable, $value='')
Sets the given variable to the given value. 
 
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag. 
 
Content object of ilPageObject (see ILIAS DTD). 
 
static _lookupObjId(int $ref_id)
 
static insertResourcesIntoPageContent(string $a_content)
Insert resources (see also ilContainerContentGUI::determinePageEmbeddedBlocks for presentation) ...
 
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...) 
 
static _lookupTitle(int $obj_id)
 
setContent(string $a_html)
Sets content for standard template. 
 
ILIAS Container InternalDomainService $container_domain
 
edit(bool $a_insert=false)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setValue(string $a_value)
 
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD) 
 
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id 
 
ilGlobalTemplateInterface $tpl
 
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
initForm(bool $a_insert=false)
 
getContainerViewManager()
 
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block. 
 
static getPluginObjectByType(string $type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin...
 
ilObjectDefinition $obj_definition
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
__construct(Container $dic, ilPlugin $plugin)
 
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block. 
 
static _lookupType(int $id, bool $reference=false)