ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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, $a_ref_id)
 __checkItemAnonymized ($a_obj_id, $a_type)
- Public Member Functions inherited from ilLearningProgressBaseGUI
 ilLearningProgressBaseGUI ($a_mode, $a_ref_id=0, $a_usr_id=0)
 activePDF ()
 __checkPDF ()
 isAnonymized ()
 isObjectAnonymized ()
 getMode ()
 getRefId ()
 getObjId ()
 getUserId ()
 activateStatistics ($a_act=true)
 __getDefaultCommand ()
 __setSubTabs ($a_active)
 __buildFooter ()
 __buildHeader ()
 __insertPath (&$a_tpl, $a_ref_id)
 insert path
 __showImageByStatus (&$tpl, $a_status, $tpl_prefix="")
__initTableGUI ()
 __showObjectDetails (&$info, $item_id=0)
 show details about current object.
 __appendLPDetails (&$info, $item_id, $user_id)
 __readStatus ($a_obj_id, $user_id)
 __showButton ($a_link, $a_text, $a_target= '')
 __sort ($a_ids, $a_table, $a_field, $a_id_name)
 Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
 __getPercent ($max, $reached)
 __readItemStatusInfo ($a_items)
 __getLegendHTML ()

Private Member Functions

 showModeSelection ()
 Show mode selection.

Additional Inherited Members

- Static Public Member Functions inherited from ilLearningProgressBaseGUI
static _showImageByStatus (&$tpl, $a_status, $tpl_prefix="")
- Data Fields inherited from ilLearningProgressBaseGUI
 $tpl = null
 $ctrl = null
 $lng = null
 $ref_id = 0
 $mode = 0
 $statistics_activated = false

Detailed Description

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

Member Function Documentation

ilLPListOfSettingsGUI::__addInfo ( )

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

References $_POST, LP_MODE_COLLECTION, LP_MODE_VISITS, ilUtil\sendInfo(), and ilUtil\sendSuccess().

Referenced by saveSettings().

{
$message = $this->lng->txt('trac_settings_saved');
if($this->obj_settings->getMode() == $_POST['modus'])
{
return true;
}
switch($_POST['modus'])
{
$message = $this->lng->txt('trac_edit_collection');
ilUtil::sendInfo($message);
break;
$message = $this->lng->txt('trac_edit_visits');
ilUtil::sendInfo($message);
break;
default:
;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPListOfSettingsGUI::__checkItemAnonymized (   $a_obj_id,
  $a_type 
)

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

References ilObjTest\_lookupAnonymity().

Referenced by __showCollectionTable().

{
switch($a_type)
{
case 'tst':
include_once './Modules/Test/classes/class.ilObjTest.php';
{
return true;
}
return false;
default:
return false;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPListOfSettingsGUI::__formatPath (   $a_path_arr,
  $a_ref_id 
)

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

References $data.

Referenced by __showCollectionTable().

{
global $tree;
#$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(!$tree->isGrandChild($this->getRefId(),$data['ref_id']))
{
continue;
}
if($a_ref_id == $data['ref_id'])
{
break;
}
if($counter++)
{
$path .= " -> ";
}
$path .= $data['title'];
}
return $path;
}

+ Here is the caller graph for this function:

ilLPListOfSettingsGUI::__showCollectionTable ( )

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

References ilLearningProgressBaseGUI\$ref_id, ilLearningProgressBaseGUI\$tpl, $type, __checkItemAnonymized(), __formatPath(), ilLPCollections\_getCountPossibleItems(), ilFrameTargetInfo\_getFrame(), ilLink\_getLink(), ilLPCollections\_getPossibleItems(), ilLPObjSettings\_lookupMode(), ilLPObjSettings\_mode2Text(), 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';
include_once 'classes/class.ilLink.php';
include_once 'classes/class.ilFrameTargetInfo.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_lp_determination'));
$tpl->setVariable("COLL_TITLE_IMG",ilUtil::getImagePath('icon_trac.gif'));
//$tpl->setVariable("TABLE_TITLE",$this->lng->txt('trac_crs_assignments'));
$tpl->setVariable("TABLE_TITLE",$this->lng->txt('trac_lp_determination'));
$tpl->setVariable("TABLE_INFO",$this->lng->txt('trac_lp_determination_info_crs'));
$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()) and !count($events))
{
$tpl->setCurrentBlock("no_items");
$tpl->setVariable("NO_ITEM_MESSAGE",$this->lng->txt('trac_no_items'));
$tpl->parseCurrentBlock();
}
// Show header
$tpl->addBlockFile('MATERIALS','materials','tpl.trac_collections_row.html','Services/Tracking');
$counter = 0;
// Show materials
{
$obj_id = $ilObjDataCache->lookupObjId($ref_id);
$type = $ilObjDataCache->lookupType($obj_id);
$anonymized = $this->__checkItemAnonymized($obj_id,$type);
$tpl->setCurrentBlock("materials");
$tpl->setVariable('TYPE_IMG',ilUtil::getImagePath('icon_'.$type.'_s.gif'));
$tpl->setVariable('ALT_IMG',$this->lng->txt('obj_'.$type));
// Link to settings
$tpl->setVariable("COLL_MODE",
$this->lng->txt('trac_mode').": ".
if($anonymized)
{
$tpl->setVariable("ANONYMIZED",$this->lng->txt('trac_anonymized_info_short'));
}
$tpl->setVariable("COLL_LINK",ilLink::_getLink($ref_id,$ilObjDataCache->lookupType($obj_id)));
$tpl->setVariable("COLL_FRAME",ilFrameTargetInfo::_getFrame('MainContent',$ilObjDataCache->lookupType($obj_id)));
$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'));
if(!$anonymized)
{
$tpl->setVariable("CHECK_TRAC",ilUtil::formCheckbox(0,'item_ids[]',$ref_id));
}
$path = $this->__formatPath($tree->getPathFull($ref_id),$ref_id);
$tpl->setVariable("COLL_PATH",$this->lng->txt('path').": ".$path);
// Assigned
$tpl->setVariable("ASSIGNED_IMG_OK",$lp_collections->isAssigned($ref_id)
? ilUtil::getImagePath('icon_ok.gif')
: ilUtil::getImagePath('icon_not_ok.gif'));
$tpl->setVariable("ASSIGNED_STATUS",$lp_collections->isAssigned($ref_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 182 of file class.ilLPListOfSettingsGUI.php.

References $data, ilLearningProgressBaseGUI\$tpl, ilLPCollections\_getPossibleSAHSItems(), ilUtil\formCheckbox(), ilUtil\getImagePath(), ilLearningProgressBaseGUI\getObjId(), ilUtil\sendFailure(), and ilUtil\switchColor().

Referenced by __showTablesByMode().

{
global $ilObjDataCache,$tree;
include_once 'Services/Tracking/classes/class.ilLPCollections.php';
include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
{
ilUtil::sendFailure($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_ALT",$this->lng->txt('trac_lp_determination'));
$tpl->setVariable("COLL_TITLE_IMG",ilUtil::getImagePath('icon_trac.gif'));
//$tpl->setVariable("TABLE_TITLE", $this->lng->txt('trac_assignments'));
$tpl->setVariable("TABLE_TITLE", $this->lng->txt('trac_lp_determination'));
$tpl->setVariable("TABLE_INFO", $this->lng->txt('trac_lp_determination_info_sco'));
//$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;
$tpl->addBlockFile('MATERIALS','materials','tpl.trac_collections_sco_row.html','Services/Tracking');
$counter = 0;
foreach($items as $obj_id => $data)
{
$tpl->setCurrentBlock("materials");
$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 163 of file class.ilLPListOfSettingsGUI.php.

References __showCollectionTable(), __showSCOTable(), LP_MODE_COLLECTION, LP_MODE_MANUAL_BY_TUTOR, and LP_MODE_SCORM.

Referenced by show().

{
switch($this->obj_settings->getMode())
{
break;
$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 121 of file class.ilLPListOfSettingsGUI.php.

References $_POST, ilLearningProgressBaseGUI\$ref_id, ilLearningProgressBaseGUI\getObjId(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and show().

{
if(!$_POST['item_ids'] and !$_POST['event_ids'])
{
ilUtil::sendFailure($this->lng->txt('select_one'));
$this->show();
return false;
}
if(count($_POST['item_ids']))
{
include_once 'Services/Tracking/classes/class.ilLPCollections.php';
$lp_collections = new ilLPCollections($this->getObjId());
foreach($_POST['item_ids'] as $ref_id)
{
$lp_collections->add($ref_id);
}
}
ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'));
$this->show();
}

+ Here is the call graph for this function:

ilLPListOfSettingsGUI::deassign ( )

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

References $_POST, ilLearningProgressBaseGUI\$ref_id, ilLearningProgressBaseGUI\getObjId(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and show().

{
if(!$_POST['item_ids'] and !$_POST['event_ids'])
{
ilUtil::sendFailure($this->lng->txt('select_one'));
$this->show();
return false;
}
if(count($_POST['item_ids']))
{
include_once 'Services/Tracking/classes/class.ilLPCollections.php';
$lp_collections = new ilLPCollections($this->getObjId());
foreach($_POST['item_ids'] as $ref_id)
{
$lp_collections->delete($ref_id);
}
}
ilUtil::sendSuccess($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:
$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().

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

+ Here is the call graph for this function:

ilLPListOfSettingsGUI::saveSettings ( )

Definition at line 109 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\getImagePath(), LP_MODE_VISITS, and showModeSelection().

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('no') : $this->lng->txt('yes'));
$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());
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)
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPListOfSettingsGUI::showModeSelection ( )
private

Show mode selection.

private

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

References ilLPObjSettings\_mode2InfoText().

Referenced by show().

{
$this->tpl->setVariable('TXT_MODE',$this->lng->txt('trac_mode'));
foreach($this->obj_settings->getValidModes() as $mode_key => $mode_name)
{
$this->tpl->setCurrentBlock('mode_check');
$this->tpl->setVariable('RADIO_ID',$mode_key);
$this->tpl->setVariable('RADIO_CHECKED',$mode_key == $this->obj_settings->getMode() ? ' checked="checked"' : '');
$this->tpl->setVariable('RADIO_VALUE',$mode_key);
$this->tpl->setVariable('MODE_NAME',$mode_name);
$this->tpl->setVariable('MODE_INFO',ilLPObjSettings::_mode2InfoText($mode_key));
$this->tpl->parseCurrentBlock();
}
}

+ 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: