Public Member Functions | Protected Attributes

ilAdvancedMDRecordTableGUI Class Reference

Inheritance diagram for ilAdvancedMDRecordTableGUI:
Collaboration diagram for ilAdvancedMDRecordTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd= '')
 Constructor.
 fillRow ($a_set)
 Fill row.
 parseRecords ($a_records)
 Parse records.

Protected Attributes

 $lng = null
 $ctrl

Detailed Description

Author:
Stefan Meyer <smeyer@databay.de>
Version:
$Id$

Definition at line 35 of file class.ilAdvancedMDRecordTableGUI.php.


Constructor & Destructor Documentation

ilAdvancedMDRecordTableGUI::__construct ( a_parent_obj,
a_parent_cmd = '' 
)

Constructor.

public

Parameters:
 

Reimplemented from ilTable2GUI.

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

References $ilCtrl, $lng, ilTable2GUI::addColumn(), ilTable2GUI::setDefaultOrderDirection(), ilTable2GUI::setDefaultOrderField(), ilTable2GUI::setFormAction(), and ilTable2GUI::setRowTemplate().

        {
                global $lng,$ilCtrl;
                
                $this->lng = $lng;
                $this->ctrl = $ilCtrl;
                
                parent::__construct($a_parent_obj,$a_parent_cmd);
                $this->addColumn('','f',1);
                $this->addColumn($this->lng->txt('title'),'title',"30%");
                $this->addColumn($this->lng->txt('md_fields'),'fields',"35%");
                $this->addColumn($this->lng->txt('md_adv_active'),'active',"5%");
                $this->addColumn($this->lng->txt('md_obj_types'),'obj_types',"30%");
                
                $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
                $this->setRowTemplate("tpl.show_records_row.html","Services/AdvancedMetaData");
                $this->setDefaultOrderField("title");
                $this->setDefaultOrderDirection("desc");
        }

Here is the call graph for this function:


Member Function Documentation

ilAdvancedMDRecordTableGUI::fillRow ( a_set  ) 

Fill row.

public

Parameters:
 

Reimplemented from ilTable2GUI.

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

References ilAdvancedMDRecord::_getAssignableObjectTypes(), and ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId().

        {
                foreach(ilAdvancedMDRecord::_getAssignableObjectTypes() as $obj_type)
                {
                        $this->tpl->setCurrentBlock('ass_obj_types');
                        $this->tpl->setVariable('VAL_OBJ_TYPE',$this->lng->txt('objs_'.$obj_type));
                        $this->tpl->setVariable('ASS_ID',$a_set['id']);
                        $this->tpl->setVariable('ASS_NAME',$obj_type);
                        if(in_array($obj_type,$a_set['obj_types']))
                        {
                                $this->tpl->setVariable('ASS_CHECKED','checked="checked"');
                        }
                        $this->tpl->parseCurrentBlock();
                }
                $this->tpl->setVariable('VAL_ID',$a_set['id']);
                $this->tpl->setVariable('VAL_TITLE',$a_set['title']);
                if(strlen($a_set['description']))
                {
                        $this->tpl->setVariable('VAL_DESCRIPTION',$a_set['description']);
                }
                $defs = ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($a_set['id']);
                if(!count($defs))
                {
                        $this->tpl->setVariable('TXT_FIELDS',$this->lng->txt('md_adv_no_fields'));
                }
                foreach($defs as $definition_obj)
                {
                        $this->tpl->setCurrentBlock('field_entry');
                        $this->tpl->setVariable('FIELD_NAME',$definition_obj->getTitle());
                        $this->tpl->parseCurrentBlock();
                }
                
                $this->tpl->setVariable('ACTIVE_CHECKED',$a_set['active'] ? ' checked="checked" ' : '');
                $this->tpl->setVariable('ACTIVE_ID',$a_set['id']);
                
                $this->ctrl->setParameter($this->parent_obj,'record_id',$a_set['id']);
                $this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTarget($this->parent_obj,'editRecord'));
                $this->tpl->setVariable('TXT_EDIT_RECORD',$this->lng->txt('edit'));
        }

Here is the call graph for this function:

ilAdvancedMDRecordTableGUI::parseRecords ( a_records  ) 

Parse records.

public

Parameters:
array array of record objects

Definition at line 121 of file class.ilAdvancedMDRecordTableGUI.php.

References ilTable2GUI::setData().

        {
                foreach($a_records as $record)
                {
                        $tmp_arr['id'] = $record->getRecordId();
                        $tmp_arr['active'] = $record->isActive();
                        $tmp_arr['title'] = $record->getTitle();
                        $tmp_arr['description'] = $record->getDescription();
                        $tmp_arr['fields'] = array();
                        $tmp_arr['obj_types'] = $record->getAssignedObjectTypes();
                        
                        $records_arr[] = $tmp_arr;
                }
                $this->setData($records_arr ? $records_arr : array());
        }

Here is the call graph for this function:


Field Documentation

ilAdvancedMDRecordTableGUI::$ctrl [protected]

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

ilAdvancedMDRecordTableGUI::$lng = null [protected]

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

Referenced by __construct().


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