Fixing PHP warnings.

1.9.x
Julio Montoya 11 years ago
parent 5e76e9e6ba
commit b2b5ca34f1
  1. 30
      main/inc/lib/display.lib.php

@ -1340,18 +1340,28 @@ class Display
// var_dump($item_property);
}
// Also drop announcements and events that are not for the user or his group.
if (($item_property['tool'] == TOOL_ANNOUNCEMENT
|| $item_property['tool'] == TOOL_CALENDAR_EVENT)
&& (($item_property['to_user_id'] != $user_id )
&& (!isset($item_property['to_group_id'])
|| !in_array($item_property['to_group_id'], $group_ids)))) {
if ((
$item_property['tool'] == TOOL_ANNOUNCEMENT ||
$item_property['tool'] == TOOL_CALENDAR_EVENT
) &&
(
($item_property['to_user_id'] != $user_id) &&
(!isset($item_property['to_group_id']) || !in_array($item_property['to_group_id'], $group_ids)))
) {
continue;
}
// If it's a survey, make sure the user's invited. Otherwise drop it.
if ($item_property['tool'] == TOOL_SURVEY) {
$survey_info = survey_manager::get_survey($item_property['ref'], 0, $course_code);
$invited_users = SurveyUtil::get_invited_users($survey_info['code'], $course_code);
if (!in_array($user_id, $invited_users['course_users'])) continue;
if (!empty($survey_info)) {
$invited_users = SurveyUtil::get_invited_users(
$survey_info['code'],
$course_code
);
if (!in_array($user_id, $invited_users['course_users'])) {
continue;
}
}
}
// If it's a learning path, ensure it is currently visible to the user
if ($item_property['tool'] == TOOL_LEARNPATH) {
@ -1367,11 +1377,6 @@ class Display
}
}
if ($course_info['real_id'] == 1) {
/*var_dump($notifications);
exit;*/
}
// Show all tool icons where there is something new.
$retvalue = ' ';
while (list($key, $notification) = each($notifications)) {
@ -1386,6 +1391,7 @@ class Display
$retvalue .= '<a href="'.api_get_path(WEB_CODE_PATH).$notification['link'].'?cidReq='.$course_code.'&amp;ref='.$notification['ref'].'&amp;gidReq='.$notification['to_group_id'].'&amp;id_session='.$my_course['id_session'].'">'.
Display::return_icon($notification['image'], $label).'</a>&nbsp;';
}
return $retvalue;
}

Loading…
Cancel
Save