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