ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

public

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

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

55  {
56  global $DIC;
57 
58  $lng = $DIC['lng'];
59  $tpl = $DIC['tpl'];
60 
61  $this->tpl = $tpl;
62  $this->lng = $lng;
63 
64  $this->mode = $a_mode;
65  $this->rbac_id = $a_rbac_id;
66  $this->obj_id = $a_obj_id;
67 
69  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
static _getInstance()
get instance
+ Here is the call graph for this function:

Member Function Documentation

◆ fillTemplate()

ilMDCopyrightSelectionGUI::fillTemplate ( )

parse

public

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

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

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

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


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