ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules 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 (string $cmd_class)
 
 getCmdClass ()
 
 setHighlighter (?ilLuceneHighlighterResultParser $highlighter)
 
 getHighlighter ()
 
 getRefId ()
 
 getObjId ()
 
 getType ()
 
 getSubItemIds (bool $limited=false)
 
 getItemListGUI ()
 
 init (ilObjectListGUI $item_list_gui, int $ref_id, array $subitem_ids)
 
 getHTML ()
 

Static Public Member Functions

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

Protected Member Functions

 showDetailsLink ()
 

Protected Attributes

ilCtrlInterface $ctrl
 
ilLanguage $lng
 
string $cmd_class = ''
 
ilTemplate $tpl = null
 
ilLuceneHighlighterResultParser $highlighter = null
 
array $subitem_ids = []
 
ilObjectListGUI $item_list_gui = null
 
int $ref_id = 0
 
int $obj_id = 0
 
string $type = ''
 

Static Protected Attributes

static int $MAX_SUBITEMS = 5
 
static array $details = []
 

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

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

Constructor & Destructor Documentation

◆ __construct()

ilSubItemListGUI::__construct ( string  $cmd_class)

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

References $cmd_class, $DIC, ILIAS\Repository\ctrl(), ilSearchSettings\getInstance(), and ILIAS\Repository\lng().

45  {
46  global $DIC;
47 
48  $this->ctrl = $DIC->ctrl();
49  $this->lng = $DIC->language();
50 
51  $this->cmd_class = $cmd_class;
52  self::$MAX_SUBITEMS = ilSearchSettings::getInstance()->getMaxSubitems();
53  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ enabledDetails()

static ilSubItemListGUI::enabledDetails ( int  $obj_id)
staticfinal

As long as static::enableDetails is not possible this method is final.

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

References $obj_id.

76  : bool
77  {
78  return isset($_SESSION['lucene_search']['details'][$obj_id]) && $_SESSION['lucene_search']['details'][$obj_id];
79  }

◆ getCmdClass()

ilSubItemListGUI::getCmdClass ( )

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

References $cmd_class.

Referenced by showDetailsLink().

81  : string
82  {
83  return $this->cmd_class;
84  }
+ Here is the caller graph for this function:

◆ getHighlighter()

◆ getHTML()

ilSubItemListGUI::getHTML ( )
abstract

Referenced by showDetailsLink().

+ Here is the caller graph for this function:

◆ getItemListGUI()

ilSubItemListGUI::getItemListGUI ( )

◆ getObjId()

◆ getRefId()

ilSubItemListGUI::getRefId ( )

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

References $ref_id.

Referenced by ilObjMediaPoolSubItemListGUI\getHTML(), ilObjGlossarySubItemListGUI\getHTML(), ilObjWikiSubItemListGUI\getHTML(), ilObjExerciseSubItemListGUI\getHTML(), and init().

96  : int
97  {
98  return $this->ref_id;
99  }
+ Here is the caller graph for this function:

◆ getSubItemIds()

ilSubItemListGUI::getSubItemIds ( bool  $limited = false)

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

References $subitem_ids, and getObjId().

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

111  : array
112  {
113  if ($limited && !self::enabledDetails($this->getObjId())) {
114  return array_slice($this->subitem_ids, 0, self::$MAX_SUBITEMS);
115  }
116 
117  return $this->subitem_ids;
118  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilSubItemListGUI::getType ( )

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

References $type.

106  : string
107  {
108  return $this->type;
109  }

◆ init()

ilSubItemListGUI::init ( ilObjectListGUI  $item_list_gui,
int  $ref_id,
array  $subitem_ids 
)

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

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

125  : void
126  {
127  $this->tpl = new ilTemplate('tpl.subitem_list.html', true, true, 'components/ILIAS/ILIASObject');
128  $this->item_list_gui = $item_list_gui;
129  $this->ref_id = $ref_id;
130  $this->obj_id = ilObject::_lookupObjId($this->getRefId());
131  $this->type = ilObject::_lookupType($this->getObjId());
132  $this->subitem_ids = $subitem_ids;
133  }
static _lookupObjId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
ilObjectListGUI $item_list_gui
+ Here is the call graph for this function:

◆ resetDetails()

static ilSubItemListGUI::resetDetails ( )
staticfinal

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

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

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

68  : void
69  {
70  $_SESSION['lucene_search']['details'] = [];
71  }
+ Here is the caller graph for this function:

◆ setHighlighter()

ilSubItemListGUI::setHighlighter ( ?ilLuceneHighlighterResultParser  $highlighter)

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

References $highlighter.

86  : void
87  {
88  $this->highlighter = $highlighter;
89  }
ilLuceneHighlighterResultParser $highlighter

◆ setShowDetails()

static ilSubItemListGUI::setShowDetails ( int  $obj_id)
staticfinal

set show details.

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

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

References $obj_id.

Referenced by ilSearchResultPresentation\__construct().

60  : void
61  {
62  $_SESSION['lucene_search']['details'][$obj_id] = true;
63  }
+ Here is the caller graph for this function:

◆ showDetailsLink()

ilSubItemListGUI::showDetailsLink ( )
protected

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

References ILIAS\Repository\ctrl(), getCmdClass(), getHTML(), getObjId(), getSubItemIds(), and ILIAS\Repository\lng().

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

135  : void
136  {
137  if (count($this->getSubItemIds()) <= self::$MAX_SUBITEMS) {
138  return;
139  }
140  if (self::enabledDetails($this->getObjId())) {
141  return;
142  }
143 
144  $additional = count($this->getSubItemIds()) - self::$MAX_SUBITEMS;
145 
146  $this->ctrl->setParameterByClass($this->getCmdClass(), 'details', $this->getObjId());
147  $link = $this->ctrl->getLinkTargetByClass($this->getCmdClass(), '');
148  $this->ctrl->clearParametersByClass($this->getCmdClass());
149 
150  $this->tpl->setCurrentBlock('choose_details');
151  $this->tpl->setVariable('LUC_DETAILS_LINK', $link);
152  $this->tpl->setVariable('LUC_NUM_HITS', sprintf($this->lng->txt('lucene_more_hits_link'), $additional));
153  $this->tpl->parseCurrentBlock();
154  }
getSubItemIds(bool $limited=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $cmd_class

string ilSubItemListGUI::$cmd_class = ''
protected

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

Referenced by __construct(), and getCmdClass().

◆ $ctrl

ilCtrlInterface ilSubItemListGUI::$ctrl
protected

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

◆ $details

array ilSubItemListGUI::$details = []
staticprotected

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

◆ $highlighter

ilLuceneHighlighterResultParser ilSubItemListGUI::$highlighter = null
protected

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

Referenced by getHighlighter(), and setHighlighter().

◆ $item_list_gui

ilObjectListGUI ilSubItemListGUI::$item_list_gui = null
protected

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

Referenced by getItemListGUI(), and init().

◆ $lng

◆ $MAX_SUBITEMS

int ilSubItemListGUI::$MAX_SUBITEMS = 5
staticprotected

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

◆ $obj_id

int ilSubItemListGUI::$obj_id = 0
protected

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

Referenced by enabledDetails(), getObjId(), and setShowDetails().

◆ $ref_id

int ilSubItemListGUI::$ref_id = 0
protected

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

Referenced by getRefId(), and init().

◆ $subitem_ids

array ilSubItemListGUI::$subitem_ids = []
protected

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

Referenced by getSubItemIds(), and init().

◆ $tpl

ilTemplate ilSubItemListGUI::$tpl = null
protected

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

◆ $type

string ilSubItemListGUI::$type = ''
protected

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

Referenced by getType().


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