ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMDCopyrightSelectionGUI Class Reference
+ Collaboration diagram for ilMDCopyrightSelectionGUI:

Public Member Functions

 __construct ($a_mode, $a_rbac_id, $a_obj_id)
 Constructor. More...
 
 fillTemplate ()
 parse More...
 

Data Fields

const MODE_QUICKEDIT = 1
 
const MODE_EDIT = 2
 

Protected Attributes

 $tpl
 
 $lng
 
 $settings
 

Private Attributes

 $mode
 
 $rbac_id
 
 $obj_id
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

@access public

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

55 {
56 global $lng,$tpl;
57
58 $this->tpl = $tpl;
59 $this->lng = $lng;
60
61 $this->mode = $a_mode;
62 $this->rbac_id = $a_rbac_id;
63 $this->obj_id = $a_obj_id;
64
66 }
static _getInstance()
get instance
settings()
Definition: settings.php:2

References $lng, $tpl, ilMDSettings\_getInstance(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillTemplate()

ilMDCopyrightSelectionGUI::fillTemplate ( )

parse

@access public

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

75 {
76 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
77
78 $desc = ilMDRights::_lookupDescription($this->rbac_id, $this->obj_id);
79
80 if (!$this->settings->isCopyrightSelectionActive() or
81 !count($entries = ilMDCopyrightSelectionEntry::_getEntries())) {
82 $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt('meta_copyright'));
83 $this->tpl->setVariable(
84 'COPYRIGHT_VAL',
86 );
87 return true;
88 }
89
91
92 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
93 $found = false;
94 foreach ($entries as $entry) {
95 $this->tpl->setCurrentBlock('copyright_selection');
96
97 if ($entry->getEntryId() == $default_id) {
98 $found = true;
99 $this->tpl->setVariable('COPYRIGHT_CHECKED', 'checked="checked"');
100 }
101 $this->tpl->setVariable('COPYRIGHT_ID', $entry->getEntryId());
102 $this->tpl->setVariable('COPYRIGHT_TITLE', $entry->getTitle());
103 $this->tpl->setVariable('COPYRIGHT_DESCRIPTION', $entry->getDescription());
104 $this->tpl->parseCurrentBlock();
105 }
106
107 $this->tpl->setCurrentBlock('copyright_selection');
108 if (!$found) {
109 $this->tpl->setVariable('COPYRIGHT_CHECKED', 'checked="checked"');
110 }
111 $this->tpl->setVariable('COPYRIGHT_ID', 0);
112 $this->tpl->setVariable('COPYRIGHT_TITLE', $this->lng->txt('meta_cp_own'));
113
114 $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt('meta_copyright'));
115 if (!$found) {
116 $this->tpl->setVariable('COPYRIGHT_VAL', $desc);
117 }
118 }
static _extractEntryId($a_cp_string)
extract entry id
static _lookupDescription($a_rbac_id, $a_obj_id)
Lookup description (copyright)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References ilMDCopyrightSelectionEntry\_extractEntryId(), ilMDCopyrightSelectionEntry\_getEntries(), ilMDRights\_lookupDescription(), ilUtil\prepareFormOutput(), and settings().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilMDCopyrightSelectionGUI::$lng
protected

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

Referenced by __construct().

◆ $mode

ilMDCopyrightSelectionGUI::$mode
private

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

◆ $obj_id

ilMDCopyrightSelectionGUI::$obj_id
private

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

◆ $rbac_id

ilMDCopyrightSelectionGUI::$rbac_id
private

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

◆ $settings

ilMDCopyrightSelectionGUI::$settings
protected

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

◆ $tpl

ilMDCopyrightSelectionGUI::$tpl
protected

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

Referenced by __construct().

◆ MODE_EDIT

const ilMDCopyrightSelectionGUI::MODE_EDIT = 2

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

◆ MODE_QUICKEDIT

const ilMDCopyrightSelectionGUI::MODE_QUICKEDIT = 1

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