ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilPresentationFullGUI Class Reference
+ Collaboration diagram for ilPresentationFullGUI:

Public Member Functions

 __construct ( $parent_object, ilObjGlossary $glossary, bool $offline, int $tax_node=0,)
 
 executeCommand ()
 
 show ()
 
 renderPanelForOffline ()
 

Protected Member Functions

 determinePageLength ()
 
 initFilter ()
 
 initPanel (int $page_length=0)
 
 initDropdown (int $page_length)
 

Protected Attributes

ILIAS Style Content Service $content_style
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs_gui
 
ilNavigationHistory $nav_history
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
 $parent_obj
 
ilObjGlossary $glossary
 
bool $offline = false
 
int $tax_node = 0
 
Presentation PresentationGUIRequest $request
 
Presentation PresentationManager $manager
 
ilUIFilterService $filter_service
 
array $filter_data = null
 

Detailed Description

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

Definition at line 27 of file class.ilPresentationFullGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPresentationFullGUI::__construct (   $parent_object,
ilObjGlossary  $glossary,
bool  $offline,
int  $tax_node = 0 
)

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

References $DIC, $glossary, $offline, $tax_node, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

52  {
53  global $DIC;
54 
55  $this->ctrl = $DIC->ctrl();
56  $this->user = $DIC->user();
57  $this->lng = $DIC->language();
58  $this->tpl = $DIC->ui()->mainTemplate();
59  $this->tabs_gui = $DIC->tabs();
60  $this->nav_history = $DIC["ilNavigationHistory"];
61  $this->ui_fac = $DIC->ui()->factory();
62  $this->ui_ren = $DIC->ui()->renderer();
63  $this->parent_obj = $parent_object;
64  $this->glossary = $glossary;
65  $this->offline = $offline;
66  $this->tax_node = $tax_node;
67  $this->request = $DIC->glossary()
68  ->internal()
69  ->gui()
70  ->presentation()
71  ->request();
72  $this->manager = $DIC->glossary()
73  ->internal()
74  ->domain()
75  ->presentation($this->glossary);
76  $this->filter_service = $DIC->uiService()->filter();
77  $this->content_style = $DIC->contentStyle();
78  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ determinePageLength()

ilPresentationFullGUI::determinePageLength ( )
protected

Definition at line 93 of file class.ilPresentationFullGUI.php.

References ILIAS\Repository\int(), and ILIAS\Repository\user().

Referenced by initPanel().

93  : int
94  {
95  if ($this->request->getPageLength() === -1) {
96  $page_length = (int) $this->user->getPref("hits_per_page") ?: 9999;
97  $this->manager->setSessionPageLength($page_length);
98  } elseif ($this->request->getPageLength() > 0) {
99  $page_length = $this->request->getPageLength();
100  $this->manager->setSessionPageLength($page_length);
101  } elseif ($this->manager->getSessionPageLength() > 0) {
102  $page_length = $this->manager->getSessionPageLength();
103  } else {
104  $page_length = (int) $this->user->getPref("hits_per_page") ?: 9999;
105  }
106 
107  return $page_length;
108  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPresentationFullGUI::executeCommand ( )

Definition at line 80 of file class.ilPresentationFullGUI.php.

References ILIAS\Repository\ctrl().

80  : void
81  {
82  $next_class = $this->ctrl->getNextClass($this);
83  $cmd = $this->ctrl->getCmd();
84 
85  switch ($next_class) {
86  default:
87  $cmd = $this->ctrl->getCmd("show");
88  $ret = $this->$cmd();
89  break;
90  }
91  }
+ Here is the call graph for this function:

◆ initDropdown()

ilPresentationFullGUI::initDropdown ( int  $page_length)
protected

Definition at line 224 of file class.ilPresentationFullGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by initPanel().

224  : UI\Component\Dropdown\Dropdown
225  {
226  $hpp = ($this->user->getPref("hits_per_page") != 9999)
227  ? $this->user->getPref("hits_per_page")
228  : $this->lng->txt("no_limit");
229 
230  $terms_per_page_sel = [-1 => $this->lng->txt("default") . " (" . $hpp . ")", 5 => "5", 10 => "10",
231  15 => "15", 20 => "20", 30 => "30", 40 => "40", 50 => "50", 100 => "100"];
232 
233  foreach ($terms_per_page_sel as $count => $count_text) {
234  $this->ctrl->setParameter($this->parent_obj, "page_length", $count);
235  $items[] = $this->ui_fac->button()->shy($count_text, $this->ctrl->getLinkTarget($this, "show"));
236  $this->ctrl->setParameter($this->parent_obj, "page_length", "");
237  }
238  $dropdown = $this->ui_fac->dropdown()->standard($items)
239  ->withLabel($page_length . " " . $this->lng->txt("glo_terms_per_page"));
240 
241  return $dropdown;
242  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilPresentationFullGUI::initFilter ( )
protected

Definition at line 136 of file class.ilPresentationFullGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilUtil\stripSlashes().

Referenced by show().

136  : UI\Component\Input\Container\Filter\Standard
137  {
138  $first_letters = $this->glossary->getFirstLetters($this->tax_node);
139  $session_letter = ilUtil::stripSlashes($this->manager->getSessionLetter());
140  if (!empty($session_letter) && !in_array($session_letter, $first_letters)) {
141  $first_letters[$session_letter] = $session_letter;
142  }
143 
144  $filter = $this->filter_service->standard(
145  self::class . "_filter_" . $this->glossary->getRefId(),
146  $this->ctrl->getLinkTarget($this, "show"),
147  [
148  "letter" => $this->ui_fac->input()->field()->select(
149  $this->lng->txt("glo_term_letter"),
150  $first_letters
151  ),
152  "term" => $this->ui_fac->input()->field()->text($this->lng->txt("cont_term")),
153  "definition" => $this->ui_fac->input()->field()->text($this->lng->txt("cont_definition"))
154  ],
155  [true, true, true],
156  true,
157  true
158  );
159 
160  return $filter;
161  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPanel()

ilPresentationFullGUI::initPanel ( int  $page_length = 0)
protected

Definition at line 163 of file class.ilPresentationFullGUI.php.

References ILIAS\Repository\ctrl(), determinePageLength(), initDropdown(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilPageObjectGUI\PRESENTATION.

Referenced by renderPanelForOffline(), and show().

163  : UI\Component\Panel\Panel
164  {
165  if (!$page_length) {
166  $page_length = $this->determinePageLength();
167  }
168 
169  $terms = $this->glossary->getTermList(
170  $this->filter_data["term"] ?? "",
171  $this->filter_data["letter"] ?? "",
172  $this->filter_data["definition"] ?? "",
173  $this->tax_node,
174  false,
175  false,
176  null,
177  false,
178  true
179  );
180 
181  $terms_sliced = array_slice(
182  $terms,
183  $this->request->getCurrentPage() * $page_length,
184  $page_length
185  );
186 
187  $subs = [];
188  foreach ($terms_sliced as $term) {
189  $subs[] = $this->ui_fac->panel()->sub(
190  $term["term"],
191  $this->ui_fac->legacy($this->parent_obj->listDefinitions(
192  $this->request->getRefId(),
193  (int) $term["id"],
194  true,
195  false,
197  false
198  ))
199  );
200  }
201 
202  $panel = $this->ui_fac->panel()->standard($this->lng->txt("cont_terms"), $subs);
203  if (!$this->offline) {
204  $pagination = $this->ui_fac->viewControl()->pagination()
205  ->withTargetURL(
206  $this->ctrl->getLinkTarget($this, "show"),
207  "current_page"
208  )
209  ->withTotalEntries(count($terms))
210  ->withPageSize($page_length)
211  ->withMaxPaginationButtons(5)
212  ->withCurrentPage($this->request->getCurrentPage());
213 
214  $dropdown = $this->initDropdown($page_length);
215 
216  $panel = $panel
217  ->withViewControls([$pagination])
218  ->withActions($dropdown);
219  }
220 
221  return $panel;
222  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderPanelForOffline()

ilPresentationFullGUI::renderPanelForOffline ( )

Definition at line 244 of file class.ilPresentationFullGUI.php.

References initPanel().

244  : string
245  {
246  $panel = $this->initPanel(9999);
247  $panel_html = $this->ui_ren->render($panel);
248  //$this->tpl->setVariable("ADM_CONTENT", $panel_html);
249  //return $this->tpl->printToString();
250  return $panel_html;
251  }
+ Here is the call graph for this function:

◆ show()

ilPresentationFullGUI::show ( )

Definition at line 110 of file class.ilPresentationFullGUI.php.

References ILIAS\Repository\ctrl(), initFilter(), and initPanel().

110  : void
111  {
112  $this->ctrl->setParameter($this, "term_id", "");
113  $this->tabs_gui->activateTab("terms");
114 
115  $this->nav_history->addItem(
116  $this->glossary->getRefId(),
117  $this->ctrl->getLinkTargetByClass("ilGlossaryPresentationGUI", "listTerms"),
118  "glo"
119  );
120 
121  $this->content_style->gui()->addCss(
122  $this->tpl,
123  $this->glossary->getRefId()
124  );
125 
126  $filter = $this->initFilter();
127  $this->filter_data = $this->filter_service->getData($filter);
128  $this->manager->setSessionLetter($this->filter_data["letter"] ?? "");
129 
130  $panel = $this->initPanel();
131 
132  $this->tpl->setContent($this->ui_ren->render([$filter, $panel]));
133  $this->tpl->setPermanentLink("glo", $this->glossary->getRefId());
134  }
+ Here is the call graph for this function:

Field Documentation

◆ $content_style

ILIAS Style Content Service ilPresentationFullGUI::$content_style
protected

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

◆ $ctrl

ilCtrl ilPresentationFullGUI::$ctrl
protected

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

◆ $filter_data

array ilPresentationFullGUI::$filter_data = null
protected

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

◆ $filter_service

ilUIFilterService ilPresentationFullGUI::$filter_service
protected

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

◆ $glossary

ilObjGlossary ilPresentationFullGUI::$glossary
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilPresentationFullGUI::$lng
protected

Definition at line 32 of file class.ilPresentationFullGUI.php.

◆ $manager

Presentation PresentationManager ilPresentationFullGUI::$manager
protected

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

◆ $nav_history

ilNavigationHistory ilPresentationFullGUI::$nav_history
protected

Definition at line 35 of file class.ilPresentationFullGUI.php.

◆ $offline

bool ilPresentationFullGUI::$offline = false
protected

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

Referenced by __construct().

◆ $parent_obj

ilPresentationFullGUI::$parent_obj
protected

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

◆ $request

Presentation PresentationGUIRequest ilPresentationFullGUI::$request
protected

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

◆ $tabs_gui

ilTabsGUI ilPresentationFullGUI::$tabs_gui
protected

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

◆ $tax_node

int ilPresentationFullGUI::$tax_node = 0
protected

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

Referenced by __construct().

◆ $tpl

ilGlobalTemplateInterface ilPresentationFullGUI::$tpl
protected

Definition at line 33 of file class.ilPresentationFullGUI.php.

◆ $ui_fac

UI Factory ilPresentationFullGUI::$ui_fac
protected

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

◆ $ui_ren

UI Renderer ilPresentationFullGUI::$ui_ren
protected

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

◆ $user

ilObjUser ilPresentationFullGUI::$user
protected

Definition at line 30 of file class.ilPresentationFullGUI.php.


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