示例#1
0
 /**
  * checkWhatsNew
  * @author giorgio 24/apr/2013
  *
  *
  * @param ADALoggableUser $userObj	user data to check for something new
  * @param int $courseInstanceId		course instance id to check for something new
  *
  * @return boolean true if there's some new messages for passed user in passed course instance
  */
 public static function checkWhatsNew($userObj, $courseInstanceId, $courseId = 0)
 {
     // new nodes in course
     $userObj->updateWhatsNew();
     $count_new_nodes = 0;
     foreach ($userObj->getwhatsnew() as $whatsnewintester) {
         foreach ($whatsnewintester as $whatsnewelem) {
             if (strpos($whatsnewelem['id_nodo'], $courseId) !== false) {
                 $count_new_nodes++;
             }
         }
     }
     // new messages in forum, AKA NOTES!!!
     $msg_forum_count = MultiPort::count_new_notes($userObj, $courseInstanceId);
     return $count_new_nodes > 0 || $msg_forum_count > 0;
 }