ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

return

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

59 {
60
61 $this->cmdClass = $a_cmd_class;
62 self::$MAX_SUBITEMS = ilSearchSettings::getInstance()->getMaxSubitems();
63 }

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

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

References $_SESSION.

◆ getCmdClass()

ilSubItemListGUI::getCmdClass ( )

get cmd class

Returns

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

109 {
110 return $this->cmdClass;
111 }

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

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 }

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

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

References $type.

◆ init()

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

init

Parameters
<br>
Returns

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

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

234 {
235 if(!ilSearchSettings::getInstance()->isSubRelevanceVisible() ||
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";
247 $pbar->setCurrent($relevance);
248
249 $this->tpl->setCurrentBlock('relevance');
250 $this->tpl->setVariable('REL_PBAR', $pbar->render());
251 $this->tpl->parseCurrentBlock();
252 }
static getInstance()
Factory.
getHighlighter()
get highlighter

References ilSearchSettings\enabledLucene(), 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 86 of file class.ilSubItemListGUI.php.

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

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 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.

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

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

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
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 }
getSubItemIds($a_limited=false)
get sub item ids
$additional
Definition: goto.php:89
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40

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

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 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.

Referenced by showDetailsLink().

◆ $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: