ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilContainerObjectiveGUI Class Reference

GUI class for course objective view. More...

+ Inheritance diagram for ilContainerObjectiveGUI:
+ Collaboration diagram for ilContainerObjectiveGUI:

Public Member Functions

 __construct ($a_container_gui)
 Constructor.
 getDetailsLevel ($a_objective_id)
 get details level
 getMainContent ()
 Impementation of abstract method getMainContent.
 showStatus ($tpl)
 show status
 showObjectives ($a_tpl)
 show objectives
 addFooterRow ($tpl)
 add footer row
 showMaterials ($a_tpl, $a_mode)
 Show all other (no assigned tests, no assigned materials) materials.
- Public Member Functions inherited from ilContainerContentGUI
 __construct (&$container_gui_obj)
 Constructor.
 getContainerObject ()
 Get container object.
 getContainerGUI ()
 Get container GUI object.
 setOutput ()
 Sets view output into column layout.
 determinePageEmbeddedBlocks ($a_container_page_html)
 Determine all blocks that are embedded in the container page.
 addEmbeddedBlock ($block_type, $block_parameter)
 Add embedded block.
 getEmbeddedBlocks ()
 Get page embedded blocks.
 renderPageEmbeddedBlocks ()
 Render Page Embedded Blocks.
 renderItem ($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
 Render an item.
 newBlockTemplate ()
 returns a new list block template
 addStandardRow (&$a_tpl, $a_html, $a_ref_id=0)
 add item row to template
 addHeaderRow ($a_tpl, $a_type="", $a_text="")
 Add header row to block template.
 resetRowType ()
 Reset row type (toggling background colors)
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page.
 addMessageRow (&$a_tpl, $a_message, $a_type)
 add message row
 addSeparatorRow (&$a_tpl)
 Add separator row between two blocks.
 getGroupedObjTypes ()
 Get grouped repository object types.
 getIntroduction ()
 Get introduction.
 getItemGroupsHTML ($a_tpl)
 Get item groups HTML.
 renderItemGroup ($a_tpl, $a_itgr)
 Render item group.

Data Fields

const MATERIALS_TESTS = 1
const MATERIALS_OTHER = 2
- Data Fields inherited from ilContainerContentGUI
const DETAILS_DEACTIVATED = 0
const DETAILS_TITLE = 1
const DETAILS_ALL = 2
 $container_gui
 $container_obj

Protected Member Functions

 renderObjective ($a_objective_id)
 render objective
 initDetails ()
 init details
 showButton ($a_cmd, $a_text, $a_target= '')
 show action button
- Protected Member Functions inherited from ilContainerContentGUI
 getRightColumnHTML ()
 Get HTML for right column.
 getCenterColumnHTML ()
 Get HTML for center column.
 clearAdminCommandsDetermination ()
 cleaer administration commands determination
 determineAdminCommands ($a_ref_id, $a_admin_com_included_in_list=false)
 determin admin commands
 getItemGUI ($item_data, $a_show_path=false)
 Get ListGUI object for item.

Protected Attributes

 $force_details = 0
- Protected Attributes inherited from ilContainerContentGUI
 $details_level = self::DETAILS_DEACTIVATED

Private Attributes

 $output_html = ''

Detailed Description

GUI class for course objective view.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

ilContainerObjectiveGUI::__construct (   $a_container_gui)

Constructor.

public

Parameters
objectcontainer gui object
Returns

Definition at line 51 of file class.ilContainerObjectiveGUI.php.

References $lng, and initDetails().

{
global $lng;
$this->lng = $lng;
parent::__construct($a_container_gui);
$this->initDetails();
}

+ Here is the call graph for this function:

Member Function Documentation

ilContainerObjectiveGUI::addFooterRow (   $tpl)

add footer row

public

Parameters
@return

Definition at line 214 of file class.ilContainerObjectiveGUI.php.

References $_GET, $ilCtrl, $tpl, ilContainerContentGUI\getContainerObject(), and ilUtil\getImagePath().

Referenced by showObjectives().

{
global $ilCtrl;
$tpl->setCurrentBlock('details_img');
$append = $this->details_level == self::DETAILS_TITLE ? 'off' : '';
$tpl->setCurrentBlock('details_img');
$tpl->setVariable('DETAILS_SRC',ilUtil::getImagePath('details2'.$append.'.png'));
$tpl->setVariable('DETAILS_ALT',$this->lng->txt('details').' 2');
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->getContainerObject()->getRefId());
$ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "1");
$tpl->setVariable('DETAILS_LINK',
$ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
$tpl->parseCurrentBlock();
$append = $this->details_level == self::DETAILS_ALL ? 'off' : '';
$tpl->setCurrentBlock('details_img');
$tpl->setVariable('DETAILS_SRC',ilUtil::getImagePath('details3'.$append.'.png'));
$tpl->setVariable('DETAILS_ALT',$this->lng->txt('details').' 3');
$ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "2");
$tpl->setVariable('DETAILS_LINK',
$ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock('container_details_row');
$tpl->setVariable('TXT_DETAILS',$this->lng->txt('details'));
$tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerObjectiveGUI::getDetailsLevel (   $a_objective_id)

get details level

public

Parameters
@return

Reimplemented from ilContainerContentGUI.

Definition at line 68 of file class.ilContainerObjectiveGUI.php.

References ilContainerContentGUI\$details_level, and ilContainerContentGUI\DETAILS_ALL.

Referenced by renderObjective().

{
if($a_objective_id == $this->force_details)
{
}
}

+ Here is the caller graph for this function:

ilContainerObjectiveGUI::getMainContent ( )

Impementation of abstract method getMainContent.

public

Returns

Reimplemented from ilContainerContentGUI.

Definition at line 83 of file class.ilContainerObjectiveGUI.php.

References $lng, $tpl, ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), showButton(), showMaterials(), showObjectives(), and showStatus().

{
global $lng,$ilTabs,$ilAccess;
// see bug #7452
// $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
$tpl = new ilTemplate("tpl.container_page.html", true, true,"Services/Container");
// Feedback
// @todo
// $this->__showFeedBack();
if($ilAccess->checkAccess('write','',$this->getContainerObject()->getRefId()) or 1)
{
$this->showButton('askReset',$lng->txt('crs_reset_results'));
}
$this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
$this->showStatus($tpl);
$this->showMaterials($tpl,self::MATERIALS_TESTS);
$this->showMaterials($tpl,self::MATERIALS_OTHER);
$tpl->setVariable('CONTAINER_PAGE_CONTENT',$this->output_html);
#$tpl->setVariable('cont_page_content',$info_tpl->get());
#$tpl->parseCurrentBlock('CONTAINER_PAGE_CONTENT',$this->output_html);
#$tpl->parseCurrentBlock();
return $tpl->get();
}

+ Here is the call graph for this function:

ilContainerObjectiveGUI::initDetails ( )
protected

init details

protected

Parameters
@return

Definition at line 444 of file class.ilContainerObjectiveGUI.php.

References $_GET, ilContainerContentGUI\$details_level, $force_details, $ilUser, ilCourseObjective\_getObjectiveIds(), ilContainerContentGUI\DETAILS_TITLE, ilContainerContentGUI\getContainerObject(), and ilCourseObjectiveResultCache\isSuggested().

Referenced by __construct().

{
global $ilUser;
if(isset($_GET['details_level']))
{
$this->details_level = (int) $_GET['details_level'];
ilObjUser::_writePref($ilUser->getId(),'crs_objectives_details',$this->details_level);
}
else
{
$this->details_level = $ilUser->getPref('crs_objectives_details') ? $ilUser->getPref('crs_objectives_details') : self::DETAILS_TITLE;
}
if(isset($_GET['objective_details']))
{
$this->force_details = (int) $_GET['objective_details'];
ilObjUser::_writePref($ilUser->getId(),'crs_objectives_force_details_'.$this->getContainerObject()->getId(),$this->force_details);
}
elseif($details_id = $ilUser->getPref('crs_objectives_force_details_'.$this->getContainerObject()->getId()))
{
$this->force_details = $details_id;
}
else
{
include_once './Modules/Course/classes/class.ilCourseObjective.php';
include_once('./Modules/Course/classes/class.ilCourseObjectiveResultCache.php');
foreach(ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId()) as $objective_id)
{
if(ilCourseObjectiveResultCache::isSuggested($ilUser->getId(),$this->getContainerObject()->getId(),$objective_id))
{
$this->force_details = $objective_id;
break;
}
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerObjectiveGUI::renderObjective (   $a_objective_id)
protected

render objective

protected

Parameters
intobjective id
Returns
string html

Definition at line 345 of file class.ilContainerObjectiveGUI.php.

References $ilUser, $lng, ilContainerSorting\_getInstance(), ilLMObject\_lookupTitle(), ilContainerContentGUI\determineAdminCommands(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), getDetailsLevel(), ilContainerContentGUI\getItemGUI(), ilObjectActivation\getItemsByObjective(), and ilContainer\SORT_MANUAL.

Referenced by showObjectives().

{
global $ilUser,$lng;
include_once('./Modules/Course/classes/class.ilCourseObjective.php');
$objective = new ilCourseObjective($this->getContainerObject(),$a_objective_id);
include_once('./Services/Container/classes/class.ilContainerSorting.php');
include_once('./Services/Object/classes/class.ilObjectActivation.php');
$items = ilObjectActivation::getItemsByObjective($a_objective_id);
$items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj',$a_objective_id,$items);
include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
$objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
$pos = 1;
foreach($items as $item)
{
if($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL)
{
continue;
}
$chapters = $objectives_lm_obj->getChapters();
$item_list_gui2 = $this->getItemGUI($item);
$item_list_gui2->enableIcon(true);
if(count($chapters))
{
$num = 0;
$has_sections = false;
foreach($chapters as $chapter)
{
if($chapter['ref_id'] != $item['child'])
{
continue;
}
$has_sections = true;
include_once './Modules/LearningModule/classes/class.ilLMObject.php';
$details[$num]['desc'] = $lng->txt('obj_'.$chapter['type']).' -> ';
$details[$num]['target'] = '_top';
$details[$num]['link'] = "ilias.php?baseClass=ilLMPresentationGUI&ref_id=".$chapter['ref_id'].'&obj_id='.$chapter['obj_id'];
$details[$num]['name'] = ilLMObject::_lookupTitle($chapter['obj_id']);
$num++;
}
if($has_sections)
{
$item_list_gui2->enableItemDetailLinks(true);
$item_list_gui2->setItemDetailLinks($details,$lng->txt('crs_suggested_sections').': ');
}
}
if ($this->getContainerGUI()->isActiveAdministrationPanel())
{
$item_list_gui2->enableCheckbox(true);
if ($this->getContainerObject()->getOrderType() == ilContainer::SORT_MANUAL)
{
$item_list_gui2->setPositionInputField("[lobj][".$a_objective_id."][".$item["ref_id"]."]",
sprintf('%.1f', $pos));
$pos++;
}
}
$this->rendered_items[$item['child']] = true;
$sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'],
$item['obj_id'], $item['title'], $item['description']);
$this->determineAdminCommands($item["ref_id"],
$item_list_gui2->adminCommandsIncluded());
$this->objective_list_gui->addSubItemHTML($sub_item_html);
}
if($this->getDetailsLevel($a_objective_id) == self::DETAILS_ALL)
{
$this->objective_list_gui->enableCommands(false);
}
else
{
$this->objective_list_gui->enableCommands(true);
}
$html = $this->objective_list_gui->getListItemHTML(
0,
$a_objective_id,
$objective->getTitle(),
$objective->getDescription());
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerObjectiveGUI::showButton (   $a_cmd,
  $a_text,
  $a_target = '' 
)
protected

show action button

protected

Parameters
@return

Definition at line 489 of file class.ilContainerObjectiveGUI.php.

References $ilCtrl, and $tpl.

Referenced by getMainContent().

{
global $tpl,$ilCtrl;
$tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
// display button
$tpl->setCurrentBlock("btn_cell");
$tpl->setVariable("BTN_LINK",$ilCtrl->getLinkTarget($this->getContainerGUI(),$a_cmd));
$tpl->setVariable("BTN_TXT",$a_text);
if($a_target)
{
$tpl->setVariable("BTN_TARGET",$a_target);
}
$tpl->parseCurrentBlock();
}

+ Here is the caller graph for this function:

ilContainerObjectiveGUI::showMaterials (   $a_tpl,
  $a_mode 
)

Show all other (no assigned tests, no assigned materials) materials.

public

Parameters
object$tpltemplate object
Returns
void

Definition at line 254 of file class.ilContainerObjectiveGUI.php.

References $lng, $output_html, $tpl, ilContainerContentGUI\addHeaderRow(), ilContainerContentGUI\addStandardRow(), ilContainerContentGUI\clearAdminCommandsDetermination(), ilContainerContentGUI\getItemGroupsHTML(), ilContainerContentGUI\insertPageEmbeddedBlocks(), ilContainerContentGUI\newBlockTemplate(), and ilContainerContentGUI\renderItem().

Referenced by getMainContent().

{
global $ilAccess, $lng;
#$output_html = $this->getContainerGUI()->getContainerPageHTML();
// get embedded blocks
if ($output_html != "")
{
}
$tpl = $this->newBlockTemplate();
// item groups
$tpl = $this->newBlockTemplate();
if ($a_mode == self::MATERIALS_OTHER)
{
}
if (is_array($this->items["_all"]))
{
// all rows
$item_r = array();
$position = 1;
foreach($this->items["_all"] as $k => $item_data)
{
if($a_mode == self::MATERIALS_TESTS and $item_data['type'] != 'tst')
{
continue;
}
if ($item_data['type'] == 'itgr')
{
continue;
}
if($this->rendered_items[$item_data["child"]] !== true)
{
$this->rendered_items[$item_data['child']] = true;
// TODO: Position (DONE ?)
$html = $this->renderItem($item_data,$position++,$a_mode == self::MATERIALS_TESTS ? false : true);
if ($html != "")
{
$item_r[] = array("html" => $html, "id" => $item_data["child"]);
}
}
}
// if we have at least one item, output the block
if (count($item_r) > 0)
{
switch($a_mode)
{
case self::MATERIALS_TESTS:
$txt = $lng->txt('objs_tst');
break;
case self::MATERIALS_OTHER:
$txt = $lng->txt('crs_other_resources');
break;
}
$this->addHeaderRow($tpl,$a_mode == self::MATERIALS_TESTS ? 'tst' : '',$txt);
foreach($item_r as $h)
{
$this->addStandardRow($tpl, $h["html"], $h["id"]);
}
}
}
#$output_html .= $tpl->get();
$this->output_html .= $tpl->get();
#$a_tpl->setCurrentBlock('cont_page_content');
#$a_tpl->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
#$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerObjectiveGUI::showObjectives (   $a_tpl)

show objectives

public

Parameters
object$tpltemplate object
Returns

Definition at line 152 of file class.ilContainerObjectiveGUI.php.

References $ilSetting, $lng, $output_html, $tpl, ilCourseObjective\_getObjectiveIds(), addFooterRow(), ilContainerContentGUI\addHeaderRow(), ilContainerContentGUI\addStandardRow(), ilContainerContentGUI\clearAdminCommandsDetermination(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilContainerContentGUI\insertPageEmbeddedBlocks(), ilContainerContentGUI\newBlockTemplate(), and renderObjective().

Referenced by getMainContent().

{
global $lng,$ilSetting;
$output_html = $this->getContainerGUI()->getContainerPageHTML();
// get embedded blocks
if ($output_html != "")
{
}
$tpl = $this->newBlockTemplate();
// All objectives
include_once './Modules/Course/classes/class.ilCourseObjective.php';
if(!count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId())))
{
return false;
}
include_once('./Modules/Course/classes/class.ilCourseObjectiveListGUI.php');
$this->objective_list_gui = new ilCourseObjectiveListGUI();
$this->objective_list_gui->setContainerObject($this->getContainerGUI());
if ($ilSetting->get("icon_position_in_lists") == "item_rows")
{
$this->objective_list_gui->enableIcon(true);
}
$item_html = array();
foreach($objective_ids as $objective_id)
{
if($html = $this->renderObjective($objective_id))
{
$item_html[] = $html;
}
}
// if we have at least one item, output the block
if (count($item_html) > 0)
{
$this->addHeaderRow($tpl,'lobj',$lng->txt('crs_objectives'));
foreach($item_html as $h)
{
$this->addStandardRow($tpl, $h);
}
}
$this->addFooterRow($tpl);
$this->output_html .= $output_html.$tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerObjectiveGUI::showStatus (   $tpl)

show status

public

Parameters
@return

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

References $ilUser, $lng, ilContainerContentGUI\getContainerObject(), ilUtil\getImagePath(), ilCourseObjectiveResultCache\getStatus(), and IL_OBJECTIVE_STATUS_EMPTY.

Referenced by getMainContent().

{
global $ilUser,$lng;
include_once('./Modules/Course/classes/class.ilCourseObjectiveResultCache.php');
$status = ilCourseObjectiveResultCache::getStatus($ilUser->getId(),$this->getContainerObject()->getId());
if($status == IL_OBJECTIVE_STATUS_EMPTY) {
return;
}
$info_tpl = new ilTemplate('tpl.crs_objectives_view_info_table.html',true,true,'Modules/Course');
$info_tpl->setVariable("INFO_STRING",$lng->txt('crs_objectives_info_'.$status));
$info_tpl->setVariable("IMG_INFO", ilUtil::getImagePath("mess_info.png"));
$this->output_html .= $info_tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilContainerObjectiveGUI::$force_details = 0
protected

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

Referenced by initDetails().

ilContainerObjectiveGUI::$output_html = ''
private

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

Referenced by showMaterials(), and showObjectives().

const ilContainerObjectiveGUI::MATERIALS_OTHER = 2

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

const ilContainerObjectiveGUI::MATERIALS_TESTS = 1

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


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