Blame view

sources/apps/activity/index.php 1.7 KB
d1bafeea1   Kload   [fix] Upgrade to ...
1
2
3
  <?php
  
  /**
6d9380f96   Cédric Dupont   Update sources OC...
4
   * ownCloud - Activity App
d1bafeea1   Kload   [fix] Upgrade to ...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
   *
   * @author Frank Karlitschek
   * @copyright 2013 Frank Karlitschek frank@owncloud.org
   *
   * This library is free software; you can redistribute it and/or
   * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
   * License as published by the Free Software Foundation; either
   * version 3 of the License, or any later version.
   *
   * This library is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
   *
6d9380f96   Cédric Dupont   Update sources OC...
19
   * You should have received a copy of the GNU Affero General Public
d1bafeea1   Kload   [fix] Upgrade to ...
20
21
22
23
24
25
   * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
   *
   */
  
  
  // check if the user has the right permissions to access the activities
6d9380f96   Cédric Dupont   Update sources OC...
26
27
  \OCP\User::checkLoggedIn();
  \OCP\App::checkAppEnabled('activity');
d1bafeea1   Kload   [fix] Upgrade to ...
28
29
  
  // activate the right navigation entry
6d9380f96   Cédric Dupont   Update sources OC...
30
  \OCP\App::setActiveNavigationEntry('activity');
d1bafeea1   Kload   [fix] Upgrade to ...
31
32
  
  // load the needed js scripts and css
6d9380f96   Cédric Dupont   Update sources OC...
33
34
  \OCP\Util::addScript('activity', 'script');
  \OCP\Util::addStyle('activity', 'style');
d1bafeea1   Kload   [fix] Upgrade to ...
35

6d9380f96   Cédric Dupont   Update sources OC...
36
37
  $navigation = new \OCA\Activity\Navigation(\OCP\Util::getL10N('activity'));
  $navigation->setRSSToken(\OCP\Config::getUserValue(\OCP\User::getUser(), 'activity', 'rsstoken'));
d1bafeea1   Kload   [fix] Upgrade to ...
38

6d9380f96   Cédric Dupont   Update sources OC...
39
40
41
42
43
44
  // get the page that is requested. Needed for endless scrolling
  $data = new \OCA\Activity\Data(
  	\OC::$server->getActivityManager()
  );
  $page = $data->getPageFromParam() - 1;
  $filter = $data->getFilterFromParam();
d1bafeea1   Kload   [fix] Upgrade to ...
45
46
47
  
  // show activity template
  $tmpl = new \OCP\Template('activity', 'list', 'user');
6d9380f96   Cédric Dupont   Update sources OC...
48
49
  $tmpl->assign('filter', $filter);
  $tmpl->assign('appNavigation', $navigation->getTemplate($filter));
d1bafeea1   Kload   [fix] Upgrade to ...
50
  $tmpl->printPage();