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)
51 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
54 $this->lng->loadLanguageModule(
"meta");
67 $rbacsystem = $DIC[
'rbacsystem'];
69 $ilAccess = $DIC[
'ilAccess'];
71 $next_class = $this->ctrl->getNextClass($this);
72 $cmd = $this->ctrl->getCmd();
76 if (!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
77 $ilErr->raiseError($this->lng->txt(
'no_permission'),
$ilErr->WARNING);
80 switch ($next_class) {
81 case 'iladvancedmdsettingsgui':
82 $this->tabs_gui->setTabActive(
'md_advanced');
83 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDSettingsGUI.php');
85 $ret = $this->ctrl->forwardCommand($adv_md);
88 case 'ilpermissiongui':
89 $this->tabs_gui->setTabActive(
'perm_settings');
90 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
92 $ret = &$this->ctrl->forwardCommand($perm_gui);
95 case 'ilmdcopyrightusagegui':
97 $this->ctrl->setReturn($this,
'showCopyrightSettings');
98 $copyright_id =
$_GET[
'entry_id'];
100 $this->ctrl->forwardCommand($gui);
105 if (!$cmd || $cmd ==
'view') {
106 $cmd =
"showGeneralSettings";
151 $rbacsystem = $DIC[
'rbacsystem'];
152 $ilAccess = $DIC[
'ilAccess'];
154 if ($rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
155 $this->tabs_gui->addTarget(
156 "md_general_settings",
157 $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
158 array(
"showGeneralSettings",
"view")
161 $this->tabs_gui->addTarget(
163 $this->ctrl->getLinkTarget($this,
"showCopyrightSettings"),
164 array(
"showCopyrightSettings")
167 $this->tabs_gui->addTarget(
169 $this->ctrl->getLinkTargetByClass(
'iladvancedmdsettingsgui',
""),
171 'iladvancedmdsettingsgui' 175 if ($rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
176 $this->tabs_gui->addTarget(
178 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
195 $tpl->setContent($this->form->getHTML());
208 $ilAccess = $DIC[
'ilAccess'];
210 $this->tabs_gui->setTabActive(
'md_general_settings');
212 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
215 $ti =
new ilTextInputGUI($this->lng->txt(
"md_delimiter"),
"delimiter");
216 $ti->
setInfo($this->lng->txt(
"md_delimiter_info"));
217 $ti->setMaxLength(1);
219 $ti->setValue($this->md_settings->getDelimiter());
220 $this->form->addItem($ti);
222 if ($ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
223 $this->form->addCommandButton(
"saveGeneralSettings",
$lng->txt(
"save"));
224 $this->form->addCommandButton(
"showGeneralSettings",
$lng->txt(
"cancel"));
227 $this->form->setTitle(
$lng->txt(
"md_general_settings"));
228 $this->form->setFormAction($this->ctrl->getFormAction($this));
239 $ilAccess = $DIC[
'ilAccess'];
241 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
242 $ilCtrl->redirect($this,
"showGeneralSettings");
245 $delim = (trim(
$_POST[
'delimiter']) ==
"")
247 : trim(
$_POST[
'delimiter']);
248 $this->md_settings->setDelimiter($delim);
249 $this->md_settings->save();
250 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
252 $ilCtrl->redirect($this,
"showGeneralSettings");
263 $ilAccess = $DIC[
'ilAccess'];
265 $this->tabs_gui->setTabActive(
'md_copyright');
266 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.settings.html',
'Services/MetaData');
269 $this->tpl->setVariable(
'SETTINGS_TABLE', $this->form->getHTML());
271 $has_write = $ilAccess->checkAccess(
'write',
'', $this->object->getRefId());
273 include_once(
"./Services/MetaData/classes/class.ilMDCopyrightTableGUI.php");
275 $table_gui->setTitle($this->lng->txt(
"md_copyright_selection"));
276 $table_gui->parseSelections();
280 $table_gui->addCommandButton(
'addEntry', $this->lng->txt(
'add'));
281 $table_gui->addMultiCommand(
"confirmDeleteEntries", $this->lng->txt(
"delete"));
282 $table_gui->setSelectAllCheckbox(
"entry_id");
285 $this->tpl->setVariable(
'COPYRIGHT_TABLE', $table_gui->getHTML());
295 $ilAccess = $DIC[
'ilAccess'];
297 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
298 $this->ctrl->redirect($this,
"showCopyrightSettings");
301 $this->md_settings->activateCopyrightSelection((
int)
$_POST[
'active']);
302 $this->md_settings->save();
303 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
309 $this->ctrl->setParameterByClass(
'ilmdcopyrightusagegui',
'entry_id',
$_GET[
'entry_id']);
310 $this->ctrl->redirectByClass(
'ilmdcopyrightusagegui',
"showUsageTable");
321 $this->ctrl->saveParameter($this,
'entry_id');
323 $this->tpl->setContent($this->form->getHTML());
336 $this->tpl->setContent($this->form->getHTML());
352 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
358 $this->entry->setLanguage(
'en');
359 $this->entry->setCopyrightAndOtherRestrictions(
true);
360 $this->entry->setCosts(
false);
361 $this->entry->setOutdated((
int)
$_POST[
'outdated']);
363 if (!$this->entry->validate()) {
369 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
382 if (!is_array(
$_POST[
'entry_id'])
or !count(
$_POST[
'entry_id'])) {
388 include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
392 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteEntries"));
393 $c_gui->setHeaderText($this->lng->txt(
"md_delete_cp_sure"));
394 $c_gui->setCancel($this->lng->txt(
"cancel"),
"showCopyrightSettings");
395 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteEntries");
397 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
400 foreach (
$_POST[
"entry_id"] as $entry_id) {
402 $c_gui->addItem(
'entry_id[]', $entry_id, $entry->getTitle());
404 $this->tpl->setContent($c_gui->getHTML());
415 if (!is_array(
$_POST[
'entry_id'])
or !count(
$_POST[
'entry_id'])) {
421 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
422 foreach (
$_POST[
"entry_id"] as $entry_id) {
426 ilUtil::sendSuccess($this->lng->txt(
'md_copyrights_deleted'));
443 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
449 $this->entry->setOutdated((
int)
$_POST[
'outdated']);
451 if (!$this->entry->validate()) {
456 $this->entry->update();
457 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
472 $ilAccess = $DIC[
'ilAccess'];
474 if (is_object($this->form)) {
477 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
479 $this->form->setFormAction($this->ctrl->getFormAction($this));
480 $this->form->setTitle($this->lng->txt(
'md_copyright_settings'));
483 if ($ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
484 $this->form->addCommandButton(
'saveCopyrightSettings', $this->lng->txt(
'save'));
485 $this->form->addCommandButton(
'showCopyrightSettings', $this->lng->txt(
'cancel'));
489 $check->
setChecked($this->md_settings->isCopyrightSelectionActive());
491 $check->setInfo($this->lng->txt(
'md_copyright_enable_info'));
492 $this->form->addItem($check);
510 if (is_object($this->form)) {
513 if (!is_object($this->entry)) {
514 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
518 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
520 $this->form->setFormAction($this->ctrl->getFormAction($this));
523 $tit->
setValue($this->entry->getTitle());
524 $tit->setRequired(
true);
526 $tit->setMaxLength(255);
527 $this->form->addItem($tit);
530 $des->
setValue($this->entry->getDescription());
532 $this->form->addItem($des);
535 $cop->
setValue($this->entry->getCopyright());
537 $this->form->addItem($cop);
540 $use =
new ilRadioOption($this->lng->txt(
'meta_copyright_in_use'), 0);
542 $usage->addOption($use);
543 $usage->addOption($out);
544 $usage->
setValue($this->entry->getOutdated());
545 $this->form->addItem($usage);
549 $this->form->setTitle($this->lng->txt(
'md_copyright_edit'));
550 $this->form->addCommandButton(
'updateEntry', $this->lng->txt(
'save'));
551 $this->form->addCommandButton(
'showCopyrightSettings', $this->lng->txt(
'cancel'));
555 $this->form->setTitle($this->lng->txt(
'md_copyright_add'));
556 $this->form->addCommandButton(
'saveEntry', $this->lng->txt(
'save'));
557 $this->form->addCommandButton(
'showCopyrightSettings', $this->lng->txt(
'cancel'));
569 include_once(
'Services/MetaData/classes/class.ilMDSettings.php');
580 if (ini_get(
"magic_quotes_gpc")) {
581 $a_str = stripslashes($a_str);
591 if (!isset(
$_POST[
'order'])) {
592 $this->ctrl->redirect($this,
'showCopyrightSettings');
596 $positions =
$_POST[
'order'];
599 foreach ($positions as $entry_id => $position_ignored) {
601 $copyright->setOrderPosition($position++);
602 $copyright->update();
604 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
605 $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.
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
updateEntry()
update one entry
initGeneralSettingsForm($a_mode="edit")
Init general settings form.
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.