33 protected \ILIAS\Awareness\StandardGUIRequest
$request;
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");
60 $this->request = $gui_service->standardRequest();
61 $this->main_tpl = $gui_service->mainTemplate();
63 $this->ref_id = $this->request->getRefId();
64 $this->manager = $domain_service->widget(
72 $cmd = $this->
ctrl->getCmd();
74 if (in_array($cmd, array(
"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();");
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="")
ILIAS Awareness StandardGUIRequest $request
__construct(InternalDataService $data_service=null, InternalDomainService $domain_service=null, InternalGUIService $gui_service=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilGlobalTemplateInterface $main_tpl
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
Provides fluid interface to RBAC services.
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...
getAwarenessList(bool $return=false)
Get awareness list (ajax)
InternalDataService $data_service
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
static getInstance(ilUserActionContext $a_user_action_context, ilGlobalTemplateInterface $a_global_tpl, int $a_current_user_id)