Public Member Functions | Data Fields | Protected Attributes | Private Attributes

ilMDCopyrightSelectionGUI Class Reference

Collaboration diagram for ilMDCopyrightSelectionGUI:

Public Member Functions

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

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 <smeyer@databay.de>
Version:
$Id$

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


Constructor & Destructor Documentation

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().

        {
                global $lng,$tpl;
                
                $this->tpl = $tpl;
                $this->lng = $lng;
                
                $this->mode = $a_mode;
                $this->rbac_id = $a_rbac_id;
                $this->obj_id = $a_obj_id;
                
                $this->settings = ilMDSettings::_getInstance();
        }

Here is the call graph for this function:


Member Function Documentation

ilMDCopyrightSelectionGUI::fillTemplate (  ) 

parse

public

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

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

        {
                include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
                
                $desc = ilMDRights::_lookupDescription($this->rbac_id,$this->obj_id); 
                
                if(!$this->settings->isCopyrightSelectionActive() or 
                        !count($entries = ilMDCopyrightSelectionEntry::_getEntries()))
                {
                        $this->tpl->setVariable("TXT_COPYRIGHT",$this->lng->txt('meta_copyright'));
                        $this->tpl->setVariable('COPYRIGHT_VAL',
                                ilUtil::prepareFormOutput($desc));
                        return true;
                }
                
                $default_id = ilMDCopyrightSelectionEntry::_extractEntryId($desc);
                
                include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
                $found = false;
                foreach($entries as $entry)
                {
                        $this->tpl->setCurrentBlock('copyright_selection');
                        
                        if($entry->getEntryId() == $default_id)
                        {
                                $found = true;
                                $this->tpl->setVariable('COPYRIGHT_CHECKED','checked="checked"');
                        }
                        $this->tpl->setVariable('COPYRIGHT_ID',$entry->getEntryId());
                        $this->tpl->setVariable('COPYRIGHT_TITLE',$entry->getTitle());
                        $this->tpl->setVariable('COPYRIGHT_DESCRIPTION',$entry->getDescription());
                        $this->tpl->parseCurrentBlock();
                }
                
                $this->tpl->setCurrentBlock('copyright_selection');
                if(!$found)
                {
                        $this->tpl->setVariable('COPYRIGHT_CHECKED','checked="checked"');
                }
                $this->tpl->setVariable('COPYRIGHT_ID',0);
                $this->tpl->setVariable('COPYRIGHT_TITLE',$this->lng->txt('meta_cp_own'));
                
                $this->tpl->setVariable("TXT_COPYRIGHT",$this->lng->txt('meta_copyright'));
                if(!$found)
                {
                        $this->tpl->setVariable('COPYRIGHT_VAL',$desc);
                }
        }

Here is the call graph for this function:


Field Documentation

ilMDCopyrightSelectionGUI::$lng [protected]

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

Referenced by __construct().

ilMDCopyrightSelectionGUI::$mode [private]

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

ilMDCopyrightSelectionGUI::$obj_id [private]

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

ilMDCopyrightSelectionGUI::$rbac_id [private]

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

ilMDCopyrightSelectionGUI::$settings [protected]

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

ilMDCopyrightSelectionGUI::$tpl [protected]

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

Referenced by __construct().

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

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

Referenced by ilMDEditorGUI::listQuickEdit().


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