ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" 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...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 

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...
 
 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...
 

Protected Attributes

 $dic
 
 $error
 
 $rbacsystem
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

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
 

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 56 of file class.ilObjMDSettingsGUI.php.

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

57  {
58  global $DIC;
59  $this->dic = $DIC;
60  $this->error = $DIC['ilErr'];
61  $this->rbacsystem = $this->dic->rbac()->system();
62 
63  $this->type = 'mds';
64  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
65 
66  $this->lng = $this->dic->language();
67  $this->lng->loadLanguageModule("meta");
68  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ addEntry()

ilObjMDSettingsGUI::addEntry ( )

add new entry

public

Parameters

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

References initCopyrightEditForm().

Referenced by saveEntry().

341  {
342  $this->initCopyrightEditForm('add');
343  $this->tpl->setContent($this->form->getHTML());
344  }
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 387 of file class.ilObjMDSettingsGUI.php.

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

388  {
389  if (!is_array($_POST['entry_id']) or !count($_POST['entry_id'])) {
390  ilUtil::sendInfo($this->lng->txt('select_one'));
391  $this->showCopyrightSettings();
392  return true;
393  }
394 
395  include_once('Services/Utilities/classes/class.ilConfirmationGUI.php');
396  $c_gui = new ilConfirmationGUI();
397 
398  // set confirm/cancel commands
399  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteEntries"));
400  $c_gui->setHeaderText($this->lng->txt("md_delete_cp_sure"));
401  $c_gui->setCancel($this->lng->txt("cancel"), "showCopyrightSettings");
402  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteEntries");
403 
404  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
405 
406  // add items to delete
407  foreach ($_POST["entry_id"] as $entry_id) {
408  $entry = new ilMDCopyrightSelectionEntry($entry_id);
409  $c_gui->addItem('entry_id[]', $entry_id, $entry->getTitle());
410  }
411  $this->tpl->setContent($c_gui->getHTML());
412  }
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 420 of file class.ilObjMDSettingsGUI.php.

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

421  {
422  if (!is_array($_POST['entry_id']) or !count($_POST['entry_id'])) {
423  ilUtil::sendInfo($this->lng->txt('select_one'));
424  $this->showCopyrightSettings();
425  return true;
426  }
427 
428  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
429  foreach ($_POST["entry_id"] as $entry_id) {
430  $entry = new ilMDCopyrightSelectionEntry($entry_id);
431  $entry->delete();
432  }
433  ilUtil::sendSuccess($this->lng->txt('md_copyrights_deleted'));
434  $this->showCopyrightSettings();
435  return true;
436  }
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 326 of file class.ilObjMDSettingsGUI.php.

References initCopyrightEditForm().

Referenced by updateEntry().

327  {
328  $this->ctrl->saveParameter($this, 'entry_id');
329  $this->initCopyrightEditForm();
330  $this->tpl->setContent($this->form->getHTML());
331  }
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 76 of file class.ilObjMDSettingsGUI.php.

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

77  {
78  $next_class = $this->ctrl->getNextClass($this);
79  $cmd = $this->ctrl->getCmd();
80 
81  $this->prepareOutput();
82 
83  if (!$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
84  $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
85  }
86 
87  switch ($next_class) {
88  case 'iladvancedmdsettingsgui':
89  $this->tabs_gui->setTabActive('md_advanced');
90  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDSettingsGUI.php');
91  $adv_md = new ilAdvancedMDSettingsGUI();
92  $ret = $this->ctrl->forwardCommand($adv_md);
93  break;
94 
95  case 'ilpermissiongui':
96  $this->tabs_gui->setTabActive('perm_settings');
97  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
98  $perm_gui = new ilPermissionGUI($this);
99  $ret = &$this->ctrl->forwardCommand($perm_gui);
100  break;
101 
102  case 'ilmdcopyrightusagegui':
103  // this command is used if copyrightUsageGUI calls getParentReturn (see ...UsageGUI->setTabs)
104  $this->ctrl->setReturn($this, 'showCopyrightSettings');
105  $copyright_id = $_GET['entry_id'];
106  $gui = new ilMDCopyrightUsageGUI((int) $copyright_id);
107  $this->ctrl->forwardCommand($gui);
108  break;
109 
110  default:
111  $this->initMDSettings();
112  if (!$cmd || $cmd == 'view') {
113  $cmd = "showGeneralSettings";
114  }
115 
116  $this->$cmd();
117  break;
118  }
119  return true;
120  }
initMDSettings()
init Md settings
$_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 142 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 154 of file class.ilObjMDSettingsGUI.php.

References $DIC, and $rbacsystem.

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

◆ getParentObjType()

ilObjMDSettingsGUI::getParentObjType ( )
protected
Returns
string

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

134  {
135  return 'meta';
136  }

◆ getType()

ilObjMDSettingsGUI::getType ( )
protected
Returns
string

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

References $type.

126  {
127  return $this->type;
128  }
$type

◆ initCopyrightEditForm()

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

public

Parameters

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

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

Referenced by addEntry(), and editEntry().

516  {
517  if (is_object($this->form)) {
518  return true;
519  }
520  if (!is_object($this->entry)) {
521  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
522  $this->entry = new ilMDCopyrightSelectionEntry((int) $_REQUEST['entry_id']);
523  }
524 
525  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
526  $this->form = new ilPropertyFormGUI();
527  $this->form->setFormAction($this->ctrl->getFormAction($this));
528 
529  $tit = new ilTextInputGUI($this->lng->txt('title'), 'title');
530  $tit->setValue($this->entry->getTitle());
531  $tit->setRequired(true);
532  $tit->setSize(40);
533  $tit->setMaxLength(255);
534  $this->form->addItem($tit);
535 
536  $des = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
537  $des->setValue($this->entry->getDescription());
538  $des->setRows(3);
539  $this->form->addItem($des);
540 
541  $cop = new ilTextAreaInputGUI($this->lng->txt('md_copyright_value'), 'copyright');
542  $cop->setValue($this->entry->getCopyright());
543  $cop->setRows(5);
544  $this->form->addItem($cop);
545 
546  $usage = new ilRadioGroupInputGUI($this->lng->txt('meta_copyright_usage'), 'outdated');
547  $use = new ilRadioOption($this->lng->txt('meta_copyright_in_use'), 0);
548  $out = new ilRadioOption($this->lng->txt('meta_copyright_outdated'), 1);
549  $usage->addOption($use);
550  $usage->addOption($out);
551  $usage->setValue($this->entry->getOutdated());
552  $this->form->addItem($usage);
553 
554  switch ($a_mode) {
555  case 'edit':
556  $this->form->setTitle($this->lng->txt('md_copyright_edit'));
557  $this->form->addCommandButton('updateEntry', $this->lng->txt('save'));
558  $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
559  break;
560 
561  case 'add':
562  $this->form->setTitle($this->lng->txt('md_copyright_add'));
563  $this->form->addCommandButton('saveEntry', $this->lng->txt('save'));
564  $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
565  break;
566  }
567  }
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 area property in a property form.
+ 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 210 of file class.ilObjMDSettingsGUI.php.

References $DIC, and ilObjectGUI\$lng.

Referenced by showGeneralSettings().

211  {
212  global $DIC;
213 
214  $lng = $DIC['lng'];
215  $ilAccess = $DIC['ilAccess'];
216 
217  $this->tabs_gui->setTabActive('md_general_settings');
218 
219  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
220  $this->form = new ilPropertyFormGUI();
221 
222  $ti = new ilTextInputGUI($this->lng->txt("md_delimiter"), "delimiter");
223  $ti->setInfo($this->lng->txt("md_delimiter_info"));
224  $ti->setMaxLength(1);
225  $ti->setSize(1);
226  $ti->setValue($this->md_settings->getDelimiter());
227  $this->form->addItem($ti);
228 
229  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
230  $this->form->addCommandButton("saveGeneralSettings", $lng->txt("save"));
231  $this->form->addCommandButton("showGeneralSettings", $lng->txt("cancel"));
232  }
233 
234  $this->form->setTitle($lng->txt("md_general_settings"));
235  $this->form->setFormAction($this->ctrl->getFormAction($this));
236  }
This class represents a property form user interface.
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ initMDSettings()

ilObjMDSettingsGUI::initMDSettings ( )
protected

init Md settings

protected

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

References ilMDSettings\_getInstance().

Referenced by executeCommand().

575  {
576  include_once('Services/MetaData/classes/class.ilMDSettings.php');
577  $this->md_settings = ilMDSettings::_getInstance();
578  }
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 475 of file class.ilObjMDSettingsGUI.php.

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

Referenced by showCopyrightSettings().

476  {
477  global $DIC;
478 
479  $ilAccess = $DIC['ilAccess'];
480 
481  if (is_object($this->form)) {
482  return true;
483  }
484  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
485  $this->form = new ilPropertyFormGUI();
486  $this->form->setFormAction($this->ctrl->getFormAction($this));
487  $this->form->setTitle($this->lng->txt('md_copyright_settings'));
488 
489 
490  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
491  $this->form->addCommandButton('saveCopyrightSettings', $this->lng->txt('save'));
492  $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
493  }
494 
495  $check = new ilCheckboxInputGUI($this->lng->txt('md_copyright_enabled'), 'active');
496  $check->setChecked($this->md_settings->isCopyrightSelectionActive());
497  $check->setValue(1);
498  $check->setInfo($this->lng->txt('md_copyright_enable_info'));
499  $this->form->addItem($check);
500 
502  $this->getAdministrationFormId(),
503  $this->form,
504  $this
505  );
506  }
This class represents a property form user interface.
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.
$DIC
Definition: xapitoken.php:46
+ 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 596 of file class.ilObjMDSettingsGUI.php.

References $_POST.

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

◆ saveCopyrightSettings()

ilObjMDSettingsGUI::saveCopyrightSettings ( )

Save news and external webfeeds settings.

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

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

299  {
300  global $DIC;
301 
302  $ilAccess = $DIC['ilAccess'];
303 
304  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
305  $this->ctrl->redirect($this, "showCopyrightSettings");
306  }
307 
308  $this->md_settings->activateCopyrightSelection((int) $_POST['active']);
309  $this->md_settings->save();
310  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
311  $this->showCopyrightSettings();
312  }
showCopyrightSettings()
Edit copyright settings.
$DIC
Definition: xapitoken.php:46
$_POST["username"]
+ Here is the call graph for this function:

◆ saveEntry()

ilObjMDSettingsGUI::saveEntry ( )

save new entry

public

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

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

354  {
355  global $DIC;
356 
357  $ilErr = $DIC['ilErr'];
358 
359  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
360  $this->entry = new ilMDCopyrightSelectionEntry(0);
361 
362  $this->entry->setTitle(ilUtil::stripSlashes($_POST['title']));
363  $this->entry->setDescription(ilUtil::stripSlashes($_POST['description']));
364  $this->entry->setCopyright($this->stripSlashes($_POST['copyright']));
365  $this->entry->setLanguage('en');
366  $this->entry->setCopyrightAndOtherRestrictions(true);
367  $this->entry->setCosts(false);
368  $this->entry->setOutdated((int) $_POST['outdated']);
369 
370  if (!$this->entry->validate()) {
371  ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields'));
372  $this->addEntry();
373  return false;
374  }
375  $this->entry->add();
376  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
377  $this->showCopyrightSettings();
378  return true;
379  }
stripSlashes($a_str)
Special function to strip slashes for copyright fields.
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
$DIC
Definition: xapitoken.php:46
$_POST["username"]
+ Here is the call graph for this function:

◆ saveGeneralSettings()

ilObjMDSettingsGUI::saveGeneralSettings ( )

Save general settings.

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

References $_POST, $DIC, and $ilCtrl.

242  {
243  global $DIC;
244 
245  $ilCtrl = $DIC['ilCtrl'];
246  $ilAccess = $DIC['ilAccess'];
247 
248  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
249  $ilCtrl->redirect($this, "showGeneralSettings");
250  }
251 
252  $delim = (trim($_POST['delimiter']) == "")
253  ? ","
254  : trim($_POST['delimiter']);
255  $this->md_settings->setDelimiter($delim);
256  $this->md_settings->save();
257  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
258 
259  $ilCtrl->redirect($this, "showGeneralSettings");
260  }
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46
$_POST["username"]

◆ showCopyrightSettings()

ilObjMDSettingsGUI::showCopyrightSettings ( )

Edit copyright settings.

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

References $DIC, and initSettingsForm().

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

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

◆ showCopyrightUsages()

ilObjMDSettingsGUI::showCopyrightUsages ( )

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

References $_GET.

315  {
316  $this->ctrl->setParameterByClass('ilmdcopyrightusagegui', 'entry_id', $_GET['entry_id']);
317  $this->ctrl->redirectByClass('ilmdcopyrightusagegui', "showUsageTable");
318  }
$_GET["client_id"]

◆ showGeneralSettings()

ilObjMDSettingsGUI::showGeneralSettings ( )

Edit general settings.

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

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

196  {
197  global $DIC;
198 
199  $tpl = $DIC['tpl'];
200 
201  $this->initGeneralSettingsForm();
202  $tpl->setContent($this->form->getHTML());
203  }
initGeneralSettingsForm($a_mode="edit")
Init general settings form.
$DIC
Definition: xapitoken.php:46
+ 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 585 of file class.ilObjMDSettingsGUI.php.

Referenced by saveEntry(), and updateEntry().

586  {
587  if (ini_get("magic_quotes_gpc")) {
588  $a_str = stripslashes($a_str);
589  }
590  return $a_str;
591  }
+ Here is the caller graph for this function:

◆ updateEntry()

ilObjMDSettingsGUI::updateEntry ( )

update one entry

public

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

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

445  {
446  global $DIC;
447 
448  $ilErr = $DIC['ilErr'];
449 
450  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
451  $this->entry = new ilMDCopyrightSelectionEntry((int) $_REQUEST['entry_id']);
452 
453  $this->entry->setTitle(ilUtil::stripSlashes($_POST['title']));
454  $this->entry->setDescription(ilUtil::stripSlashes($_POST['description']));
455  $this->entry->setCopyright($this->stripSlashes($_POST['copyright']));
456  $this->entry->setOutdated((int) $_POST['outdated']);
457 
458  if (!$this->entry->validate()) {
459  ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields'));
460  $this->editEntry();
461  return false;
462  }
463  $this->entry->update();
464  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
465  $this->showCopyrightSettings();
466  return true;
467  }
stripSlashes($a_str)
Special function to strip slashes for copyright fields.
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
$DIC
Definition: xapitoken.php:46
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $dic

ilObjMDSettingsGUI::$dic
protected

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

◆ $error

ilObjMDSettingsGUI::$error
protected

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

◆ $rbacsystem

ilObjMDSettingsGUI::$rbacsystem
protected

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

Referenced by getAdminTabs().


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