ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjMDSettingsGUI Class Reference

Meta Data Settings. More...

+ Inheritance diagram for ilObjMDSettingsGUI:
+ Collaboration diagram for ilObjMDSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 showGeneralSettings ()
 Edit general settings. More...
 
 initGeneralSettingsForm ($a_mode="edit")
 Init general settings form. More...
 
 saveGeneralSettings ()
 Save general settings. More...
 
 showCopyrightSettings ()
 Edit copyright settings. More...
 
 saveCopyrightSettings ()
 Save news and external webfeeds settings. More...
 
 showCopyrightUsages ()
 
 editEntry ()
 edit one selection More...
 
 addEntry ()
 add new entry More...
 
 saveEntry ()
 save new entry More...
 
 confirmDeleteEntries ()
 confirm deletion of entries More...
 
 deleteEntries ()
 delete entries More...
 
 updateEntry ()
 update one entry More...
 
 initCopyrightEditForm ($a_mode='edit')
 public More...
 
 saveCopyrightPosition ()
 Save the order position to display the copyrights in the GUI table. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Protected Member Functions

 getType ()
 
 getParentObjType ()
 
 getAdministrationFormId ()
 
 initSettingsForm ()
 protected More...
 
 initMDSettings ()
 init Md settings More...
 
 stripSlashes ($a_str)
 Special function to strip slashes for copyright fields. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjMDSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor.

public

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

References $DIC, and ilObjectGUI\$lng.

45  {
46  global $DIC;
47 
48  $lng = $DIC['lng'];
49 
50  $this->type = 'mds';
51  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
52 
53  $this->lng = $lng;
54  $this->lng->loadLanguageModule("meta");
55  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ addEntry()

ilObjMDSettingsGUI::addEntry ( )

add new entry

public

Parameters

Definition at line 333 of file class.ilObjMDSettingsGUI.php.

References initCopyrightEditForm().

Referenced by saveEntry().

334  {
335  $this->initCopyrightEditForm('add');
336  $this->tpl->setContent($this->form->getHTML());
337  }
initCopyrightEditForm($a_mode='edit')
public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteEntries()

ilObjMDSettingsGUI::confirmDeleteEntries ( )

confirm deletion of entries

public

Definition at line 380 of file class.ilObjMDSettingsGUI.php.

References $_POST, ilUtil\sendInfo(), and showCopyrightSettings().

381  {
382  if (!is_array($_POST['entry_id']) or !count($_POST['entry_id'])) {
383  ilUtil::sendInfo($this->lng->txt('select_one'));
384  $this->showCopyrightSettings();
385  return true;
386  }
387 
388  include_once('Services/Utilities/classes/class.ilConfirmationGUI.php');
389  $c_gui = new ilConfirmationGUI();
390 
391  // set confirm/cancel commands
392  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteEntries"));
393  $c_gui->setHeaderText($this->lng->txt("md_delete_cp_sure"));
394  $c_gui->setCancel($this->lng->txt("cancel"), "showCopyrightSettings");
395  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteEntries");
396 
397  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
398 
399  // add items to delete
400  foreach ($_POST["entry_id"] as $entry_id) {
401  $entry = new ilMDCopyrightSelectionEntry($entry_id);
402  $c_gui->addItem('entry_id[]', $entry_id, $entry->getTitle());
403  }
404  $this->tpl->setContent($c_gui->getHTML());
405  }
showCopyrightSettings()
Edit copyright settings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteEntries()

ilObjMDSettingsGUI::deleteEntries ( )

delete entries

public

Definition at line 413 of file class.ilObjMDSettingsGUI.php.

References $_POST, ilUtil\sendInfo(), and showCopyrightSettings().

414  {
415  if (!is_array($_POST['entry_id']) or !count($_POST['entry_id'])) {
416  ilUtil::sendInfo($this->lng->txt('select_one'));
417  $this->showCopyrightSettings();
418  return true;
419  }
420 
421  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
422  foreach ($_POST["entry_id"] as $entry_id) {
423  $entry = new ilMDCopyrightSelectionEntry($entry_id);
424  $entry->delete();
425  }
426  ilUtil::sendSuccess($this->lng->txt('md_copyrights_deleted'));
427  $this->showCopyrightSettings();
428  return true;
429  }
showCopyrightSettings()
Edit copyright settings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ editEntry()

ilObjMDSettingsGUI::editEntry ( )

edit one selection

public

Definition at line 319 of file class.ilObjMDSettingsGUI.php.

References initCopyrightEditForm().

Referenced by updateEntry().

320  {
321  $this->ctrl->saveParameter($this, 'entry_id');
322  $this->initCopyrightEditForm();
323  $this->tpl->setContent($this->form->getHTML());
324  }
initCopyrightEditForm($a_mode='edit')
public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjMDSettingsGUI::executeCommand ( )

Execute command.

public

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

References $_GET, $DIC, ilObjectGUI\$ilErr, $ret, initMDSettings(), and ilObjectGUI\prepareOutput().

64  {
65  global $DIC;
66 
67  $rbacsystem = $DIC['rbacsystem'];
68  $ilErr = $DIC['ilErr'];
69  $ilAccess = $DIC['ilAccess'];
70 
71  $next_class = $this->ctrl->getNextClass($this);
72  $cmd = $this->ctrl->getCmd();
73 
74  $this->prepareOutput();
75 
76  if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
77  $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
78  }
79 
80  switch ($next_class) {
81  case 'iladvancedmdsettingsgui':
82  $this->tabs_gui->setTabActive('md_advanced');
83  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDSettingsGUI.php');
84  $adv_md = new ilAdvancedMDSettingsGUI();
85  $ret = $this->ctrl->forwardCommand($adv_md);
86  break;
87 
88  case 'ilpermissiongui':
89  $this->tabs_gui->setTabActive('perm_settings');
90  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
91  $perm_gui = new ilPermissionGUI($this);
92  $ret = &$this->ctrl->forwardCommand($perm_gui);
93  break;
94 
95  case 'ilmdcopyrightusagegui':
96  // this command is used if copyrightUsageGUI calls getParentReturn (see ...UsageGUI->setTabs)
97  $this->ctrl->setReturn($this, 'showCopyrightSettings');
98  $copyright_id = $_GET['entry_id'];
99  $gui = new ilMDCopyrightUsageGUI((int) $copyright_id);
100  $this->ctrl->forwardCommand($gui);
101  break;
102 
103  default:
104  $this->initMDSettings();
105  if (!$cmd || $cmd == 'view') {
106  $cmd = "showGeneralSettings";
107  }
108 
109  $this->$cmd();
110  break;
111  }
112  return true;
113  }
initMDSettings()
init Md settings
global $DIC
Definition: saml.php:7
$_GET["client_id"]
prepareOutput($a_show_subobjects=true)
prepare output
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdministrationFormId()

ilObjMDSettingsGUI::getAdministrationFormId ( )
protected
Returns
int

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

References ilAdministrationSettingsFormHandler\FORM_META_COPYRIGHT.

Referenced by initSettingsForm().

+ Here is the caller graph for this function:

◆ getAdminTabs()

ilObjMDSettingsGUI::getAdminTabs ( )

Get tabs.

public

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

References $DIC.

148  {
149  global $DIC;
150 
151  $rbacsystem = $DIC['rbacsystem'];
152  $ilAccess = $DIC['ilAccess'];
153 
154  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
155  $this->tabs_gui->addTarget(
156  "md_general_settings",
157  $this->ctrl->getLinkTarget($this, "showGeneralSettings"),
158  array("showGeneralSettings", "view")
159  );
160 
161  $this->tabs_gui->addTarget(
162  "md_copyright",
163  $this->ctrl->getLinkTarget($this, "showCopyrightSettings"),
164  array("showCopyrightSettings")
165  );
166 
167  $this->tabs_gui->addTarget(
168  "md_advanced",
169  $this->ctrl->getLinkTargetByClass('iladvancedmdsettingsgui', ""),
170  '',
171  'iladvancedmdsettingsgui'
172  );
173  }
174 
175  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
176  $this->tabs_gui->addTarget(
177  "perm_settings",
178  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
179  array(),
180  'ilpermissiongui'
181  );
182  }
183  }
global $DIC
Definition: saml.php:7

◆ getParentObjType()

ilObjMDSettingsGUI::getParentObjType ( )
protected
Returns
string

Definition at line 126 of file class.ilObjMDSettingsGUI.php.

127  {
128  return 'meta';
129  }

◆ getType()

ilObjMDSettingsGUI::getType ( )
protected
Returns
string

Definition at line 118 of file class.ilObjMDSettingsGUI.php.

References $type.

119  {
120  return $this->type;
121  }
$type

◆ initCopyrightEditForm()

ilObjMDSettingsGUI::initCopyrightEditForm (   $a_mode = 'edit')

public

Parameters

Definition at line 508 of file class.ilObjMDSettingsGUI.php.

References $out, ilTextInputGUI\setValue(), ilRadioOption\setValue(), and ilTextAreaInputGUI\setValue().

Referenced by addEntry(), and editEntry().

509  {
510  if (is_object($this->form)) {
511  return true;
512  }
513  if (!is_object($this->entry)) {
514  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
515  $this->entry = new ilMDCopyrightSelectionEntry((int) $_REQUEST['entry_id']);
516  }
517 
518  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
519  $this->form = new ilPropertyFormGUI();
520  $this->form->setFormAction($this->ctrl->getFormAction($this));
521 
522  $tit = new ilTextInputGUI($this->lng->txt('title'), 'title');
523  $tit->setValue($this->entry->getTitle());
524  $tit->setRequired(true);
525  $tit->setSize(40);
526  $tit->setMaxLength(255);
527  $this->form->addItem($tit);
528 
529  $des = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
530  $des->setValue($this->entry->getDescription());
531  $des->setRows(3);
532  $this->form->addItem($des);
533 
534  $cop = new ilTextAreaInputGUI($this->lng->txt('md_copyright_value'), 'copyright');
535  $cop->setValue($this->entry->getCopyright());
536  $cop->setRows(5);
537  $this->form->addItem($cop);
538 
539  $usage = new ilRadioGroupInputGUI($this->lng->txt('meta_copyright_usage'), 'outdated');
540  $use = new ilRadioOption($this->lng->txt('meta_copyright_in_use'), 0);
541  $out = new ilRadioOption($this->lng->txt('meta_copyright_outdated'), 1);
542  $usage->addOption($use);
543  $usage->addOption($out);
544  $usage->setValue($this->entry->getOutdated());
545  $this->form->addItem($usage);
546 
547  switch ($a_mode) {
548  case 'edit':
549  $this->form->setTitle($this->lng->txt('md_copyright_edit'));
550  $this->form->addCommandButton('updateEntry', $this->lng->txt('save'));
551  $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
552  break;
553 
554  case 'add':
555  $this->form->setTitle($this->lng->txt('md_copyright_add'));
556  $this->form->addCommandButton('saveEntry', $this->lng->txt('save'));
557  $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
558  break;
559  }
560  }
This class represents an option in a radio group.
This class represents a property form user interface.
setValue($a_value)
Set Value.
This class represents a property in a property form.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
This class represents a text area property in a property form.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initGeneralSettingsForm()

ilObjMDSettingsGUI::initGeneralSettingsForm (   $a_mode = "edit")

Init general settings form.

Parameters
int$a_modeEdit Mode

Definition at line 203 of file class.ilObjMDSettingsGUI.php.

References $DIC, ilObjectGUI\$lng, and ilFormPropertyGUI\setInfo().

Referenced by showGeneralSettings().

204  {
205  global $DIC;
206 
207  $lng = $DIC['lng'];
208  $ilAccess = $DIC['ilAccess'];
209 
210  $this->tabs_gui->setTabActive('md_general_settings');
211 
212  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
213  $this->form = new ilPropertyFormGUI();
214 
215  $ti = new ilTextInputGUI($this->lng->txt("md_delimiter"), "delimiter");
216  $ti->setInfo($this->lng->txt("md_delimiter_info"));
217  $ti->setMaxLength(1);
218  $ti->setSize(1);
219  $ti->setValue($this->md_settings->getDelimiter());
220  $this->form->addItem($ti);
221 
222  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
223  $this->form->addCommandButton("saveGeneralSettings", $lng->txt("save"));
224  $this->form->addCommandButton("showGeneralSettings", $lng->txt("cancel"));
225  }
226 
227  $this->form->setTitle($lng->txt("md_general_settings"));
228  $this->form->setFormAction($this->ctrl->getFormAction($this));
229  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
setInfo($a_info)
Set Information Text.
This class represents a text property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMDSettings()

ilObjMDSettingsGUI::initMDSettings ( )
protected

init Md settings

protected

Definition at line 567 of file class.ilObjMDSettingsGUI.php.

References ilMDSettings\_getInstance().

Referenced by executeCommand().

568  {
569  include_once('Services/MetaData/classes/class.ilMDSettings.php');
570  $this->md_settings = ilMDSettings::_getInstance();
571  }
static _getInstance()
get instance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjMDSettingsGUI::initSettingsForm ( )
protected

protected

Definition at line 468 of file class.ilObjMDSettingsGUI.php.

References $DIC, ilAdministrationSettingsFormHandler\addFieldsToForm(), getAdministrationFormId(), and ilCheckboxInputGUI\setChecked().

Referenced by showCopyrightSettings().

469  {
470  global $DIC;
471 
472  $ilAccess = $DIC['ilAccess'];
473 
474  if (is_object($this->form)) {
475  return true;
476  }
477  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
478  $this->form = new ilPropertyFormGUI();
479  $this->form->setFormAction($this->ctrl->getFormAction($this));
480  $this->form->setTitle($this->lng->txt('md_copyright_settings'));
481 
482 
483  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
484  $this->form->addCommandButton('saveCopyrightSettings', $this->lng->txt('save'));
485  $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
486  }
487 
488  $check = new ilCheckboxInputGUI($this->lng->txt('md_copyright_enabled'), 'active');
489  $check->setChecked($this->md_settings->isCopyrightSelectionActive());
490  $check->setValue(1);
491  $check->setInfo($this->lng->txt('md_copyright_enable_info'));
492  $this->form->addItem($check);
493 
495  $this->getAdministrationFormId(),
496  $this->form,
497  $this
498  );
499  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
This class represents a checkbox property in a property form.
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
setChecked($a_checked)
Set Checked.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCopyrightPosition()

ilObjMDSettingsGUI::saveCopyrightPosition ( )

Save the order position to display the copyrights in the GUI table.

Definition at line 589 of file class.ilObjMDSettingsGUI.php.

References $_POST.

590  {
591  if (!isset($_POST['order'])) {
592  $this->ctrl->redirect($this, 'showCopyrightSettings');
593  return false;
594  }
595 
596  $positions = $_POST['order'];
597  asort($positions);
598  $position = 0;
599  foreach ($positions as $entry_id => $position_ignored) {
600  $copyright = new ilMDCopyrightSelectionEntry($entry_id);
601  $copyright->setOrderPosition($position++);
602  $copyright->update();
603  }
604  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
605  $this->ctrl->redirect($this, 'showCopyrightSettings');
606  return false;
607  }
$_POST["username"]

◆ saveCopyrightSettings()

ilObjMDSettingsGUI::saveCopyrightSettings ( )

Save news and external webfeeds settings.

Definition at line 291 of file class.ilObjMDSettingsGUI.php.

References $_POST, $DIC, and showCopyrightSettings().

292  {
293  global $DIC;
294 
295  $ilAccess = $DIC['ilAccess'];
296 
297  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
298  $this->ctrl->redirect($this, "showCopyrightSettings");
299  }
300 
301  $this->md_settings->activateCopyrightSelection((int) $_POST['active']);
302  $this->md_settings->save();
303  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
304  $this->showCopyrightSettings();
305  }
global $DIC
Definition: saml.php:7
showCopyrightSettings()
Edit copyright settings.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveEntry()

ilObjMDSettingsGUI::saveEntry ( )

save new entry

public

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

References $_POST, $DIC, ilObjectGUI\$ilErr, addEntry(), ilUtil\sendInfo(), showCopyrightSettings(), stripSlashes(), and ilUtil\stripSlashes().

347  {
348  global $DIC;
349 
350  $ilErr = $DIC['ilErr'];
351 
352  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
353  $this->entry = new ilMDCopyrightSelectionEntry(0);
354 
355  $this->entry->setTitle(ilUtil::stripSlashes($_POST['title']));
356  $this->entry->setDescription(ilUtil::stripSlashes($_POST['description']));
357  $this->entry->setCopyright($this->stripSlashes($_POST['copyright']));
358  $this->entry->setLanguage('en');
359  $this->entry->setCopyrightAndOtherRestrictions(true);
360  $this->entry->setCosts(false);
361  $this->entry->setOutdated((int) $_POST['outdated']);
362 
363  if (!$this->entry->validate()) {
364  ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields'));
365  $this->addEntry();
366  return false;
367  }
368  $this->entry->add();
369  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
370  $this->showCopyrightSettings();
371  return true;
372  }
stripSlashes($a_str)
Special function to strip slashes for copyright fields.
global $DIC
Definition: saml.php:7
showCopyrightSettings()
Edit copyright settings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ saveGeneralSettings()

ilObjMDSettingsGUI::saveGeneralSettings ( )

Save general settings.

Definition at line 234 of file class.ilObjMDSettingsGUI.php.

References $_POST, $DIC, and $ilCtrl.

235  {
236  global $DIC;
237 
238  $ilCtrl = $DIC['ilCtrl'];
239  $ilAccess = $DIC['ilAccess'];
240 
241  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
242  $ilCtrl->redirect($this, "showGeneralSettings");
243  }
244 
245  $delim = (trim($_POST['delimiter']) == "")
246  ? ","
247  : trim($_POST['delimiter']);
248  $this->md_settings->setDelimiter($delim);
249  $this->md_settings->save();
250  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
251 
252  $ilCtrl->redirect($this, "showGeneralSettings");
253  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ showCopyrightSettings()

ilObjMDSettingsGUI::showCopyrightSettings ( )

Edit copyright settings.

Definition at line 259 of file class.ilObjMDSettingsGUI.php.

References $DIC, and initSettingsForm().

Referenced by confirmDeleteEntries(), deleteEntries(), saveCopyrightSettings(), saveEntry(), and updateEntry().

260  {
261  global $DIC;
262 
263  $ilAccess = $DIC['ilAccess'];
264 
265  $this->tabs_gui->setTabActive('md_copyright');
266  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.settings.html', 'Services/MetaData');
267 
268  $this->initSettingsForm();
269  $this->tpl->setVariable('SETTINGS_TABLE', $this->form->getHTML());
270 
271  $has_write = $ilAccess->checkAccess('write', '', $this->object->getRefId());
272 
273  include_once("./Services/MetaData/classes/class.ilMDCopyrightTableGUI.php");
274  $table_gui = new ilMDCopyrightTableGUI($this, 'showCopyrightSettings', $has_write);
275  $table_gui->setTitle($this->lng->txt("md_copyright_selection"));
276  $table_gui->parseSelections();
277 
278  if ($has_write) {
279  // $table_gui->addCommandButton("updateCopyrightSelection", $this->lng->txt("save"));
280  $table_gui->addCommandButton('addEntry', $this->lng->txt('add'));
281  $table_gui->addMultiCommand("confirmDeleteEntries", $this->lng->txt("delete"));
282  $table_gui->setSelectAllCheckbox("entry_id");
283  }
284 
285  $this->tpl->setVariable('COPYRIGHT_TABLE', $table_gui->getHTML());
286  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCopyrightUsages()

ilObjMDSettingsGUI::showCopyrightUsages ( )

Definition at line 307 of file class.ilObjMDSettingsGUI.php.

References $_GET.

308  {
309  $this->ctrl->setParameterByClass('ilmdcopyrightusagegui', 'entry_id', $_GET['entry_id']);
310  $this->ctrl->redirectByClass('ilmdcopyrightusagegui', "showUsageTable");
311  }
$_GET["client_id"]

◆ showGeneralSettings()

ilObjMDSettingsGUI::showGeneralSettings ( )

Edit general settings.

Definition at line 188 of file class.ilObjMDSettingsGUI.php.

References $DIC, ilObjectGUI\$tpl, and initGeneralSettingsForm().

189  {
190  global $DIC;
191 
192  $tpl = $DIC['tpl'];
193 
194  $this->initGeneralSettingsForm();
195  $tpl->setContent($this->form->getHTML());
196  }
global $DIC
Definition: saml.php:7
initGeneralSettingsForm($a_mode="edit")
Init general settings form.
+ Here is the call graph for this function:

◆ stripSlashes()

ilObjMDSettingsGUI::stripSlashes (   $a_str)
protected

Special function to strip slashes for copyright fields.

protected

Definition at line 578 of file class.ilObjMDSettingsGUI.php.

Referenced by saveEntry(), and updateEntry().

579  {
580  if (ini_get("magic_quotes_gpc")) {
581  $a_str = stripslashes($a_str);
582  }
583  return $a_str;
584  }
+ Here is the caller graph for this function:

◆ updateEntry()

ilObjMDSettingsGUI::updateEntry ( )

update one entry

public

Definition at line 437 of file class.ilObjMDSettingsGUI.php.

References $_POST, $DIC, ilObjectGUI\$ilErr, editEntry(), ilUtil\sendInfo(), showCopyrightSettings(), stripSlashes(), and ilUtil\stripSlashes().

438  {
439  global $DIC;
440 
441  $ilErr = $DIC['ilErr'];
442 
443  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
444  $this->entry = new ilMDCopyrightSelectionEntry((int) $_REQUEST['entry_id']);
445 
446  $this->entry->setTitle(ilUtil::stripSlashes($_POST['title']));
447  $this->entry->setDescription(ilUtil::stripSlashes($_POST['description']));
448  $this->entry->setCopyright($this->stripSlashes($_POST['copyright']));
449  $this->entry->setOutdated((int) $_POST['outdated']);
450 
451  if (!$this->entry->validate()) {
452  ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields'));
453  $this->editEntry();
454  return false;
455  }
456  $this->entry->update();
457  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
458  $this->showCopyrightSettings();
459  return true;
460  }
stripSlashes($a_str)
Special function to strip slashes for copyright fields.
global $DIC
Definition: saml.php:7
showCopyrightSettings()
Edit copyright settings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
editEntry()
edit one selection
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

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