ILIAS  release_8 Revision v8.23
ilMDCopyrightSelectionGUI Class Reference
+ Collaboration diagram for ilMDCopyrightSelectionGUI:

Public Member Functions

 __construct (int $a_mode, int $a_rbac_id, int $a_obj_id)
 
 fillTemplate ()
 

Data Fields

const MODE_QUICKEDIT = 1
 
const MODE_EDIT = 2
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilMDSettings $settings
 

Private Attributes

int $rbac_id
 
int $obj_id
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 31 of file class.ilMDCopyrightSelectionGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMDCopyrightSelectionGUI::__construct ( int  $a_mode,
int  $a_rbac_id,
int  $a_obj_id 
)

Definition at line 43 of file class.ilMDCopyrightSelectionGUI.php.

References $DIC, ilMDSettings\_getInstance(), ILIAS\Repository\lng(), and ILIAS\Repository\settings().

44  {
45  global $DIC;
46 
47  $this->lng = $DIC->language();
48  $this->tpl = $DIC->ui()->mainTemplate();
49 
50  $this->rbac_id = $a_rbac_id;
51  $this->obj_id = $a_obj_id;
52 
54  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ fillTemplate()

ilMDCopyrightSelectionGUI::fillTemplate ( )

Definition at line 56 of file class.ilMDCopyrightSelectionGUI.php.

References ilMDCopyrightSelectionEntry\_extractEntryId(), ilMDCopyrightSelectionEntry\_getEntries(), ilMDRights\_lookupDescription(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\prepareFormOutput(), and ILIAS\Repository\settings().

56  : bool
57  {
58  $desc = ilMDRights::_lookupDescription($this->rbac_id, $this->obj_id);
59 
60  if (!$this->settings->isCopyrightSelectionActive() or
61  !count($entries = ilMDCopyrightSelectionEntry::_getEntries())) {
62  $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt('meta_copyright'));
63  $this->tpl->setVariable(
64  'COPYRIGHT_VAL',
66  );
67  return true;
68  }
69 
71 
72  $found = false;
73  foreach ($entries as $entry) {
74  $this->tpl->setCurrentBlock('copyright_selection');
75 
76  if ($entry->getEntryId() === $default_id) {
77  $found = true;
78  $this->tpl->setVariable('COPYRIGHT_CHECKED', 'checked="checked"');
79  }
80  $this->tpl->setVariable('COPYRIGHT_ID', $entry->getEntryId());
81  $this->tpl->setVariable('COPYRIGHT_TITLE', $entry->getTitle());
82  $this->tpl->setVariable('COPYRIGHT_DESCRIPTION', $entry->getDescription());
83  $this->tpl->parseCurrentBlock();
84  }
85 
86  $this->tpl->setCurrentBlock('copyright_selection');
87  if (!$found) {
88  $this->tpl->setVariable('COPYRIGHT_CHECKED', 'checked="checked"');
89  }
90  $this->tpl->setVariable('COPYRIGHT_ID', 0);
91  $this->tpl->setVariable('COPYRIGHT_TITLE', $this->lng->txt('meta_cp_own'));
92 
93  $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt('meta_copyright'));
94  if (!$found) {
95  $this->tpl->setVariable('COPYRIGHT_VAL', $desc);
96  }
97  return false;
98  }
static _lookupDescription(int $a_rbac_id, int $a_obj_id)
static prepareFormOutput($a_str, bool $a_strip=false)
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilMDCopyrightSelectionGUI::$lng
protected

Definition at line 37 of file class.ilMDCopyrightSelectionGUI.php.

◆ $obj_id

int ilMDCopyrightSelectionGUI::$obj_id
private

Definition at line 41 of file class.ilMDCopyrightSelectionGUI.php.

◆ $rbac_id

int ilMDCopyrightSelectionGUI::$rbac_id
private

Definition at line 40 of file class.ilMDCopyrightSelectionGUI.php.

◆ $settings

ilMDSettings ilMDCopyrightSelectionGUI::$settings
protected

Definition at line 38 of file class.ilMDCopyrightSelectionGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilMDCopyrightSelectionGUI::$tpl
protected

Definition at line 36 of file class.ilMDCopyrightSelectionGUI.php.

◆ MODE_EDIT

const ilMDCopyrightSelectionGUI::MODE_EDIT = 2

Definition at line 34 of file class.ilMDCopyrightSelectionGUI.php.

◆ MODE_QUICKEDIT

const ilMDCopyrightSelectionGUI::MODE_QUICKEDIT = 1

Definition at line 33 of file class.ilMDCopyrightSelectionGUI.php.


The documentation for this class was generated from the following file: