ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMDEditorGUI Class Reference
+ Collaboration diagram for ilMDEditorGUI:

Public Member Functions

 __construct (int $a_rbac_id, int $a_obj_id, string $a_obj_type)
 
 executeCommand ()
 
 debug ()
 
 listQuickEdit_scorm ()
 
 listQuickEdit (ilPropertyFormGUI $form=null)
 
 initQuickEditForm (?Signal $a_signal_id)
 
 keywordAutocomplete ()
 
 updateQuickEdit ()
 
 updateQuickEdit_scorm_propagate (string $request, string $type)
 
 updateQuickEdit_scorm_prop_expert ()
 
 updateQuickEdit_scorm_prop_designer ()
 
 updateQuickEdit_scorm_prop_poc ()
 
 updateQuickEdit_scorm ()
 
 listGeneral ()
 
 updateGeneral ()
 
 updateTechnical ()
 
 listTechnical ()
 
 listLifecycle ()
 
 updateLifecycle ()
 
 listMetaMetaData ()
 
 updateMetaMetaData ()
 
 listRights ()
 
 updateRights ()
 
 listEducational ()
 
 updateEducational ()
 
 listRelation ()
 
 updateRelation ()
 
 listAnnotation ()
 
 updateAnnotation ()
 
 listClassification ()
 
 updateClassification ()
 
 deleteElement ()
 
 deleteSection ()
 
 addSection ()
 
 addSectionElement ()
 
 listSection ()
 
 __fillSubelements (ilTemplate $tpl)
 
 __setTabs (string $a_active)
 
 __showLanguageSelect (string $a_name, string $a_value="")
 
 __buildMonthsSelect (string $sel_month)
 
 __buildDaysSelect (string $sel_day)
 
 addObserver (object $a_class, string $a_method, string $a_element)
 
 callListeners (string $a_element)
 

Protected Member Functions

 initMetaIndexFromQuery ()
 
 initSectionFromQuery ()
 
 initSectionFromRequest ()
 
 listQuickEditCopyright (ilPropertyFormGUI $form)
 
 getChangeCopyrightModal ()
 
 getTltPostVars ()
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs_gui
 
Factory $ui_factory
 
Renderer $ui_renderer
 
ilRbacSystem $rbac_system
 
ilTree $tree
 
ilToolbarGUI $toolbarGUI
 
ilMDSettings $md_settings
 
GlobalHttpState $http
 
Refinery $refinery
 
object $md_section = null
 
ilPropertyFormGUI $form = null
 
ilMD $md_obj
 
array $observers = []
 
int $rbac_id
 
int $obj_id
 
string $obj_type
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilMDEditorGUI::__construct ( int  $a_rbac_id,
int  $a_obj_id,
string  $a_obj_type 
)

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

References $DIC, ilMDSettings\_getInstance(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

65  {
66  global $DIC;
67 
68  $this->lng = $DIC->language();
69  $this->tpl = $DIC->ui()->mainTemplate();
70  $this->tabs_gui = $DIC->tabs();
71  $this->ctrl = $DIC->ctrl();
72  $this->rbac_system = $DIC->rbac()->system();
73  $this->tree = $DIC->repositoryTree();
74  $this->toolbarGUI = $DIC->toolbar();
75 
76  $this->ui_factory = $DIC->ui()->factory();
77  $this->ui_renderer = $DIC->ui()->renderer();
78  $this->http = $DIC->http();
79  $this->refinery = $DIC->refinery();
80 
81  $this->md_obj = new ilMD($a_rbac_id, $a_obj_id, $a_obj_type);
82 
83  $this->lng->loadLanguageModule('meta');
84 
85  $this->md_settings = ilMDSettings::_getInstance();
86  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Member Function Documentation

◆ __buildDaysSelect()

ilMDEditorGUI::__buildDaysSelect ( string  $sel_day)

Definition at line 3896 of file class.ilMDEditorGUI.php.

References $i, and ilLegacyFormElementsUtil\formSelect().

Referenced by listEducational(), and listQuickEdit_scorm().

3896  : string
3897  {
3898  $options = [];
3899  for ($i = 0; $i <= 31; $i++) {
3900  $options[$i] = sprintf('%02d', $i);
3901  }
3902  return ilLegacyFormElementsUtil::formSelect($sel_day, 'tlt[d]', $options, false, true);
3903  }
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildMonthsSelect()

ilMDEditorGUI::__buildMonthsSelect ( string  $sel_month)

Definition at line 3887 of file class.ilMDEditorGUI.php.

References $i, and ilLegacyFormElementsUtil\formSelect().

Referenced by listEducational(), and listQuickEdit_scorm().

3887  : string
3888  {
3889  $options = [];
3890  for ($i = 0; $i <= 24; $i++) {
3891  $options[$i] = sprintf('%02d', $i);
3892  }
3893  return ilLegacyFormElementsUtil::formSelect($sel_month, 'tlt[mo]', $options, false, true);
3894  }
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __fillSubelements()

ilMDEditorGUI::__fillSubelements ( ilTemplate  $tpl)

Definition at line 3803 of file class.ilMDEditorGUI.php.

References ilLegacyFormElementsUtil\formSelect(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by listGeneral(), listLifecycle(), listMetaMetaData(), and listTechnical().

3803  : void
3804  {
3805  if (count($subs = $this->md_section->getPossibleSubelements())) {
3806  //$subs = array_merge(array('' => 'meta_please_select'),$subs);
3807 
3808  $tpl->setCurrentBlock("subelements");
3809  $tpl->setVariable(
3810  "SEL_SUBELEMENTS",
3811  ilLegacyFormElementsUtil::formSelect('', 'section_element', $subs)
3812  );
3813  $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
3814  $tpl->parseCurrentBlock();
3815 
3816  $tpl->setVariable("TXT_ADD", $this->lng->txt('meta_add'));
3817  }
3818  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setTabs()

ilMDEditorGUI::__setTabs ( string  $a_active)

Definition at line 3820 of file class.ilMDEditorGUI.php.

References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), ilSubmitButton\getInstance(), and ILIAS\Repository\lng().

Referenced by debug(), listAnnotation(), listClassification(), listEducational(), listGeneral(), listLifecycle(), listMetaMetaData(), listQuickEdit(), listQuickEdit_scorm(), listRelation(), listRights(), and listTechnical().

3820  : void
3821  {
3822  $tabs = array(
3823  'meta_quickedit' => 'listQuickEdit',
3824  'meta_general' => 'listGeneral',
3825  'meta_lifecycle' => 'listLifecycle',
3826  'meta_meta_metadata' => 'listMetaMetadata',
3827  'meta_technical' => 'listTechnical',
3828  'meta_educational' => 'listEducational',
3829  'meta_rights' => 'listRights',
3830  'meta_relation' => 'listRelation',
3831  'meta_annotation' => 'listAnnotation',
3832  'meta_classification' => 'listClassification'
3833  );
3834 
3835  if (DEVMODE) {
3836  $tabs['debug'] = 'debug';
3837  }
3838 
3839  $section = new ilSelectInputGUI($this->lng->txt("meta_section"), "section");
3840 
3841  $options = array();
3842  foreach (array_keys($tabs) as $key) {
3843  $options[$key] = $this->lng->txt($key);
3844  }
3845  $section->setOptions($options);
3846  $section->setValue($a_active);
3847 
3848  $this->toolbarGUI->addStickyItem($section, true);
3849 
3850  $button = ilSubmitButton::getInstance();
3851  $button->setCaption("show");
3852  $button->setCommand("listSection");
3853  $this->toolbarGUI->addStickyItem($button);
3854 
3855  $this->toolbarGUI->setFormAction($this->ctrl->getFormAction($this, "listSection"));
3856  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __showLanguageSelect()

ilMDEditorGUI::__showLanguageSelect ( string  $a_name,
string  $a_value = "" 
)

Definition at line 3858 of file class.ilMDEditorGUI.php.

References ilMDLanguageItem\_getLanguages(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listAnnotation(), listClassification(), listEducational(), listGeneral(), listLifecycle(), listMetaMetaData(), listQuickEdit_scorm(), listRelation(), listRights(), and listTechnical().

3858  : string
3859  {
3860  $tpl = new ilTemplate(
3861  "tpl.lang_selection.html",
3862  true,
3863  true,
3864  "Services/MetaData"
3865  );
3866 
3867  foreach (ilMDLanguageItem::_getLanguages() as $code => $text) {
3868  $tpl->setCurrentBlock("lg_option");
3869  $tpl->setVariable("VAL_LG", $code);
3870  $tpl->setVariable("TXT_LG", $text);
3871 
3872  if ($a_value !== "" && $a_value === $code) {
3873  $tpl->setVariable("SELECTED", "selected");
3874  }
3875 
3877  }
3878  $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
3879  $tpl->setVariable("SEL_NAME", $a_name);
3880 
3881  $return = $tpl->get();
3882  unset($tpl);
3883 
3884  return $return;
3885  }
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addObserver()

ilMDEditorGUI::addObserver ( object  $a_class,
string  $a_method,
string  $a_element 
)

Definition at line 3906 of file class.ilMDEditorGUI.php.

3906  : bool
3907  {
3908  $this->observers[$a_element]['class'] = $a_class;
3909  $this->observers[$a_element]['method'] = $a_method;
3910 
3911  return true;
3912  }

◆ addSection()

ilMDEditorGUI::addSection ( )

Definition at line 3543 of file class.ilMDEditorGUI.php.

References ILIAS\LTI\ToolProvider\$key, initSectionFromQuery(), and listSection().

3543  : bool
3544  {
3545  // Switch section
3546  switch ($this->initSectionFromQuery()) {
3547  case 'meta_technical':
3548  $this->md_section = $this->md_obj->addTechnical();
3549  $this->md_section->save();
3550  break;
3551 
3552  case 'meta_lifecycle':
3553  $this->md_section = $this->md_obj->addLifecycle();
3554  $this->md_section->save();
3555  $con = $this->md_section->addContribute();
3556  $con->save();
3557 
3558  $ent = $con->addEntity();
3559  $ent->save();
3560  break;
3561 
3562  case 'meta_meta_metadata':
3563  $this->md_section = $this->md_obj->addMetaMetadata();
3564  $this->md_section->save();
3565 
3566  $ide = $this->md_section->addIdentifier();
3567  $ide->save();
3568 
3569  $con = $this->md_section->addContribute();
3570  $con->save();
3571 
3572  $ent = $con->addEntity();
3573  $ent->save();
3574  break;
3575 
3576  case 'meta_rights':
3577  $this->md_section = $this->md_obj->addRights();
3578  $this->md_section->save();
3579  break;
3580 
3581  case 'meta_educational':
3582  $this->md_section = $this->md_obj->addEducational();
3583  $this->md_section->save();
3584  break;
3585 
3586  case 'meta_relation':
3587  $this->md_section = $this->md_obj->addRelation();
3588  $this->md_section->save();
3589  $ident = $this->md_section->addIdentifier_();
3590  $ident->save();
3591  $des = $this->md_section->addDescription();
3592  $des->save();
3593  break;
3594 
3595  case 'meta_annotation':
3596  $this->md_section = $this->md_obj->addAnnotation();
3597  $this->md_section->save();
3598  break;
3599 
3600  case 'meta_classification':
3601  $this->md_section = $this->md_obj->addClassification();
3602  $this->md_section->save();
3603 
3604  $taxon_path = $this->md_section->addTaxonPath();
3605  $taxon_path->save();
3606 
3607  $taxon = $taxon_path->addTaxon();
3608  $taxon->save();
3609 
3610  $key = $this->md_section->addKeyword();
3611  $key->save();
3612  break;
3613 
3614  }
3615 
3616  $this->listSection();
3617  return true;
3618  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ addSectionElement()

ilMDEditorGUI::addSectionElement ( )

Definition at line 3620 of file class.ilMDEditorGUI.php.

References ILIAS\FileDelivery\http(), initMetaIndexFromQuery(), initSectionFromQuery(), listSection(), and ILIAS\Repository\refinery().

3620  : bool
3621  {
3622  $section_element = '';
3623  if ($this->http->wrapper()->query()->has('section_element')) {
3624  $section_element = $this->http->wrapper()->query()->retrieve(
3625  'section_element',
3626  $this->refinery->kindlyTo()->string()
3627  );
3628  }
3629  if ($this->http->wrapper()->post()->has('section_element')) {
3630  $section_element = $this->http->wrapper()->post()->retrieve(
3631  'section_element',
3632  $this->refinery->kindlyTo()->string()
3633  );
3634  }
3635 
3636  // Switch section
3637  switch ($this->initSectionFromQuery()) {
3638  case 'meta_technical':
3639  $this->md_section = $this->md_obj->getTechnical();
3640  break;
3641 
3642  case 'meta_lifecycle':
3643  $this->md_section = $this->md_obj->getLifecycle();
3644  break;
3645 
3646  case 'meta_meta_metadata':
3647  $this->md_section = $this->md_obj->getMetaMetadata();
3648  break;
3649 
3650  case 'meta_general':
3651  $this->md_section = $this->md_obj->getGeneral();
3652  break;
3653 
3654  case 'meta_educational':
3655  $this->md_section = $this->md_obj->getEducational();
3656  break;
3657 
3658  case 'meta_classification':
3659  $arr = explode("_", $section_element);
3660  $section_element = $arr[0];
3661  $this->md_section = $this->md_obj->getClassification((int) ($arr[1] ?? 0));
3662  break;
3663  }
3664 
3665  // Switch new element
3666  $md_new = null;
3667  switch ($section_element) {
3668  case 'meta_or_composite':
3669  $md_new = $this->md_section->addOrComposite();
3670  $md_new = $md_new->addRequirement();
3671  break;
3672 
3673  case 'meta_requirement':
3674  $md_new = $this->md_section->addRequirement();
3675  break;
3676 
3677  case 'meta_location':
3678  $md_new = $this->md_section->addLocation();
3679  break;
3680 
3681  case 'meta_format':
3682  $md_new = $this->md_section->addFormat();
3683  break;
3684 
3685  case 'meta_entity':
3686  $md_new = $this->md_section->getContribute($this->initMetaIndexFromQuery());
3687  $md_new = $md_new->addEntity();
3688  break;
3689 
3690  case 'meta_identifier':
3691  $md_new = $this->md_section->addIdentifier();
3692  break;
3693 
3694  case 'meta_contribute':
3695  $md_new = $this->md_section->addContribute();
3696  $md_new->save();
3697  $md_new = $md_new->addEntity();
3698  break;
3699 
3700  case 'educational_language':
3701  case 'meta_language':
3702  $md_new = $this->md_section->addLanguage();
3703  break;
3704 
3705  case 'educational_description':
3706  case 'meta_description':
3707  $md_new = $this->md_section->addDescription();
3708  break;
3709 
3710  case 'Keyword':
3711  case 'meta_keyword':
3712  $md_new = $this->md_section->addKeyword();
3713  break;
3714 
3715  case 'educational_typical_age_range':
3716  $md_new = $this->md_section->addTypicalAgeRange();
3717  break;
3718 
3719  case 'relation_resource_identifier':
3720  $rel = $this->md_obj->getRelation($this->initMetaIndexFromQuery());
3721  $md_new = $rel->addIdentifier_();
3722  break;
3723 
3724  case 'relation_resource_description':
3725  $rel = $this->md_obj->getRelation($this->initMetaIndexFromQuery());
3726  $md_new = $rel->addDescription();
3727  break;
3728 
3729  case 'TaxonPath':
3730  $md_new = $this->md_section->addTaxonPath();
3731  $md_new->save();
3732  $md_new = $md_new->addTaxon();
3733  break;
3734 
3735  case 'Taxon':
3736  $tax_path = $this->md_section->getTaxonPath($this->initMetaIndexFromQuery());
3737  $md_new = $tax_path->addTaxon();
3738  break;
3739  }
3740 
3741  $md_new->save();
3742 
3743  $this->listSection();
3744 
3745  return true;
3746  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ callListeners()

ilMDEditorGUI::callListeners ( string  $a_element)
Returns
mixed

Definition at line 3917 of file class.ilMDEditorGUI.php.

Referenced by updateAnnotation(), updateClassification(), updateEducational(), updateGeneral(), updateLifecycle(), updateMetaMetaData(), updateQuickEdit(), updateQuickEdit_scorm(), updateRelation(), updateRights(), and updateTechnical().

3918  {
3919  if (isset($this->observers[$a_element])) {
3920  $class = &$this->observers[$a_element]['class'];
3921  $method = $this->observers[$a_element]['method'];
3922 
3923  return $class->$method($a_element);
3924  }
3925  return '';
3926  }
+ Here is the caller graph for this function:

◆ debug()

ilMDEditorGUI::debug ( )

Definition at line 145 of file class.ilMDEditorGUI.php.

References __setTabs(), and ilMD2XML\startExport().

Referenced by listSection().

145  : bool
146  {
147  $xml_writer = new ilMD2XML($this->md_obj->getRBACId(), $this->md_obj->getObjId(), $this->md_obj->getObjType());
148  $xml_writer->startExport();
149 
150  $this->__setTabs('meta_general');
151 
152  $this->tpl->setContent(htmlentities($xml_writer->getXML()));
153 
154  return true;
155  }
__setTabs(string $a_active)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteElement()

ilMDEditorGUI::deleteElement ( )

Definition at line 3507 of file class.ilMDEditorGUI.php.

References ilMDFactory\_getInstance(), ILIAS\FileDelivery\http(), initMetaIndexFromQuery(), listSection(), and ILIAS\Repository\refinery().

3507  : bool
3508  {
3509  $meta_path = '';
3510  if ($this->http->wrapper()->query()->has('meta_path')) {
3511  $meta_path = $this->http->wrapper()->query()->retrieve(
3512  'meta_path',
3513  $this->refinery->kindlyTo()->string()
3514  );
3515  }
3516 
3517  $meta_technical = 0;
3518  if ($this->http->wrapper()->query()->has('meta_technical')) {
3519  $meta_technical = $this->http->wrapper()->query()->retrieve(
3520  'meta_technical',
3521  $this->refinery->kindlyTo()->int()
3522  );
3523  }
3524 
3525  $md_element = ilMDFactory::_getInstance($meta_path, $this->initMetaIndexFromQuery(), $meta_technical);
3526  $md_element->delete();
3527 
3528  $this->listSection();
3529 
3530  return true;
3531  }
static http()
Fetches the global http state from ILIAS.
static _getInstance(string $a_type, int $a_index, ?int $a_technical_id=0)
+ Here is the call graph for this function:

◆ deleteSection()

ilMDEditorGUI::deleteSection ( )

Definition at line 3533 of file class.ilMDEditorGUI.php.

References ilMDFactory\_getInstance(), initMetaIndexFromQuery(), initSectionFromQuery(), and listSection().

3533  : bool
3534  {
3535  $md_element = ilMDFactory::_getInstance($this->initSectionFromQuery(), $this->initMetaIndexFromQuery());
3536  $md_element->delete();
3537 
3538  $this->listSection();
3539 
3540  return true;
3541  }
static _getInstance(string $a_type, int $a_index, ?int $a_technical_id=0)
+ Here is the call graph for this function:

◆ executeCommand()

ilMDEditorGUI::executeCommand ( )

Definition at line 129 of file class.ilMDEditorGUI.php.

References ILIAS\Repository\ctrl().

129  : void
130  {
131  $next_class = $this->ctrl->getNextClass($this);
132 
133  $cmd = $this->ctrl->getCmd();
134  switch ($next_class) {
135 
136  default:
137  if (!$cmd) {
138  $cmd = "listSection";
139  }
140  $this->$cmd();
141  break;
142  }
143  }
+ Here is the call graph for this function:

◆ getChangeCopyrightModal()

ilMDEditorGUI::getChangeCopyrightModal ( )
protected

Definition at line 3928 of file class.ilMDEditorGUI.php.

References ilMDSettings\_getInstance(), ILIAS\Repository\ctrl(), ilMDSettings\isCopyrightSelectionActive(), and ILIAS\Repository\lng().

Referenced by listQuickEdit().

3928  : ?Interruptive
3929  {
3932  return null;
3933  }
3934 
3935  $link = $this->ctrl->getLinkTarget($this, 'updateQuickEdit');
3936  return $this->ui_factory
3937  ->modal()
3938  ->interruptive(
3939  $this->lng->txt("meta_copyright_change_warning_title"),
3940  $this->lng->txt("meta_copyright_change_info"),
3941  $link
3942  );
3943  }
ilMDSettings $md_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTltPostVars()

◆ initMetaIndexFromQuery()

ilMDEditorGUI::initMetaIndexFromQuery ( )
protected

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

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by addSectionElement(), deleteElement(), and deleteSection().

88  : int
89  {
90  $meta_index = 0;
91  if ($this->http->wrapper()->query()->has('meta_index')) {
92  $meta_index = $this->http->wrapper()->query()->retrieve(
93  'meta_index',
94  $this->refinery->kindlyTo()->int()
95  );
96  }
97  return $meta_index;
98  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initQuickEditForm()

ilMDEditorGUI::initQuickEditForm ( ?Signal  $a_signal_id)

Definition at line 459 of file class.ilMDEditorGUI.php.

References $form, $id, $lang, ilMDSettings\_getInstance(), ilMDLanguageItem\_getLanguages(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), listQuickEditCopyright(), ILIAS\Repository\lng(), ilTextAreaInputGUI\setCols(), and ilTypicalLearningTimeInputGUI\setValueByLOMDuration().

Referenced by listQuickEdit(), and updateQuickEdit().

460  {
461  $this->form = new ilPropertyFormGUI();
462  $this->form->setId('ilquickeditform');
463  $this->form->setShowTopButtons(false);
464 
465  // title
466  $ti = new ilTextInputGUI($this->lng->txt("title"), "gen_title");
467  $ti->setMaxLength(200);
468  $ti->setSize(50);
469  if ($this->md_obj->getObjType() !== 'sess') {
470  $ti->setRequired(true);
471  }
472  $ti->setValue($this->md_section->getTitle());
473  $this->form->addItem($ti);
474 
475  // description(s)
476  foreach ($ids = $this->md_section->getDescriptionIds() as $id) {
477  $md_des = $this->md_section->getDescription($id);
478  $ta = new ilTextAreaInputGUI(
479  $this->lng->txt("meta_description"),
480  "gen_description_" . $id . "_description"
481  );
482  $ta->setCols(50);
483  $ta->setRows(4);
484  $ta->setValue($md_des->getDescription());
485  if (count($ids) > 1) {
486  $ta->setInfo($this->lng->txt("meta_l_" . $md_des->getDescriptionLanguageCode()));
487  }
488 
489  $this->form->addItem($ta);
490  }
491 
492  // language(s)
493  $first = true;
494  $options = ilMDLanguageItem::_getLanguages();
495  $first_lang = 'en';
496  foreach ($ids = $this->md_section->getLanguageIds() as $id) {
497  $md_lan = $this->md_section->getLanguage($id);
498  $first_lang = $md_lan->getLanguageCode();
499  $si = new ilSelectInputGUI($this->lng->txt("meta_language"), 'gen_language_' . $id . '_language');
500  $si->setOptions($options);
501  $si->setValue($md_lan->getLanguageCode());
502  $this->form->addItem($si);
503  $first = false;
504  }
505  if ($first) {
506  $si = new ilSelectInputGUI($this->lng->txt("meta_language"), "gen_language_language");
507  $si->setOptions($options);
508  $this->form->addItem($si);
509  }
510 
511  // keyword(s)
512  $first = true;
513  $keywords = array();
514  foreach ($ids = $this->md_section->getKeywordIds() as $id) {
515  $md_key = $this->md_section->getKeyword($id);
516  if (trim($md_key->getKeyword()) !== '') {
517  $keywords[$md_key->getKeywordLanguageCode()][] = $md_key->getKeyword();
518  }
519  }
520  foreach ($keywords as $lang => $keyword_set) {
521  $kw = new ilTextInputGUI(
522  $this->lng->txt("keywords"),
523  "keywords[value][" . $lang . "]"
524  );
525  $kw->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
526  $kw->setMaxLength(200);
527  $kw->setSize(50);
528  $kw->setMulti(true);
529  if (count($keywords) > 1) {
530  $kw->setInfo($this->lng->txt("meta_l_" . $lang));
531  }
532  $this->form->addItem($kw);
533  asort($keyword_set);
534  $kw->setValue($keyword_set);
535  }
536  if ($keywords === []) {
537  $kw = new ilTextInputGUI(
538  $this->lng->txt("keywords"),
539  "keywords[value][" . $first_lang . "]"
540  );
541  $kw->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
542  $kw->setMaxLength(200);
543  $kw->setSize(50);
544  $kw->setMulti(true);
545  $this->form->addItem($kw);
546  }
547 
548  // Lifecycle...
549  // Authors
550  $ta = new ilTextAreaInputGUI(
551  $this->lng->txt('authors') . "<br />" .
552  "(" . sprintf($this->lng->txt('md_separated_by'), $this->md_settings->getDelimiter()) . ")",
553  "life_authors"
554  );
555  $ta->setCols(50);
556  $ta->setRows(2);
557  if ($this->md_obj->getLifecycle() instanceof ilMDLifecycle) {
558  $sep = $ent_str = "";
559  foreach (($ids = $this->md_obj->getLifecycle()->getContributeIds()) as $con_id) {
560  $md_con = $this->md_obj->getLifecycle()->getContribute($con_id);
561  if ($md_con->getRole() === "Author") {
562  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
563  $md_ent = $md_con->getEntity($ent_id);
564  $ent_str .= $sep . $md_ent->getEntity();
565  $sep = $this->md_settings->getDelimiter() . " ";
566  }
567  }
568  }
569  $ta->setValue($ent_str);
570  }
571  $this->form->addItem($ta);
572 
573  // copyright
574  $this->listQuickEditCopyright($this->form);
575 
576  // typical learning time
577 
578  $tlt = new ilTypicalLearningTimeInputGUI($this->lng->txt("meta_typical_learning_time"), "tlt");
579  $edu = $this->md_obj->getEducational();
580  if (is_object($edu)) {
581  $tlt->setValueByLOMDuration($edu->getTypicalLearningTime());
582  }
583  $this->form->addItem($tlt);
584 
585  $this->form->addCommandButton("updateQuickEdit", $this->lng->txt("save"), 'button_ilquickeditform');
586  $this->form->setTitle($this->lng->txt("meta_quickedit"));
587  $this->form->setFormAction($this->ctrl->getFormAction($this));
588 
589  if (ilMDSettings::_getInstance()->isCopyrightSelectionActive()) {
590  $this->tpl->addJavaScript(
591  'Services/MetaData/js/ilMetaCopyrightListener.js'
592  );
593  $this->tpl->addOnLoadCode(
594  'il.MetaDataCopyrightListener.init("' .
595  $a_signal_id . '","copyright","form_ilquickeditform","button_ilquickeditform");'
596  );
597  }
598 
599  return $this->form;
600  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPropertyFormGUI $form
form( $class_path, string $cmd)
$lang
Definition: xapiexit.php:26
This class represents a text area property in a property form.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
listQuickEditCopyright(ilPropertyFormGUI $form)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSectionFromQuery()

ilMDEditorGUI::initSectionFromQuery ( )
protected

Definition at line 100 of file class.ilMDEditorGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by addSection(), addSectionElement(), deleteSection(), and initSectionFromRequest().

100  : string
101  {
102  $section = '';
103  if ($this->http->wrapper()->query()->has('section')) {
104  $section = $this->http->wrapper()->query()->retrieve(
105  'section',
106  $this->refinery->kindlyTo()->string()
107  );
108  }
109 
110  return $section;
111  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSectionFromRequest()

ilMDEditorGUI::initSectionFromRequest ( )
protected

Definition at line 113 of file class.ilMDEditorGUI.php.

References ILIAS\FileDelivery\http(), initSectionFromQuery(), and ILIAS\Repository\refinery().

Referenced by listSection().

113  : string
114  {
115  if ($section = $this->initSectionFromQuery()) {
116  return $section;
117  }
118 
119  if ($this->http->wrapper()->post()->has('section')) {
120  $section = $this->http->wrapper()->post()->retrieve(
121  'section',
122  $this->refinery->kindlyTo()->string()
123  );
124  }
125 
126  return $section;
127  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ keywordAutocomplete()

ilMDEditorGUI::keywordAutocomplete ( )

Definition at line 685 of file class.ilMDEditorGUI.php.

References $res, ilMDKeyword\_getMatchingKeywords(), exit, ILIAS\FileDelivery\http(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

685  : void
686  {
687  $term = '';
688  if ($this->http->wrapper()->query()->has('term')) {
689  $term = $this->http->wrapper()->query()->retrieve(
690  'term',
691  $this->refinery->kindlyTo()->string()
692  );
693  }
694 
696  ilUtil::stripSlashes($term),
697  $this->md_obj->getObjType(),
698  $this->md_obj->getRBACId()
699  );
700 
701  $result = array();
702  $cnt = 0;
703  foreach ($res as $r) {
704  if ($cnt++ > 19) {
705  continue;
706  }
707  $entry = new stdClass();
708  $entry->value = $r;
709  $entry->label = $r;
710  $result[] = $entry;
711  }
712 
713  echo json_encode($result, JSON_THROW_ON_ERROR);
714  exit;
715  }
$res
Definition: ltiservices.php:69
exit
Definition: login.php:28
static _getMatchingKeywords(string $a_query, string $a_type, int $a_rbac_id=0)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ listAnnotation()

ilMDEditorGUI::listAnnotation ( )

Definition at line 3116 of file class.ilMDEditorGUI.php.

References __setTabs(), __showLanguageSelect(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

3116  : void
3117  {
3118  $this->__setTabs('meta_annotation');
3119  $tpl = new ilTemplate('tpl.md_annotation.html', true, true, 'Services/MetaData');
3120 
3121  $anno_ids = $this->md_obj->getAnnotationIds();
3122  if ($anno_ids === []) {
3123  $tpl->setCurrentBlock("no_annotation");
3124  $tpl->setVariable("TXT_NO_ANNOTATION", $this->lng->txt("meta_no_annotation"));
3125  $tpl->setVariable("TXT_ADD_ANNOTATION", $this->lng->txt("meta_add"));
3126  $this->ctrl->setParameter($this, "section", "meta_annotation");
3127  $tpl->setVariable(
3128  "ACTION_ADD_ANNOTATION",
3129  $this->ctrl->getLinkTarget($this, "addSection")
3130  );
3132  } else {
3133  foreach ($anno_ids as $anno_id) {
3134  $this->ctrl->setParameter($this, 'meta_index', $anno_id);
3135  $this->ctrl->setParameter($this, "section", "meta_annotation");
3136 
3137  $this->md_section = $this->md_obj->getAnnotation($anno_id);
3138 
3139  $tpl->setCurrentBlock("annotation_loop");
3140  $tpl->setVariable("ANNOTATION_ID", $anno_id);
3141  $tpl->setVariable("TXT_ANNOTATION", $this->lng->txt("meta_annotation"));
3142  $this->ctrl->setParameter($this, "meta_index", $anno_id);
3143  $tpl->setVariable(
3144  "ACTION_DELETE",
3145  $this->ctrl->getLinkTarget($this, "deleteSection")
3146  );
3147  $this->ctrl->setParameter($this, "section", "meta_annotation");
3148  $tpl->setVariable(
3149  "ACTION_ADD",
3150  $this->ctrl->getLinkTarget($this, "addSection")
3151  );
3152  $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
3153  $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
3154 
3155  $tpl->setVariable("TXT_ENTITY", $this->lng->txt("meta_entity"));
3156  $tpl->setVariable(
3157  "VAL_ENTITY",
3158  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getEntity())
3159  );
3160  $tpl->setVariable("TXT_DATE", $this->lng->txt("meta_date"));
3161  $tpl->setVariable(
3162  "VAL_DATE",
3163  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getDate())
3164  );
3165 
3166  /* Description */
3167  $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
3168  $tpl->setVariable("TXT_VALUE", $this->lng->txt("meta_value"));
3169  $tpl->setVariable(
3170  "VAL_DESCRIPTION",
3171  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getDescription())
3172  );
3173  $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
3174  $tpl->setVariable(
3175  "VAL_DESCRIPTION_LANGUAGE",
3176  $this->__showLanguageSelect(
3177  'annotation[' . $anno_id . '][Language]',
3178  $this->md_section->getDescriptionLanguageCode()
3179  )
3180  );
3181 
3183  }
3184 
3185  $tpl->setCurrentBlock("annotation");
3186  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
3187  $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
3189  }
3190 
3191  $this->tpl->setContent($tpl->get());
3192  }
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listClassification()

ilMDEditorGUI::listClassification ( )

Definition at line 3222 of file class.ilMDEditorGUI.php.

References __setTabs(), __showLanguageSelect(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

3222  : void
3223  {
3224  $this->__setTabs('meta_classification');
3225  $tpl = new ilTemplate('tpl.md_classification.html', true, true, 'Services/MetaData');
3226 
3227  $class_ids = $this->md_obj->getClassificationIds();
3228  if ($class_ids === []) {
3229  $tpl->setCurrentBlock("no_classification");
3230  $tpl->setVariable("TXT_NO_CLASSIFICATION", $this->lng->txt("meta_no_classification"));
3231  $tpl->setVariable("TXT_ADD_CLASSIFICATION", $this->lng->txt("meta_add"));
3232  $this->ctrl->setParameter($this, "section", "meta_classification");
3233  $tpl->setVariable(
3234  "ACTION_ADD_CLASSIFICATION",
3235  $this->ctrl->getLinkTarget($this, "addSection")
3236  );
3238  } else {
3239  foreach ($class_ids as $class_id) {
3240  $this->md_section = $this->md_obj->getClassification($class_id);
3241  $this->ctrl->setParameter($this, "section", "meta_classification");
3242 
3243  /* TaxonPath */
3244  $tp_ids = $this->md_section->getTaxonPathIds();
3245  foreach ($tp_ids as $tp_id) {
3246  $tax_path = $this->md_section->getTaxonPath($tp_id);
3247 
3248  $tax_ids = $tax_path->getTaxonIds();
3249 
3250  foreach ($tax_ids as $tax_id) {
3251  $taxon = $tax_path->getTaxon($tax_id);
3252 
3253  if (count($tax_ids) > 1) {
3254  $tpl->setCurrentBlock("taxon_delete");
3255  $this->ctrl->setParameter($this, "meta_index", $tax_id);
3256  $this->ctrl->setParameter($this, "meta_path", "classification_taxon");
3257  $tpl->setVariable(
3258  "TAXONPATH_TAXON_LOOP_ACTION_DELETE",
3259  $this->ctrl->getLinkTarget($this, "deleteElement")
3260  );
3261  $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
3263  }
3264 
3265  $tpl->setCurrentBlock("taxonpath_taxon_loop");
3266  $tpl->setVariable("TAXONPATH_TAXON_LOOP_NO", $tax_id);
3267  $tpl->setVariable("TAXONPATH_TAXON_LOOP_TAXONPATH_NO", $tp_id);
3268  $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_TAXON", $this->lng->txt("meta_taxon"));
3269  $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
3270  $tpl->setVariable(
3271  "TAXONPATH_TAXON_LOOP_VAL_TAXON",
3273  );
3274  $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_ID", $this->lng->txt("meta_id"));
3275  $tpl->setVariable(
3276  "TAXONPATH_TAXON_LOOP_VAL_ID",
3277  ilLegacyFormElementsUtil::prepareFormOutput($taxon->getTaxonId())
3278  );
3279  $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
3280  $tpl->setVariable(
3281  "TAXONPATH_TAXON_LOOP_VAL_TAXON_LANGUAGE",
3282  $this->__showLanguageSelect(
3283  'classification[TaxonPath][Taxon][' . $tax_id . '][Language]',
3284  $taxon->getTaxonLanguageCode()
3285  )
3286  );
3287 
3288  $this->ctrl->setParameter($this, "section_element", "Taxon_" . $class_id);
3289  $this->ctrl->setParameter($this, "meta_index", $tp_id);
3290  $tpl->setVariable(
3291  "TAXONPATH_TAXON_LOOP_ACTION_ADD",
3292  $this->ctrl->getLinkTarget($this, "addSectionElement")
3293  );
3294  $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
3296  }
3297 
3298  if (count($tp_ids) > 1) {
3299  $tpl->setCurrentBlock("taxonpath_delete");
3300  $this->ctrl->setParameter($this, "meta_index", $tp_id);
3301  $this->ctrl->setParameter($this, "meta_path", "classification_taxon_path");
3302  $tpl->setVariable(
3303  "TAXONPATH_LOOP_ACTION_DELETE",
3304  $this->ctrl->getLinkTarget($this, "deleteElement")
3305  );
3306  $tpl->setVariable("TAXONPATH_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
3308  }
3309 
3310  $tpl->setCurrentBlock("taxonpath_loop");
3311  $tpl->setVariable("TAXONPATH_LOOP_NO", $tp_id);
3312  $tpl->setVariable("TAXONPATH_LOOP_ROWSPAN", (3 * count($tax_ids)) + 2);
3313  $tpl->setVariable("TAXONPATH_LOOP_TXT_TAXONPATH", $this->lng->txt("meta_taxon_path"));
3314  $tpl->setVariable("TAXONPATH_LOOP_TXT_SOURCE", $this->lng->txt("meta_source"));
3315  $tpl->setVariable("TAXONPATH_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
3316  $tpl->setVariable("TAXONPATH_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
3317  $tpl->setVariable(
3318  "TAXONPATH_LOOP_VAL_SOURCE",
3319  ilLegacyFormElementsUtil::prepareFormOutput($tax_path->getSource())
3320  );
3321  $tpl->setVariable(
3322  "TAXONPATH_LOOP_VAL_SOURCE_LANGUAGE",
3323  $this->__showLanguageSelect(
3324  'classification[TaxonPath][' . $tp_id . '][Source][Language]',
3325  $tax_path->getSourceLanguageCode()
3326  )
3327  );
3328  $this->ctrl->setParameter($this, "section_element", "TaxonPath_" . $class_id);
3329  $this->ctrl->setParameter($this, "meta_index", $class_id);
3330  $tpl->setVariable(
3331  "TAXONPATH_LOOP_ACTION_ADD",
3332  $this->ctrl->getLinkTarget($this, "addSectionElement")
3333  );
3334  $tpl->setVariable("TAXONPATH_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
3336  }
3337 
3338  /* Description */
3339  $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
3340  $tpl->setVariable("TXT_VALUE", $this->lng->txt("meta_value"));
3341  $tpl->setVariable(
3342  "VAL_DESCRIPTION",
3343  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getDescription())
3344  );
3345  $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
3346  $tpl->setVariable(
3347  "VAL_DESCRIPTION_LANGUAGE",
3348  $this->__showLanguageSelect(
3349  'classification[' . $class_id . '][Language]',
3350  $this->md_section->getDescriptionLanguageCode()
3351  )
3352  );
3353 
3354  /* Keyword */
3355  $key_ids = $this->md_section->getKeywordIds();
3356  foreach ($key_ids as $key_id) {
3357  if (count($key_ids) > 1) {
3358  $this->ctrl->setParameter($this, "meta_index", $key_id);
3359  $this->ctrl->setParameter($this, "meta_path", "classification_keyword");
3360  $tpl->setCurrentBlock("keyword_delete");
3361  $tpl->setVariable(
3362  "KEYWORD_LOOP_ACTION_DELETE",
3363  $this->ctrl->getLinkTarget($this, "deleteElement")
3364  );
3365  $tpl->setVariable("KEYWORD_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
3367  }
3368 
3369  $keyword = $this->md_section->getKeyword($key_id);
3370  $tpl->setCurrentBlock("keyword_loop");
3371  $tpl->setVariable("KEYWORD_LOOP_NO", $key_id);
3372  $tpl->setVariable("KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt("meta_keyword"));
3373  $tpl->setVariable("KEYWORD_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
3374  $tpl->setVariable(
3375  "KEYWORD_LOOP_VAL",
3376  ilLegacyFormElementsUtil::prepareFormOutput($keyword->getKeyword())
3377  );
3378  $tpl->setVariable("KEYWORD_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
3379  $tpl->setVariable(
3380  "KEYWORD_LOOP_VAL_LANGUAGE",
3381  $this->__showLanguageSelect(
3382  'classification[Keyword][' . $key_id . '][Language]',
3383  $keyword->getKeywordLanguageCode()
3384  )
3385  );
3386  $this->ctrl->setParameter($this, "meta_index", $class_id);
3387  $this->ctrl->setParameter($this, "section_element", "Keyword_" . $class_id);
3388  $tpl->setVariable(
3389  "KEYWORD_LOOP_ACTION_ADD",
3390  $this->ctrl->getLinkTarget($this, "addSectionElement")
3391  );
3392  $tpl->setVariable("KEYWORD_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
3394  }
3395 
3396  $tpl->setCurrentBlock("classification_loop");
3397  $tpl->setVariable("TXT_CLASSIFICATION", $this->lng->txt("meta_classification"));
3398  $this->ctrl->setParameter($this, "meta_index", $class_id);
3399  $tpl->setVariable(
3400  "ACTION_DELETE",
3401  $this->ctrl->getLinkTarget($this, "deleteSection")
3402  );
3403  $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
3404  $tpl->setVariable(
3405  "ACTION_ADD",
3406  $this->ctrl->getLinkTarget($this, "addSection")
3407  );
3408  $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
3409 
3410  $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
3411  $tpl->setVariable("TXT_TAXONPATH", $this->lng->txt("meta_taxon_path"));
3412  $tpl->setVariable("TXT_KEYWORD", $this->lng->txt("meta_keyword"));
3413  $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
3414 
3415  $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
3416  $tpl->setVariable("CLASS_ID", $class_id);
3417  $tpl->setVariable("TXT_PURPOSE", $this->lng->txt("meta_purpose"));
3418  $tpl->setVariable("TXT_DISCIPLINE", $this->lng->txt("meta_learning_resource_type"));
3419  $tpl->setVariable("TXT_IDEA", $this->lng->txt("meta_idea"));
3420  $tpl->setVariable("TXT_PREREQUISITE", $this->lng->txt("meta_prerequisite"));
3421  $tpl->setVariable("TXT_EDUCATIONALOBJECTIVE", $this->lng->txt("meta_educational_objective"));
3422  $tpl->setVariable(
3423  "TXT_ACCESSIBILITYRESTRICTIONS",
3424  $this->lng->txt("meta_accessibility_restrictions")
3425  );
3426  $tpl->setVariable("TXT_EDUCATIONALLEVEL", $this->lng->txt("meta_educational_level"));
3427  $tpl->setVariable("TXT_SKILLLEVEL", $this->lng->txt("meta_skill_level"));
3428  $tpl->setVariable("TXT_SECURITYLEVEL", $this->lng->txt("meta_security_level"));
3429  $tpl->setVariable("TXT_COMPETENCY", $this->lng->txt("meta_competency"));
3430  $tpl->setVariable("VAL_PURPOSE_" . strtoupper($this->md_section->getPurpose()), " selected");
3432  }
3433 
3434  $tpl->setCurrentBlock("classification");
3435  $tpl->setVariable(
3436  "EDIT_ACTION",
3437  $this->ctrl->getFormAction($this)
3438  );
3439  $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
3441  }
3442 
3443  $this->tpl->setContent($tpl->get());
3444  }
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listEducational()

ilMDEditorGUI::listEducational ( )

Definition at line 2557 of file class.ilMDEditorGUI.php.

References $id, $valid, __buildDaysSelect(), __buildMonthsSelect(), __setTabs(), __showLanguageSelect(), ilMDUtils\_LOMDurationToArray(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\makeTimeSelect(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

2557  : void
2558  {
2559  $this->__setTabs('meta_educational');
2560  $tpl = new ilTemplate('tpl.md_educational.html', true, true, 'Services/MetaData');
2561 
2562  if (!is_object($this->md_section = $this->md_obj->getEducational())) {
2563  $tpl->setCurrentBlock("no_educational");
2564  $tpl->setVariable("TXT_NO_EDUCATIONAL", $this->lng->txt("meta_no_educational"));
2565  $tpl->setVariable("TXT_ADD_EDUCATIONAL", $this->lng->txt("meta_add"));
2566  $this->ctrl->setParameter($this, "section", "meta_educational");
2567  $tpl->setVariable(
2568  "ACTION_ADD_EDUCATIONAL",
2569  $this->ctrl->getLinkTarget($this, "addSection")
2570  );
2572  } else {
2573  $this->ctrl->setReturn($this, 'listEducational');
2574  $this->ctrl->setParameter($this, 'section', 'meta_educational');
2575  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
2576 
2577  $this->ctrl->setParameter($this, "meta_index", $this->md_section->getMetaId());
2578  $tpl->setVariable(
2579  "ACTION_DELETE",
2580  $this->ctrl->getLinkTarget($this, "deleteSection")
2581  );
2582 
2583  $tpl->setVariable("TXT_EDUCATIONAL", $this->lng->txt("meta_educational"));
2584  $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
2585  $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
2586  $tpl->setVariable("TXT_TYPICALAGERANGE", $this->lng->txt("meta_typical_age_range"));
2587  $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
2588  $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
2589  $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
2590  $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
2591 
2592  $tpl->setVariable("TXT_INTERACTIVITYTYPE", $this->lng->txt("meta_interactivity_type"));
2593  $tpl->setVariable("TXT_LEARNINGRESOURCETYPE", $this->lng->txt("meta_learning_resource_type"));
2594  $tpl->setVariable("TXT_INTERACTIVITYLEVEL", $this->lng->txt("meta_interactivity_level"));
2595  $tpl->setVariable("TXT_SEMANTICDENSITY", $this->lng->txt("meta_semantic_density"));
2596  $tpl->setVariable("TXT_INTENDEDENDUSERROLE", $this->lng->txt("meta_intended_end_user_role"));
2597  $tpl->setVariable("TXT_CONTEXT", $this->lng->txt("meta_context"));
2598  $tpl->setVariable("TXT_DIFFICULTY", $this->lng->txt("meta_difficulty"));
2599 
2600  $tpl->setVariable(
2601  "VAL_INTERACTIVITYTYPE_" . strtoupper($this->md_section->getInteractivityType()),
2602  " selected"
2603  );
2604  $tpl->setVariable(
2605  "VAL_LEARNINGRESOURCETYPE_" . strtoupper($this->md_section->getLearningResourceType()),
2606  " selected"
2607  );
2608  $tpl->setVariable(
2609  "VAL_INTERACTIVITYLEVEL_" . strtoupper($this->md_section->getInteractivityLevel()),
2610  " selected"
2611  );
2612  $tpl->setVariable(
2613  "VAL_SEMANTICDENSITY_" . strtoupper($this->md_section->getSemanticDensity()),
2614  " selected"
2615  );
2616  $tpl->setVariable(
2617  "VAL_INTENDEDENDUSERROLE_" . strtoupper($this->md_section->getIntendedEndUserRole()),
2618  " selected"
2619  );
2620  $tpl->setVariable("VAL_CONTEXT_" . strtoupper($this->md_section->getContext()), " selected");
2621  $tpl->setVariable("VAL_DIFFICULTY_" . strtoupper($this->md_section->getDifficulty()), " selected");
2622  #$tpl->setVariable("VAL_TYPICALLEARNINGTIME", ilUtil::prepareFormOutput($this->md_section->getTypicalLearningTime()));
2623 
2624  $tpl->setVariable("TXT_ACTIVE", $this->lng->txt("meta_active"));
2625  $tpl->setVariable("TXT_EXPOSITIVE", $this->lng->txt("meta_expositive"));
2626  $tpl->setVariable("TXT_MIXED", $this->lng->txt("meta_mixed"));
2627  $tpl->setVariable("TXT_EXERCISE", $this->lng->txt("meta_exercise"));
2628  $tpl->setVariable("TXT_SIMULATION", $this->lng->txt("meta_simulation"));
2629  $tpl->setVariable("TXT_QUESTIONNAIRE", $this->lng->txt("meta_questionnaire"));
2630  $tpl->setVariable("TXT_DIAGRAMM", $this->lng->txt("meta_diagramm"));
2631  $tpl->setVariable("TXT_FIGURE", $this->lng->txt("meta_figure"));
2632  $tpl->setVariable("TXT_GRAPH", $this->lng->txt("meta_graph"));
2633  $tpl->setVariable("TXT_INDEX", $this->lng->txt("meta_index"));
2634  $tpl->setVariable("TXT_SLIDE", $this->lng->txt("meta_slide"));
2635  $tpl->setVariable("TXT_TABLE", $this->lng->txt("meta_table"));
2636  $tpl->setVariable("TXT_NARRATIVETEXT", $this->lng->txt("meta_narrative_text"));
2637  $tpl->setVariable("TXT_EXAM", $this->lng->txt("meta_exam"));
2638  $tpl->setVariable("TXT_EXPERIMENT", $this->lng->txt("meta_experiment"));
2639  $tpl->setVariable("TXT_PROBLEMSTATEMENT", $this->lng->txt("meta_problem_statement"));
2640  $tpl->setVariable("TXT_SELFASSESSMENT", $this->lng->txt("meta_self_assessment"));
2641  $tpl->setVariable("TXT_LECTURE", $this->lng->txt("meta_lecture"));
2642  $tpl->setVariable("TXT_VERYLOW", $this->lng->txt("meta_very_low"));
2643  $tpl->setVariable("TXT_LOW", $this->lng->txt("meta_low"));
2644  $tpl->setVariable("TXT_MEDIUM", $this->lng->txt("meta_medium"));
2645  $tpl->setVariable("TXT_HIGH", $this->lng->txt("meta_high"));
2646  $tpl->setVariable("TXT_VERYHIGH", $this->lng->txt("meta_very_high"));
2647  $tpl->setVariable("TXT_TEACHER", $this->lng->txt("meta_teacher"));
2648  $tpl->setVariable("TXT_AUTHOR", $this->lng->txt("meta_author"));
2649  $tpl->setVariable("TXT_LEARNER", $this->lng->txt("meta_learner"));
2650  $tpl->setVariable("TXT_MANAGER", $this->lng->txt("meta_manager"));
2651  $tpl->setVariable("TXT_SCHOOL", $this->lng->txt("meta_school"));
2652  $tpl->setVariable("TXT_HIGHEREDUCATION", $this->lng->txt("meta_higher_education"));
2653  $tpl->setVariable("TXT_TRAINING", $this->lng->txt("meta_training"));
2654  $tpl->setVariable("TXT_OTHER", $this->lng->txt("meta_other"));
2655  $tpl->setVariable("TXT_VERYEASY", $this->lng->txt("meta_very_easy"));
2656  $tpl->setVariable("TXT_EASY", $this->lng->txt("meta_easy"));
2657  $tpl->setVariable("TXT_DIFFICULT", $this->lng->txt("meta_difficult"));
2658  $tpl->setVariable("TXT_VERYDIFFICULT", $this->lng->txt("meta_very_difficult"));
2659  $tpl->setVariable("TXT_TYPICALLEARNINGTIME", $this->lng->txt("meta_typical_learning_time"));
2660 
2661  // Typical learning time
2662  $tlt = array(0, 0, 0, 0, 0);
2663  $valid = true;
2664 
2665  if (!$tlt = ilMDUtils::_LOMDurationToArray($this->md_section->getTypicalLearningTime())) {
2666  if ($this->md_section->getTypicalLearningTime() !== '') {
2667  $tlt = array(0, 0, 0, 0, 0);
2668  $valid = false;
2669  }
2670  }
2671 
2672  $tpl->setVariable("TXT_MONTH", $this->lng->txt('md_months'));
2673  $tpl->setVariable("SEL_MONTHS", $this->__buildMonthsSelect((string) ($tlt[0] ?? '')));
2674  $tpl->setVariable("SEL_DAYS", $this->__buildDaysSelect((string) ($tlt[1] ?? '')));
2675 
2676  $tpl->setVariable("TXT_DAYS", $this->lng->txt('md_days'));
2677  $tpl->setVariable("TXT_TIME", $this->lng->txt('md_time'));
2678 
2679  $tpl->setVariable("TXT_TYPICAL_LEARN_TIME", $this->lng->txt('meta_typical_learning_time'));
2680  $tpl->setVariable(
2681  "SEL_TLT",
2683  'tlt',
2684  !($tlt[4] ?? false),
2685  $tlt[2] ?? 0,
2686  $tlt[3] ?? 0,
2687  $tlt[4] ?? 0,
2688  false
2689  )
2690  );
2691  $tpl->setVariable("TLT_HINT", ($tlt[4] ?? null) ? '(hh:mm:ss)' : '(hh:mm)');
2692 
2693  if (!$valid) {
2694  $tpl->setCurrentBlock("tlt_not_valid");
2695  $tpl->setVariable("TXT_CURRENT_VAL", $this->lng->txt('meta_current_value'));
2696  $tpl->setVariable("TLT", $this->md_section->getTypicalLearningTime());
2697  $tpl->setVariable("INFO_TLT_NOT_VALID", $this->lng->txt('meta_info_tlt_not_valid'));
2699  }
2700 
2701  /* TypicalAgeRange */
2702  $first = true;
2703  foreach ($ids = $this->md_section->getTypicalAgeRangeIds() as $id) {
2704  $md_age = $this->md_section->getTypicalAgeRange($id);
2705 
2706  // extra test due to bug 5316 (may be due to eLaix import)
2707  if (is_object($md_age)) {
2708  if ($first) {
2709  $tpl->setCurrentBlock("agerange_head");
2710  $tpl->setVariable(
2711  "TYPICALAGERANGE_LOOP_TXT_TYPICALAGERANGE",
2712  $this->lng->txt("meta_typical_age_range")
2713  );
2714  $tpl->setVariable("ROWSPAN_AGERANGE", count($ids));
2716  $first = false;
2717  }
2718 
2719  $this->ctrl->setParameter($this, 'meta_index', $id);
2720  $this->ctrl->setParameter($this, 'meta_path', 'educational_typical_age_range');
2721 
2722  $tpl->setCurrentBlock("typicalagerange_delete");
2723  $tpl->setVariable(
2724  "TYPICALAGERANGE_LOOP_ACTION_DELETE",
2725  $this->ctrl->getLinkTarget($this, "deleteElement")
2726  );
2727  $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
2729 
2730  $tpl->setCurrentBlock("typicalagerange_loop");
2731  $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
2732  $tpl->setVariable(
2733  "TYPICALAGERANGE_LOOP_VAL",
2734  ilLegacyFormElementsUtil::prepareFormOutput($md_age->getTypicalAgeRange())
2735  );
2736  $tpl->setVariable("TYPICALAGERANGE_LOOP_NO", $id);
2737  $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
2738  $tpl->setVariable(
2739  "TYPICALAGERANGE_LOOP_VAL_LANGUAGE",
2740  $this->__showLanguageSelect(
2741  'educational[TypicalAgeRange][' . $id . '][Language]',
2742  $md_age->getTypicalAgeRangeLanguageCode()
2743  )
2744  );
2745  $this->ctrl->setParameter($this, "section_element", "educational_typical_age_range");
2746  $tpl->setVariable(
2747  "TYPICALAGERANGE_LOOP_ACTION_ADD",
2748  $this->ctrl->getLinkTarget($this, "addSectionElement")
2749  );
2750  $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
2752  }
2753  }
2754 
2755  /* Description */
2756  $first = true;
2757  foreach ($ids = $this->md_section->getDescriptionIds() as $id) {
2758  if ($first) {
2759  $tpl->setCurrentBlock("desc_head");
2760  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
2761  $tpl->setVariable("ROWSPAN_DESC", count($ids));
2763  $first = false;
2764  }
2765 
2766  $md_des = $this->md_section->getDescription($id);
2767 
2768  $this->ctrl->setParameter($this, 'meta_index', $id);
2769  $this->ctrl->setParameter($this, 'meta_path', 'educational_description');
2770 
2771  $tpl->setCurrentBlock("description_loop");
2772  $tpl->setVariable("DESCRIPTION_LOOP_NO", $id);
2773  $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
2774  $tpl->setVariable(
2775  "DESCRIPTION_LOOP_VAL",
2776  ilLegacyFormElementsUtil::prepareFormOutput($md_des->getDescription())
2777  );
2778  $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
2779  $tpl->setVariable(
2780  "DESCRIPTION_LOOP_VAL_LANGUAGE",
2781  $this->__showLanguageSelect(
2782  'educational[Description][' . $id . '][Language]',
2783  $md_des->getDescriptionLanguageCode()
2784  )
2785  );
2786  $tpl->setVariable(
2787  "DESCRIPTION_LOOP_ACTION_DELETE",
2788  $this->ctrl->getLinkTarget($this, "deleteElement")
2789  );
2790  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
2791  $this->ctrl->setParameter($this, "section_element", "educational_description");
2792  $tpl->setVariable(
2793  "DESCRIPTION_LOOP_ACTION_ADD",
2794  $this->ctrl->getLinkTarget($this, "addSectionElement")
2795  );
2796  $tpl->setVariable("DESCRIPTION_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
2798  }
2799 
2800  /* Language */
2801  $first = true;
2802  foreach ($ids = $this->md_section->getLanguageIds() as $id) {
2803  if ($first) {
2804  $tpl->setCurrentBlock("language_head");
2805  $tpl->setVariable("LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
2806  $tpl->setVariable("ROWSPAN_LANG", count($ids));
2808  $first = false;
2809  }
2810 
2811  $md_lang = $this->md_section->getLanguage($id);
2812 
2813  $this->ctrl->setParameter($this, 'meta_index', $id);
2814  $this->ctrl->setParameter($this, 'meta_path', 'educational_language');
2815 
2816  $tpl->setCurrentBlock("language_loop");
2817  $tpl->setVariable(
2818  "LANGUAGE_LOOP_VAL_LANGUAGE",
2819  $this->__showLanguageSelect(
2820  'educational[Language][' . $id . ']',
2821  $md_lang->getLanguageCode()
2822  )
2823  );
2824 
2825  $tpl->setVariable(
2826  "LANGUAGE_LOOP_ACTION_DELETE",
2827  $this->ctrl->getLinkTarget($this, "deleteElement")
2828  );
2829  $tpl->setVariable("LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
2830  $this->ctrl->setParameter($this, "section_element", "educational_language");
2831  $tpl->setVariable(
2832  "LANGUAGE_LOOP_ACTION_ADD",
2833  $this->ctrl->getLinkTarget($this, "addSectionElement")
2834  );
2835  $tpl->setVariable("LANGUAGE_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
2837  }
2838 
2839  $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
2840 
2841  $tpl->setCurrentBlock("educational");
2843  }
2844 
2845  $this->tpl->setContent($tpl->get());
2846  }
static _LOMDurationToArray(string $a_string)
LOM datatype duration is a string like P2M4DT7H18M2S (2 months 4 days 7 hours 18 minutes 2 seconds) T...
__buildDaysSelect(string $sel_day)
$valid
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
ilGlobalTemplateInterface $tpl
__buildMonthsSelect(string $sel_month)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
static makeTimeSelect(string $prefix, bool $short=true, int $hour=0, int $minute=0, int $second=0, bool $a_use_default=true, array $a_further_options=[])
Creates a combination of HTML selects for time inputs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listGeneral()

ilMDEditorGUI::listGeneral ( )

Definition at line 1309 of file class.ilMDEditorGUI.php.

References $id, __fillSubelements(), __setTabs(), __showLanguageSelect(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection(), and updateGeneral().

1309  : void
1310  {
1311  if (!is_object($this->md_section = $this->md_obj->getGeneral())) {
1312  $this->md_section = $this->md_obj->addGeneral();
1313  $this->md_section->save();
1314  }
1315 
1316  $this->__setTabs('meta_general');
1317 
1318  $tpl = new ilTemplate('tpl.md_general.html', true, true, 'Services/MetaData');
1319 
1320  $this->ctrl->setReturn($this, 'listGeneral');
1321  $this->ctrl->setParameter($this, 'section', 'meta_general');
1322  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
1323 
1324  $this->__fillSubelements($tpl);
1325 
1326  $tpl->setVariable("TXT_GENERAL", $this->lng->txt("meta_general"));
1327  $tpl->setVariable("TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
1328  $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
1329  $tpl->setVariable("TXT_KEYWORD", $this->lng->txt("meta_keyword"));
1330  $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
1331  $tpl->setVariable("TXT_STRUCTURE", $this->lng->txt("meta_structure"));
1332  $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
1333  $tpl->setVariable("TXT_ATOMIC", $this->lng->txt("meta_atomic"));
1334  $tpl->setVariable("TXT_COLLECTION", $this->lng->txt("meta_collection"));
1335  $tpl->setVariable("TXT_NETWORKED", $this->lng->txt("meta_networked"));
1336  $tpl->setVariable("TXT_HIERARCHICAL", $this->lng->txt("meta_hierarchical"));
1337  $tpl->setVariable("TXT_LINEAR", $this->lng->txt("meta_linear"));
1338 
1339  // Structure
1340  $tpl->setVariable("STRUCTURE_VAL_" . strtoupper($this->md_section->getStructure()), " selected=selected");
1341 
1342  // Identifier
1343  $first = true;
1344  foreach ($ids = $this->md_section->getIdentifierIds() as $id) {
1345  $md_ide = $this->md_section->getIdentifier($id);
1346 
1347  //
1348  if ($first) {
1349  $tpl->setCurrentBlock("id_head");
1350  $tpl->setVariable("IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
1351  $tpl->setVariable("IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt("meta_catalog"));
1352  $tpl->setVariable("IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt("meta_entry"));
1353  $tpl->setVariable("ROWSPAN_ID", count($ids));
1355  $first = false;
1356  }
1357 
1358  if (count($ids) > 1) {
1359  $this->ctrl->setParameter($this, 'meta_index', $id);
1360  $this->ctrl->setParameter($this, 'meta_path', 'meta_identifier');
1361 
1362  if ($md_ide->getCatalog() !== "ILIAS") {
1363  $tpl->setCurrentBlock("identifier_delete");
1364  $tpl->setVariable(
1365  "IDENTIFIER_LOOP_ACTION_DELETE",
1366  $this->ctrl->getLinkTarget($this, 'deleteElement')
1367  );
1368  $tpl->setVariable("IDENTIFIER_LOOP_TXT_DELETE", $this->lng->txt('delete'));
1370  }
1371  }
1372 
1373  $tpl->setCurrentBlock("identifier_loop");
1374  if ($md_ide->getCatalog() === "ILIAS") {
1375  $tpl->setVariable("DISABLE_IDENT", ' disabled="disabled" ');
1376  }
1377  $tpl->setVariable("IDENTIFIER_LOOP_NO", $id);
1378  $tpl->setVariable(
1379  "IDENTIFIER_LOOP_VAL_IDENTIFIER_CATALOG",
1380  ilLegacyFormElementsUtil::prepareFormOutput($md_ide->getCatalog())
1381  );
1382  $tpl->setVariable(
1383  "IDENTIFIER_LOOP_VAL_IDENTIFIER_ENTRY",
1384  ilLegacyFormElementsUtil::prepareFormOutput($md_ide->getEntry())
1385  );
1387  }
1388 
1389  // Language
1390  $first = true;
1391  foreach ($ids = $this->md_section->getLanguageIds() as $id) {
1392  $md_lan = $this->md_section->getLanguage($id);
1393 
1394  if ($first) {
1395  $tpl->setCurrentBlock("language_head");
1396  $tpl->setVariable("ROWSPAN_LANG", count($ids));
1397  $tpl->setVariable("LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
1399  $first = false;
1400  }
1401 
1402  if (count($ids) > 1) {
1403  $this->ctrl->setParameter($this, 'meta_index', $id);
1404  $this->ctrl->setParameter($this, 'meta_path', 'meta_language');
1405 
1406  $tpl->setCurrentBlock("language_delete");
1407  $tpl->setVariable(
1408  "LANGUAGE_LOOP_ACTION_DELETE",
1409  $this->ctrl->getLinkTarget($this, 'deleteElement')
1410  );
1411  $tpl->setVariable("LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
1413  }
1414  $tpl->setCurrentBlock("language_loop");
1415  $tpl->setVariable("LANGUAGE_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
1416  'gen_language[' . $id . '][language]',
1417  $md_lan->getLanguageCode()
1418  ));
1420  }
1421 
1422  // TITLE
1423  $tpl->setVariable("TXT_TITLE", $this->lng->txt('title'));
1424  $tpl->setVariable(
1425  "VAL_TITLE",
1426  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getTitle())
1427  );
1428  $tpl->setVariable("VAL_TITLE_LANGUAGE", $this->__showLanguageSelect(
1429  'gen_title_language',
1430  $this->md_section->getTitleLanguageCode()
1431  ));
1432 
1433  // DESCRIPTION
1434  foreach ($ids = $this->md_section->getDescriptionIds() as $id) {
1435  $md_des = $this->md_section->getDescription($id);
1436 
1437  if (count($ids) > 1) {
1438  $this->ctrl->setParameter($this, 'meta_index', $id);
1439  $this->ctrl->setParameter($this, 'meta_path', 'meta_description');
1440 
1441  $tpl->setCurrentBlock("description_delete");
1442  $tpl->setVariable(
1443  "DESCRIPTION_LOOP_ACTION_DELETE",
1444  $this->ctrl->getLinkTarget($this, 'deleteElement')
1445  );
1446  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
1448  }
1449 
1450  $tpl->setCurrentBlock("description_loop");
1451  $tpl->setVariable("DESCRIPTION_LOOP_NO", $id);
1452  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
1453  $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
1454  $tpl->setVariable(
1455  "DESCRIPTION_LOOP_VAL",
1456  ilLegacyFormElementsUtil::prepareFormOutput($md_des->getDescription())
1457  );
1458  $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
1459  $tpl->setVariable("DESCRIPTION_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
1460  "gen_description[" . $id . '][language]',
1461  $md_des->getDescriptionLanguageCode()
1462  ));
1464  }
1465 
1466  // KEYWORD
1467  $first = true;
1468  foreach ($ids = $this->md_section->getKeywordIds() as $id) {
1469  $md_key = $this->md_section->getKeyword($id);
1470 
1471  if ($first) {
1472  $tpl->setCurrentBlock("keyword_head");
1473  $tpl->setVariable("ROWSPAN_KEYWORD", count($ids));
1474  $tpl->setVariable("KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt("meta_keyword"));
1476  $first = false;
1477  }
1478 
1479  if (count($ids) > 1) {
1480  $this->ctrl->setParameter($this, 'meta_index', $id);
1481  $this->ctrl->setParameter($this, 'meta_path', 'meta_keyword');
1482 
1483  $tpl->setCurrentBlock("keyword_delete");
1484  $tpl->setVariable(
1485  "KEYWORD_LOOP_ACTION_DELETE",
1486  $this->ctrl->getLinkTarget($this, 'deleteElement')
1487  );
1488  $tpl->setVariable("KEYWORD_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
1490  }
1491 
1492  $tpl->setCurrentBlock("keyword_loop");
1493  $tpl->setVariable("KEYWORD_LOOP_NO", $id);
1494  $tpl->setVariable("KEYWORD_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
1495  $tpl->setVariable(
1496  "KEYWORD_LOOP_VAL",
1497  ilLegacyFormElementsUtil::prepareFormOutput($md_key->getKeyword())
1498  );
1499  $tpl->setVariable("KEYWORD_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
1500  $tpl->setVariable("KEYWORD_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
1501  "gen_keyword[" . $id . '][language]',
1502  $md_key->getKeywordLanguageCode()
1503  ));
1504 
1506  }
1507 
1508  // Coverage
1509  $tpl->setVariable("COVERAGE_LOOP_TXT_COVERAGE", $this->lng->txt('meta_coverage'));
1510  $tpl->setVariable(
1511  "COVERAGE_LOOP_VAL",
1512  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getCoverage())
1513  );
1514  $tpl->setVariable("COVERAGE_LOOP_TXT_LANGUAGE", $this->lng->txt('meta_language'));
1515  $tpl->setVariable("COVERAGE_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
1516  'gen_coverage_language',
1517  $this->md_section->getCoverageLanguageCode()
1518  ));
1519 
1520  $tpl->setVariable("TXT_SAVE", $this->lng->txt('save'));
1521 
1522  $this->tpl->setContent($tpl->get());
1523  }
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__fillSubelements(ilTemplate $tpl)
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listLifecycle()

ilMDEditorGUI::listLifecycle ( )

Definition at line 2040 of file class.ilMDEditorGUI.php.

References __fillSubelements(), __setTabs(), __showLanguageSelect(), ilMDUtilSelect\_getRoleSelect(), ilMDUtilSelect\_getStatusSelect(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

2040  : bool
2041  {
2042  $this->__setTabs('meta_lifecycle');
2043  $tpl = new ilTemplate('tpl.md_lifecycle.html', true, true, 'Services/MetaData');
2044 
2045  $this->ctrl->setParameter($this, "section", "meta_lifecycle");
2046  if (!is_object($this->md_section = $this->md_obj->getLifecycle())) {
2047  $tpl->setCurrentBlock("no_lifecycle");
2048  $tpl->setVariable("TXT_NO_LIFECYCLE", $this->lng->txt("meta_no_lifecycle"));
2049  $tpl->setVariable("TXT_ADD_LIFECYCLE", $this->lng->txt("meta_add"));
2050  $tpl->setVariable("ACTION_ADD_LIFECYCLE", $this->ctrl->getLinkTarget($this, "addSection"));
2052 
2053  $this->tpl->setContent($tpl->get());
2054 
2055  return true;
2056  }
2057  $this->ctrl->setReturn($this, 'listLifecycle');
2058  $this->ctrl->setParameter($this, "meta_index", $this->md_section->getMetaId());
2059 
2060  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
2061  $tpl->setVariable("TXT_LIFECYCLE", $this->lng->txt('meta_lifecycle'));
2062 
2063  // Delete link
2064  $tpl->setVariable(
2065  "ACTION_DELETE",
2066  $this->ctrl->getLinkTarget($this, "deleteSection")
2067  );
2068  $tpl->setVariable("TXT_DELETE", $this->lng->txt('delete'));
2069 
2070  // New element
2071  $this->__fillSubelements($tpl);
2072 
2073  // Status
2074  $tpl->setVariable("TXT_STATUS", $this->lng->txt('meta_status'));
2076  $this->md_section->getStatus(),
2077  "lif_status",
2078  array(0 => $this->lng->txt('meta_please_select'))
2079  ));
2080  // Version
2081  $tpl->setVariable("TXT_VERSION", $this->lng->txt('meta_version'));
2082  $tpl->setVariable(
2083  "VAL_VERSION",
2084  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getVersion())
2085  );
2086 
2087  $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt('meta_language'));
2088  $tpl->setVariable("VAL_VERSION_LANGUAGE", $this->__showLanguageSelect(
2089  'lif_language',
2090  $this->md_section->getVersionLanguageCode()
2091  ));
2092 
2093  // Contributes
2094  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
2095  $md_con = $this->md_section->getContribute($con_id);
2096 
2097  if (count($ids) > 1) {
2098  $this->ctrl->setParameter($this, 'meta_index', $con_id);
2099  $this->ctrl->setParameter($this, 'meta_path', 'meta_contribute');
2100 
2101  $tpl->setCurrentBlock("contribute_delete");
2102  $tpl->setVariable(
2103  "CONTRIBUTE_LOOP_ACTION_DELETE",
2104  $this->ctrl->getLinkTarget($this, 'deleteElement')
2105  );
2106  $tpl->setVariable("CONTRIBUTE_LOOP_TXT_DELETE", $this->lng->txt('delete'));
2108  }
2109  // Entities
2110  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
2111  $md_ent = $md_con->getEntity($ent_id);
2112 
2113  $this->ctrl->setParameter($this, 'meta_path', 'meta_entity');
2114 
2115  if (count($ent_ids) > 1) {
2116  $tpl->setCurrentBlock("contribute_entity_delete");
2117 
2118  $this->ctrl->setParameter($this, 'meta_index', $ent_id);
2119  $tpl->setVariable(
2120  "CONTRIBUTE_ENTITY_LOOP_ACTION_DELETE",
2121  $this->ctrl->getLinkTarget($this, 'deleteElement')
2122  );
2123  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_DELETE", $this->lng->txt('delete'));
2125  }
2126 
2127  $tpl->setCurrentBlock("contribute_entity_loop");
2128 
2129  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_CONTRIBUTE_NO", $con_id);
2130  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_NO", $ent_id);
2131  $tpl->setVariable(
2132  "CONTRIBUTE_ENTITY_LOOP_VAL_ENTITY",
2133  ilLegacyFormElementsUtil::prepareFormOutput($md_ent->getEntity())
2134  );
2135  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_ENTITY", $this->lng->txt('meta_entity'));
2137  }
2138  $tpl->setCurrentBlock("contribute_loop");
2139 
2140  $this->ctrl->setParameter($this, 'section_element', 'meta_entity');
2141  $this->ctrl->setParameter($this, 'meta_index', $con_id);
2142  $tpl->setVariable(
2143  "CONTRIBUTE_ENTITY_LOOP_ACTION_ADD",
2144  $this->ctrl->getLinkTarget($this, 'addSectionElement')
2145  );
2146  $tpl->setVariable(
2147  "CONTRIBUTE_ENTITY_LOOP_TXT_ADD",
2148  $this->lng->txt('add') . " " . $this->lng->txt('meta_entity')
2149  );
2150 
2151  $tpl->setVariable("CONTRIBUTE_LOOP_ROWSPAN", 2 + count($ent_ids));
2152  $tpl->setVariable("CONTRIBUTE_LOOP_TXT_CONTRIBUTE", $this->lng->txt('meta_contribute'));
2153  $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ROLE", $this->lng->txt('meta_role'));
2154  $tpl->setVariable("SEL_CONTRIBUTE_ROLE", ilMDUtilSelect::_getRoleSelect(
2155  $md_con->getRole(),
2156  "met_contribute[" . $con_id . "][Role]",
2157  array(0 => $this->lng->txt('meta_please_select'))
2158  ));
2159  $tpl->setVariable("CONTRIBUTE_LOOP_TXT_DATE", $this->lng->txt('meta_date'));
2160  $tpl->setVariable("CONTRIBUTE_LOOP_NO", $con_id);
2161  $tpl->setVariable(
2162  "CONTRIBUTE_LOOP_VAL_DATE",
2164  );
2165 
2167  }
2168  $tpl->setVariable("TXT_SAVE", $this->lng->txt('save'));
2169 
2170  $this->tpl->setContent($tpl->get());
2171 
2172  return true;
2173  }
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__fillSubelements(ilTemplate $tpl)
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
static _getStatusSelect(string $a_selected, string $a_name, array $prepend=array(), bool $a_options_only=false)
Prepare a meta lifecycle status selector.
ilGlobalTemplateInterface $tpl
static _getRoleSelect(string $a_selected, string $a_name, array $prepend=array(), bool $a_options_only=false)
Prepare a meta lifecycle status selector.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listMetaMetaData()

ilMDEditorGUI::listMetaMetaData ( )

Definition at line 2253 of file class.ilMDEditorGUI.php.

References $id, __fillSubelements(), __setTabs(), __showLanguageSelect(), ilMDUtilSelect\_getRoleSelect(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

2253  : bool
2254  {
2255  $this->__setTabs('meta_meta_metadata');
2256  $tpl = new ilTemplate('tpl.md_meta_metadata.html', true, true, 'Services/MetaData');
2257 
2258  $this->ctrl->setParameter($this, "section", "meta_meta_metadata");
2259  if (!is_object($this->md_section = $this->md_obj->getMetaMetadata())) {
2260  $tpl->setCurrentBlock("no_meta_meta");
2261  $tpl->setVariable("TXT_NO_META_META", $this->lng->txt("meta_no_meta_metadata"));
2262  $tpl->setVariable("TXT_ADD_META_META", $this->lng->txt("meta_add"));
2263  $tpl->setVariable("ACTION_ADD_META_META", $this->ctrl->getLinkTarget($this, "addSection"));
2265 
2266  $this->tpl->setContent($tpl->get());
2267 
2268  return true;
2269  }
2270  $this->ctrl->setReturn($this, 'listMetaMetaData');
2271  $this->ctrl->setParameter($this, "meta_index", $this->md_section->getMetaId());
2272 
2273  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
2274  $tpl->setVariable("TXT_META_METADATA", $this->lng->txt('meta_meta_metadata'));
2275 
2276  // Delete link
2277  $tpl->setVariable(
2278  "ACTION_DELETE",
2279  $this->ctrl->getLinkTarget($this, "deleteSection")
2280  );
2281  $tpl->setVariable("TXT_DELETE", $this->lng->txt('delete'));
2282 
2283  // New element
2284  $this->__fillSubelements($tpl);
2285 
2286  $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt('meta_language'));
2287 
2288  $tpl->setVariable(
2289  "VAL_LANGUAGE",
2290  $this->__showLanguageSelect('met_language', $this->md_section->getLanguageCode())
2291  );
2292  $tpl->setVariable("TXT_METADATASCHEME", $this->lng->txt('meta_metadatascheme'));
2293  $tpl->setVariable("VAL_METADATASCHEME", $this->md_section->getMetaDataScheme());
2294 
2295  // Identifier
2296  foreach ($ids = $this->md_section->getIdentifierIds() as $id) {
2297  $md_ide = $this->md_section->getIdentifier($id);
2298 
2299  if (count($ids) > 1) {
2300  $this->ctrl->setParameter($this, 'meta_index', $id);
2301  $this->ctrl->setParameter($this, 'meta_path', 'meta_identifier');
2302 
2303  $tpl->setCurrentBlock("identifier_delete");
2304  $tpl->setVariable(
2305  "IDENTIFIER_LOOP_ACTION_DELETE",
2306  $this->ctrl->getLinkTarget($this, 'deleteElement')
2307  );
2308  $tpl->setVariable("IDENTIFIER_LOOP_TXT_DELETE", $this->lng->txt('delete'));
2310  }
2311 
2312  $tpl->setCurrentBlock("identifier_loop");
2313  $tpl->setVariable("IDENTIFIER_LOOP_NO", $id);
2314  $tpl->setVariable("IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
2315  $tpl->setVariable("IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt("meta_catalog"));
2316  $tpl->setVariable(
2317  "IDENTIFIER_LOOP_VAL_IDENTIFIER_CATALOG",
2318  ilLegacyFormElementsUtil::prepareFormOutput($md_ide->getCatalog())
2319  );
2320  $tpl->setVariable("IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt("meta_entry"));
2321  $tpl->setVariable(
2322  "IDENTIFIER_LOOP_VAL_IDENTIFIER_ENTRY",
2323  ilLegacyFormElementsUtil::prepareFormOutput($md_ide->getEntry())
2324  );
2326  }
2327 
2328  // Contributes
2329  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
2330  $md_con = $this->md_section->getContribute($con_id);
2331 
2332  if (count($ids) > 1) {
2333  $this->ctrl->setParameter($this, 'meta_index', $con_id);
2334  $this->ctrl->setParameter($this, 'meta_path', 'meta_contribute');
2335 
2336  $tpl->setCurrentBlock("contribute_delete");
2337  $tpl->setVariable(
2338  "CONTRIBUTE_LOOP_ACTION_DELETE",
2339  $this->ctrl->getLinkTarget($this, 'deleteElement')
2340  );
2341  $tpl->setVariable("CONTRIBUTE_LOOP_TXT_DELETE", $this->lng->txt('delete'));
2343  }
2344  // Entities
2345  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
2346  $md_ent = $md_con->getEntity($ent_id);
2347 
2348  $this->ctrl->setParameter($this, 'meta_path', 'meta_entity');
2349 
2350  if (count($ent_ids) > 1) {
2351  $tpl->setCurrentBlock("contribute_entity_delete");
2352 
2353  $this->ctrl->setParameter($this, 'meta_index', $ent_id);
2354  $tpl->setVariable(
2355  "CONTRIBUTE_ENTITY_LOOP_ACTION_DELETE",
2356  $this->ctrl->getLinkTarget($this, 'deleteElement')
2357  );
2358  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_DELETE", $this->lng->txt('delete'));
2360  }
2361 
2362  $tpl->setCurrentBlock("contribute_entity_loop");
2363 
2364  $this->ctrl->setParameter($this, 'section_element', 'meta_entity');
2365  $this->ctrl->setParameter($this, 'meta_index', $con_id);
2366  $tpl->setVariable(
2367  "CONTRIBUTE_ENTITY_LOOP_ACTION_ADD",
2368  $this->ctrl->getLinkTarget($this, 'addSectionElement')
2369  );
2370  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_ADD", $this->lng->txt('add'));
2371 
2372  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_CONTRIBUTE_NO", $con_id);
2373  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_NO", $ent_id);
2374  $tpl->setVariable(
2375  "CONTRIBUTE_ENTITY_LOOP_VAL_ENTITY",
2376  ilLegacyFormElementsUtil::prepareFormOutput($md_ent->getEntity())
2377  );
2378  $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_ENTITY", $this->lng->txt('meta_entity'));
2380  }
2381  $tpl->setCurrentBlock("contribute_loop");
2382  $tpl->setVariable("CONTRIBUTE_LOOP_ROWSPAN", 2 + count($ent_ids));
2383  $tpl->setVariable("CONTRIBUTE_LOOP_TXT_CONTRIBUTE", $this->lng->txt('meta_contribute'));
2384  $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ROLE", $this->lng->txt('meta_role'));
2385  $tpl->setVariable("SEL_CONTRIBUTE_ROLE", ilMDUtilSelect::_getRoleSelect(
2386  $md_con->getRole(),
2387  "met_contribute[" . $con_id . "][Role]",
2388  array(0 => $this->lng->txt('meta_please_select'))
2389  ));
2390  $tpl->setVariable("CONTRIBUTE_LOOP_TXT_DATE", $this->lng->txt('meta_date'));
2391  $tpl->setVariable("CONTRIBUTE_LOOP_NO", $con_id);
2392  $tpl->setVariable(
2393  "CONTRIBUTE_LOOP_VAL_DATE",
2395  );
2396 
2398  }
2399  $tpl->setVariable("TXT_SAVE", $this->lng->txt('save'));
2400 
2401  $this->tpl->setContent($tpl->get());
2402 
2403  return true;
2404  }
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__fillSubelements(ilTemplate $tpl)
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
ilGlobalTemplateInterface $tpl
static _getRoleSelect(string $a_selected, string $a_name, array $prepend=array(), bool $a_options_only=false)
Prepare a meta lifecycle status selector.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listQuickEdit()

ilMDEditorGUI::listQuickEdit ( ilPropertyFormGUI  $form = null)

Definition at line 434 of file class.ilMDEditorGUI.php.

References __setTabs(), getChangeCopyrightModal(), ilPropertyFormGUI\getHTML(), and initQuickEditForm().

Referenced by listSection(), and updateQuickEdit().

434  : void
435  {
436  if (!is_object($this->md_section = $this->md_obj->getGeneral())) {
437  $this->md_section = $this->md_obj->addGeneral();
438  $this->md_section->save();
439  }
440 
441  $this->__setTabs('meta_quickedit');
442 
443  $interruptive_modal = $this->getChangeCopyrightModal();
444  $interruptive_signal = null;
445  $modal_content = '';
446  if ($interruptive_modal !== null) {
447  $interruptive_signal = $interruptive_modal->getShowSignal();
448  $modal_content = $this->ui_renderer->render($interruptive_modal);
449  }
450  if (!$form instanceof ilPropertyFormGUI) {
451  $form = $this->initQuickEditForm($interruptive_signal);
452  }
453 
454  $this->tpl->setContent(
455  $modal_content . $form->getHTML()
456  );
457  }
__setTabs(string $a_active)
initQuickEditForm(?Signal $a_signal_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listQuickEdit_scorm()

ilMDEditorGUI::listQuickEdit_scorm ( )
Deprecated:
with release 5_3

Definition at line 160 of file class.ilMDEditorGUI.php.

References $id, $lang, $valid, __buildDaysSelect(), __buildMonthsSelect(), __setTabs(), __showLanguageSelect(), ilMDUtilSelect\_getStatusSelect(), ilMDUtils\_LOMDurationToArray(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\makeTimeSelect(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

160  : void
161  {
162  if (!is_object($this->md_section = $this->md_obj->getGeneral())) {
163  $this->md_section = $this->md_obj->addGeneral();
164  $this->md_section->save();
165  }
166 
167  $this->__setTabs('meta_quickedit');
168 
169  $tpl = new ilTemplate('tpl.md_quick_edit_scorm.html', true, true, 'Services/MetaData');
170 
171  $this->ctrl->setReturn($this, 'listGeneral');
172  $this->ctrl->setParameter($this, 'section', 'meta_general');
173  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
174 
175  $tpl->setVariable("TXT_QUICK_EDIT", $this->lng->txt("meta_quickedit"));
176  $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
177  $tpl->setVariable("TXT_KEYWORD", $this->lng->txt("meta_keyword"));
178  $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
179  $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
180 
181  // Language
182  $first = true;
183  foreach ($ids = $this->md_section->getLanguageIds() as $id) {
184  $md_lan = $this->md_section->getLanguage($id);
185 
186  if ($first) {
187  $tpl->setCurrentBlock("language_head");
188  $tpl->setVariable("ROWSPAN_LANG", count($ids));
189  $tpl->setVariable("LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
191  $first = false;
192  }
193 
194  if (count($ids) > 1) {
195  $this->ctrl->setParameter($this, 'meta_index', $id);
196  $this->ctrl->setParameter($this, 'meta_path', 'meta_language');
197 
198  $tpl->setCurrentBlock("language_delete");
199  $tpl->setVariable(
200  "LANGUAGE_LOOP_ACTION_DELETE",
201  $this->ctrl->getLinkTarget($this, 'deleteElement')
202  );
203  $tpl->setVariable("LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
205  }
206  $tpl->setCurrentBlock("language_loop");
207  $tpl->setVariable("LANGUAGE_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
208  'gen_language[' . $id . '][language]',
209  $md_lan->getLanguageCode()
210  ));
212  }
213 
214  if ($first) {
215  $tpl->setCurrentBlock("language_head");
216  $tpl->setVariable("ROWSPAN_LANG", 1);
217  $tpl->setVariable("LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
219  $tpl->setCurrentBlock("language_loop");
220  $tpl->setVariable("LANGUAGE_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
221  'gen_language[][language]',
222  ""
223  ));
225  }
226 
227  // TITLE
228  $tpl->setVariable("TXT_TITLE", $this->lng->txt('title'));
229  $tpl->setVariable(
230  "VAL_TITLE",
231  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getTitle())
232  );
233  $tpl->setVariable("VAL_TITLE_LANGUAGE", $this->__showLanguageSelect(
234  'gen_title_language',
235  $this->md_section->getTitleLanguageCode()
236  ));
237 
238  // DESCRIPTION
239  foreach ($ids = $this->md_section->getDescriptionIds() as $id) {
240  $md_des = $this->md_section->getDescription($id);
241 
242  if (count($ids) > 1) {
243  $this->ctrl->setParameter($this, 'meta_index', $id);
244  $this->ctrl->setParameter($this, 'meta_path', 'meta_description');
245 
246  $tpl->setCurrentBlock("description_delete");
247  $tpl->setVariable(
248  "DESCRIPTION_LOOP_ACTION_DELETE",
249  $this->ctrl->getLinkTarget($this, 'deleteElement')
250  );
251  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
253  }
254 
255  $tpl->setCurrentBlock("description_loop");
256  $tpl->setVariable("DESCRIPTION_LOOP_NO", $id);
257  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
258  $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
259  $tpl->setVariable(
260  "DESCRIPTION_LOOP_VAL",
261  ilLegacyFormElementsUtil::prepareFormOutput($md_des->getDescription())
262  );
263  $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
264  $tpl->setVariable("DESCRIPTION_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
265  "gen_description[" . $id . '][language]',
266  $md_des->getDescriptionLanguageCode()
267  ));
269  }
270 
271  // KEYWORD
272  $first = true;
273  $keywords = array();
274  foreach ($ids = $this->md_section->getKeywordIds() as $id) {
275  $md_key = $this->md_section->getKeyword($id);
276  $keywords[$md_key->getKeywordLanguageCode()][]
277  = $md_key->getKeyword();
278  }
279 
280  $lang = '';
281  foreach ($keywords as $lang => $keyword_set) {
282  if ($first) {
283  $tpl->setCurrentBlock("keyword_head");
284  $tpl->setVariable("ROWSPAN_KEYWORD", count($keywords));
285  $tpl->setVariable("TXT_COMMA_SEP2", $this->lng->txt('comma_separated'));
286  $tpl->setVariable("KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt("keywords"));
288  $first = false;
289  }
290 
291  $tpl->setCurrentBlock("keyword_loop");
292  $tpl->setVariable(
293  "KEYWORD_LOOP_VAL",
295  implode(", ", $keyword_set)
296  )
297  );
298  $tpl->setVariable("LANG", $lang);
299  $tpl->setVariable("KEYWORD_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
300  "keyword[language][$lang]",
301  $lang
302  ));
304  }
305 
306  if ($keywords === []) {
307  $tpl->setCurrentBlock("keyword_head");
308  $tpl->setVariable("ROWSPAN_KEYWORD", 1);
309  $tpl->setVariable("TXT_COMMA_SEP2", $this->lng->txt('comma_separated'));
310  $tpl->setVariable("KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt("keywords"));
312  $tpl->setCurrentBlock("keyword_loop");
313  $tpl->setVariable("KEYWORD_LOOP_VAL_LANGUAGE", $this->__showLanguageSelect(
314  "keyword[language][$lang]",
315  $lang
316  ));
317  }
318 
319  // Lifecycle...
320  // experts
321  $tpl->setVariable("TXT_EXPERTS", $this->lng->txt('meta_subjectmatterexpert'));
322  $tpl->setVariable("TXT_COMMA_SEP", $this->lng->txt('comma_separated'));
323  $tpl->setVariable("TXT_SCOPROP_EXPERT", $this->lng->txt('sco_propagate'));
324  if (is_object($this->md_section = $this->md_obj->getLifecycle())) {
325  $sep = $ent_str = "";
326  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
327  $md_con = $this->md_section->getContribute($con_id);
328  if ($md_con->getRole() === "SubjectMatterExpert") {
329  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
330  $md_ent = $md_con->getEntity($ent_id);
331  $ent_str .= $sep . $md_ent->getEntity();
332  $sep = ", ";
333  }
334  }
335  }
337  }
338  // InstructionalDesigner
339  $tpl->setVariable("TXT_DESIGNERS", $this->lng->txt('meta_instructionaldesigner'));
340  $tpl->setVariable("TXT_SCOPROP_DESIGNERS", $this->lng->txt('sco_propagate'));
341  if (is_object($this->md_section = $this->md_obj->getLifecycle())) {
342  $sep = $ent_str = "";
343  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
344  $md_con = $this->md_section->getContribute($con_id);
345  if ($md_con->getRole() === "InstructionalDesigner") {
346  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
347  $md_ent = $md_con->getEntity($ent_id);
348  $ent_str .= $sep . $md_ent->getEntity();
349  $sep = ", ";
350  }
351  }
352  }
353  $tpl->setVariable("DESIGNERS_VAL", ilLegacyFormElementsUtil::prepareFormOutput($ent_str));
354  }
355  // Point of Contact
356  $tpl->setVariable("TXT_POC", $this->lng->txt('meta_pointofcontact'));
357  $tpl->setVariable("TXT_SCOPROP_POC", $this->lng->txt('sco_propagate'));
358  if (is_object($this->md_section = $this->md_obj->getLifecycle())) {
359  $sep = $ent_str = "";
360  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
361  $md_con = $this->md_section->getContribute($con_id);
362  if ($md_con->getRole() === "PointOfContact") {
363  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
364  $md_ent = $md_con->getEntity($ent_id);
365  $ent_str .= $sep . $md_ent->getEntity();
366  $sep = ", ";
367  }
368  }
369  }
371  }
372 
373  $tpl->setVariable("TXT_STATUS", $this->lng->txt('meta_status'));
374  if (!is_object($this->md_section = $this->md_obj->getLifecycle())) {
375  $this->md_section = $this->md_obj->addLifecycle();
376  $this->md_section->save();
377  }
378  if (is_object($this->md_section = $this->md_obj->getLifecycle())) {
380  $this->md_section->getStatus(),
381  "lif_status",
382  array(0 => $this->lng->txt('meta_please_select'))
383  ));
384  }
385 
386  // Rights...
387  // Copyright
388  // smeyer 2018-09-14 not supported
389 
390  $tlt = array(0, 0, 0, 0, 0);
391  $valid = true;
392  if (is_object($this->md_section = $this->md_obj->getEducational())) {
393  if (!$tlt = ilMDUtils::_LOMDurationToArray($this->md_section->getTypicalLearningTime())) {
394  if ($this->md_section->getTypicalLearningTime() !== '') {
395  $tlt = array(0, 0, 0, 0, 0);
396  $valid = false;
397  }
398  }
399  }
400  $tpl->setVariable("TXT_MONTH", $this->lng->txt('md_months'));
401  $tpl->setVariable("SEL_MONTHS", $this->__buildMonthsSelect((string) ($tlt[0] ?? '')));
402  $tpl->setVariable("SEL_DAYS", $this->__buildDaysSelect((string) ($tlt[1] ?? '')));
403 
404  $tpl->setVariable("TXT_DAYS", $this->lng->txt('md_days'));
405  $tpl->setVariable("TXT_TIME", $this->lng->txt('md_time'));
406 
407  $tpl->setVariable("TXT_TYPICAL_LEARN_TIME", $this->lng->txt('meta_typical_learning_time'));
408  $tpl->setVariable(
409  "SEL_TLT",
411  'tlt',
412  !($tlt[4] ?? false),
413  $tlt[2] ?? 0,
414  $tlt[3] ?? 0,
415  $tlt[4] ?? 0,
416  false
417  )
418  );
419  $tpl->setVariable("TLT_HINT", ($tlt[4] ?? null) ? '(hh:mm:ss)' : '(hh:mm)');
420 
421  if (!$valid) {
422  $tpl->setCurrentBlock("tlt_not_valid");
423  $tpl->setVariable("TXT_CURRENT_VAL", $this->lng->txt('meta_current_value'));
424  $tpl->setVariable("TLT", $this->md_section->getTypicalLearningTime());
425  $tpl->setVariable("INFO_TLT_NOT_VALID", $this->lng->txt('meta_info_tlt_not_valid'));
427  }
428 
429  $tpl->setVariable("TXT_SAVE", $this->lng->txt('save'));
430 
431  $this->tpl->setContent($tpl->get());
432  }
static _LOMDurationToArray(string $a_string)
LOM datatype duration is a string like P2M4DT7H18M2S (2 months 4 days 7 hours 18 minutes 2 seconds) T...
__buildDaysSelect(string $sel_day)
$valid
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
static _getStatusSelect(string $a_selected, string $a_name, array $prepend=array(), bool $a_options_only=false)
Prepare a meta lifecycle status selector.
ilGlobalTemplateInterface $tpl
__buildMonthsSelect(string $sel_month)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
$lang
Definition: xapiexit.php:26
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
static makeTimeSelect(string $prefix, bool $short=true, int $hour=0, int $minute=0, int $second=0, bool $a_use_default=true, array $a_further_options=[])
Creates a combination of HTML selects for time inputs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listQuickEditCopyright()

ilMDEditorGUI::listQuickEditCopyright ( ilPropertyFormGUI  $form)
protected

Definition at line 602 of file class.ilMDEditorGUI.php.

References ilMDCopyrightSelectionEntry\_extractEntryId(), ilMDCopyrightSelectionEntry\_getEntries(), ilMDSettings\_getInstance(), ilMDRights\_lookupDescription(), ilPropertyFormGUI\addItem(), ilMDCopyrightSelectionEntry\getDefault(), ilOerHarvesterSettings\getInstance(), ILIAS\Repository\lng(), ilFormPropertyGUI\setInfo(), ilRadioOption\setTitle(), ilRadioGroupInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by initQuickEditForm().

602  : bool
603  {
605  $oer_settings = ilOerHarvesterSettings::getInstance();
606 
608  $description = ilMDRights::_lookupDescription(
609  $this->md_obj->getRBACId(),
610  $this->md_obj->getObjId()
611  );
612 
613  //current id can be 0 for non predefined copyright.
614  //Todo add new DB column with copyright id instead of parse descriptions to get entry ID.
615  if ($description) {
616  $current_id = ilMDCopyrightSelectionEntry::_extractEntryId($description);
617  } else {
619  }
620 
621  if (
622  !$this->md_settings->isCopyrightSelectionActive() ||
623  !count($cp_entries)
624  ) {
625  return true;
626  }
627 
628  $copyright = new ilRadioGroupInputGUI($this->lng->txt('meta_copyright'), 'copyright');
629  $copyright->setValue((string) $current_id);
630 
631  foreach ($cp_entries as $copyright_entry) {
632  $radio_entry = new ilRadioOption(
633  $copyright_entry->getTitle(),
634  (string) $copyright_entry->getEntryId(),
635  $copyright_entry->getDescription()
636  );
637 
638  if ($copyright_entry->getOutdated()) {
639  $radio_entry->setTitle("(" . $this->lng->txt('meta_copyright_outdated') . ") " . $radio_entry->getTitle());
640  $radio_entry->setDisabled(true);
641  }
642 
643  if (
644  $oer_settings->supportsHarvesting($this->md_obj->getObjType()) &&
645  $oer_settings->isActiveCopyrightTemplate($copyright_entry->getEntryId())
646  ) {
647  // block harvesting
648  $blocked = new ilCheckboxInputGUI(
649  $this->lng->txt('meta_oer_blocked'),
650  'copyright_oer_blocked_' . $copyright_entry->getEntryId()
651  );
652  $blocked->setInfo($this->lng->txt('meta_oer_blocked_info'));
653  $blocked->setValue('1');
654  $status = new ilOerHarvesterObjectStatus($this->md_obj->getRBACId());
655  if ($status->isBlocked()) {
656  $blocked->setChecked(true);
657  }
658  $radio_entry->addSubItem($blocked);
659  }
660 
661  $copyright->addOption($radio_entry);
662  }
663 
664  // add own selection
665  $own_selection = new ilRadioOption(
666  $this->lng->txt('meta_cp_own'),
667  'copyright_text'
668  );
669  $own_selection->setValue('0');
670 
671  // copyright text
672  $own_copyright = new ilTextAreaInputGUI(
673  '',
674  'copyright_text'
675  );
676  if ($current_id === 0) {
677  $own_copyright->setValue($description);
678  }
679  $own_selection->addSubItem($own_copyright);
680  $copyright->addOption($own_selection);
681  $form->addItem($copyright);
682  return true;
683  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a checkbox property in a property form.
static _lookupDescription(int $a_rbac_id, int $a_obj_id)
This class represents a property in a property form.
ilMDSettings $md_settings
setValue(string $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
setTitle(string $a_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listRelation()

ilMDEditorGUI::listRelation ( )

Definition at line 2923 of file class.ilMDEditorGUI.php.

References __setTabs(), __showLanguageSelect(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

2923  : void
2924  {
2925  $this->__setTabs('meta_relation');
2926  $tpl = new ilTemplate('tpl.md_relation.html', true, true, 'Services/MetaData');
2927 
2928  $rel_ids = $this->md_obj->getRelationIds();
2929  if ($rel_ids === []) {
2930  $tpl->setCurrentBlock("no_relation");
2931  $tpl->setVariable("TXT_NO_RELATION", $this->lng->txt("meta_no_relation"));
2932  $tpl->setVariable("TXT_ADD_RELATION", $this->lng->txt("meta_add"));
2933  $this->ctrl->setParameter($this, "section", "meta_relation");
2934  $tpl->setVariable(
2935  "ACTION_ADD_RELATION",
2936  $this->ctrl->getLinkTarget($this, "addSection")
2937  );
2939  } else {
2940  foreach ($rel_ids as $rel_id) {
2941  $this->md_section = $this->md_obj->getRelation($rel_id);
2942 
2943  $this->ctrl->setParameter($this, 'meta_index', $rel_id);
2944  $this->ctrl->setParameter($this, "section", "meta_relation");
2945 
2946  /* Identifier_ */
2947  $res_ids = $this->md_section->getIdentifier_Ids();
2948  foreach ($res_ids as $res_id) {
2949  $ident = $this->md_section->getIdentifier_($res_id);
2950  $this->ctrl->setParameter($this, "meta_index", $res_id);
2951 
2952  if (count($res_ids) > 1) {
2953  $tpl->setCurrentBlock("identifier_delete");
2954  $this->ctrl->setParameter($this, "meta_path", "relation_resource_identifier");
2955  $tpl->setVariable(
2956  "IDENTIFIER_LOOP_ACTION_DELETE",
2957  $this->ctrl->getLinkTarget($this, "deleteElement")
2958  );
2959  $tpl->setVariable("IDENTIFIER_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
2961  }
2962 
2963  $tpl->setCurrentBlock("identifier_loop");
2964 
2965  $tpl->setVariable("IDENTIFIER_LOOP_NO", $res_id);
2966  $tpl->setVariable("IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
2967  $this->ctrl->setParameter($this, 'meta_index', $rel_id);
2968  $this->ctrl->setParameter($this, "section_element", "relation_resource_identifier");
2969  $tpl->setVariable(
2970  "IDENTIFIER_LOOP_ACTION_ADD",
2971  $this->ctrl->getLinkTarget($this, "addSectionElement")
2972  );
2973  $tpl->setVariable("IDENTIFIER_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
2974  $tpl->setVariable("IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt("meta_entry"));
2975  $tpl->setVariable("IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt("meta_catalog"));
2976  $tpl->setVariable(
2977  "IDENTIFIER_LOOP_VAL_CATALOG",
2978  ilLegacyFormElementsUtil::prepareFormOutput($ident->getCatalog())
2979  );
2980  $tpl->setVariable(
2981  "IDENTIFIER_LOOP_VAL_ENTRY",
2983  );
2985  }
2986 
2987  /* Description */
2988  $res_dess = $this->md_section->getDescriptionIds();
2989  foreach ($res_dess as $res_des) {
2990  $des = $this->md_section->getDescription($res_des);
2991  $this->ctrl->setParameter($this, "meta_index", $res_des);
2992 
2993  if (count($res_dess) > 1) {
2994  $tpl->setCurrentBlock("description_delete");
2995  $this->ctrl->setParameter($this, "meta_path", "relation_resource_description");
2996  $tpl->setVariable(
2997  "DESCRIPTION_LOOP_ACTION_DELETE",
2998  $this->ctrl->getLinkTarget($this, "deleteElement")
2999  );
3000  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
3002  }
3003 
3004  $tpl->setCurrentBlock("description_loop");
3005  $tpl->setVariable("DESCRIPTION_LOOP_NO", $res_des);
3006  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
3007  $this->ctrl->setParameter($this, 'meta_index', $rel_id);
3008  $this->ctrl->setParameter($this, "section_element", "relation_resource_description");
3009  $tpl->setVariable(
3010  "DESCRIPTION_LOOP_ACTION_ADD",
3011  $this->ctrl->getLinkTarget($this, "addSectionElement")
3012  );
3013  $tpl->setVariable("DESCRIPTION_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
3014  $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
3015  $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
3016  $tpl->setVariable(
3017  "DESCRIPTION_LOOP_VAL",
3018  ilLegacyFormElementsUtil::prepareFormOutput($des->getDescription())
3019  );
3020  $tpl->setVariable(
3021  "DESCRIPTION_LOOP_VAL_LANGUAGE",
3022  $this->__showLanguageSelect(
3023  'relation[Resource][Description][' . $res_des . '][Language]',
3024  $des->getDescriptionLanguageCode()
3025  )
3026  );
3028  }
3029 
3030  $tpl->setCurrentBlock("relation_loop");
3031  $tpl->setVariable("REL_ID", $rel_id);
3032  $tpl->setVariable("TXT_RELATION", $this->lng->txt("meta_relation"));
3033  $this->ctrl->setParameter($this, "meta_index", $this->md_section->getMetaId());
3034  $tpl->setVariable(
3035  "ACTION_DELETE",
3036  $this->ctrl->getLinkTarget($this, "deleteSection")
3037  );
3038  $this->ctrl->setParameter($this, "section", "meta_relation");
3039  $tpl->setVariable(
3040  "ACTION_ADD",
3041  $this->ctrl->getLinkTarget($this, "addSection")
3042  );
3043  $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
3044  $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
3045  $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
3046  $tpl->setVariable("TXT_KIND", $this->lng->txt("meta_kind"));
3047  $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
3048  $tpl->setVariable("TXT_ISPARTOF", $this->lng->txt("meta_is_part_of"));
3049  $tpl->setVariable("TXT_HASPART", $this->lng->txt("meta_has_part"));
3050  $tpl->setVariable("TXT_ISVERSIONOF", $this->lng->txt("meta_is_version_of"));
3051  $tpl->setVariable("TXT_HASVERSION", $this->lng->txt("meta_has_version"));
3052  $tpl->setVariable("TXT_ISFORMATOF", $this->lng->txt("meta_is_format_of"));
3053  $tpl->setVariable("TXT_HASFORMAT", $this->lng->txt("meta_has_format"));
3054  $tpl->setVariable("TXT_REFERENCES", $this->lng->txt("meta_references"));
3055  $tpl->setVariable("TXT_ISREFERENCEDBY", $this->lng->txt("meta_is_referenced_by"));
3056  $tpl->setVariable("TXT_ISBASEDON", $this->lng->txt("meta_is_based_on"));
3057  $tpl->setVariable("TXT_ISBASISFOR", $this->lng->txt("meta_is_basis_for"));
3058  $tpl->setVariable("TXT_REQUIRES", $this->lng->txt("meta_requires"));
3059  $tpl->setVariable("TXT_ISREQUIREDBY", $this->lng->txt("meta_is_required_by"));
3060  $tpl->setVariable("TXT_RESOURCE", $this->lng->txt("meta_resource"));
3061  $tpl->setVariable("VAL_KIND_" . strtoupper($this->md_section->getKind()), " selected");
3063  }
3064 
3065  $tpl->setCurrentBlock("relation");
3066  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
3067  $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
3069  }
3070 
3071  $this->tpl->setContent($tpl->get());
3072  }
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listRights()

ilMDEditorGUI::listRights ( )

Definition at line 2467 of file class.ilMDEditorGUI.php.

References __setTabs(), __showLanguageSelect(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

2467  : void
2468  {
2469  $this->__setTabs('meta_rights');
2470  $tpl = new ilTemplate('tpl.md_rights.html', true, true, 'Services/MetaData');
2471 
2472  if (!is_object($this->md_section = $this->md_obj->getRights())) {
2473  $tpl->setCurrentBlock("no_rights");
2474  $tpl->setVariable("TXT_NO_RIGHTS", $this->lng->txt("meta_no_rights"));
2475  $tpl->setVariable("TXT_ADD_RIGHTS", $this->lng->txt("meta_add"));
2476  $this->ctrl->setParameter($this, "section", "meta_rights");
2477  $tpl->setVariable(
2478  "ACTION_ADD_RIGHTS",
2479  $this->ctrl->getLinkTarget($this, "addSection")
2480  );
2482  } else {
2483  $this->ctrl->setReturn($this, 'listRights');
2484  $this->ctrl->setParameter($this, 'section', 'meta_rights');
2485  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
2486 
2487  $tpl->setVariable("TXT_RIGHTS", $this->lng->txt("meta_rights"));
2488  $tpl->setVariable("TXT_COST", $this->lng->txt("meta_cost"));
2489  $tpl->setVariable(
2490  "TXT_COPYRIGHTANDOTHERRESTRICTIONS",
2491  $this->lng->txt("meta_copyright_and_other_restrictions")
2492  );
2493  $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
2494  $tpl->setVariable("TXT_YES", $this->lng->txt("meta_yes"));
2495  $tpl->setVariable("TXT_NO", $this->lng->txt("meta_no"));
2496 
2497  $this->ctrl->setParameter($this, "section", "meta_rights");
2498  $this->ctrl->setParameter($this, "meta_index", $this->md_section->getMetaId());
2499  $tpl->setVariable(
2500  "ACTION_DELETE",
2501  $this->ctrl->getLinkTarget($this, "deleteSection")
2502  );
2503 
2504  $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
2505 
2506  $tpl->setVariable("VAL_COST_" . strtoupper($this->md_section->getCosts()), " selected");
2507  $tpl->setVariable("VAL_COPYRIGHTANDOTHERRESTRICTIONS_" .
2508  strtoupper($this->md_section->getCopyrightAndOtherRestrictions()), " selected");
2509 
2510  $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
2511  $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
2512  $tpl->setVariable(
2513  "DESCRIPTION_LOOP_VAL",
2514  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getDescription())
2515  );
2516  $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
2517  $tpl->setVariable(
2518  "DESCRIPTION_LOOP_VAL_LANGUAGE",
2519  $this->__showLanguageSelect(
2520  'rights[DescriptionLanguage]',
2521  $this->md_section->getDescriptionLanguageCode()
2522  )
2523  );
2524 
2525  $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
2526 
2527  $tpl->setCurrentBlock("rights");
2529  }
2530 
2531  $this->tpl->setContent($tpl->get());
2532  }
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listSection()

ilMDEditorGUI::listSection ( )

Definition at line 3748 of file class.ilMDEditorGUI.php.

References debug(), initSectionFromRequest(), listAnnotation(), listClassification(), listEducational(), listGeneral(), listLifecycle(), listMetaMetaData(), listQuickEdit(), listQuickEdit_scorm(), listRelation(), listRights(), and listTechnical().

Referenced by addSection(), addSectionElement(), deleteElement(), deleteSection(), updateAnnotation(), updateClassification(), updateEducational(), updateLifecycle(), updateMetaMetaData(), updateRelation(), updateRights(), and updateTechnical().

3748  : void
3749  {
3750  switch ($this->initSectionFromRequest()) {
3751  case 'meta_general':
3752  $this->listGeneral();
3753  break;
3754 
3755  case 'meta_lifecycle':
3756  $this->listLifecycle();
3757  break;
3758 
3759  case 'meta_technical':
3760  $this->listTechnical();
3761  break;
3762 
3763  case 'meta_meta_metadata':
3764  $this->listMetaMetaData();
3765  break;
3766 
3767  case 'debug':
3768  $this->debug();
3769  break;
3770 
3771  case 'meta_rights':
3772  $this->listRights();
3773  break;
3774 
3775  case 'meta_educational':
3776  $this->listEducational();
3777  break;
3778 
3779  case 'meta_relation':
3780  $this->listRelation();
3781  break;
3782 
3783  case 'meta_annotation':
3784  $this->listAnnotation();
3785  break;
3786 
3787  case 'meta_classification':
3788  $this->listClassification();
3789  break;
3790 
3791  default:
3792  if ($this->md_obj->getObjType() === 'sahs' || $this->md_obj->getObjType() === 'sco') {
3793  $this->listQuickEdit_scorm();
3794  break;
3795  } else {
3796  $this->listQuickEdit();
3797  break;
3798  }
3799  }
3800  }
listQuickEdit(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listTechnical()

ilMDEditorGUI::listTechnical ( )

Definition at line 1752 of file class.ilMDEditorGUI.php.

References $id, __fillSubelements(), __setTabs(), __showLanguageSelect(), ilMDUtilSelect\_getBrowserSelect(), ilMDUtilSelect\_getLocationTypeSelect(), ilMDUtilSelect\_getOperatingSystemSelect(), ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by listSection().

1752  : bool
1753  {
1754  $this->__setTabs('meta_technical');
1755  $tpl = new ilTemplate('tpl.md_technical.html', true, true, 'Services/MetaData');
1756 
1757  $this->ctrl->setParameter($this, "section", "meta_technical");
1758  if (!is_object($this->md_section = $this->md_obj->getTechnical())) {
1759  $tpl->setCurrentBlock("no_technical");
1760  $tpl->setVariable("TXT_NO_TECHNICAL", $this->lng->txt("meta_no_technical"));
1761  $tpl->setVariable("TXT_ADD_TECHNICAL", $this->lng->txt("meta_add"));
1762  $tpl->setVariable("ACTION_ADD_TECHNICAL", $this->ctrl->getLinkTarget($this, "addSection"));
1764 
1765  $this->tpl->setContent($tpl->get());
1766 
1767  return true;
1768  }
1769  $this->ctrl->setReturn($this, 'listTechnical');
1770  $this->ctrl->setParameter($this, "meta_index", $this->md_section->getMetaId());
1771 
1772  $tpl->setVariable("EDIT_ACTION", $this->ctrl->getFormAction($this));
1773  $tpl->setVariable("TXT_TECHNICAL", $this->lng->txt('meta_technical'));
1774 
1775  // Delete link
1776  $tpl->setVariable(
1777  "ACTION_DELETE",
1778  $this->ctrl->getLinkTarget($this, "deleteSection")
1779  );
1780  $tpl->setVariable("TXT_DELETE", $this->lng->txt('delete'));
1781 
1782  // New element
1783  $this->__fillSubelements($tpl);
1784 
1785  // Format
1786  foreach ($ids = $this->md_section->getFormatIds() as $id) {
1787  $md_for = $this->md_section->getFormat($id);
1788 
1789  $tpl->setCurrentBlock("format_loop");
1790 
1791  $this->ctrl->setParameter($this, 'meta_index', $id);
1792  $this->ctrl->setParameter($this, 'meta_path', 'meta_format');
1793  $tpl->setVariable("FORMAT_LOOP_ACTION_DELETE", $this->ctrl->getLinkTarget($this, 'deleteElement'));
1794  $tpl->setVariable("FORMAT_LOOP_TXT_DELETE", $this->lng->txt('delete'));
1795 
1796  $tpl->setVariable("FORMAT_LOOP_NO", $id);
1797  $tpl->setVariable("FORMAT_LOOP_TXT_FORMAT", $this->lng->txt('meta_format'));
1798  $tpl->setVariable(
1799  "FORMAT_LOOP_VAL",
1800  ilLegacyFormElementsUtil::prepareFormOutput($md_for->getFormat())
1801  );
1802 
1804  }
1805  // Size
1806  $tpl->setVariable("SIZE_TXT_SIZE", $this->lng->txt('meta_size'));
1807  $tpl->setVariable("SIZE_VAL", ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getSize()));
1808 
1809  // Location
1810  foreach ($ids = $this->md_section->getLocationIds() as $id) {
1811  $md_loc = $this->md_section->getLocation($id);
1812 
1813  $tpl->setCurrentBlock("location_loop");
1814 
1815  $this->ctrl->setParameter($this, 'meta_index', $id);
1816  $this->ctrl->setParameter($this, 'meta_path', 'meta_location');
1817  $tpl->setVariable("LOCATION_LOOP_ACTION_DELETE", $this->ctrl->getLinkTarget($this, 'deleteElement'));
1818  $tpl->setVariable("LOCATION_LOOP_TXT_DELETE", $this->lng->txt('delete'));
1819 
1820  $tpl->setVariable("LOCATION_LOOP_TXT_LOCATION", $this->lng->txt('meta_location'));
1821  $tpl->setVariable("LOCATION_LOOP_NO", $id);
1822  $tpl->setVariable("LOCATION_LOOP_TXT_TYPE", $this->lng->txt('meta_type'));
1823  $tpl->setVariable(
1824  "LOCATION_LOOP_VAL",
1825  ilLegacyFormElementsUtil::prepareFormOutput($md_loc->getLocation())
1826  );
1827 
1828  $tpl->setVariable(
1829  "SEL_LOCATION_TYPE",
1831  $md_loc->getLocationType(),
1832  "met_location[" . $id . "][Type]",
1833  array(0 => $this->lng->txt('meta_please_select'))
1834  )
1835  );
1837  }
1838  // Requirement
1839  foreach ($ids = $this->md_section->getRequirementIds() as $id) {
1840  $md_re = $this->md_section->getRequirement($id);
1841 
1842  $tpl->setCurrentBlock("requirement_loop");
1843 
1844  $this->ctrl->setParameter($this, 'meta_index', $id);
1845  $this->ctrl->setParameter($this, 'meta_path', 'meta_requirement');
1846  $tpl->setVariable(
1847  "REQUIREMENT_LOOP_ACTION_DELETE",
1848  $this->ctrl->getLinkTarget($this, 'deleteElement')
1849  );
1850  $tpl->setVariable("REQUIREMENT_LOOP_TXT_DELETE", $this->lng->txt('delete'));
1851 
1852  $tpl->setVariable("REQUIREMENT_LOOP_TXT_REQUIREMENT", $this->lng->txt('meta_requirement'));
1853  $tpl->setVariable("REQUIREMENT_LOOP_TXT_TYPE", $this->lng->txt('meta_type'));
1854  $tpl->setVariable("REQUIREMENT_LOOP_TXT_OPERATINGSYSTEM", $this->lng->txt('meta_operating_system'));
1855  $tpl->setVariable("REQUIREMENT_LOOP_TXT_BROWSER", $this->lng->txt('meta_browser'));
1856  $tpl->setVariable("REQUIREMENT_LOOP_TXT_NAME", $this->lng->txt('meta_name'));
1857  $tpl->setVariable("REQUIREMENT_LOOP_TXT_MINIMUMVERSION", $this->lng->txt('meta_minimum_version'));
1858  $tpl->setVariable("REQUIREMENT_LOOP_TXT_MAXIMUMVERSION", $this->lng->txt('meta_maximum_version'));
1859 
1860  $tpl->setVariable("REQUIREMENT_LOOP_NO", $id);
1861  $tpl->setVariable(
1862  "REQUIREMENT_SEL_OS_NAME",
1864  $md_re->getOperatingSystemName(),
1865  "met_re[" . $id . "][os][name]",
1866  array(0 => $this->lng->txt('meta_please_select'))
1867  )
1868  );
1869  $tpl->setVariable(
1870  "REQUIREMENT_SEL_BROWSER_NAME",
1872  $md_re->getBrowserName(),
1873  "met_re[" . $id . "][browser][name]",
1874  array(0 => $this->lng->txt('meta_please_select'))
1875  )
1876  );
1877 
1878  $tpl->setVariable(
1879  "REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MINIMUMVERSION",
1880  ilLegacyFormElementsUtil::prepareFormOutput($md_re->getOperatingSystemMinimumVersion())
1881  );
1882 
1883  $tpl->setVariable(
1884  "REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MAXIMUMVERSION",
1885  ilLegacyFormElementsUtil::prepareFormOutput($md_re->getOperatingSystemMaximumVersion())
1886  );
1887 
1888  $tpl->setVariable(
1889  "REQUIREMENT_LOOP_VAL_BROWSER_MINIMUMVERSION",
1890  ilLegacyFormElementsUtil::prepareFormOutput($md_re->getBrowserMinimumVersion())
1891  );
1892 
1893  $tpl->setVariable(
1894  "REQUIREMENT_LOOP_VAL_BROWSER_MAXIMUMVERSION",
1895  ilLegacyFormElementsUtil::prepareFormOutput($md_re->getBrowserMaximumVersion())
1896  );
1898  }
1899  // OrComposite
1900  foreach ($ids = $this->md_section->getOrCompositeIds() as $or_id) {
1901  $md_or = $this->md_section->getOrComposite($or_id);
1902  foreach ($ids = $md_or->getRequirementIds() as $id) {
1903  $md_re = $this->md_section->getRequirement($id);
1904 
1905  $tpl->setCurrentBlock("orrequirement_loop");
1906 
1907  $this->ctrl->setParameter($this, 'meta_index', $id);
1908  $this->ctrl->setParameter($this, 'meta_path', 'meta_requirement');
1909  $tpl->setVariable(
1910  "ORREQUIREMENT_LOOP_ACTION_DELETE",
1911  $this->ctrl->getLinkTarget($this, 'deleteElement')
1912  );
1913  $tpl->setVariable("ORREQUIREMENT_LOOP_TXT_DELETE", $this->lng->txt('delete'));
1914 
1915  $tpl->setVariable("ORREQUIREMENT_LOOP_TXT_REQUIREMENT", $this->lng->txt('meta_requirement'));
1916  $tpl->setVariable("ORREQUIREMENT_LOOP_TXT_TYPE", $this->lng->txt('meta_type'));
1917  $tpl->setVariable(
1918  "ORREQUIREMENT_LOOP_TXT_OPERATINGSYSTEM",
1919  $this->lng->txt('meta_operating_system')
1920  );
1921  $tpl->setVariable("ORREQUIREMENT_LOOP_TXT_BROWSER", $this->lng->txt('meta_browser'));
1922  $tpl->setVariable("ORREQUIREMENT_LOOP_TXT_NAME", $this->lng->txt('meta_name'));
1923  $tpl->setVariable(
1924  "ORREQUIREMENT_LOOP_TXT_MINIMUMVERSION",
1925  $this->lng->txt('meta_minimum_version')
1926  );
1927  $tpl->setVariable(
1928  "ORREQUIREMENT_LOOP_TXT_MAXIMUMVERSION",
1929  $this->lng->txt('meta_maximum_version')
1930  );
1931 
1932  $tpl->setVariable("ORREQUIREMENT_LOOP_NO", $id);
1933  $tpl->setVariable(
1934  "ORREQUIREMENT_SEL_OS_NAME",
1936  $md_re->getOperatingSystemName(),
1937  "met_re[" . $id . "][os][name]",
1938  array(0 => $this->lng->txt('meta_please_select'))
1939  )
1940  );
1941  $tpl->setVariable(
1942  "ORREQUIREMENT_SEL_BROWSER_NAME",
1944  $md_re->getBrowserName(),
1945  "met_re[" . $id . "][browser][name]",
1946  array(0 => $this->lng->txt('meta_please_select'))
1947  )
1948  );
1949 
1950  $tpl->setVariable(
1951  "ORREQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MINIMUMVERSION",
1952  ilLegacyFormElementsUtil::prepareFormOutput($md_re->getOperatingSystemMinimumVersion())
1953  );
1954 
1955  $tpl->setVariable(
1956  "ORREQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MAXIMUMVERSION",
1957  ilLegacyFormElementsUtil::prepareFormOutput($md_re->getOperatingSystemMaximumVersion())
1958  );
1959 
1960  $tpl->setVariable(
1961  "ORREQUIREMENT_LOOP_VAL_BROWSER_MINIMUMVERSION",
1962  ilLegacyFormElementsUtil::prepareFormOutput($md_re->getBrowserMinimumVersion())
1963  );
1964 
1965  $tpl->setVariable(
1966  "ORREQUIREMENT_LOOP_VAL_BROWSER_MAXIMUMVERSION",
1967  ilLegacyFormElementsUtil::prepareFormOutput($md_re->getBrowserMaximumVersion())
1968  );
1970  }
1971  $tpl->setCurrentBlock("orcomposite_loop");
1972 
1973  $this->ctrl->setParameter($this, 'meta_index', $or_id);
1974  $this->ctrl->setParameter($this, 'meta_path', 'meta_or_composite');
1975  $this->ctrl->setParameter($this, 'meta_technical', $this->md_section->getMetaId());
1976  $tpl->setVariable(
1977  "ORCOMPOSITE_LOOP_ACTION_DELETE",
1978  $this->ctrl->getLinkTarget($this, 'deleteElement')
1979  );
1980  $tpl->setVariable("ORCOMPOSITE_LOOP_TXT_DELETE", $this->lng->txt('delete'));
1981 
1982  $tpl->setVariable("ORCOMPOSITE_LOOP_TXT_ORCOMPOSITE", $this->lng->txt('meta_or_composite'));
1984  }
1985 
1986  // InstallationRemarks
1987  $tpl->setVariable(
1988  "INSTALLATIONREMARKS_TXT_INSTALLATIONREMARKS",
1989  $this->lng->txt('meta_installation_remarks')
1990  );
1991  $tpl->setVariable("INSTALLATIONREMARKS_TXT_LANGUAGE", $this->lng->txt('meta_language'));
1992 
1993  $tpl->setVariable(
1994  "INSTALLATIONREMARKS_VAL",
1995  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getInstallationRemarks())
1996  );
1997  $tpl->setVariable(
1998  "INSTALLATIONREMARKS_VAL_LANGUAGE",
1999  $this->__showLanguageSelect(
2000  'inst_language',
2001  $this->md_section->getInstallationRemarksLanguageCode()
2002  )
2003  );
2004 
2005  // Other platform requirement
2006  $tpl->setVariable(
2007  "OTHERPLATTFORMREQUIREMENTS_TXT_OTHERPLATTFORMREQUIREMENTS",
2008  $this->lng->txt('meta_other_plattform_requirements')
2009  );
2010  $tpl->setVariable("OTHERPLATTFORMREQUIREMENTS_TXT_LANGUAGE", $this->lng->txt('meta_language'));
2011 
2012  $tpl->setVariable(
2013  "OTHERPLATTFORMREQUIREMENTS_VAL",
2014  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getOtherPlatformRequirements())
2015  );
2016  $tpl->setVariable(
2017  "OTHERPLATTFORMREQUIREMENTS_VAL_LANGUAGE",
2018  $this->__showLanguageSelect(
2019  'opr_language',
2020  $this->md_section->getOtherPlatformRequirementsLanguageCode()
2021  )
2022  );
2023 
2024  // Duration
2025  $tpl->setVariable("DURATION_TXT_DURATION", $this->lng->txt('meta_duration'));
2026  $tpl->setVariable(
2027  "DURATION_VAL",
2028  ilLegacyFormElementsUtil::prepareFormOutput($this->md_section->getDuration())
2029  );
2030 
2031  $tpl->setCurrentBlock("technical");
2032  $tpl->setVariable("TXT_SAVE", $this->lng->txt('save'));
2034 
2035  $this->tpl->setContent($tpl->get());
2036 
2037  return true;
2038  }
static _getOperatingSystemSelect(string $a_selected, string $a_name, array $prepend=array(), bool $a_options_only=false)
Prepare a meta technical os selector.
static _getBrowserSelect(string $a_selected, string $a_name, array $prepend=array(), bool $a_options_only=false)
Prepare a meta technical browser selector.
__showLanguageSelect(string $a_name, string $a_value="")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__fillSubelements(ilTemplate $tpl)
__setTabs(string $a_active)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static prepareFormOutput($a_str, bool $a_strip=false)
static _getLocationTypeSelect(string $a_selected, string $a_name, array $prepend=array())
Prepare a meta location type.
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAnnotation()

ilMDEditorGUI::updateAnnotation ( )

Definition at line 3194 of file class.ilMDEditorGUI.php.

References $id, callListeners(), ILIAS\FileDelivery\http(), listSection(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

3194  : void
3195  {
3196  $annotation_post = [];
3197  if ($this->http->wrapper()->post()->has('annotation')) {
3198  $annotation_post = $this->http->wrapper()->post()->retrieve(
3199  'annotation',
3200  $this->refinery->identity()
3201  );
3202  }
3203 
3204  // relation
3205  foreach ($ids = $this->md_obj->getAnnotationIds() as $id) {
3206  // entity
3207  $annotation = $this->md_obj->getAnnotation($id);
3208  $annotation->setEntity(ilUtil::stripSlashes($annotation_post[$id]['Entity'] ?? ''));
3209  $annotation->setDate(ilUtil::stripSlashes($annotation_post[$id]['Date'] ?? ''));
3210  $annotation->setDescription(ilUtil::stripSlashes($annotation_post[$id]['Description'] ?? ''));
3211  $annotation->setDescriptionLanguage(
3212  new ilMDLanguageItem($annotation_post[$id]['Language'])
3213  );
3214  $annotation->update();
3215  }
3216 
3217  $this->callListeners('Annotation');
3218  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
3219  $this->listSection();
3220  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ updateClassification()

ilMDEditorGUI::updateClassification ( )

Definition at line 3446 of file class.ilMDEditorGUI.php.

References $id, callListeners(), ILIAS\FileDelivery\http(), listSection(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

3446  : void
3447  {
3448  $classification_post = [];
3449  if ($this->http->wrapper()->post()->has('classification')) {
3450  $classification_post = $this->http->wrapper()->post()->retrieve(
3451  'classification',
3452  $this->refinery->identity()
3453  );
3454  }
3455 
3456  // relation
3457  foreach ($ids = $this->md_obj->getClassificationIds() as $id) {
3458  // entity
3459  $classification = $this->md_obj->getClassification($id);
3460  $classification->setPurpose($classification_post[$id]['Purpose'] ?? '');
3461 
3462  $classification->setDescription(ilUtil::stripSlashes($classification_post[$id]['Description'] ?? ''));
3463  $classification->setDescriptionLanguage(
3464  new ilMDLanguageItem($classification_post[$id]['Language'] ?? '')
3465  );
3466 
3467  $classification->update();
3468 
3469  $key_ids = $classification->getKeywordIds();
3470  foreach ($key_ids as $key_id) {
3471  $keyword = $classification->getKeyword($key_id);
3472  $keyword->setKeyword(ilUtil::stripSlashes($classification_post['Keyword'][$key_id]['Value'] ?? ''));
3473  $keyword->setKeywordLanguage(
3474  new ilMDLanguageItem($classification_post['Keyword'][$key_id]['Language'] ?? '')
3475  );
3476  $keyword->update();
3477  }
3478 
3479  $tp_ids = $classification->getTaxonPathIds();
3480  foreach ($tp_ids as $tp_id) {
3481  $tax_path = $classification->getTaxonPath($tp_id);
3482  $tax_path->setSource(ilUtil::stripSlashes($classification_post['TaxonPath'][$tp_id]['Source']['Value'] ?? ''));
3483  $tax_path->setSourceLanguage(
3484  new ilMDLanguageItem((string) ($classification_post['TaxonPath'][$tp_id]['Source']['Language'] ?? ''))
3485  );
3486  $tax_path->update();
3487 
3488  $tax_ids = $tax_path->getTaxonIds();
3489 
3490  foreach ($tax_ids as $tax_id) {
3491  $taxon = $tax_path->getTaxon($tax_id);
3492  $taxon->setTaxon(ilUtil::stripSlashes($classification_post['TaxonPath']['Taxon'][$tax_id]['Value'] ?? ''));
3493  $taxon->setTaxonLanguage(
3494  new ilMDLanguageItem((string) ($classification_post['TaxonPath']['Taxon'][$tax_id]['Language'] ?? ''))
3495  );
3496  $taxon->setTaxonId(ilUtil::stripSlashes($classification_post['TaxonPath']['Taxon'][$tax_id]['Id'] ?? ''));
3497  $taxon->update();
3498  }
3499  }
3500  }
3501 
3502  $this->callListeners('Classification');
3503  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
3504  $this->listSection();
3505  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ updateEducational()

ilMDEditorGUI::updateEducational ( )

Definition at line 2848 of file class.ilMDEditorGUI.php.

References $id, callListeners(), getTltPostVars(), ILIAS\FileDelivery\http(), listSection(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

2848  : void
2849  {
2850  $educational_post = [];
2851  if ($this->http->wrapper()->post()->has('educational')) {
2852  $educational_post = $this->http->wrapper()->post()->retrieve(
2853  'educational',
2854  $this->refinery->identity()
2855  );
2856  }
2857 
2858  // update rights section
2859  $this->md_section = $this->md_obj->getEducational();
2860  $this->md_section->setInteractivityType($educational_post['InteractivityType'] ?? '');
2861  $this->md_section->setLearningResourceType($educational_post['LearningResourceType'] ?? '');
2862  $this->md_section->setInteractivityLevel($educational_post['InteractivityLevel'] ?? '');
2863  $this->md_section->setSemanticDensity($educational_post['SemanticDensity'] ?? '');
2864  $this->md_section->setIntendedEndUserRole($educational_post['IntendedEndUserRole'] ?? '');
2865  $this->md_section->setContext($educational_post['Context'] ?? '');
2866  $this->md_section->setDifficulty($educational_post['Difficulty'] ?? '');
2867 
2868  $tlt_post = [];
2869  if ($this->http->wrapper()->post()->has('tlt')) {
2870  $tlt_post = $this->http->wrapper()->post()->retrieve(
2871  'tlt',
2872  $this->refinery->kindlyTo()->dictOf(
2873  $this->refinery->kindlyTo()->int()
2874  )
2875  );
2876  }
2877  $tlt_post_vars = $this->getTltPostVars();
2878  $this->md_section->setPhysicalTypicalLearningTime(
2879  $tlt_post[$tlt_post_vars['mo']] ?? 0,
2880  $tlt_post[$tlt_post_vars['d']] ?? 0,
2881  $tlt_post[$tlt_post_vars['h']] ?? 0,
2882  $tlt_post[$tlt_post_vars['m']] ?? 0,
2883  $tlt_post[$tlt_post_vars['s']] ?? 0
2884  );
2885  $this->callListeners('Educational');
2886 
2887  /* TypicalAgeRange */
2888  foreach ($ids = $this->md_section->getTypicalAgeRangeIds() as $id) {
2889  $md_age = $this->md_section->getTypicalAgeRange($id);
2890  $md_age->setTypicalAgeRange(ilUtil::stripSlashes($educational_post['TypicalAgeRange'][$id]['Value'] ?? ''));
2891  $md_age->setTypicalAgeRangeLanguage(
2892  new ilMDLanguageItem($educational_post['TypicalAgeRange'][$id]['Language'] ?? '')
2893  );
2894  $md_age->update();
2895  }
2896 
2897  /* Description */
2898  foreach ($ids = $this->md_section->getDescriptionIds() as $id) {
2899  $md_des = $this->md_section->getDescription($id);
2900  $md_des->setDescription(ilUtil::stripSlashes($educational_post['Description'][$id]['Value'] ?? ''));
2901  $md_des->setDescriptionLanguage(
2902  new ilMDLanguageItem($educational_post['Description'][$id]['Language'] ?? '')
2903  );
2904  $md_des->update();
2905  }
2906 
2907  /* Language */
2908  foreach ($ids = $this->md_section->getLanguageIds() as $id) {
2909  $md_lang = $this->md_section->getLanguage($id);
2910  $md_lang->setLanguage(
2911  new ilMDLanguageItem($educational_post['Language'][$id] ?? '')
2912  );
2913  $md_lang->update();
2914  }
2915 
2916  $this->md_section->update();
2917 
2918  $this->callListeners('Educational');
2919  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
2920  $this->listSection();
2921  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ updateGeneral()

ilMDEditorGUI::updateGeneral ( )

Definition at line 1525 of file class.ilMDEditorGUI.php.

References $data, $id, callListeners(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), listGeneral(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

1525  : bool
1526  {
1527  $gen_title = '';
1528  if ($this->http->wrapper()->post()->has('gen_title')) {
1529  $gen_title = $this->http->wrapper()->post()->retrieve(
1530  'gen_title',
1531  $this->refinery->kindlyTo()->string()
1532  );
1533  }
1534  if (trim($gen_title) === '') {
1535  if ($this->md_obj->getObjType() !== 'sess') {
1536  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('title_required'));
1537  $this->listGeneral();
1538  return false;
1539  }
1540  }
1541 
1542  $gen_structure = '';
1543  if ($this->http->wrapper()->post()->has('gen_structure')) {
1544  $gen_structure = $this->http->wrapper()->post()->retrieve(
1545  'gen_structure',
1546  $this->refinery->kindlyTo()->string()
1547  );
1548  }
1549  $gen_title_language = '';
1550  if ($this->http->wrapper()->post()->has('gen_title_language')) {
1551  $gen_title_language = $this->http->wrapper()->post()->retrieve(
1552  'gen_title_language',
1553  $this->refinery->kindlyTo()->string()
1554  );
1555  }
1556  $gen_coverage = '';
1557  if ($this->http->wrapper()->post()->has('gen_coverage')) {
1558  $gen_coverage = $this->http->wrapper()->post()->retrieve(
1559  'gen_coverage',
1560  $this->refinery->kindlyTo()->string()
1561  );
1562  }
1563  $gen_coverage_language = '';
1564  if ($this->http->wrapper()->post()->has('gen_coverage_language')) {
1565  $gen_coverage_language = $this->http->wrapper()->post()->retrieve(
1566  'gen_coverage_language',
1567  $this->refinery->kindlyTo()->string()
1568  );
1569  }
1570  // General values
1571  $this->md_section = $this->md_obj->getGeneral();
1572  $this->md_section->setStructure($gen_structure);
1573  $this->md_section->setTitle($gen_title);
1574  $this->md_section->setTitleLanguage(new ilMDLanguageItem($gen_title_language));
1575  $this->md_section->setCoverage(ilUtil::stripSlashes($gen_coverage));
1576  $this->md_section->setCoverageLanguage(new ilMDLanguageItem($gen_coverage_language));
1577  $this->md_section->update();
1578 
1579  // Identifier
1580  $gen_identifier = [];
1581  if ($this->http->wrapper()->post()->has('gen_identifier')) {
1582  $gen_identifier = $this->http->wrapper()->post()->retrieve(
1583  'gen_identifier',
1584  $this->refinery->identity()
1585  );
1586  }
1587  foreach ($gen_identifier as $id => $data) {
1588  $md_ide = $this->md_section->getIdentifier($id);
1589  $md_ide->setCatalog(ilUtil::stripSlashes($data['Catalog']));
1590  $md_ide->setEntry(ilUtil::stripSlashes($data['Entry']));
1591  $md_ide->update();
1592  }
1593 
1594  // Language
1595  $gen_language = [];
1596  if ($this->http->wrapper()->post()->has('gen_language')) {
1597  $gen_language = $this->http->wrapper()->post()->retrieve(
1598  'gen_language',
1599  $this->refinery->identity()
1600  );
1601  }
1602  foreach ($gen_language as $id => $data) {
1603  $md_lan = $this->md_section->getLanguage($id);
1604  $md_lan->setLanguage(new ilMDLanguageItem($data['language']));
1605  $md_lan->update();
1606  }
1607  // Description
1608  $gen_description = [];
1609  if ($this->http->wrapper()->post()->has('gen_description')) {
1610  $gen_description = $this->http->wrapper()->post()->retrieve(
1611  'gen_description',
1612  $this->refinery->identity()
1613  );
1614  }
1615  foreach ($gen_description as $id => $data) {
1616  $md_des = $this->md_section->getDescription($id);
1617  $md_des->setDescription(ilUtil::stripSlashes($data['description']));
1618  $md_des->setDescriptionLanguage(new ilMDLanguageItem($data['language']));
1619  $md_des->update();
1620  }
1621  // Keyword
1622  $gen_keyword = [];
1623  if ($this->http->wrapper()->post()->has('gen_keyword')) {
1624  $gen_keyword = $this->http->wrapper()->post()->retrieve(
1625  'gen_keyword',
1626  $this->refinery->identity()
1627  );
1628  }
1629  foreach ($gen_keyword as $id => $data) {
1630  $md_key = $this->md_section->getKeyword($id);
1631 
1632  $md_key->setKeyword(ilUtil::stripSlashes($data['keyword']));
1633  $md_key->setKeywordLanguage(new ilMDLanguageItem($data['language']));
1634  $md_key->update();
1635  }
1636  $this->callListeners('General');
1637 
1638  // Redirect here to read new title and description
1639  // Otherwise ('Lifecycle' 'technical' ...) simply call listSection()
1640  $this->ctrl->setParameter($this, "section", "meta_general");
1641  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"), true);
1642  $this->ctrl->redirect($this, 'listSection');
1643  return true;
1644  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ updateLifecycle()

ilMDEditorGUI::updateLifecycle ( )

Definition at line 2175 of file class.ilMDEditorGUI.php.

References $data, $id, callListeners(), ILIAS\FileDelivery\http(), listSection(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

2175  : bool
2176  {
2177  $lif_language = '';
2178  if ($this->http->wrapper()->post()->has('lif_language')) {
2179  $lif_language = $this->http->wrapper()->post()->retrieve(
2180  'lif_language',
2181  $this->refinery->kindlyTo()->string()
2182  );
2183  }
2184  $lif_version = '';
2185  if ($this->http->wrapper()->post()->has('lif_version')) {
2186  $lif_version = $this->http->wrapper()->post()->retrieve(
2187  'lif_version',
2188  $this->refinery->kindlyTo()->string()
2189  );
2190  }
2191  $lif_status = '';
2192  if ($this->http->wrapper()->post()->has('lif_status')) {
2193  $lif_status = $this->http->wrapper()->post()->retrieve(
2194  'lif_status',
2195  $this->refinery->kindlyTo()->string()
2196  );
2197  }
2198 
2199  // update metametadata section
2200  $this->md_section = $this->md_obj->getLifecycle();
2201  $this->md_section->setVersionLanguage(new ilMDLanguageItem($lif_language));
2202  $this->md_section->setVersion(ilUtil::stripSlashes($lif_version));
2203  $this->md_section->setStatus($lif_status);
2204  $this->md_section->update();
2205 
2206  // Identifier
2207  $ide_post = [];
2208  if ($this->http->wrapper()->post()->has('met_identifier')) {
2209  $ide_post = (array) $this->http->wrapper()->post()->retrieve(
2210  'met_identifier',
2211  $this->refinery->identity()
2212  );
2213  }
2214  foreach ($ide_post as $id => $data) {
2215  $md_ide = $this->md_section->getIdentifier($id);
2216  $md_ide->setCatalog(ilUtil::stripSlashes($data['Catalog'] ?? ''));
2217  $md_ide->setEntry(ilUtil::stripSlashes($data['Entry'] ?? ''));
2218  $md_ide->update();
2219  }
2220  // Contribute
2221  $contribute_post = [];
2222  if ($this->http->wrapper()->post()->has('met_contribute')) {
2223  $contribute_post = (array) $this->http->wrapper()->post()->retrieve(
2224  'met_contribute',
2225  $this->refinery->identity()
2226  );
2227  }
2228  foreach ($contribute_post as $id => $cont_data) {
2229  $md_con = $this->md_section->getContribute($id);
2230  $md_con->setRole(ilUtil::stripSlashes($cont_data['Role'] ?? ''));
2231  $md_con->setDate(ilUtil::stripSlashes($cont_data['Date'] ?? ''));
2232  $md_con->update();
2233 
2234  $entity_post = [];
2235  if ($this->http->wrapper()->post()->has('met_entity')) {
2236  $entity_post = (array) $this->http->wrapper()->post()->retrieve(
2237  'met_entity',
2238  $this->refinery->identity()
2239  );
2240  }
2241  foreach (($entity_post[$id] ?? []) as $ent_id => $ent_data) {
2242  $md_ent = $md_con->getEntity($ent_id);
2243  $md_ent->setEntity(ilUtil::stripSlashes($ent_data['Entity']));
2244  $md_ent->update();
2245  }
2246  }
2247  $this->callListeners('Lifecycle');
2248  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
2249  $this->listSection();
2250  return true;
2251  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ updateMetaMetaData()

ilMDEditorGUI::updateMetaMetaData ( )

Definition at line 2406 of file class.ilMDEditorGUI.php.

References $data, $id, callListeners(), ILIAS\FileDelivery\http(), listSection(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

2406  : bool
2407  {
2408  // update metametadata section
2409  $met_language = '';
2410  if ($this->http->wrapper()->post()->has('met_language')) {
2411  $met_language = (string) $this->http->wrapper()->post()->retrieve(
2412  'met_language',
2413  $this->refinery->kindlyTo()->string()
2414  );
2415  }
2416  $this->md_section = $this->md_obj->getMetaMetadata();
2417  $this->md_section->setLanguage(new ilMDLanguageItem($met_language));
2418  $this->md_section->update();
2419 
2420  // Identifier
2421  $met_identifier = [];
2422  if ($this->http->wrapper()->post()->has('met_identifier')) {
2423  $met_identifier = (array) $this->http->wrapper()->post()->retrieve(
2424  'met_identifier',
2425  $this->refinery->identity()
2426  );
2427  }
2428  foreach ($met_identifier as $id => $data) {
2429  $md_ide = $this->md_section->getIdentifier($id);
2430  $md_ide->setCatalog(ilUtil::stripSlashes($data['Catalog'] ?? ''));
2431  $md_ide->setEntry(ilUtil::stripSlashes($data['Entry'] ?? ''));
2432  $md_ide->update();
2433  }
2434  // Contribute
2435  $met_contribute = [];
2436  if ($this->http->wrapper()->post()->has('met_contribute')) {
2437  $met_contribute = (array) $this->http->wrapper()->post()->retrieve(
2438  'met_contribute',
2439  $this->refinery->identity()
2440  );
2441  }
2442  foreach ($met_contribute as $id => $cont_data) {
2443  $md_con = $this->md_section->getContribute($id);
2444  $md_con->setRole(ilUtil::stripSlashes($cont_data['Role'] ?? ''));
2445  $md_con->setDate(ilUtil::stripSlashes($cont_data['Date'] ?? ''));
2446  $md_con->update();
2447 
2448  $met_entity = [];
2449  if ($this->http->wrapper()->post()->has('met_entity')) {
2450  $met_entity = (array) $this->http->wrapper()->post()->retrieve(
2451  'met_entity',
2452  $this->refinery->identity()
2453  );
2454  }
2455  foreach ($met_entity[$id] as $ent_id => $ent_data) {
2456  $md_ent = $md_con->getEntity($ent_id);
2457  $md_ent->setEntity(ilUtil::stripSlashes($ent_data['Entity'] ?? ''));
2458  $md_ent->update();
2459  }
2460  }
2461  $this->callListeners('MetaMetaData');
2462  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
2463  $this->listSection();
2464  return true;
2465  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ updateQuickEdit()

ilMDEditorGUI::updateQuickEdit ( )

Definition at line 717 of file class.ilMDEditorGUI.php.

References $auth, $i, $id, callListeners(), ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getInput(), ilOerHarvesterSettings\getInstance(), getTltPostVars(), ILIAS\FileDelivery\http(), IL_INST_ID, initQuickEditForm(), ILIAS\Repository\int(), listQuickEdit(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilPropertyFormGUI\setValuesByPost(), ilUtil\stripSlashes(), and ilMDKeyword\updateKeywords().

717  : bool
718  {
719  $this->md_section = $this->md_obj->getGeneral();
720 
721  $form = $this->initQuickEditForm(null);
722  if (!$form->checkInput()) {
723  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('title_required'));
725  $this->listQuickEdit($form);
726  return false;
727  }
728  $this->md_section->setTitle($form->getInput('gen_title'));
729  $this->md_section->update();
730 
731  $has_language = false;
732  foreach ($ids = $this->md_section->getLanguageIds() as $id) {
733  $md_lan = $this->md_section->getLanguage($id);
734  $md_lan->setLanguage(
735  new ilMDLanguageItem(
736  $form->getInput('gen_language_' . $id . '_language')
737  )
738  );
739  $md_lan->update();
740  $has_language = true;
741  }
742  if (!$has_language) {
743  $md_lan = $this->md_section->addLanguage();
744  $md_lan->setLanguage(
745  new ilMDLanguageItem(
746  $form->getInput('gen_language_language')
747  )
748  );
749  $md_lan->save();
750  }
751 
752  foreach ($ids = $this->md_section->getDescriptionIds() as $id) {
753  $md_des = $this->md_section->getDescription($id);
754  $md_des->setDescription($form->getInput('gen_description_' . $id . '_description'));
755  $md_des->update();
756  }
757 
758 
759  // Keyword
760 
761  $keywords = [];
762  if ($this->http->wrapper()->post()->has('keywords')) {
763  $keywords = (array) $this->http->wrapper()->post()->retrieve(
764  'keywords',
765  $this->refinery->identity()
766  );
767  }
768  $keyword_values = $keywords['value'] ?? null;
769  if (is_array($keyword_values)) {
770  ilMDKeyword::updateKeywords($this->md_section, $keyword_values);
771  }
772  $this->callListeners('General');
773 
774  // Copyright
775  $copyright = 0;
776  if ($this->http->wrapper()->post()->has('copyright')) {
777  $copyright = $this->http->wrapper()->post()->retrieve(
778  'copyright',
779  $this->refinery->kindlyTo()->int()
780  );
781  }
782  $copyright_text = 0;
783  if ($this->http->wrapper()->post()->has('copyright_text')) {
784  $copyright_text = $this->http->wrapper()->post()->retrieve(
785  'copyright_text',
786  $this->refinery->kindlyTo()->string()
787  );
788  }
789  if (
790  $copyright > 0 ||
791  $copyright_text !== ''
792  ) {
793  if (!is_object($this->md_section = $this->md_obj->getRights())) {
794  $this->md_section = $this->md_obj->addRights();
795  $this->md_section->save();
796  }
797  if ($copyright > 0) {
798  $this->md_section->setCopyrightAndOtherRestrictions("Yes");
799  $this->md_section->setDescription('il_copyright_entry__' . IL_INST_ID . '__' . (int) $copyright);
800  } else {
801  $this->md_section->setCopyrightAndOtherRestrictions("Yes");
802  $this->md_section->setDescription((string) $copyright_text);
803  }
804  $this->md_section->update();
805 
806  // update oer status
807  $oer_settings = ilOerHarvesterSettings::getInstance();
808  if ($oer_settings->supportsHarvesting($this->md_obj->getObjType())) {
809  $chosen_copyright = $copyright;
810  $status = new ilOerHarvesterObjectStatus($this->md_obj->getRBACId());
811 
812  $copyright_blocked = false;
813  if ($this->http->wrapper()->post()->has('copyright_oer_blocked_' . $chosen_copyright)) {
814  $copyright_blocked = $this->http->wrapper()->post()->retrieve(
815  'copyright_oer_blocked_' . $chosen_copyright,
816  $this->refinery->kindlyTo()->bool()
817  );
818  }
819  $status->setBlocked($copyright_blocked);
820  $status->save();
821  }
822  } elseif (is_object($this->md_section = $this->md_obj->getRights())) {
823  $this->md_section->setCopyrightAndOtherRestrictions("No");
824  $this->md_section->setDescription("");
825  $this->md_section->update();
826  }
827  $this->callListeners('Rights');
828 
829  //Educational...
830  $tlt = $form->getInput('tlt');
831  $tlt_set = false;
832  $tlt_post_vars = $this->getTltPostVars();
833  foreach ($tlt_post_vars as $post_var) {
834  $tlt_section = (int) ($tlt[$post_var] ?? 0);
835  if ($tlt_section > 0) {
836  $tlt_set = true;
837  break;
838  }
839  }
840  if ($tlt_set) {
841  if (!is_object($this->md_section = $this->md_obj->getEducational())) {
842  $this->md_section = $this->md_obj->addEducational();
843  $this->md_section->save();
844  }
845  $this->md_section->setPhysicalTypicalLearningTime(
846  (int) ($tlt[$tlt_post_vars['mo']] ?? 0),
847  (int) ($tlt[$tlt_post_vars['d']] ?? 0),
848  (int) ($tlt[$tlt_post_vars['h']] ?? 0),
849  (int) ($tlt[$tlt_post_vars['m']] ?? 0),
850  (int) ($tlt[$tlt_post_vars['s']] ?? 0)
851  );
852  $this->md_section->update();
853  } elseif (is_object($this->md_section = $this->md_obj->getEducational())) {
854  $this->md_section->setPhysicalTypicalLearningTime(0, 0, 0, 0, 0);
855  $this->md_section->update();
856  }
857  $this->callListeners('Educational');
858  //Lifecycle...
859  // Authors
860  if ($form->getInput('life_authors') !== '') {
861  if (!is_object($this->md_section = $this->md_obj->getLifecycle())) {
862  $this->md_section = $this->md_obj->addLifecycle();
863  $this->md_section->save();
864  }
865 
866  // determine all entered authors
867  $life_authors = $form->getInput('life_authors');
868  $auth_arr = explode($this->md_settings->getDelimiter(), $life_authors);
869  for ($i = 0, $iMax = count($auth_arr); $i < $iMax; $i++) {
870  $auth_arr[$i] = trim($auth_arr[$i]);
871  }
872 
873  $md_con_author = "";
874 
875  // update existing author entries (delete if not entered)
876  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
877  $md_con = $this->md_section->getContribute($con_id);
878  if ($md_con->getRole() === "Author") {
879  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
880  $md_ent = $md_con->getEntity($ent_id);
881 
882  // entered author already exists
883  if (in_array($md_ent->getEntity(), $auth_arr, true)) {
884  unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr, true)]);
885  } else { // existing author has not been entered again -> delete
886  $md_ent->delete();
887  }
888  }
889  $md_con_author = $md_con;
890  }
891  }
892 
893  // insert enterd, but not existing authors
894  if (count($auth_arr) > 0) {
895  if (!is_object($md_con_author)) {
896  $md_con_author = $this->md_section->addContribute();
897  $md_con_author->setRole("Author");
898  $md_con_author->save();
899  }
900  foreach ($auth_arr as $auth) {
901  $md_ent = $md_con_author->addEntity();
902  $md_ent->setEntity(ilUtil::stripSlashes($auth));
903  $md_ent->save();
904  }
905  }
906  } elseif (is_object($this->md_section = $this->md_obj->getLifecycle())) {
907  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
908  $md_con = $this->md_section->getContribute($con_id);
909  if ($md_con->getRole() === "Author") {
910  $md_con->delete();
911  }
912  }
913  }
914  $this->callListeners('Lifecycle');
915 
916  // Redirect here to read new title and description
917  // Otherwise ('Lifecycle' 'technical' ...) simply call listSection()
918  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"), true);
919  $this->ctrl->redirect($this, 'listSection');
920  return true;
921  }
const IL_INST_ID
Definition: constants.php:40
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
static updateKeywords(ilMDGeneral $a_md_section, array $a_keywords)
initQuickEditForm(?Signal $a_signal_id)
$auth
Definition: metadata.php:76
ilPropertyFormGUI $form
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
listQuickEdit(ilPropertyFormGUI $form=null)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ updateQuickEdit_scorm()

ilMDEditorGUI::updateQuickEdit_scorm ( )
Todo:
discuss with scorm maintainer how to proceed with this quick edit implementation

Definition at line 1011 of file class.ilMDEditorGUI.php.

References $auth, $data, $i, $id, $lang, $post, callListeners(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), IL_INST_ID, ILIAS\Repository\lng(), and ilUtil\stripSlashes().

Referenced by updateQuickEdit_scorm_propagate().

1011  : void
1012  {
1013  $post = $this->http->request()->getParsedBody();
1014 
1015  // General values
1016  $this->md_section = $this->md_obj->getGeneral();
1017  $this->md_section->setTitle(ilUtil::stripSlashes($post['gen_title'] ?? ''));
1018  $this->md_section->setTitleLanguage(new ilMDLanguageItem($post['gen_title_language'] ?? ''));
1019  $this->md_section->update();
1020 
1021 
1022  // Language
1023  if (is_array($post['gen_language'] ?? null)) {
1024  foreach ($post['gen_language'] as $id => $data) {
1025  if ($id > 0) {
1026  $md_lan = $this->md_section->getLanguage($id);
1027  $md_lan->setLanguage(new ilMDLanguageItem($data['language']));
1028  $md_lan->update();
1029  } else {
1030  $md_lan = $this->md_section->addLanguage();
1031  $md_lan->setLanguage(new ilMDLanguageItem($data['language']));
1032  $md_lan->save();
1033  }
1034  }
1035  }
1036  // Description
1037  if (is_array($post['gen_description'] ?? null)) {
1038  foreach ($post['gen_description'] as $id => $data) {
1039  $md_des = $this->md_section->getDescription($id);
1040  $md_des->setDescription(ilUtil::stripSlashes($data['description']));
1041  $md_des->setDescriptionLanguage(new ilMDLanguageItem($data['language']));
1042  $md_des->update();
1043  }
1044  }
1045 
1046  // Keyword
1047  if (is_array($post["keywords"]["value"] ?? null)) {
1048  $new_keywords = array();
1049  foreach ($post["keywords"]["value"] as $lang => $keywords) {
1050  $language = $post["keyword"]["language"][$lang];
1051  $keywords = explode(",", $keywords);
1052  foreach ($keywords as $keyword) {
1053  $new_keywords[$language][] = trim($keyword);
1054  }
1055  }
1056 
1057  // update existing author entries (delete if not entered)
1058  foreach ($ids = $this->md_section->getKeywordIds() as $id) {
1059  $md_key = $this->md_section->getKeyword($id);
1060 
1061  $lang = $md_key->getKeywordLanguageCode();
1062 
1063  // entered keyword already exists
1064  if (is_array($new_keywords[$lang] ?? '') &&
1065  in_array($md_key->getKeyword(), $new_keywords[$lang], true)) {
1066  unset($new_keywords[$lang][array_search($md_key->getKeyword(), $new_keywords[$lang], true)]);
1067  } else { // existing keyword has not been entered again -> delete
1068  $md_key->delete();
1069  }
1070  }
1071 
1072  // insert entered, but not existing keywords
1073  foreach ($new_keywords as $lang => $key_arr) {
1074  foreach ($key_arr as $keyword) {
1075  if ($keyword !== "") {
1076  $md_key = $this->md_section->addKeyword();
1077  $md_key->setKeyword(ilUtil::stripSlashes($keyword));
1078  $md_key->setKeywordLanguage(new ilMDLanguageItem($lang));
1079  $md_key->save();
1080  }
1081  }
1082  }
1083  }
1084  $this->callListeners('General');
1085 
1086  // Copyright
1087  if (($post['copyright_id'] ?? null) or ($post['rights_copyright'] ?? null)) {
1088  if (!is_object($this->md_section = $this->md_obj->getRights())) {
1089  $this->md_section = $this->md_obj->addRights();
1090  $this->md_section->save();
1091  }
1092  if ($post['copyright_id'] ?? null) {
1093  $this->md_section->setCopyrightAndOtherRestrictions("Yes");
1094  $this->md_section->setDescription('il_copyright_entry__' . IL_INST_ID . '__' . (int) $post['copyright_id']);
1095  } else {
1096  $this->md_section->setCopyrightAndOtherRestrictions("Yes");
1097  $this->md_section->setDescription(ilUtil::stripSlashes($post["rights_copyright"]));
1098  }
1099  $this->md_section->update();
1100  } elseif (is_object($this->md_section = $this->md_obj->getRights())) {
1101  $this->md_section->setCopyrightAndOtherRestrictions("No");
1102  $this->md_section->setDescription("");
1103  $this->md_section->update();
1104  }
1105  $this->callListeners('Rights');
1106 
1107  //Educational...
1108  // Typical Learning Time
1109  if (($post['tlt']['mo'] ?? null) or ($post['tlt']['d'] ?? null) or
1110  ($post["tlt"]['h'] ?? null) or ($post['tlt']['m'] ?? null) or
1111  ($post['tlt']['s'] ?? null)) {
1112  if (!is_object($this->md_section = $this->md_obj->getEducational())) {
1113  $this->md_section = $this->md_obj->addEducational();
1114  $this->md_section->save();
1115  }
1116  $this->md_section->setPhysicalTypicalLearningTime(
1117  (int) ($post['tlt']['mo'] ?? 0),
1118  (int) ($post['tlt']['d'] ?? 0),
1119  (int) ($post['tlt']['h'] ?? 0),
1120  (int) ($post['tlt']['m'] ?? 0),
1121  (int) ($post['tlt']['s'] ?? 0)
1122  );
1123  $this->md_section->update();
1124  } elseif (is_object($this->md_section = $this->md_obj->getEducational())) {
1125  $this->md_section->setPhysicalTypicalLearningTime(0, 0, 0, 0, 0);
1126  $this->md_section->update();
1127  }
1128  $this->callListeners('Educational');
1129  //Lifecycle...
1130  // experts
1131  if ($post["life_experts"] != "") {
1132  if (!is_object($this->md_section = $this->md_obj->getLifecycle())) {
1133  $this->md_section = $this->md_obj->addLifecycle();
1134  $this->md_section->save();
1135  }
1136 
1137  // determine all entered authors
1138  $auth_arr = explode(",", $post["life_experts"]);
1139  for ($i = 0, $iMax = count($auth_arr); $i < $iMax; $i++) {
1140  $auth_arr[$i] = trim($auth_arr[$i]);
1141  }
1142 
1143  $md_con_author = "";
1144 
1145  // update existing author entries (delete if not entered)
1146  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
1147  $md_con = $this->md_section->getContribute($con_id);
1148  if ($md_con->getRole() === "SubjectMatterExpert") {
1149  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
1150  $md_ent = $md_con->getEntity($ent_id);
1151 
1152  // entered author already exists
1153  if (in_array($md_ent->getEntity(), $auth_arr, true)) {
1154  unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr, true)]);
1155  } else { // existing author has not been entered again -> delete
1156  $md_ent->delete();
1157  }
1158  }
1159  $md_con_author = $md_con;
1160  }
1161  }
1162 
1163  // insert enterd, but not existing authors
1164  if (count($auth_arr) > 0) {
1165  if (!is_object($md_con_author)) {
1166  $md_con_author = $this->md_section->addContribute();
1167  $md_con_author->setRole("SubjectMatterExpert");
1168  $md_con_author->save();
1169  }
1170  foreach ($auth_arr as $auth) {
1171  $md_ent = $md_con_author->addEntity();
1172  $md_ent->setEntity(ilUtil::stripSlashes($auth));
1173  $md_ent->save();
1174  }
1175  }
1176  } elseif (is_object($this->md_section = $this->md_obj->getLifecycle())) {
1177  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
1178  $md_con = $this->md_section->getContribute($con_id);
1179  if ($md_con->getRole() === "SubjectMatterExpert") {
1180  $md_con->delete();
1181  }
1182  }
1183  }
1184 
1185  // InstructionalDesigner
1186  if (($post["life_designers"] ?? null) != "") {
1187  if (!is_object($this->md_section = $this->md_obj->getLifecycle())) {
1188  $this->md_section = $this->md_obj->addLifecycle();
1189  $this->md_section->save();
1190  }
1191 
1192  // determine all entered authors
1193  $auth_arr = explode(",", $post["life_designers"]);
1194  for ($i = 0, $iMax = count($auth_arr); $i < $iMax; $i++) {
1195  $auth_arr[$i] = trim($auth_arr[$i]);
1196  }
1197 
1198  $md_con_author = "";
1199 
1200  // update existing author entries (delete if not entered)
1201  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
1202  $md_con = $this->md_section->getContribute($con_id);
1203  if ($md_con->getRole() === "InstructionalDesigner") {
1204  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
1205  $md_ent = $md_con->getEntity($ent_id);
1206 
1207  // entered author already exists
1208  if (in_array($md_ent->getEntity(), $auth_arr, true)) {
1209  unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr, true)]);
1210  } else { // existing author has not been entered again -> delete
1211  $md_ent->delete();
1212  }
1213  }
1214  $md_con_author = $md_con;
1215  }
1216  }
1217 
1218  // insert enterd, but not existing authors
1219  if (count($auth_arr) > 0) {
1220  if (!is_object($md_con_author)) {
1221  $md_con_author = $this->md_section->addContribute();
1222  $md_con_author->setRole("InstructionalDesigner");
1223  $md_con_author->save();
1224  }
1225  foreach ($auth_arr as $auth) {
1226  $md_ent = $md_con_author->addEntity();
1227  $md_ent->setEntity(ilUtil::stripSlashes($auth));
1228  $md_ent->save();
1229  }
1230  }
1231  } elseif (is_object($this->md_section = $this->md_obj->getLifecycle())) {
1232  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
1233  $md_con = $this->md_section->getContribute($con_id);
1234  if ($md_con->getRole() === "InstructionalDesigner") {
1235  $md_con->delete();
1236  }
1237  }
1238  }
1239 
1240  // Point of Contact
1241  if (($post["life_poc"] ?? null) != "") {
1242  if (!is_object($this->md_section = $this->md_obj->getLifecycle())) {
1243  $this->md_section = $this->md_obj->addLifecycle();
1244  $this->md_section->save();
1245  }
1246 
1247  // determine all entered authors
1248  $auth_arr = explode(",", $post["life_poc"]);
1249  for ($i = 0, $iMax = count($auth_arr); $i < $iMax; $i++) {
1250  $auth_arr[$i] = trim($auth_arr[$i]);
1251  }
1252 
1253  $md_con_author = "";
1254 
1255  // update existing author entries (delete if not entered)
1256  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
1257  $md_con = $this->md_section->getContribute($con_id);
1258  if ($md_con->getRole() === "PointOfContact") {
1259  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
1260  $md_ent = $md_con->getEntity($ent_id);
1261 
1262  // entered author already exists
1263  if (in_array($md_ent->getEntity(), $auth_arr, true)) {
1264  unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr, true)]);
1265  } else { // existing author has not been entered again -> delete
1266  $md_ent->delete();
1267  }
1268  }
1269  $md_con_author = $md_con;
1270  }
1271  }
1272 
1273  // insert enterd, but not existing authors
1274  if (count($auth_arr) > 0) {
1275  if (!is_object($md_con_author)) {
1276  $md_con_author = $this->md_section->addContribute();
1277  $md_con_author->setRole("PointOfContact");
1278  $md_con_author->save();
1279  }
1280  foreach ($auth_arr as $auth) {
1281  $md_ent = $md_con_author->addEntity();
1282  $md_ent->setEntity(ilUtil::stripSlashes($auth));
1283  $md_ent->save();
1284  }
1285  }
1286  } elseif (is_object($this->md_section = $this->md_obj->getLifecycle())) {
1287  foreach (($ids = $this->md_section->getContributeIds()) as $con_id) {
1288  $md_con = $this->md_section->getContribute($con_id);
1289  if ($md_con->getRole() === "PointOfContact") {
1290  $md_con->delete();
1291  }
1292  }
1293  }
1294 
1295  $this->md_section = $this->md_obj->getLifecycle();
1296  $this->md_section->setVersionLanguage(new ilMDLanguageItem($post['lif_language'] ?? ''));
1297  $this->md_section->setVersion(ilUtil::stripSlashes($post['lif_version'] ?? ''));
1298  $this->md_section->setStatus($post['lif_status'] ?? '');
1299  $this->md_section->update();
1300 
1301  $this->callListeners('Lifecycle');
1302 
1303  // Redirect here to read new title and description
1304  // Otherwise ('Lifecycle' 'technical' ...) simply call listSection()
1305  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"), true);
1306  $this->ctrl->redirect($this, 'listSection');
1307  }
const IL_INST_ID
Definition: constants.php:40
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
$auth
Definition: metadata.php:76
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$lang
Definition: xapiexit.php:26
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$post
Definition: ltitoken.php:49
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateQuickEdit_scorm_prop_designer()

ilMDEditorGUI::updateQuickEdit_scorm_prop_designer ( )

Definition at line 998 of file class.ilMDEditorGUI.php.

References updateQuickEdit_scorm_propagate().

998  : void
999  {
1000  $this->updateQuickEdit_scorm_propagate("life_designers", "InstructionalDesigner");
1001  }
updateQuickEdit_scorm_propagate(string $request, string $type)
+ Here is the call graph for this function:

◆ updateQuickEdit_scorm_prop_expert()

ilMDEditorGUI::updateQuickEdit_scorm_prop_expert ( )

Definition at line 993 of file class.ilMDEditorGUI.php.

References updateQuickEdit_scorm_propagate().

993  : void
994  {
995  $this->updateQuickEdit_scorm_propagate("life_experts", "SubjectMatterExpert");
996  }
updateQuickEdit_scorm_propagate(string $request, string $type)
+ Here is the call graph for this function:

◆ updateQuickEdit_scorm_prop_poc()

ilMDEditorGUI::updateQuickEdit_scorm_prop_poc ( )

Definition at line 1003 of file class.ilMDEditorGUI.php.

References updateQuickEdit_scorm_propagate().

1003  : void
1004  {
1005  $this->updateQuickEdit_scorm_propagate("life_poc", "PointOfContact");
1006  }
updateQuickEdit_scorm_propagate(string $request, string $type)
+ Here is the call graph for this function:

◆ updateQuickEdit_scorm_propagate()

ilMDEditorGUI::updateQuickEdit_scorm_propagate ( string  $request,
string  $type 
)

Definition at line 923 of file class.ilMDEditorGUI.php.

References $auth, $i, $post, $type, ilTree\getNodeData(), ilTree\getRootId(), ilTree\getSubTree(), ILIAS\FileDelivery\http(), ilTree\setTableNames(), ilTree\setTreeTablePK(), ilUtil\stripSlashes(), and updateQuickEdit_scorm().

Referenced by updateQuickEdit_scorm_prop_designer(), updateQuickEdit_scorm_prop_expert(), and updateQuickEdit_scorm_prop_poc().

923  : void
924  {
925  $module_id = $this->md_obj->getObjId();
926  if ($this->md_obj->getObjType() === 'sco') {
927  $module_id = $this->md_obj->getRBACId();
928  }
929  $tree = new ilTree($module_id);
930  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
931  $tree->setTreeTablePK("slm_id");
932 
933  $post = $this->http->request()->getParsedBody();
934  foreach ($tree->getSubTree($tree->getNodeData($tree->getRootId()), true, ['sco']) as $sco) {
935  $sco_md = new ilMD($module_id, $sco['obj_id'], 'sco');
936  if ($post[$request] != "") {
937  if (!is_object($sco_md_section = $sco_md->getLifecycle())) {
938  $sco_md_section = $sco_md->addLifecycle();
939  $sco_md_section->save();
940  }
941  // determine all entered authors
942  $auth_arr = explode(",", $post[$request]);
943  for ($i = 0, $iMax = count($auth_arr); $i < $iMax; $i++) {
944  $auth_arr[$i] = trim($auth_arr[$i]);
945  }
946 
947  $md_con_author = "";
948 
949  // update existing author entries (delete if not entered)
950  foreach (($ids = $sco_md_section->getContributeIds()) as $con_id) {
951  $md_con = $sco_md_section->getContribute($con_id);
952  if ($md_con->getRole() === $type) {
953  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
954  $md_ent = $md_con->getEntity($ent_id);
955 
956  // entered author already exists
957  if (in_array($md_ent->getEntity(), $auth_arr, true)) {
958  unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr, true)]);
959  } else { // existing author has not been entered again -> delete
960  $md_ent->delete();
961  }
962  }
963  $md_con_author = $md_con;
964  }
965  }
966 
967  // insert enterd, but not existing authors
968  if (count($auth_arr) > 0) {
969  if (!is_object($md_con_author)) {
970  $md_con_author = $sco_md_section->addContribute();
971  $md_con_author->setRole($type);
972  $md_con_author->save();
973  }
974  foreach ($auth_arr as $auth) {
975  $md_ent = $md_con_author->addEntity();
976  $md_ent->setEntity(ilUtil::stripSlashes($auth));
977  $md_ent->save();
978  }
979  }
980  } elseif (is_object($sco_md_section = $sco_md->getLifecycle())) {
981  foreach (($ids = $sco_md_section->getContributeIds()) as $con_id) {
982  $md_con = $sco_md_section->getContribute($con_id);
983  if ($md_con->getRole() === $type) {
984  $md_con->delete();
985  }
986  }
987  }
988  $sco_md->update();
989  }
990  $this->updateQuickEdit_scorm();
991  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
$type
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
$auth
Definition: metadata.php:76
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
static http()
Fetches the global http state from ILIAS.
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
$post
Definition: ltitoken.php:49
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateRelation()

ilMDEditorGUI::updateRelation ( )

Definition at line 3074 of file class.ilMDEditorGUI.php.

References $id, callListeners(), ILIAS\FileDelivery\http(), listSection(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

3074  : void
3075  {
3076  $relation_post = [];
3077  if ($this->http->wrapper()->post()->has('relation')) {
3078  $relation_post = $this->http->wrapper()->post()->retrieve(
3079  'relation',
3080  $this->refinery->identity()
3081  );
3082  }
3083  // relation
3084  foreach ($ids = $this->md_obj->getRelationIds() as $id) {
3085  // kind
3086  $relation = $this->md_obj->getRelation($id);
3087  $relation->setKind((string) ($relation_post[$id]['Kind'] ?? ''));
3088  $relation->update();
3089 
3090  // identifiers
3091  $res_idents = $relation->getIdentifier_Ids();
3092  foreach ($res_idents as $res_id) {
3093  $ident = $relation->getIdentifier_($res_id);
3094  $ident->setCatalog(ilUtil::stripSlashes($relation_post['Resource']['Identifier'][$res_id]['Catalog'] ?? ''));
3095  $ident->setEntry(ilUtil::stripSlashes($relation_post['Resource']['Identifier'][$res_id]['Entry'] ?? ''));
3096  $ident->update();
3097  }
3098 
3099  // descriptions
3100  $res_dess = $relation->getDescriptionIds();
3101  foreach ($res_dess as $res_des) {
3102  $des = $relation->getDescription($res_des);
3103  $des->setDescription(ilUtil::stripSlashes($relation_post['Resource']['Description'][$res_des]['Value'] ?? ''));
3104  $des->setDescriptionLanguage(
3105  new ilMDLanguageItem($relation_post['Resource']['Description'][$res_des]['Language'] ?? '')
3106  );
3107  $des->update();
3108  }
3109  }
3110 
3111  $this->callListeners('Relation');
3112  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
3113  $this->listSection();
3114  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ updateRights()

ilMDEditorGUI::updateRights ( )

Definition at line 2534 of file class.ilMDEditorGUI.php.

References callListeners(), ILIAS\FileDelivery\http(), listSection(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

2534  : void
2535  {
2536  // update rights section
2537  $rights_post = [];
2538  if ($this->http->wrapper()->post()->has('rights')) {
2539  $rights_post = $this->http->wrapper()->post()->retrieve(
2540  'rights',
2541  $this->refinery->identity()
2542  );
2543  }
2544 
2545  $this->md_section = $this->md_obj->getRights();
2546  $this->md_section->setCosts($rights_post['Cost'] ?? '');
2547  $this->md_section->setCopyrightAndOtherRestrictions($rights_post['CopyrightAndOtherRestrictions'] ?? '');
2548  $this->md_section->setDescriptionLanguage(new ilMDLanguageItem($rights_post['DescriptionLanguage'] ?? ''));
2549  $this->md_section->setDescription(ilUtil::stripSlashes($rights_post['Description'] ?? ''));
2550  $this->md_section->update();
2551 
2552  $this->callListeners('Rights');
2553  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
2554  $this->listSection();
2555  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
+ Here is the call graph for this function:

◆ updateTechnical()

ilMDEditorGUI::updateTechnical ( )

Definition at line 1646 of file class.ilMDEditorGUI.php.

References $data, $id, callListeners(), ILIAS\FileDelivery\http(), listSection(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

1646  : bool
1647  {
1648  // update technical section
1649  $met_size = '';
1650  if ($this->http->wrapper()->post()->has('met_size')) {
1651  $met_size = $this->http->wrapper()->post()->retrieve(
1652  'met_size',
1653  $this->refinery->kindlyTo()->string()
1654  );
1655  }
1656  $met_inst = '';
1657  if ($this->http->wrapper()->post()->has('met_inst')) {
1658  $met_inst = $this->http->wrapper()->post()->retrieve(
1659  'met_inst',
1660  $this->refinery->kindlyTo()->string()
1661  );
1662  }
1663  $inst_language = '';
1664  if ($this->http->wrapper()->post()->has('inst_language')) {
1665  $inst_language = $this->http->wrapper()->post()->retrieve(
1666  'inst_language',
1667  $this->refinery->kindlyTo()->string()
1668  );
1669  }
1670  $met_opr = '';
1671  if ($this->http->wrapper()->post()->has('met_opr')) {
1672  $met_opr = $this->http->wrapper()->post()->retrieve(
1673  'met_opr',
1674  $this->refinery->kindlyTo()->string()
1675  );
1676  }
1677  $duration = '';
1678  if ($this->http->wrapper()->post()->has('duration')) {
1679  $duration = $this->http->wrapper()->post()->retrieve(
1680  'duration',
1681  $this->refinery->kindlyTo()->string()
1682  );
1683  }
1684  $opr_language = '';
1685  if ($this->http->wrapper()->post()->has('opr_language')) {
1686  $opr_language = $this->http->wrapper()->post()->retrieve(
1687  'opr_language',
1688  $this->refinery->kindlyTo()->string()
1689  );
1690  }
1691 
1692  $this->md_section = $this->md_obj->getTechnical();
1693  $this->md_section->setSize($met_size);
1694  $this->md_section->setInstallationRemarks($met_inst);
1695  $this->md_section->setInstallationRemarksLanguage(new ilMDLanguageItem($inst_language));
1696  $this->md_section->setOtherPlatformRequirements($met_opr);
1697  $this->md_section->setOtherPlatformRequirementsLanguage(new ilMDLanguageItem($opr_language));
1698  $this->md_section->setDuration($duration);
1699  $this->md_section->update();
1700 
1701  // Format
1702  $met_format = [];
1703  if ($this->http->wrapper()->post()->has('met_format')) {
1704  $met_format = (array) $this->http->wrapper()->post()->retrieve(
1705  'met_format',
1706  $this->refinery->identity()
1707  );
1708  }
1709  foreach ($met_format as $id => $data) {
1710  $md_for = $this->md_section->getFormat($id);
1711  $md_for->setFormat(ilUtil::stripSlashes($data['Format']));
1712  $md_for->update();
1713  }
1714  // Location
1715  $met_location = [];
1716  if ($this->http->wrapper()->post()->has('met_location')) {
1717  $met_location = (array) $this->http->wrapper()->post()->retrieve(
1718  'met_location',
1719  $this->refinery->identity()
1720  );
1721  }
1722  foreach ($met_location as $id => $data) {
1723  $md_loc = $this->md_section->getLocation($id);
1724  $md_loc->setLocation(ilUtil::stripSlashes($data['Location']));
1725  $md_loc->setLocationType(ilUtil::stripSlashes($data['Type']));
1726  $md_loc->update();
1727  }
1728  $met_re = [];
1729  if ($this->http->wrapper()->post()->has('met_re')) {
1730  $met_re = (array) $this->http->wrapper()->post()->retrieve(
1731  'met_re',
1732  $this->refinery->identity()
1733  );
1734  }
1735  foreach ($met_re as $id => $data) {
1736  $md_re = $this->md_section->getRequirement($id);
1737  $md_re->setOperatingSystemName(ilUtil::stripSlashes($data['os']['name']));
1738  $md_re->setOperatingSystemMinimumVersion(ilUtil::stripSlashes($data['os']['MinimumVersion']));
1739  $md_re->setOperatingSystemMaximumVersion(ilUtil::stripSlashes($data['os']['MaximumVersion']));
1740  $md_re->setBrowserName(ilUtil::stripSlashes($data['browser']['name']));
1741  $md_re->setBrowserMinimumVersion(ilUtil::stripSlashes($data['browser']['MinimumVersion']));
1742  $md_re->setBrowserMaximumVersion(ilUtil::stripSlashes($data['browser']['MaximumVersion']));
1743  $md_re->update();
1744  }
1745  $this->callListeners('Technical');
1746 
1747  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
1748  $this->listSection();
1749  return true;
1750  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
callListeners(string $a_element)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilMDEditorGUI::$ctrl
protected

Definition at line 38 of file class.ilMDEditorGUI.php.

◆ $form

ilPropertyFormGUI ilMDEditorGUI::$form = null
protected

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

Referenced by initQuickEditForm().

◆ $http

GlobalHttpState ilMDEditorGUI::$http
protected

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

◆ $lng

ilLanguage ilMDEditorGUI::$lng
protected

Definition at line 39 of file class.ilMDEditorGUI.php.

◆ $md_obj

ilMD ilMDEditorGUI::$md_obj
protected

Definition at line 56 of file class.ilMDEditorGUI.php.

◆ $md_section

◆ $md_settings

ilMDSettings ilMDEditorGUI::$md_settings
protected

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

◆ $obj_id

int ilMDEditorGUI::$obj_id
protected

Definition at line 61 of file class.ilMDEditorGUI.php.

◆ $obj_type

string ilMDEditorGUI::$obj_type
protected

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

◆ $observers

array ilMDEditorGUI::$observers = []
protected

Definition at line 58 of file class.ilMDEditorGUI.php.

◆ $rbac_id

int ilMDEditorGUI::$rbac_id
protected

Definition at line 60 of file class.ilMDEditorGUI.php.

◆ $rbac_system

ilRbacSystem ilMDEditorGUI::$rbac_system
protected

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

◆ $refinery

Refinery ilMDEditorGUI::$refinery
protected

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

◆ $tabs_gui

ilTabsGUI ilMDEditorGUI::$tabs_gui
protected

Definition at line 41 of file class.ilMDEditorGUI.php.

◆ $toolbarGUI

ilToolbarGUI ilMDEditorGUI::$toolbarGUI
protected

Definition at line 46 of file class.ilMDEditorGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilMDEditorGUI::$tpl
protected

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

◆ $tree

ilTree ilMDEditorGUI::$tree
protected

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

◆ $ui_factory

Factory ilMDEditorGUI::$ui_factory
protected

Definition at line 42 of file class.ilMDEditorGUI.php.

◆ $ui_renderer

Renderer ilMDEditorGUI::$ui_renderer
protected

Definition at line 43 of file class.ilMDEditorGUI.php.


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