ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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 $lng, $tpl, and ilMDSettings\_getInstance().

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 
65  $this->settings = ilMDSettings::_getInstance();
66  }
static _getInstance()
get instance
+ Here is the call graph for this function:

Member Function Documentation

◆ fillTemplate()

ilMDCopyrightSelectionGUI::fillTemplate ( )

parse

public

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

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

Referenced by ilMDEditorGUI\listQuickEdit_scorm().

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