40 $this->
lng = $DIC->language();
41 $this->
ctrl = $DIC->ctrl();
42 $this->obj_definition =
$DIC[
"objDefinition"];
43 $this->tree =
$DIC->repositoryTree();
44 $this->
access = $DIC->access();
81 $next_class = $ilCtrl->getNextClass($this);
83 switch ($next_class) {
86 if ($ilCtrl->isAsynch() && $cmd !=
"getAjax" && $cmd !=
"filterContainer") {
99 $ilCtrl =
$DIC->ctrl();
101 if ($ilCtrl->isAsynch()) {
105 switch ($ilCtrl->getCmd()) {
106 case "filterContainer":
117 if (!$ilCtrl->isAsynch()) {
127 $tpl->addJavaScript(
"Services/Classification/js/ilClassification.js");
129 return parent::getHTML();
139 echo
$tpl->getOnLoadCodeForAsynch();
151 foreach ($this->providers as
$provider) {
157 $ajax_block_id =
"block_" . $this->
getBlockType() .
"_0";
158 $ajax_block_url = $ilCtrl->getLinkTarget($this,
"getAjax",
"",
true,
false);
159 $ajax_content_id =
"il_center_col";
160 $ajax_content_url = $ilCtrl->getLinkTarget($this,
"filterContainer",
"",
true,
false);
163 $tabs->setBackTarget($this->
lng->txt(
"clsfct_back_to_cat"), $ilCtrl->getLinkTarget($this,
"returnToParent"));
164 $tabs->addTab(
"sel_objects", $this->
lng->txt(
"clsfct_selected_objects"),
"#");
165 $tabs_html = $tabs->getHTML();
169 $tpl->addOnLoadCode(
'il.Classification.setAjax("' . $ajax_block_id .
'", "' .
170 $ajax_block_url .
'", "' . $ajax_content_id .
'", "' . $ajax_content_url .
'", ' . json_encode($tabs_html) .
');');
174 $btpl =
new ilTemplate(
"tpl.classification_block.html",
true,
true,
"Services/Classification");
176 foreach ($html as $item) {
177 $btpl->setCurrentBlock(
"provider_chunk_bl");
178 $btpl->setVariable(
"TITLE", $item[
"title"]);
179 $btpl->setVariable(
"CHUNK", $item[
"html"]);
180 $btpl->parseCurrentBlock();
183 $overall_html .= $btpl->get();
186 return $overall_html;
191 $this->repo->unsetAll();
192 $this->
ctrl->returnToParent($this);
211 if ($this->repo->isEmpty()) {
215 $all_matching_provider_object_ids =
null;
217 foreach ($this->providers as
$provider) {
219 $current = $this->repo->getValueForProvider(
$id);
221 $no_provider =
false;
223 $provider_object_ids =
$provider->getFilteredObjects();
224 if (isset($all_matching_provider_object_ids)) {
225 $all_matching_provider_object_ids = array_intersect($all_matching_provider_object_ids, $provider_object_ids);
227 $all_matching_provider_object_ids = $provider_object_ids;
231 $has_content =
false;
234 $ltpl =
new ilTemplate(
"tpl.classification_object_list.html",
true,
true,
"Services/Classification");
236 if (isset($all_matching_provider_object_ids) &&
sizeof($all_matching_provider_object_ids)) {
238 "object_reference.ref_id"
239 ,
"object_data.obj_id"
242 ,
"object_data.description"
247 $this->parent_ref_id,
248 $all_matching_provider_object_ids,
252 if (
sizeof($matching)) {
253 $valid_objects = array();
256 include_once
"Services/Object/classes/class.ilObjectListGUIPreloader.php";
259 foreach ($matching as $item) {
260 if ($item[
"ref_id"] != $this->parent_ref_id &&
262 $ilAccess->checkAccess(
"visible",
"", $item[
"ref_id"])) {
268 if (in_array($p[
"type"], array(
"root",
"cat",
"crs",
"grp"))) {
269 $block_ref_id = $p[
"ref_id"];
270 $block_title = $p[
"title"];
273 if ($block_ref_id > 0) {
274 if (!isset($valid_objects[$block_ref_id])) {
275 $valid_objects[$block_ref_id] = array(
276 "title" => $block_title,
280 $valid_objects[$block_ref_id][
"items"][] = $item;
283 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
287 if (
sizeof($valid_objects)) {
290 $preloader->preload();
292 $this->item_list_gui = array();
293 foreach ($valid_objects as $block) {
295 foreach ($items as $obj) {
296 $type = $obj[
"type"];
299 if (empty($this->item_list_gui[
$type])) {
300 $class = $objDefinition->getClassName(
$type);
303 $full_class =
"ilObj" . $class .
"ListGUI";
305 include_once(
$location .
"/class." . $full_class .
".php");
306 $this->item_list_gui[
$type] =
new $full_class();
307 $this->item_list_gui[
$type]->enableDelete(
false);
308 $this->item_list_gui[
$type]->enablePath(
310 $this->parent_ref_id,
313 $this->item_list_gui[
$type]->enableLinkedPath(
true);
314 $this->item_list_gui[
$type]->enableCut(
false);
315 $this->item_list_gui[
$type]->enableCopy(
false);
316 $this->item_list_gui[
$type]->enableSubscribe(
false);
317 $this->item_list_gui[
$type]->enableLink(
false);
318 $this->item_list_gui[
$type]->enableIcon(
true);
321 foreach ($this->providers as
$provider) {
326 $html = $this->item_list_gui[
$type]->getListItemHTML(
334 $ltpl->setCurrentBlock(
"res_row");
335 $ltpl->setVariable(
"RESOURCE_HTML", $html);
336 $ltpl->parseCurrentBlock();
339 $ltpl->setCurrentBlock(
"block");
340 $ltpl->setVariable(
"BLOCK_TITLE", $block[
"title"]);
341 $ltpl->parseCurrentBlock();
349 echo
"<span id='block_" . $this->
getBlockType() .
"_0_loader'></span>";
350 echo
"<script>il.Classification.returnToParent();</script>";
366 if (!isset(self::$providers_cache[$this->parent_ref_id])) {
367 include_once
"Services/Classification/classes/class.ilClassificationProvider.php";
369 $this->parent_ref_id,
370 $this->parent_obj_id,
371 $this->parent_obj_type
375 if ($a_check_post && !$this->cl_request->getRedraw()) {
376 foreach ($this->providers as
$provider) {
378 $current =
$provider->importPostData($this->repo->getValueForProvider(
$id));
379 if (is_array($current) || $current) {
380 $this->repo->setValueForProvider(
$id, $current);
385 foreach ($this->providers as
$provider) {
387 $current = $this->repo->getValueForProvider(
$id);
397 $this->
ctrl->returnToParent($this);
417 return in_array($item[
"obj_id"], $obj_ids);
421 "object_reference.ref_id"
422 ,
"object_data.obj_id"
425 ,
"object_data.description"
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static return function(ContainerConfigurator $containerConfigurator)
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
This class represents a block method of a block.
setTitle(string $a_title)
ilGlobalTemplateInterface $main_tpl
Classification block, displayed in different contexts, e.g.
StandardGUIRequest $cl_request
ilClassificationSessionRepository $repo
getLegacyContent()
Get legacy content.
isRepositoryObject()
Returns whether block has a corresponding repository object.
initProviders(bool $a_check_post=false)
ilObjectDefinition $obj_definition
static array $providers_cache
getSubItemIds(array $obj_ids)
Get sub item ids depending on container type that match the preselected object ids.
static getValidProviders(int $a_parent_ref_id, int $a_parent_obj_id, string $a_parent_obj_type)
Get all valid providers (for parent container)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCmd(string $fallback_command=null)
@inheritDoc
loadLanguageModule(string $a_module)
Load language module.
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...
parses the objects.xml it handles the xml-description of all ilias objects
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
getChilds(int $a_node_id, string $a_order="", string $a_direction="ASC")
get child nodes of given node
getSubTreeFilteredByObjIds(int $a_node_id, array $a_obj_ids, array $a_fields=[])
get all node ids in the subtree under specified node id, filter by object ids
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc