23 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
44 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
49 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
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(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
88 $ret =& $this->ctrl->forwardCommand($perm_gui);
95 $cmd =
"showGeneralSettings";
112 global $rbacsystem, $ilAccess;
114 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
116 $this->tabs_gui->addTarget(
"md_general_settings",
117 $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
118 array(
"showGeneralSettings",
"view"));
120 $this->tabs_gui->addTarget(
"md_copyright",
121 $this->ctrl->getLinkTarget($this,
"showCopyrightSettings"),
122 array(
"showCopyrightSettings"));
124 $this->tabs_gui->addTarget(
"md_advanced",
125 $this->ctrl->getLinkTargetByClass(
'iladvancedmdsettingsgui',
""),
127 'iladvancedmdsettingsgui');
131 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
133 $this->tabs_gui->addTarget(
"perm_settings",
134 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
135 array(),
'ilpermissiongui');
147 $tpl->setContent($this->form->getHTML());
157 global
$lng, $ilAccess;
159 $this->tabs_gui->setTabActive(
'md_general_settings');
161 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
164 $ti =
new ilTextInputGUI($this->lng->txt(
"md_delimiter"),
"delimiter");
165 $ti->
setInfo($this->lng->txt(
"md_delimiter_info"));
166 $ti->setMaxLength(1);
168 $ti->setValue($this->md_settings->getDelimiter());
169 $this->form->addItem($ti);
171 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
173 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
174 $this->form->addCommandButton(
"showGeneralSettings", $lng->txt(
"cancel"));
177 $this->form->setTitle($lng->txt(
"md_general_settings"));
178 $this->form->setFormAction($this->ctrl->getFormAction($this));
189 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
191 $ilCtrl->redirect($this,
"showGeneralSettings");
194 $delim = (trim(
$_POST[
'delimiter']) ==
"")
196 : trim(
$_POST[
'delimiter']);
197 $this->md_settings->setDelimiter($delim);
198 $this->md_settings->save();
201 $ilCtrl->redirect($this,
"showGeneralSettings");
212 $this->tabs_gui->setTabActive(
'md_copyright');
213 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.settings.html',
'Services/MetaData');
216 $this->tpl->setVariable(
'SETTINGS_TABLE',$this->form->getHTML());
218 $has_write = $ilAccess->checkAccess(
'write',
'',$this->
object->getRefId());
220 include_once(
"./Services/MetaData/classes/class.ilMDCopyrightTableGUI.php");
222 $table_gui->setTitle($this->lng->txt(
"md_copyright_selection"));
223 $table_gui->parseSelections();
228 $table_gui->addCommandButton(
'addEntry',$this->lng->txt(
'add'));
229 $table_gui->addMultiCommand(
"confirmDeleteEntries", $this->lng->txt(
"delete"));
230 $table_gui->setSelectAllCheckbox(
"entry_id");
233 $this->tpl->setVariable(
'COPYRIGHT_TABLE',$table_gui->getHTML());
243 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
245 $this->ctrl->redirect($this,
"showCopyrightSettings");
248 $this->md_settings->activateCopyrightSelection((
int)
$_POST[
'active']);
249 $this->md_settings->save();
263 $this->ctrl->saveParameter($this,
'entry_id');
265 $this->tpl->setContent($this->form->getHTML());
278 $this->tpl->setContent($this->form->getHTML());
292 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
298 $this->entry->setLanguage(
'en');
299 $this->entry->setCopyrightAndOtherRestrictions(
true);
300 $this->entry->setCosts(
false);
302 if(!$this->entry->validate())
329 include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
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");
338 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
341 foreach(
$_POST[
"entry_id"] as $entry_id)
344 $c_gui->addItem(
'entry_id[]',$entry_id,$entry->getTitle());
346 $this->tpl->setContent($c_gui->getHTML());
364 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
365 foreach(
$_POST[
"entry_id"] as $entry_id)
385 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
392 if(!$this->entry->validate())
398 $this->entry->update();
414 if(is_object($this->form))
418 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
420 $this->form->setFormAction($this->ctrl->getFormAction($this));
421 $this->form->setTitle($this->lng->txt(
'md_copyright_settings'));
423 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
425 $this->form->addCommandButton(
'saveCopyrightSettings',$this->lng->txt(
'save'));
426 $this->form->addCommandButton(
'showCopyrightSettings',$this->lng->txt(
'cancel'));
430 $check->
setChecked($this->md_settings->isCopyrightSelectionActive());
432 $check->setInfo($this->lng->txt(
'md_copyright_enable_info'));
433 $this->form->addItem($check);
445 if(is_object($this->form))
449 if(!is_object($this->entry))
451 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
455 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
457 $this->form->setFormAction($this->ctrl->getFormAction($this));
460 $tit->
setValue($this->entry->getTitle());
461 $tit->setRequired(
true);
463 $tit->setMaxLength(255);
464 $this->form->addItem($tit);
467 $des->
setValue($this->entry->getDescription());
469 $this->form->addItem($des);
472 $cop->
setValue($this->entry->getCopyright());
474 $this->form->addItem($cop);
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'));
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'));
500 include_once(
'Services/MetaData/classes/class.ilMDSettings.php');
511 if (ini_get(
"magic_quotes_gpc"))
513 $a_str = stripslashes($a_str);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initMDSettings()
init Md settings
deleteEntries()
delete entries
stripSlashes($a_str)
Special function to strip slashes for copyright fields.
executeCommand()
Execute command.
showGeneralSettings()
Edit general settings.
saveCopyrightSettings()
Save news and external webfeeds settings.
showCopyrightSettings()
Edit copyright settings.
setValue($a_value)
Set Value.
saveGeneralSettings()
Save general settings.
static _getInstance()
get instance
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
editEntry()
edit one selection
prepareOutput($a_show_subobjects=true)
prepare output
Class ilObjectGUI Basic methods of all Output classes.
This class represents a text property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
initSettingsForm()
protected
Create styles array
The data for the language used.
updateEntry()
update one entry
initGeneralSettingsForm($a_mode="edit")
Init general settings form.
Create new PHPExcel object
obj_idprivate
initCopyrightEditForm($a_mode='edit')
public
confirmDeleteEntries()
confirm deletion of entries
This class represents a text area property in a property form.
saveEntry()
save new entry
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
setValue($a_value)
Set Value.
Confirmation screen class.