ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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')
 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 public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object 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 ()
 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 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...
 
 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...
 
 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
 
 $ilias
 
 $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
 $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$

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.

public

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

References ilObjectGUI\$lng.

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  }

Member Function Documentation

◆ addEntry()

ilObjMDSettingsGUI::addEntry ( )

add new entry

public

Parameters

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

References initCopyrightEditForm().

Referenced by saveEntry().

276  {
277  $this->initCopyrightEditForm('add');
278  $this->tpl->setContent($this->form->getHTML());
279  }
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 320 of file class.ilObjMDSettingsGUI.php.

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

321  {
322  if(!is_array($_POST['entry_id']) or !count($_POST['entry_id']))
323  {
324  ilUtil::sendInfo($this->lng->txt('select_one'));
325  $this->showCopyrightSettings();
326  return true;
327  }
328 
329  include_once('Services/Utilities/classes/class.ilConfirmationGUI.php');
330  $c_gui = new ilConfirmationGUI();
331 
332  // set confirm/cancel commands
333  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteEntries"));
334  $c_gui->setHeaderText($this->lng->txt("md_delete_cp_sure"));
335  $c_gui->setCancel($this->lng->txt("cancel"), "showCopyrightSettings");
336  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteEntries");
337 
338  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
339 
340  // add items to delete
341  foreach($_POST["entry_id"] as $entry_id)
342  {
343  $entry = new ilMDCopyrightSelectionEntry($entry_id);
344  $c_gui->addItem('entry_id[]',$entry_id,$entry->getTitle());
345  }
346  $this->tpl->setContent($c_gui->getHTML());
347  }
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 355 of file class.ilObjMDSettingsGUI.php.

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

356  {
357  if(!is_array($_POST['entry_id']) or !count($_POST['entry_id']))
358  {
359  ilUtil::sendInfo($this->lng->txt('select_one'));
360  $this->showCopyrightSettings();
361  return true;
362  }
363 
364  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
365  foreach($_POST["entry_id"] as $entry_id)
366  {
367  $entry = new ilMDCopyrightSelectionEntry($entry_id);
368  $entry->delete();
369  }
370  ilUtil::sendSuccess($this->lng->txt('md_copyrights_deleted'));
371  $this->showCopyrightSettings();
372  return true;
373  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 261 of file class.ilObjMDSettingsGUI.php.

References initCopyrightEditForm().

Referenced by updateEntry().

262  {
263  $this->ctrl->saveParameter($this,'entry_id');
264  $this->initCopyrightEditForm();
265  $this->tpl->setContent($this->form->getHTML());
266  }
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 61 of file class.ilObjMDSettingsGUI.php.

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

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  {
72  $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
73  }
74 
75  switch($next_class)
76  {
77  case 'iladvancedmdsettingsgui':
78  $this->tabs_gui->setTabActive('md_advanced');
79  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDSettingsGUI.php');
80  $adv_md = new ilAdvancedMDSettingsGUI();
81  $ret = $this->ctrl->forwardCommand($adv_md);
82  break;
83 
84  case 'ilpermissiongui':
85  $this->tabs_gui->setTabActive('perm_settings');
86  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
87  $perm_gui = new ilPermissionGUI($this);
88  $ret =& $this->ctrl->forwardCommand($perm_gui);
89  break;
90 
91  default:
92  $this->initMDSettings();
93  if(!$cmd || $cmd == 'view')
94  {
95  $cmd = "showGeneralSettings";
96  }
97 
98  $this->$cmd();
99  break;
100  }
101  return true;
102  }
initMDSettings()
init Md settings
global $ilErr
Definition: raiseError.php:16
$cmd
Definition: sahs_server.php:35
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:

◆ getAdminTabs()

ilObjMDSettingsGUI::getAdminTabs ( )

Get tabs.

public

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

References array.

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

◆ initCopyrightEditForm()

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

public

Parameters

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

References ilTextInputGUI\setValue(), and ilTextAreaInputGUI\setValue().

Referenced by addEntry(), and editEntry().

444  {
445  if(is_object($this->form))
446  {
447  return true;
448  }
449  if(!is_object($this->entry))
450  {
451  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
452  $this->entry = new ilMDCopyrightSelectionEntry((int) $_REQUEST['entry_id']);
453  }
454 
455  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
456  $this->form = new ilPropertyFormGUI();
457  $this->form->setFormAction($this->ctrl->getFormAction($this));
458 
459  $tit = new ilTextInputGUI($this->lng->txt('title'),'title');
460  $tit->setValue($this->entry->getTitle());
461  $tit->setRequired(true);
462  $tit->setSize(40);
463  $tit->setMaxLength(255);
464  $this->form->addItem($tit);
465 
466  $des = new ilTextAreaInputGUI($this->lng->txt('description'),'description');
467  $des->setValue($this->entry->getDescription());
468  $des->setRows(3);
469  $this->form->addItem($des);
470 
471  $cop = new ilTextAreaInputGUI($this->lng->txt('md_copyright_value'),'copyright');
472  $cop->setValue($this->entry->getCopyright());
473  $cop->setRows(5);
474  $this->form->addItem($cop);
475 
476  switch($a_mode)
477  {
478  case 'edit':
479  $this->form->setTitle($this->lng->txt('md_copyright_edit'));
480  $this->form->addCommandButton('updateEntry',$this->lng->txt('save'));
481  $this->form->addCommandButton('showCopyrightSettings',$this->lng->txt('cancel'));
482  break;
483 
484  case 'add':
485  $this->form->setTitle($this->lng->txt('md_copyright_add'));
486  $this->form->addCommandButton('saveEntry',$this->lng->txt('save'));
487  $this->form->addCommandButton('showCopyrightSettings',$this->lng->txt('cancel'));
488  break;
489  }
490 
491  }
This class represents a property form user interface.
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 155 of file class.ilObjMDSettingsGUI.php.

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

Referenced by showGeneralSettings().

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

References ilMDSettings\_getInstance().

Referenced by executeCommand().

499  {
500  include_once('Services/MetaData/classes/class.ilMDSettings.php');
501  $this->md_settings = ilMDSettings::_getInstance();
502  }
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 410 of file class.ilObjMDSettingsGUI.php.

References ilCheckboxInputGUI\setChecked().

Referenced by showCopyrightSettings().

411  {
412  global $ilAccess;
413 
414  if(is_object($this->form))
415  {
416  return true;
417  }
418  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
419  $this->form = new ilPropertyFormGUI();
420  $this->form->setFormAction($this->ctrl->getFormAction($this));
421  $this->form->setTitle($this->lng->txt('md_copyright_settings'));
422 
423  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
424  {
425  $this->form->addCommandButton('saveCopyrightSettings',$this->lng->txt('save'));
426  $this->form->addCommandButton('showCopyrightSettings',$this->lng->txt('cancel'));
427  }
428 
429  $check = new ilCheckboxInputGUI($this->lng->txt('md_copyright_enabled'),'active');
430  $check->setChecked($this->md_settings->isCopyrightSelectionActive());
431  $check->setValue(1);
432  $check->setInfo($this->lng->txt('md_copyright_enable_info'));
433  $this->form->addItem($check);
434  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setChecked($a_checked)
Set Checked.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCopyrightSettings()

ilObjMDSettingsGUI::saveCopyrightSettings ( )

Save news and external webfeeds settings.

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

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

240  {
241  global $ilAccess;
242 
243  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
244  {
245  $this->ctrl->redirect($this, "showCopyrightSettings");
246  }
247 
248  $this->md_settings->activateCopyrightSelection((int) $_POST['active']);
249  $this->md_settings->save();
250  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
251  $this->showCopyrightSettings();
252  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
showCopyrightSettings()
Edit copyright settings.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveEntry()

ilObjMDSettingsGUI::saveEntry ( )

save new entry

public

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

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

289  {
290  global $ilErr;
291 
292  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
293  $this->entry = new ilMDCopyrightSelectionEntry(0);
294 
295  $this->entry->setTitle(ilUtil::stripSlashes($_POST['title']));
296  $this->entry->setDescription(ilUtil::stripSlashes($_POST['description']));
297  $this->entry->setCopyright($this->stripSlashes($_POST['copyright']));
298  $this->entry->setLanguage('en');
299  $this->entry->setCopyrightAndOtherRestrictions(true);
300  $this->entry->setCosts(false);
301 
302  if(!$this->entry->validate())
303  {
304  ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields'));
305  $this->addEntry();
306  return false;
307  }
308  $this->entry->add();
309  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
310  $this->showCopyrightSettings();
311  return true;
312  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
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
$_POST["username"]
+ Here is the call graph for this function:

◆ saveGeneralSettings()

ilObjMDSettingsGUI::saveGeneralSettings ( )

Save general settings.

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

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

186  {
187  global $ilCtrl, $ilAccess;
188 
189  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
190  {
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  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ showCopyrightSettings()

ilObjMDSettingsGUI::showCopyrightSettings ( )

Edit copyright settings.

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

References initSettingsForm(), and object.

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

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  {
227  // $table_gui->addCommandButton("updateCopyrightSelection", $this->lng->txt("save"));
228  $table_gui->addCommandButton('addEntry',$this->lng->txt('add'));
229  $table_gui->addMultiCommand("confirmDeleteEntries", $this->lng->txt("delete"));
230  $table_gui->setSelectAllCheckbox("entry_id");
231  }
232 
233  $this->tpl->setVariable('COPYRIGHT_TABLE',$table_gui->getHTML());
234  }
Create new PHPExcel object
obj_idprivate
+ 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 142 of file class.ilObjMDSettingsGUI.php.

References ilObjectGUI\$tpl, and initGeneralSettingsForm().

143  {
144  global $tpl;
145 
146  $this->initGeneralSettingsForm();
147  $tpl->setContent($this->form->getHTML());
148  }
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 509 of file class.ilObjMDSettingsGUI.php.

Referenced by saveEntry(), and updateEntry().

510  {
511  if (ini_get("magic_quotes_gpc"))
512  {
513  $a_str = stripslashes($a_str);
514  }
515  return $a_str;
516  }
+ Here is the caller graph for this function:

◆ updateEntry()

ilObjMDSettingsGUI::updateEntry ( )

update one entry

public

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

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

382  {
383  global $ilErr;
384 
385  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
386  $this->entry = new ilMDCopyrightSelectionEntry((int) $_REQUEST['entry_id']);
387 
388  $this->entry->setTitle(ilUtil::stripSlashes($_POST['title']));
389  $this->entry->setDescription(ilUtil::stripSlashes($_POST['description']));
390  $this->entry->setCopyright($this->stripSlashes($_POST['copyright']));
391 
392  if(!$this->entry->validate())
393  {
394  ilUtil::sendInfo($this->lng->txt('fill_out_all_required_fields'));
395  $this->editEntry();
396  return false;
397  }
398  $this->entry->update();
399  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
400  $this->showCopyrightSettings();
401  return true;
402  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
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
$_POST["username"]
+ Here is the call graph for this function:

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