示例#1
0
 function dashboardAction()
 {
     $this->notifications = Newsfeed::get_for_user($_SESSION['user']->id);
     $this->setTitle("Concerto Dashboard");
     $group_str = implode(',', $_SESSION['user']->groups);
     $this->setTitle("Dashboard");
     if (count($_SESSION['user']->groups) > 0) {
         $group_str = 'OR group_id IN (' . $group_str . ')';
     } else {
         $group_str = "";
     }
     $this->screens = Screen::get_all('WHERE type = 0 ' . $group_str . ' ORDER BY `name`');
     if (!is_array($this->screens)) {
         $this->screens = array();
     }
     $this->screen_stats = Screen::screenStats('WHERE type = 0 ' . $group_str . ' ORDER BY `name`');
 }
 function newsfeedAction()
 {
     if ($user = new User($this->args[1])) {
         $this->setSubject($user->name);
         $this->num = 25;
         $this->page = $this->args[2] ? $this->args[2] : 0;
         $this->start = $this->num * $this->page;
         $this->notification_count = Newsfeed::count_for_user($user->id);
         $this->notifications = Newsfeed::get_for_user($user->id, 0, '', $this->start, $this->num);
     } else {
         $this->flash("User not found.");
         redirect_to(ADMIN_URL . '/users/');
     }
 }