105 : ?array
106 {
107 $filter = $this->request->getFilter();
108
109 $tpl =
new ilTemplate(
"tpl.awareness_list.html",
true,
true,
"Services/Awareness");
110
111 $ad = $this->manager->getListData($filter);
112
113 $users = $ad["data"];
114
115 $ucnt = 0;
116 $last_uc_title = "";
117 foreach ($users as $u) {
118 if ($u->collector != $last_uc_title) {
119 if ($u->highlighted) {
120 $tpl->touchBlock(
"highlighted");
121 }
122 $tpl->setCurrentBlock(
"uc_title");
123 $tpl->setVariable(
"UC_TITLE", $u->collector);
124 $tpl->parseCurrentBlock();
125 $tpl->setCurrentBlock(
"item");
126 $tpl->parseCurrentBlock();
127 }
128 $last_uc_title = $u->collector;
129
130 $ucnt++;
131
132 $fcnt = 0;
133 foreach ($u->actions as $act) {
134 $fcnt++;
135 if ($fcnt == 1) {
136 $tpl->touchBlock(
"arrow");
137
138
139 }
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();
146 }
147 }
148 $tpl->setCurrentBlock(
"feature");
149 $tpl->setVariable(
"FEATURE_HREF", $act->href);
150 $tpl->setVariable(
"FEATURE_TEXT", $act->text);
151 $tpl->parseCurrentBlock();
152 }
153
154 if ($u->online) {
155 $tpl->touchBlock(
"uonline");
156 $tpl->setCurrentBlock(
"uonline_text");
157 $tpl->setVariable(
"TXT_ONLINE", $this->
lng->txt(
"awrn_online"));
158 $tpl->parseCurrentBlock();
159 }
160
161 $tpl->setCurrentBlock(
"user");
162 if ($u->public_profile) {
163 $tpl->setVariable(
"UNAME", $u->lastname .
", " . $u->firstname);
164 } else {
165 $tpl->setVariable(
"UNAME",
"-");
166 }
167 $tpl->setVariable(
"UACCOUNT", $u->login);
168
169 $tpl->setVariable(
"USERIMAGE", $u->img);
170 $tpl->setVariable(
"CNT", $ucnt);
171 $tpl->parseCurrentBlock();
172 $tpl->setCurrentBlock(
"item");
173 $tpl->parseCurrentBlock();
174 }
175
176 $tpl->setCurrentBlock(
"filter");
178 $tpl->setVariable(
"FILTER_INPUT_LABEL", $this->
lng->txt(
"awrn_filter"));
179 $tpl->parseCurrentBlock();
180
181
182 $result = [
"html" =>
$tpl->get(),
184 "cnt" => $ad["cnt"]];
185
186 if ($return) {
188 return $result;
189 }
190
191 echo json_encode($result, JSON_THROW_ON_ERROR);
193 }
static get(string $a_glyph, string $a_text="")
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl