ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ determinePageLength()

ilPresentationFullGUI::determinePageLength ( )
protected

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

93 : int
94 {
95 if ($this->request->getPageLength() > 0) {
96 $page_length = $this->request->getPageLength();
97 $this->manager->setSessionPageLength($page_length);
98 } elseif ($this->manager->getSessionPageLength() > 0) {
99 $page_length = $this->manager->getSessionPageLength();
100 } else {
101 $page_length = 9999;
102 }
103
104 return $page_length;
105 }

Referenced by initPanel().

+ Here is the caller graph for this function:

◆ executeCommand()

ilPresentationFullGUI::executeCommand ( )

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

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 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initDropdown()

ilPresentationFullGUI::initDropdown ( int  $page_length)
protected

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

223 : UI\Component\Dropdown\Dropdown
224 {
225 $terms_per_page_sel = [5 => "5", 10 => "10",
226 15 => "15", 20 => "20", 30 => "30", 40 => "40", 50 => "50", 100 => "100"];
227
228 foreach ($terms_per_page_sel as $count => $count_text) {
229 $this->ctrl->setParameter($this->parent_obj, "page_length", $count);
230 $items[] = $this->ui_fac->button()->shy($count_text, $this->ctrl->getLinkTarget($this, "show"));
231 $this->ctrl->setParameter($this->parent_obj, "page_length", "");
232 }
233 $dropdown = $this->ui_fac->dropdown()->standard($items)
234 ->withLabel($page_length . " " . $this->lng->txt("glo_terms_per_page"));
235
236 return $dropdown;
237 }

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

Referenced by initPanel().

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

◆ initFilter()

ilPresentationFullGUI::initFilter ( )
protected

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

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

References ilUtil\stripSlashes().

Referenced by show().

+ 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 160 of file class.ilPresentationFullGUI.php.

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

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

Referenced by renderPanelForOffline(), and show().

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

◆ renderPanelForOffline()

ilPresentationFullGUI::renderPanelForOffline ( )

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

239 : string
240 {
241 $panel = $this->initPanel(9999);
242 $panel_html = $this->ui_ren->render($panel);
243 //$this->tpl->setVariable("ADM_CONTENT", $panel_html);
244 //return $this->tpl->printToString();
245 return $panel_html;
246 }

References initPanel().

+ Here is the call graph for this function:

◆ show()

ilPresentationFullGUI::show ( )

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

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

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

+ 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: