Awareness GUI class.
More...
Awareness GUI class.
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 29 of file class.ilAwarenessGUI.php.
◆ __construct()
Definition at line 43 of file class.ilAwarenessGUI.php.
References $DIC, $lng, $ref_id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().
51 ?? $DIC->awareness()->internal()->data();
52 $domain_service = $domain_service
53 ?? $DIC->awareness()->internal()->domain();
54 $gui_service = $gui_service
55 ?? $DIC->awareness()->internal()->gui();
56 $this->
user = $domain_service->user();
57 $this->
lng = $domain_service->lng();
58 $this->
ui = $gui_service->ui();
59 $this->
ctrl = $gui_service->ctrl();
61 $this->
lng->loadLanguageModule(
"awrn");
62 $this->request = $gui_service->standardRequest();
63 $this->main_tpl = $gui_service->mainTemplate();
65 $this->ref_id = $this->request->getRefId();
66 $this->manager = $domain_service->widget(
70 $this->gui = $DIC->awareness()->internal()->gui();
76 $this->
ui->renderer(),
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A class that provides a collection of actions on users.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
InternalDataService $data_service
◆ executeCommand()
ilAwarenessGUI::executeCommand |
( |
| ) |
|
◆ getAwarenessList()
ilAwarenessGUI::getAwarenessList |
( |
bool |
$return = false | ) |
|
Get awareness list (ajax)
- Returns
- ?array<string,string>
- Exceptions
-
Definition at line 117 of file class.ilAwarenessGUI.php.
References exit, initJS(), ILIAS\Repository\lng(), and ilLegacyFormElementsUtil\prepareFormOutput().
119 $filter = $this->request->getFilter();
121 $tpl =
new ilTemplate(
"tpl.awareness_list.html",
true,
true,
"components/ILIAS/Awareness");
123 $ad = $this->manager->getListData($filter);
125 $users = $ad[
"data"];
129 foreach ($users as $u) {
130 if ($u->collector != $last_uc_title) {
131 if ($u->highlighted) {
132 $tpl->touchBlock(
"highlighted");
134 $tpl->setCurrentBlock(
"uc_title");
135 $tpl->setVariable(
"UC_TITLE", $u->collector);
136 $tpl->parseCurrentBlock();
137 $tpl->setCurrentBlock(
"item");
138 $tpl->parseCurrentBlock();
140 $last_uc_title = $u->collector;
145 foreach ($u->actions as $act) {
148 $tpl->touchBlock(
"arrow");
152 if (is_array($act->data) && count($act->data) > 0) {
153 foreach ($act->data as $k => $v) {
154 $tpl->setCurrentBlock(
"f_data");
155 $tpl->setVariable(
"DATA_KEY", $k);
157 $tpl->parseCurrentBlock();
160 $tpl->setCurrentBlock(
"feature");
161 $tpl->setVariable(
"FEATURE_HREF", $act->href);
162 $tpl->setVariable(
"FEATURE_TEXT", $act->text);
163 $tpl->parseCurrentBlock();
167 $tpl->touchBlock(
"uonline");
168 $tpl->setCurrentBlock(
"uonline_text");
169 $tpl->setVariable(
"TXT_ONLINE", $this->
lng->txt(
"awrn_online"));
170 $tpl->parseCurrentBlock();
173 $tpl->setCurrentBlock(
"user");
174 if ($u->public_profile) {
175 $tpl->setVariable(
"UNAME", $u->lastname .
", " . $u->firstname);
177 $tpl->setVariable(
"UNAME",
"-");
179 $tpl->setVariable(
"UACCOUNT", $u->login);
181 $tpl->setVariable(
"USERIMAGE", $u->img);
182 $tpl->setVariable(
"CNT", $ucnt);
183 $tpl->parseCurrentBlock();
184 $tpl->setCurrentBlock(
"item");
185 $tpl->parseCurrentBlock();
188 $tpl->setCurrentBlock(
"filter");
189 $tpl->setVariable(
"GL_FILTER", $this->gui->symbol()->glyph(
"filter")->render());
190 $tpl->setVariable(
"FILTER_INPUT_LABEL", $this->
lng->txt(
"awrn_filter"));
191 $tpl->parseCurrentBlock();
194 $result = [
"html" => $tpl->get(),
196 "cnt" => $ad[
"cnt"]];
203 echo json_encode($result, JSON_THROW_ON_ERROR);
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ initJS()
ilAwarenessGUI::initJS |
( |
| ) |
|
Definition at line 92 of file class.ilAwarenessGUI.php.
References $user, ILIAS\Repository\ctrl(), and ilUtil\getImagePath().
Referenced by getAwarenessList().
97 $this->main_tpl->addJavaScript(
"./assets/js/Awareness.js");
98 $this->
ctrl->setParameter($this,
"ref_id", $this->ref_id);
99 $this->main_tpl->addOnLoadCode(
"il.Awareness.setBaseUrl('" . $this->
ctrl->getLinkTarget(
106 $this->main_tpl->addOnLoadCode(
"il.Awareness.setLoaderSrc('" .
ilUtil::getImagePath(
"media/loader.svg") .
"');");
107 $this->main_tpl->addOnLoadCode(
"il.Awareness.init();");
109 $this->user_action_gui->init();
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
◆ $ctrl
◆ $data_service
◆ $gui
◆ $lng
◆ $main_tpl
◆ $manager
◆ $ref_id
int ilAwarenessGUI::$ref_id |
|
protected |
◆ $request
ILIAS Awareness StandardGUIRequest ilAwarenessGUI::$request |
|
protected |
◆ $ui
◆ $user
◆ $user_action_gui
The documentation for this class was generated from the following file: