ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSubItemListGUI Class Reference

Base class for all sub item list gui's. More...

+ Inheritance diagram for ilSubItemListGUI:
+ Collaboration diagram for ilSubItemListGUI:

Public Member Functions

 __construct ($a_cmd_class)
 Constructor.
 getCmdClass ()
 get cmd class
 setHighlighter ($a_highlighter)
 set highlighter
 getHighlighter ()
 get highlighter
 getRefId ()
 get ref id
 getObjId ()
 get obj id
 getType ()
 get type
 getSubItemIds ($a_limited=false)
 get sub item ids
 getItemListGUI ()
 get item list gui
 init ($item_list_gui, $a_ref_id, $a_subitem_ids)
 init
 getHTML ()

Static Public Member Functions

static setShowDetails ($a_obj_id)
 set show details.
static resetDetails ()
 reset details As long as static::resetDetails is not possible this method is final
static enabledDetails ($a_obj_id)
 enabled show details As long as static::enableDetails is not possible this method is final

Protected Member Functions

 showDetailsLink ()
 show details link
 parseRelevance ($sub_item)

Protected Attributes

 $cmdClass = null
 $tpl

Static Protected Attributes

static $MAX_SUBITEMS = 5

Private Attributes

 $highlighter = null
 $subitem_ids = array()
 $item_list_gui
 $ref_id
 $obj_id
 $type

Static Private Attributes

static $details = array()

Detailed Description

Base class for all sub item list gui's.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 36 of file class.ilSubItemListGUI.php.

Constructor & Destructor Documentation

ilSubItemListGUI::__construct (   $a_cmd_class)

Constructor.

Parameters
@return

Definition at line 58 of file class.ilSubItemListGUI.php.

References ilSearchSettings\getInstance().

{
$this->cmdClass = $a_cmd_class;
self::$MAX_SUBITEMS = ilSearchSettings::getInstance()->getMaxSubitems();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilSubItemListGUI::enabledDetails (   $a_obj_id)
staticfinal

enabled show details As long as static::enableDetails is not possible this method is final

Parameters
int$a_obj_idobject id
Returns
bool

Definition at line 99 of file class.ilSubItemListGUI.php.

References $_SESSION.

{
return isset($_SESSION['lucene_search']['details'][$a_obj_id]) and $_SESSION['lucene_search']['details'][$a_obj_id];
}
ilSubItemListGUI::getCmdClass ( )

get cmd class

Returns

Definition at line 108 of file class.ilSubItemListGUI.php.

References $cmdClass.

Referenced by showDetailsLink().

{
}

+ Here is the caller graph for this function:

ilSubItemListGUI::getItemListGUI ( )
ilSubItemListGUI::getRefId ( )
ilSubItemListGUI::getSubItemIds (   $a_limited = false)

get sub item ids

Parameters
bool$a_limited
Returns

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

References $subitem_ids, and getObjId().

Referenced by ilObjForumSubItemListGUI\getHTML(), ilObjExerciseSubItemListGUI\getHTML(), ilObjLearningModuleSubItemListGUI\getHTML(), ilObjMediaPoolSubItemListGUI\getHTML(), ilObjGlossarySubItemListGUI\getHTML(), ilObjWikiSubItemListGUI\getHTML(), ilObjLinkResourceSubItemListGUI\getHTML(), and showDetailsLink().

{
if($a_limited and !self::enabledDetails($this->getObjId()))
{
return array_slice($this->subitem_ids,0,self::$MAX_SUBITEMS);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSubItemListGUI::getType ( )

get type

Returns

Definition at line 156 of file class.ilSubItemListGUI.php.

References $type.

{
return $this->type;
}
ilSubItemListGUI::init (   $item_list_gui,
  $a_ref_id,
  $a_subitem_ids 
)

init

Parameters
@return

Definition at line 190 of file class.ilSubItemListGUI.php.

References $item_list_gui, ilObject\_lookupObjId(), ilObject\_lookupType(), getObjId(), and getRefId().

{
$this->tpl = new ilTemplate('tpl.subitem_list.html',true,true,'Services/Object');
$this->item_list_gui = $item_list_gui;
$this->ref_id = $a_ref_id;
$this->obj_id = ilObject::_lookupObjId($this->getRefId());
$this->type = ilObject::_lookupType($this->getObjId());
$this->subitem_ids = $a_subitem_ids;
}

+ Here is the call graph for this function:

ilSubItemListGUI::parseRelevance (   $sub_item)
protected

Definition at line 233 of file class.ilSubItemListGUI.php.

References getHighlighter(), ilUtil\getImagePath(), ilSearchSettings\getInstance(), and getObjId().

Referenced by ilObjForumSubItemListGUI\getHTML(), ilObjExerciseSubItemListGUI\getHTML(), ilObjLearningModuleSubItemListGUI\getHTML(), ilObjMediaPoolSubItemListGUI\getHTML(), ilObjGlossarySubItemListGUI\getHTML(), ilObjWikiSubItemListGUI\getHTML(), and ilObjLinkResourceSubItemListGUI\getHTML().

{
if(!ilSearchSettings::getInstance()->isSubRelevanceVisible())
{
return '';
}
$this->tpl->addBlockFile('SUB_REL','sub_rel','tpl.lucene_sub_relevance.html','Services/Search');
$relevance = $this->getHighlighter()->getRelevance($this->getObjId(),$sub_item);
$width1 = (int) ((int) $relevance / 2);
$width2 = (int) ((50 - $width1));
$this->tpl->setCurrentBlock('relev');
$this->tpl->setVariable('VAL_REL',sprintf("%d %%",$relevance));
$this->tpl->setVariable('WIDTH_A',$width1);
$this->tpl->setVariable('WIDTH_B',$width2);
$this->tpl->setVariable('IMG_A',ilUtil::getImagePath("relevance_blue.png"));
$this->tpl->setVariable('IMG_B',ilUtil::getImagePath("relevance_dark.png"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilSubItemListGUI::resetDetails ( )
staticfinal

reset details As long as static::resetDetails is not possible this method is final

Returns

Definition at line 86 of file class.ilSubItemListGUI.php.

References $_SESSION.

Referenced by ilLuceneUserSearchGUI\search(), ilLuceneAdvancedSearchGUI\search(), ilLuceneSearchGUI\search(), ilSearchGUI\storeRoot(), and ilLuceneSearchGUI\storeRoot().

{
$_SESSION['lucene_search']['details'] = array();
}

+ Here is the caller graph for this function:

ilSubItemListGUI::setHighlighter (   $a_highlighter)

set highlighter

Parameters
@return

Definition at line 119 of file class.ilSubItemListGUI.php.

{
$this->highlighter = $a_highlighter;
}
static ilSubItemListGUI::setShowDetails (   $a_obj_id)
staticfinal

set show details.

Show all subitem links for a specific object As long as static::setShowDetails is not possible this method is final

Returns
Parameters
int$a_obj_idobject id

Definition at line 74 of file class.ilSubItemListGUI.php.

References $_SESSION.

Referenced by ilSearchResultPresentation\__construct().

{
$_SESSION['lucene_search']['details'][$a_obj_id] = true;
}

+ Here is the caller graph for this function:

ilSubItemListGUI::showDetailsLink ( )
protected

show details link

Returns

Definition at line 205 of file class.ilSubItemListGUI.php.

References $additional, $ilCtrl, $lng, $MAX_SUBITEMS, getCmdClass(), getObjId(), and getSubItemIds().

Referenced by ilObjForumSubItemListGUI\getHTML(), ilObjExerciseSubItemListGUI\getHTML(), ilObjLearningModuleSubItemListGUI\getHTML(), ilObjMediaPoolSubItemListGUI\getHTML(), ilObjGlossarySubItemListGUI\getHTML(), ilObjWikiSubItemListGUI\getHTML(), and ilObjLinkResourceSubItemListGUI\getHTML().

{
global $ilCtrl,$lng;
if(count($this->getSubItemIds()) <= self::$MAX_SUBITEMS)
{
return;
}
if(self::enabledDetails($this->getObjId()))
{
return;
}
$ilCtrl->setParameterByClass(get_class($this->getCmdClass()), 'details', (int) $this->getObjId());
$link = $ilCtrl->getLinkTargetByClass(get_class($this->getCmdClass()),'');
$ilCtrl->clearParametersByClass(get_class($this->getCmdClass()));
$this->tpl->setCurrentBlock('choose_details');
$this->tpl->setVariable('LUC_DETAILS_LINK',$link);
$this->tpl->setVariable('LUC_NUM_HITS',sprintf($lng->txt('lucene_more_hits_link'),$additional));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilSubItemListGUI::$cmdClass = null
protected

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

Referenced by getCmdClass().

ilSubItemListGUI::$details = array()
staticprivate

Definition at line 45 of file class.ilSubItemListGUI.php.

ilSubItemListGUI::$highlighter = null
private

Definition at line 43 of file class.ilSubItemListGUI.php.

Referenced by getHighlighter().

ilSubItemListGUI::$item_list_gui
private

Definition at line 48 of file class.ilSubItemListGUI.php.

Referenced by getItemListGUI(), and init().

ilSubItemListGUI::$MAX_SUBITEMS = 5
staticprotected

Definition at line 38 of file class.ilSubItemListGUI.php.

Referenced by showDetailsLink().

ilSubItemListGUI::$obj_id
private

Definition at line 50 of file class.ilSubItemListGUI.php.

Referenced by getObjId().

ilSubItemListGUI::$ref_id
private

Definition at line 49 of file class.ilSubItemListGUI.php.

Referenced by getRefId().

ilSubItemListGUI::$subitem_ids = array()
private

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

Referenced by getSubItemIds().

ilSubItemListGUI::$tpl
protected

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

ilSubItemListGUI::$type
private

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

Referenced by getType().


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