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 41 of file class.ilAwarenessGUI.php.
References $DIC, $ref_id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().
48 $this->data_service = $data_service
49 ?? $DIC->awareness()->internal()->data();
50 $domain_service = $domain_service
51 ?? $DIC->awareness()->internal()->domain();
52 $gui_service = $gui_service
53 ?? $DIC->awareness()->internal()->gui();
54 $this->
user = $domain_service->user();
55 $this->
lng = $domain_service->lng();
56 $this->
ui = $gui_service->ui();
57 $this->
ctrl = $gui_service->ctrl();
59 $this->
lng->loadLanguageModule(
"awrn");
61 $this->main_tpl = $gui_service->mainTemplate();
63 $this->ref_id = $this->request->getRefId();
64 $this->manager = $domain_service->
widget(
widget(int $user_id, int $ref_id=0)
◆ executeCommand()
ilAwarenessGUI::executeCommand |
( |
| ) |
|
◆ getAwarenessList()
ilAwarenessGUI::getAwarenessList |
( |
bool |
$return = false | ) |
|
Get awareness list (ajax)
- Returns
- ?array<string,string>
- Exceptions
-
Definition at line 105 of file class.ilAwarenessGUI.php.
References $tpl, exit, ilGlyphGUI\FILTER, ilGlyphGUI\get(), initJS(), ILIAS\Repository\lng(), and ilLegacyFormElementsUtil\prepareFormOutput().
107 $filter = $this->request->getFilter();
109 $tpl =
new ilTemplate(
"tpl.awareness_list.html",
true,
true,
"Services/Awareness");
111 $ad = $this->manager->getListData($filter);
113 $users = $ad[
"data"];
117 foreach ($users as $u) {
118 if ($u->collector != $last_uc_title) {
119 if ($u->highlighted) {
120 $tpl->touchBlock(
"highlighted");
122 $tpl->setCurrentBlock(
"uc_title");
123 $tpl->setVariable(
"UC_TITLE", $u->collector);
124 $tpl->parseCurrentBlock();
125 $tpl->setCurrentBlock(
"item");
126 $tpl->parseCurrentBlock();
128 $last_uc_title = $u->collector;
133 foreach ($u->actions as $act) {
136 $tpl->touchBlock(
"arrow");
140 if (is_array($act->data) && count($act->data) > 0) {
141 foreach ($act->data as $k => $v) {
142 $tpl->setCurrentBlock(
"f_data");
143 $tpl->setVariable(
"DATA_KEY", $k);
145 $tpl->parseCurrentBlock();
148 $tpl->setCurrentBlock(
"feature");
149 $tpl->setVariable(
"FEATURE_HREF", $act->href);
150 $tpl->setVariable(
"FEATURE_TEXT", $act->text);
151 $tpl->parseCurrentBlock();
155 $tpl->touchBlock(
"uonline");
156 $tpl->setCurrentBlock(
"uonline_text");
157 $tpl->setVariable(
"TXT_ONLINE", $this->
lng->txt(
"awrn_online"));
158 $tpl->parseCurrentBlock();
161 $tpl->setCurrentBlock(
"user");
162 if ($u->public_profile) {
163 $tpl->setVariable(
"UNAME", $u->lastname .
", " . $u->firstname);
165 $tpl->setVariable(
"UNAME",
"-");
167 $tpl->setVariable(
"UACCOUNT", $u->login);
169 $tpl->setVariable(
"USERIMAGE", $u->img);
170 $tpl->setVariable(
"CNT", $ucnt);
171 $tpl->parseCurrentBlock();
172 $tpl->setCurrentBlock(
"item");
173 $tpl->parseCurrentBlock();
176 $tpl->setCurrentBlock(
"filter");
178 $tpl->setVariable(
"FILTER_INPUT_LABEL", $this->
lng->txt(
"awrn_filter"));
179 $tpl->parseCurrentBlock();
182 $result = [
"html" =>
$tpl->get(),
184 "cnt" => $ad[
"cnt"]];
191 echo json_encode($result, JSON_THROW_ON_ERROR);
static get(string $a_glyph, string $a_text="")
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
◆ initJS()
ilAwarenessGUI::initJS |
( |
| ) |
|
Definition at line 79 of file class.ilAwarenessGUI.php.
References $GLOBALS, $ilUser, $user, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ilUserActionGUI\getInstance().
Referenced by getAwarenessList().
83 $this->main_tpl->addJavaScript(
"./Services/Awareness/js/Awareness.js");
84 $this->
ctrl->setParameter($this,
"ref_id", $this->ref_id);
85 $this->main_tpl->addOnLoadCode(
"il.Awareness.setBaseUrl('" . $this->
ctrl->getLinkTarget(
92 $this->main_tpl->addOnLoadCode(
"il.Awareness.setLoaderSrc('" .
ilUtil::getImagePath(
"loader.svg") .
"');");
93 $this->main_tpl->addOnLoadCode(
"il.Awareness.init();");
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(ilUserActionContext $a_user_action_context, ilGlobalTemplateInterface $a_global_tpl, int $a_current_user_id)
◆ $ctrl
◆ $data_service
◆ $lng
◆ $main_tpl
◆ $manager
◆ $ref_id
int ilAwarenessGUI::$ref_id |
|
protected |
◆ $request
ILIAS Awareness StandardGUIRequest ilAwarenessGUI::$request |
|
protected |
◆ $ui
◆ $user
The documentation for this class was generated from the following file: