ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 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')
 @access public 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 @access 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...
 

Protected Member Functions

 initSettingsForm ()
 @access 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
 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Meta Data Settings.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

@ilCtrl_Calls ilObjMDSettingsGUI: ilPermissionGUI, ilAdvancedMDSettingsGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

Contructor.

@access public

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

45 {
46 global $lng;
47
48 $this->type = 'mds';
49 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
50
51 $this->lng = $lng;
52 $this->lng->loadLanguageModule("meta");
53 }

References ilObjectGUI\$lng.

Member Function Documentation

◆ addEntry()

ilObjMDSettingsGUI::addEntry ( )

add new entry

@access public

Parameters

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

274 {
275 $this->initCopyrightEditForm('add');
276 $this->tpl->setContent($this->form->getHTML());
277 }
initCopyrightEditForm($a_mode='edit')
@access public

References initCopyrightEditForm().

Referenced by saveEntry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteEntries()

ilObjMDSettingsGUI::confirmDeleteEntries ( )

confirm deletion of entries

@access public

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

318 {
319 if (!is_array($_POST['entry_id']) or !count($_POST['entry_id'])) {
320 ilUtil::sendInfo($this->lng->txt('select_one'));
321 $this->showCopyrightSettings();
322 return true;
323 }
324
325 include_once('Services/Utilities/classes/class.ilConfirmationGUI.php');
326 $c_gui = new ilConfirmationGUI();
327
328 // set confirm/cancel commands
329 $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteEntries"));
330 $c_gui->setHeaderText($this->lng->txt("md_delete_cp_sure"));
331 $c_gui->setCancel($this->lng->txt("cancel"), "showCopyrightSettings");
332 $c_gui->setConfirm($this->lng->txt("confirm"), "deleteEntries");
333
334 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
335
336 // add items to delete
337 foreach ($_POST["entry_id"] as $entry_id) {
338 $entry = new ilMDCopyrightSelectionEntry($entry_id);
339 $c_gui->addItem('entry_id[]', $entry_id, $entry->getTitle());
340 }
341 $this->tpl->setContent($c_gui->getHTML());
342 }
$_POST["username"]
Confirmation screen class.
showCopyrightSettings()
Edit copyright settings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

+ Here is the call graph for this function:

◆ deleteEntries()

ilObjMDSettingsGUI::deleteEntries ( )

delete entries

@access public

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

351 {
352 if (!is_array($_POST['entry_id']) or !count($_POST['entry_id'])) {
353 ilUtil::sendInfo($this->lng->txt('select_one'));
354 $this->showCopyrightSettings();
355 return true;
356 }
357
358 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
359 foreach ($_POST["entry_id"] as $entry_id) {
360 $entry = new ilMDCopyrightSelectionEntry($entry_id);
361 $entry->delete();
362 }
363 ilUtil::sendSuccess($this->lng->txt('md_copyrights_deleted'));
364 $this->showCopyrightSettings();
365 return true;
366 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

◆ editEntry()

ilObjMDSettingsGUI::editEntry ( )

edit one selection

@access public

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

260 {
261 $this->ctrl->saveParameter($this, 'entry_id');
262 $this->initCopyrightEditForm();
263 $this->tpl->setContent($this->form->getHTML());
264 }

References initCopyrightEditForm().

Referenced by updateEntry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjMDSettingsGUI::executeCommand ( )

Execute command.

@access public

Reimplemented from ilObjectGUI.

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

62 {
63 global $rbacsystem,$ilErr,$ilAccess;
64
65 $next_class = $this->ctrl->getNextClass($this);
66 $cmd = $this->ctrl->getCmd();
67
68 $this->prepareOutput();
69
70 if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
71 $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
72 }
73
74 switch ($next_class) {
75 case 'iladvancedmdsettingsgui':
76 $this->tabs_gui->setTabActive('md_advanced');
77 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDSettingsGUI.php');
78 $adv_md = new ilAdvancedMDSettingsGUI();
79 $ret = $this->ctrl->forwardCommand($adv_md);
80 break;
81
82 case 'ilpermissiongui':
83 $this->tabs_gui->setTabActive('perm_settings');
84 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
85 $perm_gui = new ilPermissionGUI($this);
86 $ret =&$this->ctrl->forwardCommand($perm_gui);
87 break;
88
89 default:
90 $this->initMDSettings();
91 if (!$cmd || $cmd == 'view') {
92 $cmd = "showGeneralSettings";
93 }
94
95 $this->$cmd();
96 break;
97 }
98 return true;
99 }
initMDSettings()
init Md settings
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6

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

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjMDSettingsGUI::getAdminTabs ( )

Get tabs.

@access public

Reimplemented from ilObjectGUI.

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

108 {
109 global $rbacsystem, $ilAccess;
110
111 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
112 $this->tabs_gui->addTarget(
113 "md_general_settings",
114 $this->ctrl->getLinkTarget($this, "showGeneralSettings"),
115 array("showGeneralSettings", "view")
116 );
117
118 $this->tabs_gui->addTarget(
119 "md_copyright",
120 $this->ctrl->getLinkTarget($this, "showCopyrightSettings"),
121 array("showCopyrightSettings")
122 );
123
124 $this->tabs_gui->addTarget(
125 "md_advanced",
126 $this->ctrl->getLinkTargetByClass('iladvancedmdsettingsgui', ""),
127 '',
128 'iladvancedmdsettingsgui'
129 );
130 }
131
132 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
133 $this->tabs_gui->addTarget(
134 "perm_settings",
135 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
136 array(),
137 'ilpermissiongui'
138 );
139 }
140 }

References ilObjectGUI\$rbacsystem.

◆ initCopyrightEditForm()

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

@access public

Parameters

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

434 {
435 if (is_object($this->form)) {
436 return true;
437 }
438 if (!is_object($this->entry)) {
439 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
440 $this->entry = new ilMDCopyrightSelectionEntry((int) $_REQUEST['entry_id']);
441 }
442
443 include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
444 $this->form = new ilPropertyFormGUI();
445 $this->form->setFormAction($this->ctrl->getFormAction($this));
446
447 $tit = new ilTextInputGUI($this->lng->txt('title'), 'title');
448 $tit->setValue($this->entry->getTitle());
449 $tit->setRequired(true);
450 $tit->setSize(40);
451 $tit->setMaxLength(255);
452 $this->form->addItem($tit);
453
454 $des = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
455 $des->setValue($this->entry->getDescription());
456 $des->setRows(3);
457 $this->form->addItem($des);
458
459 $cop = new ilTextAreaInputGUI($this->lng->txt('md_copyright_value'), 'copyright');
460 $cop->setValue($this->entry->getCopyright());
461 $cop->setRows(5);
462 $this->form->addItem($cop);
463
464 switch ($a_mode) {
465 case 'edit':
466 $this->form->setTitle($this->lng->txt('md_copyright_edit'));
467 $this->form->addCommandButton('updateEntry', $this->lng->txt('save'));
468 $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
469 break;
470
471 case 'add':
472 $this->form->setTitle($this->lng->txt('md_copyright_add'));
473 $this->form->addCommandButton('saveEntry', $this->lng->txt('save'));
474 $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
475 break;
476 }
477 }
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.

Referenced by addEntry(), and editEntry().

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

159 {
160 global $lng, $ilAccess;
161
162 $this->tabs_gui->setTabActive('md_general_settings');
163
164 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
165 $this->form = new ilPropertyFormGUI();
166
167 $ti = new ilTextInputGUI($this->lng->txt("md_delimiter"), "delimiter");
168 $ti->setInfo($this->lng->txt("md_delimiter_info"));
169 $ti->setMaxLength(1);
170 $ti->setSize(1);
171 $ti->setValue($this->md_settings->getDelimiter());
172 $this->form->addItem($ti);
173
174 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
175 $this->form->addCommandButton("saveGeneralSettings", $lng->txt("save"));
176 $this->form->addCommandButton("showGeneralSettings", $lng->txt("cancel"));
177 }
178
179 $this->form->setTitle($lng->txt("md_general_settings"));
180 $this->form->setFormAction($this->ctrl->getFormAction($this));
181 }

References ilObjectGUI\$lng.

Referenced by showGeneralSettings().

+ Here is the caller graph for this function:

◆ initMDSettings()

ilObjMDSettingsGUI::initMDSettings ( )
protected

init Md settings

@access protected

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

485 {
486 include_once('Services/MetaData/classes/class.ilMDSettings.php');
487 $this->md_settings = ilMDSettings::_getInstance();
488 }
static _getInstance()
get instance

References ilMDSettings\_getInstance().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjMDSettingsGUI::initSettingsForm ( )
protected

@access protected

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

403 {
404 global $ilAccess;
405
406 if (is_object($this->form)) {
407 return true;
408 }
409 include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
410 $this->form = new ilPropertyFormGUI();
411 $this->form->setFormAction($this->ctrl->getFormAction($this));
412 $this->form->setTitle($this->lng->txt('md_copyright_settings'));
413
414 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
415 $this->form->addCommandButton('saveCopyrightSettings', $this->lng->txt('save'));
416 $this->form->addCommandButton('showCopyrightSettings', $this->lng->txt('cancel'));
417 }
418
419 $check = new ilCheckboxInputGUI($this->lng->txt('md_copyright_enabled'), 'active');
420 $check->setChecked($this->md_settings->isCopyrightSelectionActive());
421 $check->setValue(1);
422 $check->setInfo($this->lng->txt('md_copyright_enable_info'));
423 $this->form->addItem($check);
424 }
This class represents a checkbox property in a property form.

Referenced by showCopyrightSettings().

+ Here is the caller graph for this function:

◆ saveCopyrightSettings()

ilObjMDSettingsGUI::saveCopyrightSettings ( )

Save news and external webfeeds settings.

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

239 {
240 global $ilAccess;
241
242 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
243 $this->ctrl->redirect($this, "showCopyrightSettings");
244 }
245
246 $this->md_settings->activateCopyrightSelection((int) $_POST['active']);
247 $this->md_settings->save();
248 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
249 $this->showCopyrightSettings();
250 }

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

+ Here is the call graph for this function:

◆ saveEntry()

ilObjMDSettingsGUI::saveEntry ( )

save new entry

@access public

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

287 {
288 global $ilErr;
289
290 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
291 $this->entry = new ilMDCopyrightSelectionEntry(0);
292
293 $this->entry->setTitle(ilUtil::stripSlashes($_POST['title']));
294 $this->entry->setDescription(ilUtil::stripSlashes($_POST['description']));
295 $this->entry->setCopyright($this->stripSlashes($_POST['copyright']));
296 $this->entry->setLanguage('en');
297 $this->entry->setCopyrightAndOtherRestrictions(true);
298 $this->entry->setCosts(false);
299
300 if (!$this->entry->validate()) {
301 ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields'));
302 $this->addEntry();
303 return false;
304 }
305 $this->entry->add();
306 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
307 $this->showCopyrightSettings();
308 return true;
309 }
stripSlashes($a_str)
Special function to strip slashes for copyright fields.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ saveGeneralSettings()

ilObjMDSettingsGUI::saveGeneralSettings ( )

Save general settings.

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

187 {
188 global $ilCtrl, $ilAccess;
189
190 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
191 $ilCtrl->redirect($this, "showGeneralSettings");
192 }
193
194 $delim = (trim($_POST['delimiter']) == "")
195 ? ","
196 : trim($_POST['delimiter']);
197 $this->md_settings->setDelimiter($delim);
198 $this->md_settings->save();
199 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
200
201 $ilCtrl->redirect($this, "showGeneralSettings");
202 }
global $ilCtrl
Definition: ilias.php:18

References $_POST, $ilCtrl, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ showCopyrightSettings()

ilObjMDSettingsGUI::showCopyrightSettings ( )

Edit copyright settings.

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

209 {
210 global $ilAccess;
211
212 $this->tabs_gui->setTabActive('md_copyright');
213 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.settings.html', 'Services/MetaData');
214
215 $this->initSettingsForm();
216 $this->tpl->setVariable('SETTINGS_TABLE', $this->form->getHTML());
217
218 $has_write = $ilAccess->checkAccess('write', '', $this->object->getRefId());
219
220 include_once("./Services/MetaData/classes/class.ilMDCopyrightTableGUI.php");
221 $table_gui = new ilMDCopyrightTableGUI($this, 'showCopyrightSettings', $has_write);
222 $table_gui->setTitle($this->lng->txt("md_copyright_selection"));
223 $table_gui->parseSelections();
224
225 if ($has_write) {
226 // $table_gui->addCommandButton("updateCopyrightSelection", $this->lng->txt("save"));
227 $table_gui->addCommandButton('addEntry', $this->lng->txt('add'));
228 $table_gui->addMultiCommand("confirmDeleteEntries", $this->lng->txt("delete"));
229 $table_gui->setSelectAllCheckbox("entry_id");
230 }
231
232 $this->tpl->setVariable('COPYRIGHT_TABLE', $table_gui->getHTML());
233 }
initSettingsForm()
@access protected

References initSettingsForm().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showGeneralSettings()

ilObjMDSettingsGUI::showGeneralSettings ( )

Edit general settings.

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

146 {
147 global $tpl;
148
150 $tpl->setContent($this->form->getHTML());
151 }
initGeneralSettingsForm($a_mode="edit")
Init general settings form.

References ilObjectGUI\$tpl, and initGeneralSettingsForm().

+ Here is the call graph for this function:

◆ stripSlashes()

ilObjMDSettingsGUI::stripSlashes (   $a_str)
protected

Special function to strip slashes for copyright fields.

@access protected

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

496 {
497 if (ini_get("magic_quotes_gpc")) {
498 $a_str = stripslashes($a_str);
499 }
500 return $a_str;
501 }

Referenced by saveEntry(), and updateEntry().

+ Here is the caller graph for this function:

◆ updateEntry()

ilObjMDSettingsGUI::updateEntry ( )

update one entry

@access public

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

375 {
376 global $ilErr;
377
378 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
379 $this->entry = new ilMDCopyrightSelectionEntry((int) $_REQUEST['entry_id']);
380
381 $this->entry->setTitle(ilUtil::stripSlashes($_POST['title']));
382 $this->entry->setDescription(ilUtil::stripSlashes($_POST['description']));
383 $this->entry->setCopyright($this->stripSlashes($_POST['copyright']));
384
385 if (!$this->entry->validate()) {
386 ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields'));
387 $this->editEntry();
388 return false;
389 }
390 $this->entry->update();
391 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
392 $this->showCopyrightSettings();
393 return true;
394 }
editEntry()
edit one selection

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

+ Here is the call graph for this function:

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