23 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
56 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
60 $this->error = $DIC[
'ilErr'];
61 $this->rbacsystem = $this->dic->rbac()->system();
66 $this->lng = $this->dic->language();
67 $this->lng->loadLanguageModule(
"meta");
78 $next_class = $this->ctrl->getNextClass($this);
79 $cmd = $this->ctrl->getCmd();
83 if (!$this->rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
84 $this->error->raiseError($this->lng->txt(
'no_permission'), $this->error->WARNING);
87 switch ($next_class) {
88 case 'iladvancedmdsettingsgui':
89 $this->tabs_gui->setTabActive(
'md_advanced');
90 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDSettingsGUI.php');
92 $ret = $this->ctrl->forwardCommand($adv_md);
95 case 'ilpermissiongui':
96 $this->tabs_gui->setTabActive(
'perm_settings');
97 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
99 $ret = &$this->ctrl->forwardCommand($perm_gui);
102 case 'ilmdcopyrightusagegui':
104 $this->ctrl->setReturn($this,
'showCopyrightSettings');
105 $copyright_id =
$_GET[
'entry_id'];
107 $this->ctrl->forwardCommand($gui);
112 if (!$cmd || $cmd ==
'view') {
113 $cmd =
"showGeneralSettings";
159 $ilAccess = $DIC[
'ilAccess'];
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")
168 $this->tabs_gui->addTarget(
170 $this->ctrl->getLinkTarget($this,
"showCopyrightSettings"),
171 array(
"showCopyrightSettings")
174 $this->tabs_gui->addTarget(
176 $this->ctrl->getLinkTargetByClass(
'iladvancedmdsettingsgui',
""),
178 'iladvancedmdsettingsgui' 182 if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
183 $this->tabs_gui->addTarget(
185 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
202 $tpl->setContent($this->form->getHTML());
215 $ilAccess = $DIC[
'ilAccess'];
217 $this->tabs_gui->setTabActive(
'md_general_settings');
219 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
222 $ti =
new ilTextInputGUI($this->lng->txt(
"md_delimiter"),
"delimiter");
223 $ti->setInfo($this->lng->txt(
"md_delimiter_info"));
224 $ti->setMaxLength(1);
226 $ti->setValue($this->md_settings->getDelimiter());
227 $this->form->addItem($ti);
229 if ($ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
230 $this->form->addCommandButton(
"saveGeneralSettings",
$lng->txt(
"save"));
231 $this->form->addCommandButton(
"showGeneralSettings",
$lng->txt(
"cancel"));
234 $this->form->setTitle(
$lng->txt(
"md_general_settings"));
235 $this->form->setFormAction($this->ctrl->getFormAction($this));
245 $ilCtrl = $DIC[
'ilCtrl'];
246 $ilAccess = $DIC[
'ilAccess'];
248 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
249 $ilCtrl->redirect($this,
"showGeneralSettings");
252 $delim = (trim(
$_POST[
'delimiter']) ==
"")
254 : trim(
$_POST[
'delimiter']);
255 $this->md_settings->setDelimiter($delim);
256 $this->md_settings->save();
257 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
259 $ilCtrl->redirect($this,
"showGeneralSettings");
270 $ilAccess = $DIC[
'ilAccess'];
272 $this->tabs_gui->setTabActive(
'md_copyright');
273 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.settings.html',
'Services/MetaData');
276 $this->tpl->setVariable(
'SETTINGS_TABLE', $this->form->getHTML());
278 $has_write = $ilAccess->checkAccess(
'write',
'', $this->object->getRefId());
280 include_once(
"./Services/MetaData/classes/class.ilMDCopyrightTableGUI.php");
282 $table_gui->setTitle($this->lng->txt(
"md_copyright_selection"));
283 $table_gui->parseSelections();
287 $table_gui->addCommandButton(
'addEntry', $this->lng->txt(
'add'));
288 $table_gui->addMultiCommand(
"confirmDeleteEntries", $this->lng->txt(
"delete"));
289 $table_gui->setSelectAllCheckbox(
"entry_id");
292 $this->tpl->setVariable(
'COPYRIGHT_TABLE', $table_gui->getHTML());
302 $ilAccess = $DIC[
'ilAccess'];
304 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
305 $this->ctrl->redirect($this,
"showCopyrightSettings");
308 $this->md_settings->activateCopyrightSelection((
int)
$_POST[
'active']);
309 $this->md_settings->save();
310 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
316 $this->ctrl->setParameterByClass(
'ilmdcopyrightusagegui',
'entry_id',
$_GET[
'entry_id']);
317 $this->ctrl->redirectByClass(
'ilmdcopyrightusagegui',
"showUsageTable");
328 $this->ctrl->saveParameter($this,
'entry_id');
330 $this->tpl->setContent($this->form->getHTML());
343 $this->tpl->setContent($this->form->getHTML());
359 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
365 $this->entry->setLanguage(
'en');
366 $this->entry->setCopyrightAndOtherRestrictions(
true);
367 $this->entry->setCosts(
false);
368 $this->entry->setOutdated((
int)
$_POST[
'outdated']);
370 if (!$this->entry->validate()) {
376 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
389 if (!is_array(
$_POST[
'entry_id']) or !count(
$_POST[
'entry_id'])) {
395 include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
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");
404 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
407 foreach (
$_POST[
"entry_id"] as $entry_id) {
409 $c_gui->addItem(
'entry_id[]', $entry_id, $entry->getTitle());
411 $this->tpl->setContent($c_gui->getHTML());
422 if (!is_array(
$_POST[
'entry_id']) or !count(
$_POST[
'entry_id'])) {
428 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
429 foreach (
$_POST[
"entry_id"] as $entry_id) {
433 ilUtil::sendSuccess($this->lng->txt(
'md_copyrights_deleted'));
450 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
456 $this->entry->setOutdated((
int)
$_POST[
'outdated']);
458 if (!$this->entry->validate()) {
463 $this->entry->update();
464 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
479 $ilAccess = $DIC[
'ilAccess'];
481 if (is_object($this->form)) {
484 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
486 $this->form->setFormAction($this->ctrl->getFormAction($this));
487 $this->form->setTitle($this->lng->txt(
'md_copyright_settings'));
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'));
496 $check->
setChecked($this->md_settings->isCopyrightSelectionActive());
498 $check->setInfo($this->lng->txt(
'md_copyright_enable_info'));
499 $this->form->addItem($check);
517 if (is_object($this->form)) {
520 if (!is_object($this->entry)) {
521 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
525 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
527 $this->form->setFormAction($this->ctrl->getFormAction($this));
530 $tit->setValue($this->entry->getTitle());
531 $tit->setRequired(
true);
533 $tit->setMaxLength(255);
534 $this->form->addItem($tit);
537 $des->
setValue($this->entry->getDescription());
539 $this->form->addItem($des);
542 $cop->
setValue($this->entry->getCopyright());
544 $this->form->addItem($cop);
547 $use =
new ilRadioOption($this->lng->txt(
'meta_copyright_in_use'), 0);
549 $usage->addOption($use);
550 $usage->addOption($out);
551 $usage->
setValue($this->entry->getOutdated());
552 $this->form->addItem($usage);
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'));
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'));
576 include_once(
'Services/MetaData/classes/class.ilMDSettings.php');
587 if (ini_get(
"magic_quotes_gpc")) {
588 $a_str = stripslashes($a_str);
598 if (!isset(
$_POST[
'order'])) {
599 $this->ctrl->redirect($this,
'showCopyrightSettings');
603 $positions =
$_POST[
'order'];
606 foreach ($positions as $entry_id => $position_ignored) {
608 $copyright->setOrderPosition($position++);
609 $copyright->update();
611 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
612 $this->ctrl->redirect($this,
'showCopyrightSettings');
initMDSettings()
init Md settings
deleteEntries()
delete entries
This class represents an option in a radio group.
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.
getAdministrationFormId()
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
setValue($a_value)
Set Value.
saveCopyrightPosition()
Save the order position to display the copyrights in the GUI table.
Class ilObjectGUI Basic methods of all Output classes.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
initSettingsForm()
protected
updateEntry()
update one entry
initGeneralSettingsForm($a_mode="edit")
Init general settings form.
initCopyrightEditForm($a_mode='edit')
public
confirmDeleteEntries()
confirm deletion of entries
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
saveEntry()
save new entry
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Confirmation screen class.