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");
65 $next_class = $this->ctrl->getNextClass($this);
66 $cmd = $this->ctrl->getCmd();
70 if (!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
71 $ilErr->raiseError($this->lng->txt(
'no_permission'), $ilErr->WARNING);
74 switch ($next_class) {
75 case 'iladvancedmdsettingsgui':
76 $this->tabs_gui->setTabActive(
'md_advanced');
77 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDSettingsGUI.php');
79 $ret = $this->ctrl->forwardCommand($adv_md);
82 case 'ilpermissiongui':
83 $this->tabs_gui->setTabActive(
'perm_settings');
84 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
86 $ret =&$this->ctrl->forwardCommand($perm_gui);
91 if (!$cmd || $cmd ==
'view') {
92 $cmd =
"showGeneralSettings";
111 if ($rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
112 $this->tabs_gui->addTarget(
113 "md_general_settings",
114 $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
115 array(
"showGeneralSettings",
"view")
118 $this->tabs_gui->addTarget(
120 $this->ctrl->getLinkTarget($this,
"showCopyrightSettings"),
121 array(
"showCopyrightSettings")
124 $this->tabs_gui->addTarget(
126 $this->ctrl->getLinkTargetByClass(
'iladvancedmdsettingsgui',
""),
128 'iladvancedmdsettingsgui' 132 if ($rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
133 $this->tabs_gui->addTarget(
135 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
150 $tpl->setContent($this->form->getHTML());
160 global
$lng, $ilAccess;
162 $this->tabs_gui->setTabActive(
'md_general_settings');
164 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
167 $ti =
new ilTextInputGUI($this->lng->txt(
"md_delimiter"),
"delimiter");
168 $ti->
setInfo($this->lng->txt(
"md_delimiter_info"));
169 $ti->setMaxLength(1);
171 $ti->setValue($this->md_settings->getDelimiter());
172 $this->form->addItem($ti);
174 if ($ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
175 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
176 $this->form->addCommandButton(
"showGeneralSettings", $lng->txt(
"cancel"));
179 $this->form->setTitle($lng->txt(
"md_general_settings"));
180 $this->form->setFormAction($this->ctrl->getFormAction($this));
190 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();
227 $table_gui->addCommandButton(
'addEntry', $this->lng->txt(
'add'));
228 $table_gui->addMultiCommand(
"confirmDeleteEntries", $this->lng->txt(
"delete"));
229 $table_gui->setSelectAllCheckbox(
"entry_id");
232 $this->tpl->setVariable(
'COPYRIGHT_TABLE', $table_gui->getHTML());
242 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
243 $this->ctrl->redirect($this,
"showCopyrightSettings");
246 $this->md_settings->activateCopyrightSelection((
int)
$_POST[
'active']);
247 $this->md_settings->save();
261 $this->ctrl->saveParameter($this,
'entry_id');
263 $this->tpl->setContent($this->form->getHTML());
276 $this->tpl->setContent($this->form->getHTML());
290 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
296 $this->entry->setLanguage(
'en');
297 $this->entry->setCopyrightAndOtherRestrictions(
true);
298 $this->entry->setCosts(
false);
300 if (!$this->entry->validate()) {
319 if (!is_array(
$_POST[
'entry_id']) or !count(
$_POST[
'entry_id'])) {
325 include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
329 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteEntries"));
330 $c_gui->setHeaderText($this->lng->txt(
"md_delete_cp_sure"));
331 $c_gui->setCancel($this->lng->txt(
"cancel"),
"showCopyrightSettings");
332 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteEntries");
334 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
337 foreach (
$_POST[
"entry_id"] as $entry_id) {
339 $c_gui->addItem(
'entry_id[]', $entry_id, $entry->getTitle());
341 $this->tpl->setContent($c_gui->getHTML());
352 if (!is_array(
$_POST[
'entry_id']) or !count(
$_POST[
'entry_id'])) {
358 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
359 foreach (
$_POST[
"entry_id"] as $entry_id) {
378 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
385 if (!$this->entry->validate()) {
390 $this->entry->update();
406 if (is_object($this->form)) {
409 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
411 $this->form->setFormAction($this->ctrl->getFormAction($this));
412 $this->form->setTitle($this->lng->txt(
'md_copyright_settings'));
414 if ($ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
415 $this->form->addCommandButton(
'saveCopyrightSettings', $this->lng->txt(
'save'));
416 $this->form->addCommandButton(
'showCopyrightSettings', $this->lng->txt(
'cancel'));
420 $check->
setChecked($this->md_settings->isCopyrightSelectionActive());
422 $check->setInfo($this->lng->txt(
'md_copyright_enable_info'));
423 $this->form->addItem($check);
435 if (is_object($this->form)) {
438 if (!is_object($this->entry)) {
439 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
443 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
445 $this->form->setFormAction($this->ctrl->getFormAction($this));
448 $tit->
setValue($this->entry->getTitle());
449 $tit->setRequired(
true);
451 $tit->setMaxLength(255);
452 $this->form->addItem($tit);
455 $des->
setValue($this->entry->getDescription());
457 $this->form->addItem($des);
460 $cop->
setValue($this->entry->getCopyright());
462 $this->form->addItem($cop);
466 $this->form->setTitle($this->lng->txt(
'md_copyright_edit'));
467 $this->form->addCommandButton(
'updateEntry', $this->lng->txt(
'save'));
468 $this->form->addCommandButton(
'showCopyrightSettings', $this->lng->txt(
'cancel'));
472 $this->form->setTitle($this->lng->txt(
'md_copyright_add'));
473 $this->form->addCommandButton(
'saveEntry', $this->lng->txt(
'save'));
474 $this->form->addCommandButton(
'showCopyrightSettings', $this->lng->txt(
'cancel'));
486 include_once(
'Services/MetaData/classes/class.ilMDSettings.php');
497 if (ini_get(
"magic_quotes_gpc")) {
498 $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.