119 : ?array
120 {
121 $filter = $this->request->getFilter();
122
123 $tpl =
new ilTemplate(
"tpl.awareness_list.html",
true,
true,
"components/ILIAS/Awareness");
124
125 $ad = $this->manager->getListData($filter);
126
127 $users = $ad["data"];
128
129 $ucnt = 0;
130 $last_uc_title = "";
131 foreach ($users as $u) {
132 if ($u->collector != $last_uc_title) {
133 if ($u->highlighted) {
134 $tpl->touchBlock("highlighted");
135 }
136 $tpl->setCurrentBlock("uc_title");
137 $tpl->setVariable("UC_TITLE", $u->collector);
138 $tpl->parseCurrentBlock();
139 $tpl->setCurrentBlock("item");
140 $tpl->parseCurrentBlock();
141 }
142 $last_uc_title = $u->collector;
143
144 $ucnt++;
145
146 $fcnt = 0;
147 foreach ($u->actions as $act) {
148 $fcnt++;
149 if ($fcnt == 1) {
150 $tpl->touchBlock("arrow");
151
152
153 }
154 if (is_array($act->data) && count($act->data) > 0) {
155 foreach ($act->data as $k => $v) {
156 $tpl->setCurrentBlock("f_data");
157 $tpl->setVariable("DATA_KEY", $k);
159 $tpl->parseCurrentBlock();
160 }
161 }
162 $tpl->setCurrentBlock("feature");
163 $tpl->setVariable("FEATURE_HREF", $act->href);
164 $tpl->setVariable("FEATURE_TEXT", $act->text);
165 $tpl->parseCurrentBlock();
166 }
167
168 if ($u->online) {
169 $tpl->touchBlock("uonline");
170 $tpl->setCurrentBlock("uonline_text");
171 $tpl->setVariable(
"TXT_ONLINE", $this->
lng->txt(
"awrn_online"));
172 $tpl->parseCurrentBlock();
173 }
174
175 $tpl->setCurrentBlock("user");
176 if ($u->public_profile) {
177 $tpl->setVariable("UNAME", $u->lastname . ", " . $u->firstname);
178 } else {
179 $tpl->setVariable("UNAME", "-");
180 }
181 $tpl->setVariable("UACCOUNT", $u->login);
182
183 $tpl->setVariable("USERIMAGE", $u->img);
184 $tpl->setVariable("CNT", $ucnt);
185 $tpl->parseCurrentBlock();
186 $tpl->setCurrentBlock("item");
187 $tpl->parseCurrentBlock();
188 }
189
190 $tpl->setCurrentBlock("filter");
191 $tpl->setVariable("GL_FILTER", $this->gui->symbol()->glyph("filter")->render());
192 $tpl->setVariable(
"FILTER_INPUT_LABEL", $this->
lng->txt(
"awrn_filter"));
193 $tpl->parseCurrentBlock();
194
195
196 $result = ["html" => $tpl->get(),
198 "cnt" => $ad["cnt"]];
199
200 if ($return) {
202 return $result;
203 }
204
205 echo json_encode($result, JSON_THROW_ON_ERROR);
207 }
special template class to simplify handling of ITX/PEAR