ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLPListOfSettingsGUI Class Reference

Class ilLPListOfSettingsGUI. More...

+ Inheritance diagram for ilLPListOfSettingsGUI:
+ Collaboration diagram for ilLPListOfSettingsGUI:

Public Member Functions

 ilLPListOfSettingsGUI ($a_mode, $a_ref_id)
executeCommand ()
 execute command
- 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="")
 _getImagePathForStatus ($a_status)
 Get image path for status.
 _getStatusText ($a_status)
 Get status alt text.
__initTableGUI ()
 __showObjectDetails (&$info, $item_id=0)
 show details about current object.
 __appendUserInfo (&$info, $a_user)
 __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 ()
 __showEditUser ($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
 __updateUser ($user_id, $obj_id)

Protected Member Functions

 show ()
 Show settings tables.
 initFormSettings ()
 Init property form.
 saveSettings ()
 Save learning progress settings.
 getTableByMode ()
 Get tables by mode.
 assign ()
 Save material assignment.
 deassign ()
 save mterial assignment
 groupMaterials ()
 Group materials.
 releaseMaterials ()
 saveObligatoryMaterials ()
 Save obligatory state per grouped materials.

Additional Inherited Members

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

Detailed Description

Class ilLPListOfSettingsGUI.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilLPListOfSettingsGUI.php 30423 2011-08-30 09:54:05Z jluetzen

ilLPListOfSettingsGUI:

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

Member Function Documentation

ilLPListOfSettingsGUI::assign ( )
protected

Save material assignment.

Returns
void

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

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLPCollections\activate(), ilLearningProgressBaseGUI\getObjId(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
if(!$_POST['item_ids'])
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$this->ctrl->redirect($this,'show');
}
if(count($_POST['item_ids']))
{
include_once 'Services/Tracking/classes/class.ilLPCollections.php';
ilLPCollections::activate($this->getObjId(), $_POST['item_ids']);
// refresh learning progress
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
}
ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'),true);
$this->ctrl->redirect($this,'show');
}

+ Here is the call graph for this function:

ilLPListOfSettingsGUI::deassign ( )
protected

save mterial assignment

Returns
void

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

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLPCollections\deactivate(), ilLearningProgressBaseGUI\getObjId(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
if(!$_POST['item_ids'])
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$this->ctrl->redirect($this,'show');
return false;
}
if(count($_POST['item_ids']))
{
include_once 'Services/Tracking/classes/class.ilLPCollections.php';
// refresh learning progress
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
}
ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'),true);
$this->ctrl->redirect($this,'show');
}

+ Here is the call graph for this function:

& ilLPListOfSettingsGUI::executeCommand ( )

execute command

Definition at line 32 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::getTableByMode ( )
protected

Get tables by mode.

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

References ilLearningProgressBaseGUI\getRefId(), LP_MODE_COLLECTION, LP_MODE_MANUAL_BY_TUTOR, and LP_MODE_SCORM.

Referenced by saveSettings(), and show().

{
include_once './Services/Tracking/classes/class.ilLPCollectionSettingsTableGUI.php';
switch($this->obj_settings->getMode())
{
$table = new ilLPCollectionSettingsTableGUI($this->getRefId(),$this,'show');
$table->setMode($this->obj_settings->getMode());
$table->parse();
return $table->getHTML();
default:
return '';
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPListOfSettingsGUI::groupMaterials ( )
protected

Group materials.

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

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLPCollections\createNewGrouping(), ilLearningProgressBaseGUI\getObjId(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
if(!count((array) $_POST['item_ids']))
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$this->ctrl->redirect($this,'show');
}
// Assign new grouping id
include_once './Services/Tracking/classes/class.ilLPCollections.php';
ilLPCollections::createNewGrouping($this->getObjId(),(array) $_POST['item_ids']);
// refresh learning progress
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'),true);
$this->ctrl->redirect($this,'show');
}

+ Here is the call graph for this function:

ilLPListOfSettingsGUI::ilLPListOfSettingsGUI (   $a_mode,
  $a_ref_id 
)

Definition at line 22 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::initFormSettings ( )
protected

Init property form.

Returns
ilPropertyFormGUI $form

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

References ilObjUserTracking\_getValidTimeSpan(), ilLPObjSettings\_mode2InfoText(), LP_MODE_VISITS, ilFormPropertyGUI\setRequired(), ilNumberInputGUI\setSize(), and ilNonEditableValueGUI\setValue().

Referenced by saveSettings(), and show().

{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('tracking_settings'));
$form->setFormAction($this->ctrl->getFormAction($this));
// Mode
$mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
$mod->setRequired(true);
$mod->setValue($this->obj_settings->getMode());
$form->addItem($mod);
foreach($this->obj_settings->getValidModes() as $mode_key => $mode_name)
{
$opt = new ilRadioOption(
$mode_name,
$mode_key,
);
$opt->setValue($mode_key);
$mod->addOption($opt);
// Subitem for vistits
if($mode_key == LP_MODE_VISITS)
{
$vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
$vis->setSize(3);
$vis->setMaxLength(4);
$vis->setInfo($this->lng->txt('trac_visits_info'));
$vis->setRequired(true);
$vis->setValue($this->obj_settings->getVisits());
$opt->addSubItem($vis);
// Timespan
$tim = new ilNonEditableValueGUI($this->lng->txt('trac_valid_request'), '');
$tim->setValue(
ilObjUserTracking::_getValidTimeSpan().' '.$this->lng->txt('seconds')
);
$tim->setInfo($this->lng->txt('info_valid_request'));
$opt->addSubItem($tim);
}
}
/*
// Info Active
$act = new ilCustomInputGUI($this->lng->txt('trac_activated'), '');
$img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
$img->setVariable("IMG_SRC",
$activated = ilObjUserTracking::_enabledLearningProgress()
? ilUtil::getImagePath('icon_ok.gif')
: ilUtil::getImagePath('icon_not_ok.gif')
);
$act->setHTML($img->get());
$form->addItem($act);
// Info Anonymized
$ano = new ilCustomInputGUI($this->lng->txt('trac_anonymized'), '');
$img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
$img->setVariable("IMG_SRC",
$anonymized = !ilObjUserTracking::_enabledUserRelatedData()
? ilUtil::getImagePath('icon_ok.gif')
: ilUtil::getImagePath('icon_not_ok.gif')
);
$ano->setHTML($img->get());
$form->addItem($ano);
*/
$form->addCommandButton('saveSettings', $this->lng->txt('save'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPListOfSettingsGUI::releaseMaterials ( )
protected

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

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLearningProgressBaseGUI\getObjId(), ilLPCollections\releaseGrouping(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
if(!count((array) $_POST['item_ids']))
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$this->ctrl->redirect($this,'show');
}
include_once './Services/Tracking/classes/class.ilLPCollections.php';
ilLPCollections::releaseGrouping($this->getObjId(), (array) $_POST['item_ids']);
// refresh learning progress
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'),true);
$this->ctrl->redirect($this,'show');
}

+ Here is the call graph for this function:

ilLPListOfSettingsGUI::saveObligatoryMaterials ( )
protected

Save obligatory state per grouped materials.

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

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLearningProgressBaseGUI\getObjId(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

{
if(!is_array((array) $_POST['grp']))
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$this->ctrl->redirect($this,'show');
}
try {
include_once './Services/Tracking/classes/class.ilLPCollections.php';
ilLPCollections::saveObligatoryMaterials($this->getObjId(), (array) $_POST['grp']);
// refresh learning progress
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
$this->ctrl->redirect($this,'show');
}
catch(UnexpectedValueException $e) {
ilUtil::sendFailure($this->lng->txt('trac_grouped_material_obligatory_err'), true);
ilUtil::sendInfo($this->lng->txt('err_check_input'),true);
$this->ctrl->redirect($this,'show');
}
}

+ Here is the call graph for this function:

ilLPListOfSettingsGUI::saveSettings ( )
protected

Save learning progress settings.

Returns
void

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

References getTableByMode(), initFormSettings(), LP_MODE_COLLECTION, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

{
$form = $this->initFormSettings();
if($form->checkInput())
{
$this->obj_settings->setMode((int) $form->getInput('modus'));
$this->obj_settings->setVisits($form->getInput('visits'));
$this->obj_settings->update();
if($this->obj_settings->getMode() == LP_MODE_COLLECTION)
{
ilUtil::sendInfo($this->lng->txt('trac_edit_collection'),true);
}
ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'),true);
$this->ctrl->redirect($this,'show');
}
$form->setValuesByPost();
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_obj_settings.html','Services/Tracking');
$this->tpl->setVariable('PROP_FORM',$form->getHTML());
$this->tpl->setVariable('COLLECTION_TABLE',$this->getTableByMode());
return;
}

+ Here is the call graph for this function:

ilLPListOfSettingsGUI::show ( )
protected

Show settings tables.

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

References getTableByMode(), and initFormSettings().

{
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_obj_settings.html','Services/Tracking');
$form = $this->initFormSettings();
$this->tpl->setVariable('PROP_FORM',$form->getHTML());
$this->tpl->setVariable('COLLECTION_TABLE',$this->getTableByMode());
}

+ Here is the call graph for this function:


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