Public Member Functions

ilLPListOfSettingsGUI Class Reference

Inheritance diagram for ilLPListOfSettingsGUI:
Collaboration diagram for ilLPListOfSettingsGUI:

Public Member Functions

 ilLPListOfSettingsGUI ($a_mode, $a_ref_id)
executeCommand ()
 execute command
 show ()
 saveSettings ()
 assign ()
 deassign ()
 __showTablesByMode ()
 __showSCOTable ()
 __showCollectionTable ()
 __addInfo ()
 __formatPath ($a_path_arr)

Detailed Description

Definition at line 40 of file class.ilLPListOfSettingsGUI.php.


Member Function Documentation

ilLPListOfSettingsGUI::__addInfo (  ) 

Definition at line 300 of file class.ilLPListOfSettingsGUI.php.

References $_POST, and sendInfo().

Referenced by saveSettings().

        {
                $message = $this->lng->txt('trac_settings_saved');

                if($this->obj_settings->getMode() == $_POST['modus'])
                {
                        sendInfo($message);
                        return true;
                }

                switch($_POST['modus'])
                {
                        case LP_MODE_COLLECTION:
                                $message .= '<br />';
                                $message .= $this->lng->txt('trac_edit_collection');
                                break;

                        case LP_MODE_VISITS:
                                $message .= '<br />';
                                $message .= $this->lng->txt('trac_edit_visits');
                                break;
                                

                        default:
                                ;
                }
                sendInfo($message);

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilLPListOfSettingsGUI::__formatPath ( a_path_arr  ) 

Definition at line 331 of file class.ilLPListOfSettingsGUI.php.

References $counter, $data, and $path.

        {
                        #$path = $this->__formatPath($tree->getPathFull($ref_id));
                        #$tpl->setVariable("COLL_PATH",$this->lng->txt('path').": ".$path);
                $counter = 0;
                foreach($a_path_arr as $data)
                {
                        if($counter++)
                        {
                                $path .= " -> ";
                        }
                        $path .= $data['title'];
                }

                return $path;
        }

ilLPListOfSettingsGUI::__showCollectionTable (  ) 

Definition at line 245 of file class.ilLPListOfSettingsGUI.php.

References $counter, $ilObjDataCache, $obj_id, ilLearningProgressBaseGUI::$ref_id, ilLearningProgressBaseGUI::$tpl, $tree, ilLPCollections::_getCountPossibleItems(), ilLPCollections::_getPossibleItems(), ilUtil::formCheckbox(), ilUtil::getImagePath(), ilLearningProgressBaseGUI::getObjId(), ilLearningProgressBaseGUI::getRefId(), and ilUtil::switchColor().

Referenced by __showTablesByMode().

        {
                global $ilObjDataCache,$tree;

                include_once 'Services/Tracking/classes/class.ilLPCollections.php';

                $lp_collections = new ilLPCollections($this->getObjId());

                $tpl =& new ilTemplate('tpl.trac_collections.html',true,true,'Services/Tracking');

                $tpl->setVariable("COLL_TITLE_IMG_ALT",$this->lng->txt('trac_assignments'));
                $tpl->setVariable("COLL_TITLE_IMG",ilUtil::getImagePath('icon_trac.gif'));
                $tpl->setVariable("TABLE_TITLE",$this->lng->txt('trac_crs_assignments'));
                $tpl->setVariable("ITEM_DESC",$this->lng->txt('trac_crs_items'));
                $tpl->setVariable("ITEM_ASSIGNED",$this->lng->txt('trac_assigned'));

                $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.gif'));
                $tpl->setVariable("BTN_ASSIGN",$this->lng->txt('trac_collection_assign'));
                $tpl->setVariable("BTN_DEASSIGN",$this->lng->txt('trac_collection_deassign'));

                
                if(!ilLPCollections::_getCountPossibleItems($this->getRefId()))
                {
                        $tpl->setCurrentBlock("no_items");
                        $tpl->setVariable("NO_ITEM_MESSAGE",$this->lng->txt('trac_no_items'));
                        $tpl->parseCurrentBlock();
                }
                $counter = 0;
                foreach(ilLPCollections::_getPossibleItems($this->getRefId()) as $ref_id => $obj_id)
                {
                        $tpl->setCurrentBlock("trac_row");
                        $tpl->setVariable("COLL_DESC",$ilObjDataCache->lookupDescription($obj_id));
                        $tpl->setVariable("COLL_TITLE",$ilObjDataCache->lookupTitle($obj_id));
                        $tpl->setVariable("ROW_CLASS",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
                        $tpl->setVariable("CHECK_TRAC",ilUtil::formCheckbox(0,'item_ids[]',$obj_id));

                        #$path = $this->__formatPath($tree->getPathFull($ref_id));
                        #$tpl->setVariable("COLL_PATH",$this->lng->txt('path').": ".$path);

                        // Assigned
                        $tpl->setVariable("ASSIGNED_IMG_OK",$lp_collections->isAssigned($obj_id)
                                                          ? ilUtil::getImagePath('icon_ok.gif') 
                                                          : ilUtil::getImagePath('icon_not_ok.gif'));
                        $tpl->setVariable("ASSIGNED_STATUS",$lp_collections->isAssigned($obj_id)
                                                          ? $this->lng->txt('trac_assigned')
                                                          : $this->lng->txt('trac_not_assigned'));

                        
                        $tpl->parseCurrentBlock();
                }                       
                $tpl->setVariable("SELECT_ROW",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
                $tpl->setVariable("SELECT_ALL",$this->lng->txt('select_all'));

                $this->tpl->setVariable("COLLECTION_TABLE",$tpl->get());
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilLPListOfSettingsGUI::__showSCOTable (  ) 

Definition at line 184 of file class.ilLPListOfSettingsGUI.php.

References $counter, $data, $ilObjDataCache, $obj_id, ilLearningProgressBaseGUI::$tpl, $tree, ilLPCollections::_getPossibleSAHSItems(), ilUtil::formCheckbox(), ilUtil::getImagePath(), ilLearningProgressBaseGUI::getObjId(), sendInfo(), and ilUtil::switchColor().

Referenced by __showTablesByMode().

        {
                global $ilObjDataCache,$tree;

                include_once 'Services/Tracking/classes/class.ilLPCollections.php';
                include_once 'content/classes/SCORM/class.ilSCORMItem.php';


                if(!$items = ilLPCollections::_getPossibleSAHSItems($this->getObjId()))
                {
                        sendInfo($this->lng->txt('trac_no_sahs_items_found'));
                        return false;
                }


                $lp_collections = new ilLPCollections($this->getObjId());

                $tpl =& new ilTemplate('tpl.trac_collections.html',true,true,'Services/Tracking');

                $tpl->setVariable("COLL_TITLE_IMG_ALT",$this->lng->txt('trac_assignments'));
                $tpl->setVariable("COLL_TITLE_IMG",ilUtil::getImagePath('icon_trac.gif'));
                $tpl->setVariable("TABLE_TITLE",$this->lng->txt('trac_assignments'));
                $tpl->setVariable("ITEM_DESC",$this->lng->txt('description'));
                $tpl->setVariable("ITEM_ASSIGNED",$this->lng->txt('trac_assigned'));

                $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.gif'));
                $tpl->setVariable("BTN_ASSIGN",$this->lng->txt('trac_collection_assign'));
                $tpl->setVariable("BTN_DEASSIGN",$this->lng->txt('trac_collection_deassign'));

                
                $counter = 0;

                foreach($items as $obj_id => $data)
                {
                        $tpl->setCurrentBlock("trac_row");
                        #$tpl->setVariable("COLL_DESC",$ilObjDataCache->lookupDescription($obj_id));
                        #$tpl->setVariable("COLL_TITLE",ilSCORMItem::_lookupTitle($obj_id));
                        $tpl->setVariable("COLL_TITLE",$data['title']);
                        $tpl->setVariable("ROW_CLASS",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
                        $tpl->setVariable("CHECK_TRAC",ilUtil::formCheckbox(0,'item_ids[]',$obj_id));


                        // Assigned
                        $tpl->setVariable("ASSIGNED_IMG_OK",$lp_collections->isAssigned($obj_id)
                                                          ? ilUtil::getImagePath('icon_ok.gif') 
                                                          : ilUtil::getImagePath('icon_not_ok.gif'));
                        $tpl->setVariable("ASSIGNED_STATUS",$lp_collections->isAssigned($obj_id)
                                                          ? $this->lng->txt('trac_assigned')
                                                          : $this->lng->txt('trac_not_assigned'));

                        
                        $tpl->parseCurrentBlock();
                }                       
                $tpl->setVariable("SELECT_ROW",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
                $tpl->setVariable("SELECT_ALL",$this->lng->txt('select_all'));
                $this->tpl->setVariable("COLLECTION_TABLE",$tpl->get());
        }               

Here is the call graph for this function:

Here is the caller graph for this function:

ilLPListOfSettingsGUI::__showTablesByMode (  ) 

Definition at line 166 of file class.ilLPListOfSettingsGUI.php.

References __showCollectionTable(), and __showSCOTable().

Referenced by show().

        {
                switch($this->obj_settings->getMode())
                {
                        case LP_MODE_COLLECTION:

                                $this->__showCollectionTable();
                                break;

                        case LP_MODE_SCORM:
                                
                                $this->__showSCOTable();
                                break;

                }
                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilLPListOfSettingsGUI::assign (  ) 

Definition at line 127 of file class.ilLPListOfSettingsGUI.php.

References $_POST, $obj_id, ilLearningProgressBaseGUI::getObjId(), sendInfo(), and show().

        {
                if(!$_POST['item_ids'])
                {
                        sendInfo($this->lng->txt('select_one'));
                        $this->show();
                        return false;
                }
                include_once 'Services/Tracking/classes/class.ilLPCollections.php';

                $lp_collections = new ilLPCollections($this->getObjId());

                foreach($_POST['item_ids'] as $obj_id)
                {
                        $lp_collections->add($obj_id);
                }
                sendInfo($this->lng->txt('trac_settings_saved'));
                $this->show();
        }

Here is the call graph for this function:

ilLPListOfSettingsGUI::deassign (  ) 

Definition at line 147 of file class.ilLPListOfSettingsGUI.php.

References $_POST, $obj_id, ilLearningProgressBaseGUI::getObjId(), sendInfo(), and show().

        {
                if(!$_POST['item_ids'])
                {
                        sendInfo($this->lng->txt('select_one'));
                        $this->show();
                        return false;
                }
                include_once 'Services/Tracking/classes/class.ilLPCollections.php';

                $lp_collections = new ilLPCollections($this->getObjId());

                foreach($_POST['item_ids'] as $obj_id)
                {
                        $lp_collections->delete($obj_id);
                }
                sendInfo($this->lng->txt('trac_settings_saved'));
                $this->show();
        }

Here is the call graph for this function:

& ilLPListOfSettingsGUI::executeCommand (  ) 

execute command

Definition at line 52 of file class.ilLPListOfSettingsGUI.php.

References $cmd, and ilLearningProgressBaseGUI::__getDefaultCommand().

        {
                switch($this->ctrl->getNextClass())
                {
                        default:
                                $cmd = $this->__getDefaultCommand();
                                $this->$cmd();

                }
                return true;
        }

Here is the call graph for this function:

ilLPListOfSettingsGUI::ilLPListOfSettingsGUI ( a_mode,
a_ref_id 
)

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

References ilLearningProgressBaseGUI::getObjId(), and ilLearningProgressBaseGUI::ilLearningProgressBaseGUI().

        {
                parent::ilLearningProgressBaseGUI($a_mode,$a_ref_id);

                $this->obj_settings = new ilLPObjSettings($this->getObjId());
        }

Here is the call graph for this function:

ilLPListOfSettingsGUI::saveSettings (  ) 

Definition at line 115 of file class.ilLPListOfSettingsGUI.php.

References $_POST, __addInfo(), and show().

        {
                $this->__addInfo();
                $this->obj_settings->setMode($_POST['modus']);
                if((int) $_POST['visits'])
                {
                        $this->obj_settings->setVisits((int) $_POST['visits']);
                }
                $this->obj_settings->update();
                $this->show();
        }

Here is the call graph for this function:

ilLPListOfSettingsGUI::show (  ) 

Definition at line 64 of file class.ilLPListOfSettingsGUI.php.

References __showTablesByMode(), ilObjUserTracking::_enabledLearningProgress(), ilObjUserTracking::_enabledUserRelatedData(), ilObjUserTracking::_getValidTimeSpan(), ilUtil::formSelect(), and ilUtil::getImagePath().

Referenced by assign(), deassign(), and saveSettings().

        {
                // Sub Tabs

                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_obj_settings.html','Services/Tracking');

                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormaction($this));
                $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_trac.gif'));
                $this->tpl->setVariable("ALT_IMG",$this->lng->txt('tracking_settings'));
                $this->tpl->setVariable("TXT_TRACKING_SETTINGS", $this->lng->txt("tracking_settings"));

                $this->tpl->setVariable("TXT_ACTIVATE_TRACKING", $this->lng->txt("trac_activated"));
                $this->tpl->setVariable("ACTIVATED_IMG_OK",$activated = ilObjUserTracking::_enabledLearningProgress()
                                                                ? ilUtil::getImagePath('icon_ok.gif') 
                                                                : ilUtil::getImagePath('icon_not_ok.gif'));
                $this->tpl->setVariable("ACTIVATED_STATUS",$activated ? $this->lng->txt('yes') : $this->lng->txt('no'));

                $this->tpl->setVariable("TXT_USER_RELATED_DATA", $this->lng->txt("trac_anonymized"));
                $this->tpl->setVariable("ANONYMIZED_IMG_OK",$anonymized = !ilObjUserTracking::_enabledUserRelatedData()
                                                                ? ilUtil::getImagePath('icon_ok.gif') 
                                                                : ilUtil::getImagePath('icon_not_ok.gif'));
                $this->tpl->setVariable("ANONYMIZED_STATUS",$anonymized ? $this->lng->txt('yes') : $this->lng->txt('no'));

                $this->tpl->setVariable("TXT_VALID_REQUEST",$this->lng->txt('trac_valid_request'));
                $this->tpl->setVariable("INFO_VALID_REQUEST",$this->lng->txt('info_valid_request'));
                $this->tpl->setVariable("SECONDS",$this->lng->txt('seconds'));
                $this->tpl->setVariable("VAL_SECONDS",ilObjUserTracking::_getValidTimeSpan());

                // Mode selector
                $this->tpl->setVariable("TXT_MODE",$this->lng->txt('trac_modus'));

                $this->tpl->setVariable("MODE",ilUtil::formSelect($this->obj_settings->getMode(),
                                                                                                                  'modus',
                                                                                                                  $this->obj_settings->getValidModes(),
                                                                                                                  false,true));

                if($this->obj_settings->getMode() == LP_MODE_VISITS)
                {
                        $this->tpl->setCurrentBlock("visits");
                        $this->tpl->setVariable("TXT_VISITS",$this->lng->txt('trac_num_visits'));
                        $this->tpl->setVariable("NUM_VISITS",$this->obj_settings->getVisits());
                        $this->tpl->setVariable("INFO_VISITS",$this->lng->txt('trac_visits_info'));
                        $this->tpl->parseCurrentBlock();
                }

                $this->tpl->setVariable("TXT_SAVE",$this->lng->txt('save'));

                // Show additional tables (e.g collection table)
                $this->__showTablesByMode();
        }

Here is the call graph for this function:

Here is the caller graph for this function:


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