ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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. More...
 
 getCmdClass ()
 get cmd class More...
 
 setHighlighter ($a_highlighter)
 set highlighter More...
 
 getHighlighter ()
 get highlighter More...
 
 getRefId ()
 get ref id More...
 
 getObjId ()
 get obj id More...
 
 getType ()
 get type More...
 
 getSubItemIds ($a_limited=false)
 get sub item ids More...
 
 getItemListGUI ()
 get item list gui More...
 
 init ($item_list_gui, $a_ref_id, $a_subitem_ids)
 init More...
 
 getHTML ()
 

Static Public Member Functions

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

Protected Member Functions

 showDetailsLink ()
 show details link More...
 
 parseRelevance ($sub_item)
 

Protected Attributes

 $ctrl
 
 $lng
 
 $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

◆ __construct()

ilSubItemListGUI::__construct (   $a_cmd_class)

Constructor.

Parameters

return

Reimplemented in ilObjExerciseSubItemListGUI, ilObjGlossarySubItemListGUI, ilObjLearningModuleSubItemListGUI, and ilObjWikiSubItemListGUI.

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

69 {
70 global $DIC;
71
72 $this->ctrl = $DIC->ctrl();
73 $this->lng = $DIC->language();
74
75 $this->cmdClass = $a_cmd_class;
76 self::$MAX_SUBITEMS = ilSearchSettings::getInstance()->getMaxSubitems();
77 }
global $DIC
Definition: saml.php:7

References $DIC, and ilSearchSettings\getInstance().

+ Here is the call graph for this function:

Member Function Documentation

◆ enabledDetails()

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 113 of file class.ilSubItemListGUI.php.

114 {
115 return isset($_SESSION['lucene_search']['details'][$a_obj_id]) and $_SESSION['lucene_search']['details'][$a_obj_id];
116 }
$_SESSION["AccountId"]

References $_SESSION.

◆ getCmdClass()

ilSubItemListGUI::getCmdClass ( )

get cmd class

Returns

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

123 {
124 return $this->cmdClass;
125 }

References $cmdClass.

Referenced by showDetailsLink().

+ Here is the caller graph for this function:

◆ getHighlighter()

◆ getHTML()

◆ getItemListGUI()

ilSubItemListGUI::getItemListGUI ( )

◆ getObjId()

◆ getRefId()

ilSubItemListGUI::getRefId ( )

◆ getSubItemIds()

ilSubItemListGUI::getSubItemIds (   $a_limited = false)

get sub item ids

Parameters
bool$a_limited
Returns

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

181 {
182 if ($a_limited and !self::enabledDetails($this->getObjId())) {
183 return array_slice($this->subitem_ids, 0, self::$MAX_SUBITEMS);
184 }
185
186 return $this->subitem_ids;
187 }

References $subitem_ids, and getObjId().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilSubItemListGUI::getType ( )

get type

Returns

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

171 {
172 return $this->type;
173 }

References $type.

◆ init()

ilSubItemListGUI::init (   $item_list_gui,
  $a_ref_id,
  $a_subitem_ids 
)

init

Parameters

return

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

204 {
205 $this->tpl = new ilTemplate('tpl.subitem_list.html', true, true, 'Services/Object');
206 $this->item_list_gui = $item_list_gui;
207 $this->ref_id = $a_ref_id;
208 $this->obj_id = ilObject::_lookupObjId($this->getRefId());
209 $this->type = ilObject::_lookupType($this->getObjId());
210
211 $this->subitem_ids = $a_subitem_ids;
212 }
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
special template class to simplify handling of ITX/PEAR

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

+ Here is the call graph for this function:

◆ parseRelevance()

ilSubItemListGUI::parseRelevance (   $sub_item)
protected

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

244 {
245 if (!ilSearchSettings::getInstance()->isSubRelevanceVisible() ||
246 !ilSearchSettings::getInstance()->enabledLucene()) {
247 return '';
248 }
249
250 $relevance = $this->getHighlighter()->getRelevance($this->getObjId(), $sub_item);
251
252 //$this->tpl->addBlockFile('SUB_REL','sub_rel','tpl.lucene_sub_relevance.html','Services/Search');
253
254 include_once "Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
256 $pbar->setCurrent($relevance);
257
258 $this->tpl->setVariable('REL_PBAR', $pbar->render());
259 }
static getInstance()
Factory.
getHighlighter()
get highlighter

References getHighlighter(), ilSearchSettings\getInstance(), ilProgressBar\getInstance(), and getObjId().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetDetails()

static ilSubItemListGUI::resetDetails ( )
staticfinal

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

Returns

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

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

References $_SESSION.

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

+ Here is the caller graph for this function:

◆ setHighlighter()

ilSubItemListGUI::setHighlighter (   $a_highlighter)

set highlighter

Parameters

return

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

134 {
135 $this->highlighter = $a_highlighter;
136 }

◆ setShowDetails()

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 88 of file class.ilSubItemListGUI.php.

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

References $_SESSION.

Referenced by ilSearchResultPresentation\__construct().

+ Here is the caller graph for this function:

◆ showDetailsLink()

ilSubItemListGUI::showDetailsLink ( )
protected

show details link

Returns

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

219 {
222
223 if (count($this->getSubItemIds()) <= self::$MAX_SUBITEMS) {
224 return;
225 }
226 if (self::enabledDetails($this->getObjId())) {
227 return;
228 }
229
231
232 $ilCtrl->setParameterByClass(get_class($this->getCmdClass()), 'details', (int) $this->getObjId());
233 $link = $ilCtrl->getLinkTargetByClass(get_class($this->getCmdClass()), '');
234 $ilCtrl->clearParametersByClass(get_class($this->getCmdClass()));
235
236 $this->tpl->setCurrentBlock('choose_details');
237 $this->tpl->setVariable('LUC_DETAILS_LINK', $link);
238 $this->tpl->setVariable('LUC_NUM_HITS', sprintf($lng->txt('lucene_more_hits_link'), $additional));
239 $this->tpl->parseCurrentBlock();
240 }
sprintf('%.4f', $callTime)
getSubItemIds($a_limited=false)
get sub item ids
$additional
Definition: goto.php:50
global $ilCtrl
Definition: ilias.php:18

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $cmdClass

ilSubItemListGUI::$cmdClass = null
protected

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

Referenced by getCmdClass().

◆ $ctrl

ilSubItemListGUI::$ctrl
protected

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

Referenced by showDetailsLink().

◆ $details

ilSubItemListGUI::$details = array()
staticprivate

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

◆ $highlighter

ilSubItemListGUI::$highlighter = null
private

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

Referenced by getHighlighter().

◆ $item_list_gui

ilSubItemListGUI::$item_list_gui
private

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

Referenced by getItemListGUI(), and init().

◆ $lng

◆ $MAX_SUBITEMS

ilSubItemListGUI::$MAX_SUBITEMS = 5
staticprotected

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

Referenced by showDetailsLink().

◆ $obj_id

ilSubItemListGUI::$obj_id
private

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

Referenced by getObjId().

◆ $ref_id

ilSubItemListGUI::$ref_id
private

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

Referenced by getRefId().

◆ $subitem_ids

ilSubItemListGUI::$subitem_ids = array()
private

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

Referenced by getSubItemIds().

◆ $tpl

ilSubItemListGUI::$tpl
protected

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

◆ $type

ilSubItemListGUI::$type
private

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

Referenced by getType().


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