ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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

 $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

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

References ilSearchSettings\getInstance().

59  {
60 
61  $this->cmdClass = $a_cmd_class;
62  self::$MAX_SUBITEMS = ilSearchSettings::getInstance()->getMaxSubitems();
63  }
+ 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 99 of file class.ilSubItemListGUI.php.

References $_SESSION.

100  {
101  return isset($_SESSION['lucene_search']['details'][$a_obj_id]) and $_SESSION['lucene_search']['details'][$a_obj_id];
102  }
$_SESSION["AccountId"]

◆ getCmdClass()

ilSubItemListGUI::getCmdClass ( )

get cmd class

Returns

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

References $cmdClass.

Referenced by showDetailsLink().

109  {
110  return $this->cmdClass;
111  }
+ Here is the caller graph for this function:

◆ getHighlighter()

◆ getHTML()

ilSubItemListGUI::getHTML ( )
abstract

Referenced by parseRelevance().

+ Here is the caller graph for this function:

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

167  {
168  if($a_limited and !self::enabledDetails($this->getObjId()))
169  {
170  return array_slice($this->subitem_ids,0,self::$MAX_SUBITEMS);
171  }
172 
173  return $this->subitem_ids;
174  }
+ 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 156 of file class.ilSubItemListGUI.php.

References $type.

157  {
158  return $this->type;
159  }

◆ init()

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

init

Parameters

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

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

191  {
192  $this->tpl = new ilTemplate('tpl.subitem_list.html',true,true,'Services/Object');
193  $this->item_list_gui = $item_list_gui;
194  $this->ref_id = $a_ref_id;
195  $this->obj_id = ilObject::_lookupObjId($this->getRefId());
196  $this->type = ilObject::_lookupType($this->getObjId());
197 
198  $this->subitem_ids = $a_subitem_ids;
199  }
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ parseRelevance()

ilSubItemListGUI::parseRelevance (   $sub_item)
protected

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

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

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

234  {
235  if(!ilSearchSettings::getInstance()->isSubRelevanceVisible() ||
236  !ilSearchSettings::getInstance()->enabledLucene())
237  {
238  return '';
239  }
240 
241  $relevance = $this->getHighlighter()->getRelevance($this->getObjId(),$sub_item);
242 
243  //$this->tpl->addBlockFile('SUB_REL','sub_rel','tpl.lucene_sub_relevance.html','Services/Search');
244 
245  include_once "Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
246  $pbar = ilProgressBar::getInstance();
247  $pbar->setCurrent($relevance);
248 
249  $this->tpl->setVariable('REL_PBAR', $pbar->render());
250  }
getHighlighter()
get highlighter
static getInstance()
Factory.
+ 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 86 of file class.ilSubItemListGUI.php.

References $_SESSION, and array.

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

87  {
88  $_SESSION['lucene_search']['details'] = array();
89  }
$_SESSION["AccountId"]
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ setHighlighter()

ilSubItemListGUI::setHighlighter (   $a_highlighter)

set highlighter

Parameters

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

120  {
121  $this->highlighter = $a_highlighter;
122  }

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

References $_SESSION.

Referenced by ilSearchResultPresentation\__construct().

75  {
76  $_SESSION['lucene_search']['details'][$a_obj_id] = true;
77  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ showDetailsLink()

ilSubItemListGUI::showDetailsLink ( )
protected

show details link

Returns

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

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

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

206  {
207  global $ilCtrl,$lng;
208 
209  if(count($this->getSubItemIds()) <= self::$MAX_SUBITEMS)
210  {
211  return;
212  }
213  if(self::enabledDetails($this->getObjId()))
214  {
215  return;
216  }
217 
218  $additional = count($this->getSubItemIds()) - self::$MAX_SUBITEMS;
219 
220  $ilCtrl->setParameterByClass(get_class($this->getCmdClass()), 'details', (int) $this->getObjId());
221  $link = $ilCtrl->getLinkTargetByClass(get_class($this->getCmdClass()),'');
222  $ilCtrl->clearParametersByClass(get_class($this->getCmdClass()));
223 
224  $this->tpl->setCurrentBlock('choose_details');
225  $this->tpl->setVariable('LUC_DETAILS_LINK',$link);
226  $this->tpl->setVariable('LUC_NUM_HITS',sprintf($lng->txt('lucene_more_hits_link'),$additional));
227  $this->tpl->parseCurrentBlock();
228 
229 
230  }
global $ilCtrl
Definition: ilias.php:18
getCmdClass()
get cmd class
$additional
Definition: goto.php:52
global $lng
Definition: privfeed.php:17
getSubItemIds($a_limited=false)
get sub item ids
+ 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 40 of file class.ilSubItemListGUI.php.

Referenced by getCmdClass().

◆ $details

ilSubItemListGUI::$details = array()
staticprivate

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

◆ $highlighter

ilSubItemListGUI::$highlighter = null
private

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

Referenced by getHighlighter().

◆ $item_list_gui

ilSubItemListGUI::$item_list_gui
private

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

Referenced by getItemListGUI(), and init().

◆ $MAX_SUBITEMS

ilSubItemListGUI::$MAX_SUBITEMS = 5
staticprotected

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

◆ $obj_id

ilSubItemListGUI::$obj_id
private

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

Referenced by getObjId().

◆ $ref_id

ilSubItemListGUI::$ref_id
private

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

Referenced by getRefId().

◆ $subitem_ids

ilSubItemListGUI::$subitem_ids = array()
private

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

Referenced by getSubItemIds().

◆ $tpl

ilSubItemListGUI::$tpl
protected

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

◆ $type

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: