ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjectMetaDataGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilObjectMetaDataGUI:

Public Member Functions

 __construct (ilObject $object=null, $sub_type=null, int $sub_id=null, bool $in_repository=true)
 
 executeCommand ()
 
 setTaxonomySettings (Closure $form_manipulator, Closure $form_saver)
 
 setRecordFilter (?array $filter=null)
 Set advanced record filter. More...
 
 enableTaxonomyDefinition (bool $enable)
 Enable taxonomy definition. More...
 
 getTaxonomyObjGUI ()
 
 addMDObserver (object $class, string $method, string $section)
 
 setAdvMdRecordObject (int $adv_id, string $adv_type, string $adv_subtype="-")
 Set object, that defines the adv md records being used. More...
 
 getAdvMdRecordObject ()
 Get adv md record type. More...
 
 getTab (string $base_class=null)
 Get tab link if available. More...
 
 setSubTabs (string $active)
 
 getBlockHTML (?array $commands=null, ?array $callback=null)
 Takes as an optional second input an array consisting of the object that the method that should be called back to belongs to, and a string with the name of the method. More...
 
 getKeyValueList ()
 

Protected Member Functions

 getLOMType ()
 
 isAdvMDAvailable ()
 
 isLOMAvailable ()
 
 hasAdvancedMDSettings ()
 
 hasActiveRecords ()
 check if active records exist in current path anf for object type More...
 
 canEdit ()
 
 initEditForm ()
 
 edit (ilPropertyFormGUI $a_form=null)
 
 update ()
 
 checkFilter (int $record_id)
 
 editTaxonomySettings ()
 
 initTaxonomySettingsForm ()
 
 saveTaxonomySettings ()
 

Protected Attributes

ilCtrl $ctrl
 
ilTabsGUI $tabs
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilLogger $logger = null
 
bool $in_workspace
 
 $sub_type
 
int $sub_id
 
bool $in_repository = true
 
ilObject $object
 
int $obj_id = 0
 
string $obj_type = ""
 
int $ref_id = 0
 
array $md_observers = null
 
ilTaxMDGUI $tax_md_gui = null
 
ilObjTaxonomyGUI $tax_obj_gui = null
 
Closure $taxonomy_settings_form_manipulator = null
 
Closure $taxonomy_settings_form_saver = null
 
ilAdvancedMDRecordGUI $record_gui = null
 
int $adv_id = null
 
string $adv_type = null
 
string $adv_subtype = null
 
array $record_filter = null
 

Private Attributes

ilObjectRequestRetriever $retriever
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjectMetaDataGUI

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

ilObjectMetaDataGUI: ilMDEditorGUI, ilAdvancedMDSettingsGUI, ilPropertyFormGUI, ilTaxMDGUI, ilObjTaxonomyGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilObjectMetaDataGUI::__construct ( ilObject  $object = null,
  $sub_type = null,
int  $sub_id = null,
bool  $in_repository = true 
)

Definition at line 72 of file class.ilObjectMetaDataGUI.php.

References $DIC, $GLOBALS, $in_repository, $object, $ref_id, $sub_id, $sub_type, ILIAS\Repository\ctrl(), ilObject\getId(), getLOMType(), ilObject\getRefId(), ilTaxMDGUI\getSelectableTaxonomies(), ilObject\getType(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\tabs(), ilLogLevel\WARNING, and ilObject\withReferences().

77  {
78  global $DIC;
79 
80  $this->ctrl = $DIC->ctrl();
81  $this->tabs = $DIC->tabs();
82  $this->lng = $DIC->language();
83  $this->tpl = $DIC["tpl"];
84  $this->logger = $GLOBALS['DIC']->logger()->obj();
85  $this->retriever = new ilObjectRequestRetriever($DIC->http()->wrapper(), $DIC->refinery());
86 
87  $this->in_workspace = ((int) $this->retriever->getMaybeInt("wsp_id")) > 0;
88 
89  $this->sub_type = $sub_type;
90  $this->sub_id = $sub_id;
91  $this->in_repository = $in_repository;
92 
93  if (!$this->sub_type) {
94  $this->sub_type = "-";
95  }
96 
97  if ($object) {
98  $this->object = $object;
99  $this->obj_id = $object->getId();
100  $this->obj_type = $object->getType();
101  if ($in_repository) {
102  $this->ref_id = $object->getRefId();
103  if (!$object->withReferences()) {
104  $this->logger->logStack(ilLogLevel::WARNING);
105  $this->logger->warning('ObjectMetaDataGUI called without valid reference id.');
106  }
107 
108  if (!$this->ref_id) {
109  $this->logger->logStack(ilLogLevel::WARNING);
110  $this->logger->warning('ObjectMetaDataGUI called without valid reference id.');
111  }
112  }
113 
114  $md_obj = new ilMD($this->obj_id, (int) $this->sub_id, $this->getLOMType());
115 
116  if (!$this->in_workspace && $in_repository) {
117  // (parent) container taxonomies?
118  $this->tax_md_gui = new ilTaxMDGUI(
119  $md_obj->getRBACId(),
120  $md_obj->getObjId(),
121  $md_obj->getObjType(),
123  );
124  $tax_ids = $this->tax_md_gui->getSelectableTaxonomies();
125  if (!is_array($tax_ids) || count($tax_ids) == 0) {
126  $this->tax_md_gui = null;
127  }
128  }
129  }
130 
131  $this->lng->loadLanguageModule("meta");
132  $this->lng->loadLanguageModule("tax");
133  }
withReferences()
determines whether objects are referenced or not (got ref ids or not)
global $DIC
Definition: feed.php:28
$GLOBALS["DIC"]
Definition: wac.php:31
Taxonomies selection for metadata helper GUI.
Base class for all sub item list gui's.
+ Here is the call graph for this function:

Member Function Documentation

◆ addMDObserver()

ilObjectMetaDataGUI::addMDObserver ( object  $class,
string  $method,
string  $section 
)

Definition at line 229 of file class.ilObjectMetaDataGUI.php.

Referenced by ilStructureObjectGUI\executeCommand(), and ilObjMediaObjectGUI\returnToContextObject().

229  : void
230  {
231  $this->md_observers[] = [
232  "class" => $class,
233  "method" => $method,
234  "section" => $section
235  ];
236  }
+ Here is the caller graph for this function:

◆ canEdit()

ilObjectMetaDataGUI::canEdit ( )
protected

Definition at line 353 of file class.ilObjectMetaDataGUI.php.

References hasActiveRecords().

Referenced by getTab(), and setSubTabs().

353  : bool
354  {
355  if (is_array($this->sub_type)) { // only settings
356  return false;
357  }
358 
359  if ($this->hasActiveRecords()) {
360  if ($this->sub_type == "-" || $this->sub_id) {
361  return true;
362  }
363  }
364  return false;
365  }
hasActiveRecords()
check if active records exist in current path anf for object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkFilter()

ilObjectMetaDataGUI::checkFilter ( int  $record_id)
protected

Definition at line 509 of file class.ilObjectMetaDataGUI.php.

Referenced by getBlockHTML().

509  : bool
510  {
511  return !(is_array($this->record_filter) && !in_array($record_id, $this->record_filter));
512  }
+ Here is the caller graph for this function:

◆ edit()

ilObjectMetaDataGUI::edit ( ilPropertyFormGUI  $a_form = null)
protected

Definition at line 480 of file class.ilObjectMetaDataGUI.php.

References initEditForm().

Referenced by update().

480  : void
481  {
482  if (!$a_form) {
483  $a_form = $this->initEditForm();
484  }
485 
486  $this->tpl->setContent($a_form->getHTML());
487  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editTaxonomySettings()

ilObjectMetaDataGUI::editTaxonomySettings ( )
protected

Definition at line 600 of file class.ilObjectMetaDataGUI.php.

References initTaxonomySettingsForm(), and ILIAS\Repository\tabs().

600  : void
601  {
602  $this->tabs->activateSubTab("tax_settings");
603  $form = $this->initTaxonomySettingsForm();
604  $this->tpl->setContent($form->getHTML());
605  }
+ Here is the call graph for this function:

◆ enableTaxonomyDefinition()

ilObjectMetaDataGUI::enableTaxonomyDefinition ( bool  $enable)

Enable taxonomy definition.

Definition at line 214 of file class.ilObjectMetaDataGUI.php.

References ILIAS\Repository\object().

214  : void
215  {
216  if ($enable) {
217  $this->tax_obj_gui = new ilObjTaxonomyGUI();
218  $this->tax_obj_gui->setAssignedObject($this->object->getId());
219  } else {
220  $this->tax_obj_gui = null;
221  }
222  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ executeCommand()

ilObjectMetaDataGUI::executeCommand ( )

Definition at line 135 of file class.ilObjectMetaDataGUI.php.

References ilAdvancedMDSettingsGUI\CONTEXT_OBJECT, ILIAS\Repository\ctrl(), getLOMType(), initEditForm(), and setSubTabs().

135  : void
136  {
137  $next_class = $this->ctrl->getNextClass($this);
138  $cmd = $this->ctrl->getCmd("edit");
139 
140  switch ($next_class) {
141  case 'ilmdeditorgui':
142  $this->setSubTabs("lom");
143  $md_gui = new ilMDEditorGUI($this->obj_id, (int) $this->sub_id, $this->getLOMType());
144  // custom observers?
145  if (is_array($this->md_observers)) {
146  foreach ($this->md_observers as $observer) {
147  $md_gui->addObserver($observer["class"], $observer["method"], $observer["section"]);
148  }
149  }
150  // "default" repository object observer
151  elseif (!$this->sub_id && $this->object) {
152  $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
153  }
154  $this->ctrl->forwardCommand($md_gui);
155  break;
156 
157  case 'iladvancedmdsettingsgui':
158  if ($this->in_repository) { // currently needs ref id
159  $this->setSubTabs("advmddef");
160  // TODO: needs ilAdvancedMDSettingsGUI::CONTEXT_ADMINISTRATION or
161  // ilAdvancedMDSettingsGUI::CONTEXT_OBJECT as first parameter
162  // fill in the weaker context for the moment
163  $advmdgui = new ilAdvancedMDSettingsGUI(
165  $this->ref_id,
166  $this->obj_type,
167  $this->sub_type
168  );
169  $this->ctrl->forwardCommand($advmdgui);
170  }
171  break;
172 
173  case 'iltaxmdgui':
174  $this->setSubTabs("tax_assignment");
175  $this->ctrl->forwardCommand($this->tax_md_gui);
176  break;
177 
178  case 'ilobjtaxonomygui':
179  $this->setSubTabs("tax_definition");
180  $this->ctrl->forwardCommand($this->tax_obj_gui);
181  break;
182 
183  case "ilpropertyformgui":
184  // only case is currently adv metadata internal link in info settings, see #24497
185  $form = $this->initEditForm();
186  $this->ctrl->forwardCommand($form);
187  break;
188 
189  default:
190  $this->setSubTabs("advmd");
191  $this->$cmd();
192  break;
193  }
194  }
+ Here is the call graph for this function:

◆ getAdvMdRecordObject()

ilObjectMetaDataGUI::getAdvMdRecordObject ( )

Get adv md record type.

Definition at line 260 of file class.ilObjectMetaDataGUI.php.

References $adv_id, $adv_subtype, $adv_type, $obj_id, $obj_type, $ref_id, and $sub_type.

Referenced by getBlockHTML(), getKeyValueList(), hasActiveRecords(), and isAdvMDAvailable().

260  : array
261  {
262  if ($this->adv_type == null) {
263  if ($this->in_repository) {
265  } else {
267  }
268  }
270  }
+ Here is the caller graph for this function:

◆ getBlockHTML()

ilObjectMetaDataGUI::getBlockHTML ( ?array  $commands = null,
?array  $callback = null 
)

Takes as an optional second input an array consisting of the object that the method that should be called back to belongs to, and a string with the name of the method.

Parameters
array | null$commands
null|array{0ilObject, 1: string} $callback
Returns
string

Definition at line 522 of file class.ilObjectMetaDataGUI.php.

References $obj_id, $sub_type, $url, ilAdvancedMDRecord\_getSelectedRecordsByObject(), checkFilter(), getAdvMdRecordObject(), ILIAS\Repository\int(), and ILIAS\Repository\lng().

522  : string
523  {
524  $html = "";
525 
528  $adv_type,
529  $adv_id,
530  $adv_subtype,
531  $this->in_repository
532  );
533  foreach ($advanced_md_records as $record) {
534  if (!$this->checkFilter($record->getRecordId())) {
535  continue;
536  }
537  $block = new ilObjectMetaDataBlockGUI($record, $callback);
538  $block->setValues(new ilAdvancedMDValues(
539  $record->getRecordId(),
542  (int) $this->sub_id
543  ));
544  if ($commands) {
545  foreach ($commands as $caption => $url) {
546  $block->addBlockCommand($url, $this->lng->txt($caption));
547  }
548  }
549  $html .= $block->getHTML();
550  }
551 
552  return $html;
553  }
getAdvMdRecordObject()
Get adv md record type.
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
$url
Definition: ltiregstart.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getKeyValueList()

ilObjectMetaDataGUI::getKeyValueList ( )

Definition at line 555 of file class.ilObjectMetaDataGUI.php.

References $obj_id, $sub_type, ilAdvancedMDRecord\_getSelectedRecordsByObject(), getAdvMdRecordObject(), ilADTFactory\getInstance(), ILIAS\Repository\int(), ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

555  : string
556  {
557  $html = "";
558  $sep = "";
559 
562 
565  $adv_type,
566  $adv_id,
567  $adv_subtype,
568  $this->in_repository
569  );
570  foreach ($advanced_md_records as $record) {
571  $vals = new ilAdvancedMDValues($record->getRecordId(), $this->obj_id, $this->sub_type, (int) $this->sub_id);
572 
573  // this correctly binds group and definitions
574  $vals->read();
575 
576  $defs = $vals->getDefinitions();
577  foreach ($vals->getADTGroup()->getElements() as $element_id => $element) {
578  if ($element instanceof ilADTLocation) {
579  continue;
580  }
581 
582  $html .= $sep . $defs[$element_id]->getTitle() . ": ";
583 
584  if ($element->isNull()) {
585  $value = "-";
586  } else {
587  $value = ilADTFactory::getInstance()->getPresentationBridgeForInstance($element);
588 
589  $value = $value->getHTML();
590  }
591  $html .= $value;
592  $sep = ",    ";
593  }
594  }
595 
597  return $html;
598  }
getAdvMdRecordObject()
Get adv md record type.
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
static setUseRelativeDates(bool $a_status)
set use relative dates
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getLOMType()

ilObjectMetaDataGUI::getLOMType ( )
protected

Definition at line 238 of file class.ilObjectMetaDataGUI.php.

References $obj_type, and $sub_type.

Referenced by __construct(), executeCommand(), and isLOMAvailable().

238  : string
239  {
240  if ($this->sub_type != "-" && $this->sub_id) {
241  return $this->sub_type;
242  }
243  return $this->obj_type;
244  }
+ Here is the caller graph for this function:

◆ getTab()

ilObjectMetaDataGUI::getTab ( string  $base_class = null)

Get tab link if available.

Definition at line 370 of file class.ilObjectMetaDataGUI.php.

References $path, canEdit(), ILIAS\Repository\ctrl(), hasAdvancedMDSettings(), isAdvMDAvailable(), and isLOMAvailable().

Referenced by ilGlossaryTermGUI\getTabs(), ilObjMediaObjectGUI\getTabs(), and ilStructureObjectGUI\setTabs().

370  : ?string
371  {
372  if (!$base_class) {
373  $path = [];
374  } else {
375  $path = [$base_class];
376  }
377  $path[] = "ilobjectmetadatagui";
378 
379  $link = null;
380  if ($this->isLOMAvailable()) {
381  $path[] = "ilmdeditorgui";
382  $link = $this->ctrl->getLinkTargetByClass($path, "listSection");
383  } elseif ($this->isAdvMDAvailable()) {
384  if ($this->canEdit()) {
385  $link = $this->ctrl->getLinkTarget($this, "edit");
386  } elseif ($this->hasAdvancedMDSettings()) {
387  $path[] = "iladvancedmdsettingsgui";
388  $link = $this->ctrl->getLinkTargetByClass($path, "showRecords");
389  }
390  }
391  if ($link == null && is_object($this->tax_obj_gui)) { // taxonomy definition available?
392  $path[] = "ilobjtaxonomygui";
393  $link = $this->ctrl->getLinkTargetByClass($path, "");
394  }
395  return $link;
396  }
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTaxonomyObjGUI()

ilObjectMetaDataGUI::getTaxonomyObjGUI ( )

Definition at line 224 of file class.ilObjectMetaDataGUI.php.

References $tax_obj_gui.

225  {
226  return $this->tax_obj_gui;
227  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ hasActiveRecords()

ilObjectMetaDataGUI::hasActiveRecords ( )
protected

check if active records exist in current path anf for object type

Definition at line 341 of file class.ilObjectMetaDataGUI.php.

References ilAdvancedMDRecord\_getSelectedRecordsByObject(), and getAdvMdRecordObject().

Referenced by canEdit().

341  : bool
342  {
344 
346  $adv_type,
347  $adv_id,
348  $adv_subtype,
349  $this->in_repository
350  ));
351  }
getAdvMdRecordObject()
Get adv md record type.
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasAdvancedMDSettings()

ilObjectMetaDataGUI::hasAdvancedMDSettings ( )
protected

Definition at line 326 of file class.ilObjectMetaDataGUI.php.

References ilContainer\_lookupContainerSetting(), and ilObjectServiceSettingsGUI\CUSTOM_METADATA.

Referenced by getTab(), and setSubTabs().

326  : bool
327  {
328  if ($this->sub_id) {
329  return false;
330  }
331 
333  $this->obj_id,
335  );
336  }
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditForm()

ilObjectMetaDataGUI::initEditForm ( )
protected

Definition at line 453 of file class.ilObjectMetaDataGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilAdvancedMDRecordGUI\MODE_EDITOR.

Referenced by edit(), executeCommand(), and update().

454  {
455  $form = new ilPropertyFormGUI();
456  $form->setFormAction($this->ctrl->getFormAction($this, "update"));
457  $form->setTitle($this->lng->txt("meta_tab_advmd"));
458 
459  $this->record_gui = new ilAdvancedMDRecordGUI(
461  $this->obj_type,
462  $this->obj_id,
463  $this->sub_type,
464  (int) $this->sub_id,
465  $this->in_repository
466  );
467 
468  if ($this->adv_type != "") {
469  $this->record_gui->setAdvMdRecordObject($this->adv_id, $this->adv_type, $this->adv_subtype);
470  }
471 
472  $this->record_gui->setPropertyForm($form);
473  $this->record_gui->parse();
474 
475  $form->addCommandButton("update", $this->lng->txt("save"));
476 
477  return $form;
478  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTaxonomySettingsForm()

ilObjectMetaDataGUI::initTaxonomySettingsForm ( )
protected

Definition at line 607 of file class.ilObjectMetaDataGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by editTaxonomySettings(), and saveTaxonomySettings().

608  {
609  $form = new ilPropertyFormGUI();
610  $form->setFormAction($this->ctrl->getFormAction($this));
611  $form->setTitle($this->lng->txt("tax_tax_settings"));
612  $this->taxonomy_settings_form_manipulator->bindTo($this);
613  call_user_func_array($this->taxonomy_settings_form_manipulator, [$form]);
614  $form->addCommandButton("saveTaxonomySettings", $this->lng->txt("save"));
615 
616  return $form;
617  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAdvMDAvailable()

ilObjectMetaDataGUI::isAdvMDAvailable ( )
protected

Definition at line 272 of file class.ilObjectMetaDataGUI.php.

References ilAdvancedMDRecord\_getAssignableObjectTypes(), and getAdvMdRecordObject().

Referenced by getTab(), and setSubTabs().

272  : bool
273  {
274  foreach (ilAdvancedMDRecord::_getAssignableObjectTypes() as $item) {
275  list(, $adv_type, $adv_subtype) = $this->getAdvMdRecordObject();
276 
277  if ($item["obj_type"] == $adv_type) {
278  if ((!$item["sub_type"] && $adv_subtype == "-") ||
279  ($item["sub_type"] == $adv_subtype) ||
280  (is_array($adv_subtype) && in_array($item["sub_type"], $adv_subtype))
281  ) {
282  return true;
283  }
284  }
285  }
286  return false;
287  }
getAdvMdRecordObject()
Get adv md record type.
static _getAssignableObjectTypes(bool $a_include_text=false)
Get assignable object type public.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLOMAvailable()

ilObjectMetaDataGUI::isLOMAvailable ( )
protected

Definition at line 289 of file class.ilObjectMetaDataGUI.php.

References getLOMType().

Referenced by getTab(), and setSubTabs().

289  : bool
290  {
291  $type = $this->getLOMType();
292  if ($type == $this->sub_type) {
293  $type = $this->obj_type . ":" . $type;
294  }
295 
296  return (
297  ($this->obj_id || !$this->obj_type) &&
298  in_array($type, [
299  "crs",
300  'grp',
301  "file",
302  "glo",
303  "svy",
304  "spl",
305  "tst",
306  "qpl",
307  ":mob",
308  "webr",
309  "htlm",
310  "lm",
311  "lm:st",
312  "lm:pg",
313  "sahs",
314  "sahs:sco",
315  "sahs:page",
316  'sess',
317  "iass",
318  'exc',
319  'lti',
320  'cmix',
321  'mep:mpg'
322  ])
323  );
324  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTaxonomySettings()

ilObjectMetaDataGUI::saveTaxonomySettings ( )
protected

Definition at line 619 of file class.ilObjectMetaDataGUI.php.

References ILIAS\Repository\ctrl(), initTaxonomySettingsForm(), and ILIAS\Repository\lng().

619  : void
620  {
621  $form = $this->initTaxonomySettingsForm();
622  if ($form->checkInput()) {
623  $this->taxonomy_settings_form_saver->bindTo($this);
624  call_user_func_array($this->taxonomy_settings_form_saver, [$form]);
625  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
626  $this->ctrl->redirect($this, "editTaxonomySettings");
627  } else {
628  $form->setValuesByPost();
629  $this->tpl->setContent($form->getHTML());
630  }
631  }
+ Here is the call graph for this function:

◆ setAdvMdRecordObject()

ilObjectMetaDataGUI::setAdvMdRecordObject ( int  $adv_id,
string  $adv_type,
string  $adv_subtype = "-" 
)

Set object, that defines the adv md records being used.

Default is $this->object, but the context may set another object (e.g. media pool for media objects)

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

References $adv_id, $adv_subtype, and $adv_type.

250  : void
251  {
252  $this->adv_id = $adv_id;
253  $this->adv_type = $adv_type;
254  $this->adv_subtype = $adv_subtype;
255  }

◆ setRecordFilter()

ilObjectMetaDataGUI::setRecordFilter ( ?array  $filter = null)

Set advanced record filter.

Parameters
?int[]$filter

Definition at line 206 of file class.ilObjectMetaDataGUI.php.

206  : void
207  {
208  $this->record_filter = $filter;
209  }

◆ setSubTabs()

ilObjectMetaDataGUI::setSubTabs ( string  $active)

Definition at line 398 of file class.ilObjectMetaDataGUI.php.

References canEdit(), ILIAS\Repository\ctrl(), hasAdvancedMDSettings(), isAdvMDAvailable(), isLOMAvailable(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

398  : void
399  {
400  if ($this->isLOMAvailable()) {
401  $this->tabs->addSubTab(
402  "lom",
403  $this->lng->txt("meta_tab_lom"),
404  $this->ctrl->getLinkTargetByClass("ilmdeditorgui", "listSection")
405  );
406  }
407  if ($this->isAdvMDAvailable()) {
408  if ($this->canEdit()) {
409  $this->tabs->addSubTab(
410  "advmd",
411  $this->lng->txt("meta_tab_advmd"),
412  $this->ctrl->getLinkTarget($this, "edit")
413  );
414  }
415  if ($this->hasAdvancedMDSettings()) {
416  $this->tabs->addSubTab(
417  "advmddef",
418  $this->lng->txt("meta_tab_advmd_def"),
419  $this->ctrl->getLinkTargetByClass("iladvancedmdsettingsgui", "showRecords")
420  );
421 
422  $this->tabs->addSubTab(
423  "md_adv_file_list",
424  $this->lng->txt("md_adv_file_list"),
425  $this->ctrl->getLinkTargetByClass("iladvancedmdsettingsgui", "showFiles")
426  );
427  }
428  }
429 
430  if ($this->tax_md_gui != null) {
431  $this->tax_md_gui->addSubTab();
432  }
433 
434  if ($this->tax_obj_gui != null) {
435  $this->tabs->addSubTab(
436  "tax_definition",
437  $this->lng->txt("cntr_taxonomy_definitions"),
438  $this->ctrl->getLinkTargetByClass("ilobjtaxonomygui", "")
439  );
440  }
441 
442  if ($this->taxonomy_settings_form_manipulator != null) {
443  $this->tabs->addSubTab(
444  "tax_settings",
445  $this->lng->txt("tax_tax_settings"),
446  $this->ctrl->getLinkTarget($this, "editTaxonomySettings")
447  );
448  }
449 
450  $this->tabs->activateSubTab($active);
451  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTaxonomySettings()

ilObjectMetaDataGUI::setTaxonomySettings ( Closure  $form_manipulator,
Closure  $form_saver 
)

Definition at line 196 of file class.ilObjectMetaDataGUI.php.

196  : void
197  {
198  $this->taxonomy_settings_form_manipulator = $form_manipulator;
199  $this->taxonomy_settings_form_saver = $form_saver;
200  }

◆ update()

ilObjectMetaDataGUI::update ( )
protected

Definition at line 489 of file class.ilObjectMetaDataGUI.php.

References ILIAS\Repository\ctrl(), edit(), initEditForm(), and ILIAS\Repository\lng().

489  : void
490  {
491  $form = $this->initEditForm();
492  if ($form->checkInput() && $this->record_gui->importEditFormPostValues()) {
493  $this->record_gui->writeEditForm();
494 
495  // Update ECS content
496  if ($this->obj_type == "crs") {
497  $ecs = new ilECSCourseSettings($this->object);
498  $ecs->handleContentUpdate();
499  }
500 
501  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
502  $this->ctrl->redirect($this, "edit");
503  }
504 
505  $form->setValuesByPost();
506  $this->edit($form);
507  }
edit(ilPropertyFormGUI $a_form=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Field Documentation

◆ $adv_id

int ilObjectMetaDataGUI::$adv_id = null
protected

Definition at line 62 of file class.ilObjectMetaDataGUI.php.

Referenced by getAdvMdRecordObject(), and setAdvMdRecordObject().

◆ $adv_subtype

string ilObjectMetaDataGUI::$adv_subtype = null
protected

Definition at line 64 of file class.ilObjectMetaDataGUI.php.

Referenced by getAdvMdRecordObject(), and setAdvMdRecordObject().

◆ $adv_type

string ilObjectMetaDataGUI::$adv_type = null
protected

Definition at line 63 of file class.ilObjectMetaDataGUI.php.

Referenced by getAdvMdRecordObject(), and setAdvMdRecordObject().

◆ $ctrl

ilCtrl ilObjectMetaDataGUI::$ctrl
protected

Definition at line 31 of file class.ilObjectMetaDataGUI.php.

◆ $in_repository

int ref id or obj id depending on ilObjectMetaDataGUI::$in_repository = true
protected

Definition at line 44 of file class.ilObjectMetaDataGUI.php.

Referenced by __construct().

◆ $in_workspace

bool ilObjectMetaDataGUI::$in_workspace
protected

Definition at line 37 of file class.ilObjectMetaDataGUI.php.

◆ $lng

ilLanguage ilObjectMetaDataGUI::$lng
protected

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

◆ $logger

ilLogger ilObjectMetaDataGUI::$logger = null
protected

Definition at line 35 of file class.ilObjectMetaDataGUI.php.

◆ $md_observers

array ilObjectMetaDataGUI::$md_observers = null
protected

Definition at line 49 of file class.ilObjectMetaDataGUI.php.

◆ $obj_id

int ilObjectMetaDataGUI::$obj_id = 0
protected

◆ $obj_type

string ilObjectMetaDataGUI::$obj_type = ""
protected

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

Referenced by getAdvMdRecordObject(), and getLOMType().

◆ $object

ilObject ilObjectMetaDataGUI::$object
protected

Definition at line 45 of file class.ilObjectMetaDataGUI.php.

Referenced by __construct().

◆ $record_filter

array ilObjectMetaDataGUI::$record_filter = null
protected

Definition at line 69 of file class.ilObjectMetaDataGUI.php.

◆ $record_gui

ilAdvancedMDRecordGUI ilObjectMetaDataGUI::$record_gui = null
protected

Definition at line 54 of file class.ilObjectMetaDataGUI.php.

◆ $ref_id

int ilObjectMetaDataGUI::$ref_id = 0
protected

Definition at line 48 of file class.ilObjectMetaDataGUI.php.

Referenced by __construct(), and getAdvMdRecordObject().

◆ $retriever

ilObjectRequestRetriever ilObjectMetaDataGUI::$retriever
private

Definition at line 70 of file class.ilObjectMetaDataGUI.php.

◆ $sub_id

int ilObjectMetaDataGUI::$sub_id
protected

Definition at line 40 of file class.ilObjectMetaDataGUI.php.

Referenced by __construct().

◆ $sub_type

ilObjectMetaDataGUI::$sub_type
protected

◆ $tabs

ilTabsGUI ilObjectMetaDataGUI::$tabs
protected

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

◆ $tax_md_gui

ilTaxMDGUI ilObjectMetaDataGUI::$tax_md_gui = null
protected

Definition at line 50 of file class.ilObjectMetaDataGUI.php.

◆ $tax_obj_gui

ilObjTaxonomyGUI ilObjectMetaDataGUI::$tax_obj_gui = null
protected

Definition at line 51 of file class.ilObjectMetaDataGUI.php.

Referenced by getTaxonomyObjGUI().

◆ $taxonomy_settings_form_manipulator

Closure ilObjectMetaDataGUI::$taxonomy_settings_form_manipulator = null
protected

Definition at line 52 of file class.ilObjectMetaDataGUI.php.

◆ $taxonomy_settings_form_saver

Closure ilObjectMetaDataGUI::$taxonomy_settings_form_saver = null
protected

Definition at line 53 of file class.ilObjectMetaDataGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilObjectMetaDataGUI::$tpl
protected

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


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