summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-10-08 20:23:32 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-10-08 20:23:32 -0400
commitd5cd794c01d0e3a7774e01051fa485a82897731d (patch)
treeb4e709146cd324a879b2916061ed5e06b0939f6b /index.php
parent59616abd129009357bbef269fc1ce95525f62185 (diff)
split firstrun template from main template
Diffstat (limited to 'index.php')
-rw-r--r--index.php43
1 files changed, 28 insertions, 15 deletions
diff --git a/index.php b/index.php
index fd153502d..57ca56d7f 100644
--- a/index.php
+++ b/index.php
@@ -17,15 +17,6 @@ OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('news');
OCP\App::setActiveNavigationEntry('news');
-OCP\Util::addScript('news','main');
-OCP\Util::addScript('news','news');
-OCP\Util::addScript('news','menu');
-OCP\Util::addScript('news','items');
-OCP\Util::addScript('news','jquery.timeago');
-
-OCP\Util::addStyle('news','news');
-OCP\Util::addStyle('news','settings');
-
$l = OC_L10N::get('news');
$userid = OCP\USER::getUser();
@@ -39,6 +30,16 @@ $feedid = 0;
$feedtype = 0;
if ($allfeeds) {
+
+ OCP\Util::addScript('news','main');
+ OCP\Util::addScript('news','news');
+ OCP\Util::addScript('news','menu');
+ OCP\Util::addScript('news','items');
+ OCP\Util::addScript('news','jquery.timeago');
+
+ OCP\Util::addStyle('news','news');
+ OCP\Util::addStyle('news','settings');
+
$feedid = isset( $_GET['feedid'] ) ? $_GET['feedid'] : null;
if ($feedid == null) {
$feedmapper = new OCA\News\FeedMapper(OCP\USER::getUser($userid));
@@ -55,11 +56,23 @@ if ($allfeeds) {
}
}
}
+ $tmpl = new OCP\Template( 'news', 'main', 'user' );
+ $tmpl->assign('allfeeds', $allfeeds);
+ $tmpl->assign('folderforest', $folderforest);
+ $tmpl->assign('feedid', $feedid);
+ $tmpl->assign('feedtype', $feedtype);
+ $tmpl->printPage();
+
}
+else {
+
+ OCP\Util::addScript('news','firstrun');
+
+ OCP\Util::addStyle('news','news');
+
+ $tmpl = new OCP\Template( 'news', 'firstrun', 'user' );
+ $tmpl->printPage();
+
+}
+
-$tmpl = new OCP\Template( 'news', 'main', 'user' );
-$tmpl->assign('allfeeds', $allfeeds);
-$tmpl->assign('folderforest', $folderforest);
-$tmpl->assign('feedid', $feedid);
-$tmpl->assign('feedtype', $feedtype);
-$tmpl->printPage();