23 include_once(
"./classes/class.ilObjectGUI.php");
44 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
52 $this->lng->loadLanguageModule(
"meta");
63 global $rbacsystem,
$ilErr,$ilAccess;
65 $next_class = $this->ctrl->getNextClass($this);
66 $cmd = $this->ctrl->getCmd();
70 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
72 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
77 case 'iladvancedmdsettingsgui':
78 $this->tabs_gui->setTabActive(
'md_advanced');
79 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDSettingsGUI.php');
81 $ret = $this->ctrl->forwardCommand($adv_md);
84 case 'ilpermissiongui':
85 $this->tabs_gui->setTabActive(
'perm_settings');
86 include_once(
"./classes/class.ilPermissionGUI.php");
88 $ret =& $this->ctrl->forwardCommand($perm_gui);
92 $this->tabs_gui->setTabActive(
'md_copyright');
113 global $rbacsystem, $ilAccess;
115 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
117 $this->tabs_gui->addTarget(
"md_copyright",
118 $this->ctrl->getLinkTarget($this,
"settings"),
119 array(
"settings",
"view"));
121 $this->tabs_gui->addTarget(
"md_advanced",
122 $this->ctrl->getLinkTargetByClass(
'iladvancedmdsettingsgui',
""),
124 'iladvancedmdsettingsgui');
128 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
130 $this->tabs_gui->addTarget(
"perm_settings",
131 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
132 array(),
'ilpermissiongui');
141 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.settings.html',
'Services/MetaData');
144 $this->tpl->setVariable(
'SETTINGS_TABLE',$this->form->getHTML());
146 include_once(
"./Services/MetaData/classes/class.ilMDCopyrightTableGUI.php");
148 $table_gui->setTitle($this->lng->txt(
"md_copyright_selection"));
149 $table_gui->parseSelections();
151 $table_gui->addCommandButton(
'addEntry',$this->lng->txt(
'add'));
152 $table_gui->addMultiCommand(
"confirmDeleteEntries", $this->lng->txt(
"delete"));
153 $table_gui->setSelectAllCheckbox(
"entry_id");
154 $this->tpl->setVariable(
'COPYRIGHT_TABLE',$table_gui->getHTML());
164 $this->md_settings->activateCopyrightSelection((
int) $_POST[
'active']);
165 $this->md_settings->save();
179 $this->ctrl->saveParameter($this,
'entry_id');
181 $this->tpl->setContent($this->form->getHTML());
194 $this->tpl->setContent($this->form->getHTML());
208 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
213 $this->entry->setCopyright($this->
stripSlashes($_POST[
'copyright']));
214 $this->entry->setLanguage(
'en');
215 $this->entry->setCopyrightAndOtherRestrictions(
true);
216 $this->entry->setCosts(
false);
218 if(!$this->entry->validate())
238 if(!is_array($_POST[
'entry_id']) or !count($_POST[
'entry_id']))
245 include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
249 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteEntries"));
250 $c_gui->setHeaderText($this->lng->txt(
"md_delete_cp_sure"));
251 $c_gui->setCancel($this->lng->txt(
"cancel"),
"settings");
252 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteEntries");
254 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
257 foreach($_POST[
"entry_id"] as $entry_id)
260 $c_gui->addItem(
'entry_id[]',$entry_id,$entry->getTitle());
262 $this->tpl->setContent($c_gui->getHTML());
273 if(!is_array($_POST[
'entry_id']) or !count($_POST[
'entry_id']))
280 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
281 foreach($_POST[
"entry_id"] as $entry_id)
301 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
306 $this->entry->setCopyright($this->
stripSlashes($_POST[
'copyright']));
308 if(!$this->entry->validate())
314 $this->entry->update();
328 if(is_object($this->form))
332 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
334 $this->form->setFormAction($this->ctrl->getFormAction($this));
335 $this->form->setTitle($this->lng->txt(
'md_copyright_settings'));
336 $this->form->addCommandButton(
'saveSettings',$this->lng->txt(
'save'));
337 $this->form->addCommandButton(
'settings',$this->lng->txt(
'cancel'));
340 $check->
setChecked($this->md_settings->isCopyrightSelectionActive());
342 $check->setInfo($this->lng->txt(
'md_copyright_enable_info'));
343 $this->form->addItem($check);
355 if(is_object($this->form))
359 if(!is_object($this->entry))
361 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
365 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
367 $this->form->setFormAction($this->ctrl->getFormAction($this));
370 $tit->
setValue($this->entry->getTitle());
371 $tit->setRequired(
true);
373 $tit->setMaxLength(255);
374 $this->form->addItem($tit);
377 $des->
setValue($this->entry->getDescription());
379 $this->form->addItem($des);
382 $cop->
setValue($this->entry->getCopyright());
384 $this->form->addItem($cop);
389 $this->form->setTitle($this->lng->txt(
'md_copyright_edit'));
390 $this->form->addCommandButton(
'updateEntry',$this->lng->txt(
'save'));
391 $this->form->addCommandButton(
'settings',$this->lng->txt(
'cancel'));
395 $this->form->setTitle($this->lng->txt(
'md_copyright_add'));
396 $this->form->addCommandButton(
'saveEntry',$this->lng->txt(
'save'));
397 $this->form->addCommandButton(
'settings',$this->lng->txt(
'cancel'));
410 include_once(
'Services/MetaData/classes/class.ilMDSettings.php');
421 if (ini_get(
"magic_quotes_gpc"))
423 $a_str = stripslashes($a_str);