getRequest(); $user = $request->getUser(); $query = new PhabricatorNotificationQuery(); $query->setUserPHID($user->getPHID()); $query->setLimit(15); $stories = $query->execute(); if ($stories) { $builder = new PhabricatorNotificationBuilder($stories); $notifications_view = $builder->buildView(); $content = $notifications_view->render(); } else { $content = '
'. 'You have no notifications.'. '
'; } $content .= '
'. phutil_render_tag( 'a', array( 'href' => '/notification/', ), 'View All Notifications'). '
'; $unread_count = id(new PhabricatorFeedStoryNotification()) ->countUnread($user); $json = array( 'content' => $content, 'number' => $unread_count, ); return id(new AphrontAjaxResponse())->setContent($json); } }