ILIAS  Release_4_0_x_branch Revision 61816
 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)
 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.

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

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 49 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 220 of file class.ilContainerObjectiveGUI.php.

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

Referenced by showObjectives().

{
$tpl->setCurrentBlock('details_img');
$append = $this->details_level == self::DETAILS_TITLE ? 'off' : '';
$tpl->setCurrentBlock('details_img');
$tpl->setVariable('DETAILS_SRC',ilUtil::getImagePath('details2'.$append.'.gif'));
$tpl->setVariable('DETAILS_ALT',$this->lng->txt('details').' 2');
$tpl->setVariable('DETAILS_LINK','repository.php?ref_id='.$this->getContainerObject()->getRefId().'&details_level=1');
$tpl->parseCurrentBlock();
$append = $this->details_level == self::DETAILS_ALL ? 'off' : '';
$tpl->setCurrentBlock('details_img');
$tpl->setVariable('DETAILS_SRC',ilUtil::getImagePath('details3'.$append.'.gif'));
$tpl->setVariable('DETAILS_ALT',$this->lng->txt('details').' 3');
$tpl->setVariable('DETAILS_LINK','repository.php?ref_id='.$this->getContainerObject()->getRefId().'&details_level=2');
$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 66 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 81 of file class.ilContainerObjectiveGUI.php.

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

{
global $lng,$ilTabs,$ilAccess;
$ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
include_once './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);
// @todo: Move this completely to GUI class?
/* $this->getContainerGUI()->adminCommands = $this->adminCommands;
$this->getContainerGUI()->showAdministrationPanel($tpl);
$this->getContainerGUI()->showPossibleSubObjects();
$this->getContainerGUI()->showPermanentLink($tpl);*/
return $tpl->get();
}

+ Here is the call graph for this function:

ilContainerObjectiveGUI::initDetails ( )
protected

init details

protected

Parameters
@return

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

References $_GET, ilContainerContentGUI\$details_level, $force_details, ilCourseObjective\_getObjectiveIds(), ilObjUser\_writePref(), ilContainerContentGUI\DETAILS_TITLE, elseif(), 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 329 of file class.ilContainerObjectiveGUI.php.

References $lng, ilContainerSorting\_getInstance(), ilLMObject\_lookupTitle(), ilContainerContentGUI\determineAdminCommands(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), getDetailsLevel(), ilContainerContentGUI\getItemGUI(), 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');
$items = $this->getContainerObject()->getCourseItemObject()->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 472 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 252 of file class.ilContainerObjectiveGUI.php.

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

Referenced by getMainContent().

{
global $ilAccess, $lng;
#$output_html = $this->getContainerGUI()->getContainerPageHTML();
$output_html = '';
// get embedded blocks
if ($output_html != "")
{
$output_html = $this->insertPageEmbeddedBlocks($output_html);
}
$tpl = $this->newBlockTemplate();
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($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();
$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 153 of file class.ilContainerObjectiveGUI.php.

References $ilSetting, $lng, $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 != "")
{
$output_html = $this->insertPageEmbeddedBlocks($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);
$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::showStatus (   $tpl)

show status

public

Parameters
@return

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

References $lng, $tpl, 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');
$tpl->setCurrentBlock('cont_page_content');
$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.gif"));
// ilUtil::sendInfo($this->lng->txt('crs_objectives_info_'.$status));
$tpl->setVariable('CONTAINER_PAGE_CONTENT',$info_tpl->get());
$tpl->parseCurrentBlock();
}

+ 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().

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: