23 $this->ref_id = (int)
$_GET[
"ref_id"];
32 $cmd = $this->ctrl->getCmd();
34 if (in_array(
$cmd, array(
"getAwarenessList")))
59 if (!$awrn_set->get(
"awrn_enabled",
false) || ANONYMOUS_USER_ID == $ilUser->getId())
64 $cache_period = (int) $awrn_set->get(
"caching_period");
69 $GLOBALS[
"tpl"]->addJavascript(
"./Services/Awareness/js/Awareness.js");
70 $this->ctrl->setParameter($this,
"ref_id", $this->ref_id);
71 $GLOBALS[
"tpl"]->addOnloadCode(
"il.Awareness.setBaseUrl('".$this->ctrl->getLinkTarget($this,
72 "",
"",
true,
false).
"');");
74 $GLOBALS[
"tpl"]->addOnloadCode(
"il.Awareness.init();");
76 $tpl =
new ilTemplate(
"tpl.awareness.html",
true,
true,
"Services/Awareness");
78 include_once(
"./Services/Awareness/classes/class.ilAwarenessAct.php");
80 $act->setRefId($this->ref_id);
82 if ($last_update ==
"" || ($now - $last_update) >= $cache_period)
84 $cnt = explode(
":", $act->getAwarenessUserCounter());
87 $act->notifyOnNewOnlineContacts();
98 if ($hcnt > 0 || $cnt > 0)
100 $tpl->setCurrentBlock(
"status_text");
101 $tpl->setVariable(
"STATUS_TXT", $cnt);
104 $tpl->setVariable(
"HIDDEN",
"ilAwrnBadgeHidden");
106 $tpl->parseCurrentBlock();
107 $tpl->setCurrentBlock(
"h_status_text");
108 $tpl->setVariable(
"H_STATUS_TXT", $hcnt);
111 $tpl->setVariable(
"H_HIDDEN",
"ilAwrnBadgeHidden");
113 $tpl->parseCurrentBlock();
114 $tpl->setVariable(
"HSP",
" ");
131 $filter =
$_GET[
"filter"];
133 $tpl =
new ilTemplate(
"tpl.awareness_list.html",
true,
true,
"Services/Awareness");
135 include_once(
"./Services/Awareness/classes/class.ilAwarenessAct.php");
137 $act->setRefId($this->ref_id);
139 $ad = $act->getAwarenessData($filter);
143 $cnt = explode(
":",$ad[
"cnt"]);
151 $users = $ad[
"data"];
155 foreach ($users as $u)
157 if ($u->collector != $last_uc_title)
161 $tpl->touchBlock(
"highlighted");
163 $tpl->setCurrentBlock(
"uc_title");
164 $tpl->setVariable(
"UC_TITLE", $u->collector);
165 $tpl->parseCurrentBlock();
166 $tpl->setCurrentBlock(
"item");
167 $tpl->parseCurrentBlock();
169 $last_uc_title = $u->collector;
174 foreach ($u->features as $f)
179 $tpl->touchBlock(
"arrow");
183 if (is_array($f->data) && count($f->data) > 0)
185 foreach ($f->data as $k => $v)
187 $tpl->setCurrentBlock(
"f_data");
188 $tpl->setVariable(
"DATA_KEY", $k);
190 $tpl->parseCurrentBlock();
193 $tpl->setCurrentBlock(
"feature");
194 $tpl->setVariable(
"FEATURE_HREF", $f->href);
195 $tpl->setVariable(
"FEATURE_TEXT", $f->text);
196 $tpl->parseCurrentBlock();
201 $tpl->touchBlock(
"uonline");
204 $tpl->setCurrentBlock(
"user");
205 if ($u->public_profile)
207 $tpl->setVariable(
"UNAME", $u->lastname.
", ".$u->firstname);
211 $tpl->setVariable(
"UNAME",
" ");
213 $tpl->setVariable(
"UACCOUNT", $u->login);
215 $tpl->setVariable(
"USERIMAGE", $u->img);
216 $tpl->setVariable(
"CNT", $ucnt);
217 $tpl->parseCurrentBlock();
218 $tpl->setCurrentBlock(
"item");
219 $tpl->parseCurrentBlock();
222 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
223 $tpl->setCurrentBlock(
"filter");
226 $tpl->parseCurrentBlock();
228 echo json_encode(array(
"html" =>
$tpl->get(),
229 "cnt" => $ad[
"cnt"]));
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
__construct()
Constructor.
static getInstance($a_user_id)
Get instance (for a user)
getAwarenessList()
Get awareness list (ajax)
static getInstance()
Get instance.
static get($a_var)
Get a value.
static get($a_glyph, $a_text="")
Get glyph html.
static set($a_var, $a_val)
Set a value.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
getMainMenuHTML()
Get main menu html.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
executeCommand()
Execute command.