summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-21 17:25:23 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-21 17:25:23 +0000
commit49dec692306e307bb6d39321e34044b0bc115284 (patch)
treef1d416555a7a11cc23338c2147385ea66919b8b3 /index.php
parent9d22fdc36f6257de021f36b26ce33eba99d41dc0 (diff)
downloadsemanticscuttle-49dec692306e307bb6d39321e34044b0bc115284.tar.gz
semanticscuttle-49dec692306e307bb6d39321e34044b0bc115284.tar.bz2
Minor refactoring
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@171 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'index.php')
-rw-r--r--index.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/index.php b/index.php
index d98006f..a72f1f9 100644
--- a/index.php
+++ b/index.php
@@ -21,19 +21,28 @@
require_once('header.inc.php');
+
+/* Service creation: only useful services are created */
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
$userservice =& ServiceFactory::getServiceInstance('UserService');
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+/* Managing possible inputs */
+isset($_GET['action']) ? define('GET_ACTION', $_GET['action']): define('GET_ACTION', '');
+isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0);
+isset($_GET['sort']) ? define('GET_SORT', $_GET['sort']): define('GET_SORT', '');
+//isset($_GET['popup']) ? define('GET_POPUP', $_GET['popup']): define('GET_SORT', '');
+
+
+// Logout action
$tplvars = array();
-if (isset($_GET['action'])){
- if ($_GET['action'] == "logout") {
- $userservice->logout();
- $tplvars['msg'] = T_('You have now logged out');
- }
+if (GET_ACTION == "logout") {
+ $userservice->logout();
+ $tplvars['msg'] = T_('You have now logged out');
}
+
// Header variables
$tplVars['loadjs'] = true;
$tplVars['rsschannels'] = array(
@@ -54,8 +63,8 @@ if ($usecache) {
// Pagination
$perpage = getPerPageCount();
-if (isset($_GET['page']) && intval($_GET['page']) > 1) {
- $page = $_GET['page'];
+if (intval(GET_PAGE) > 1) {
+ $page = GET_PAGE;
$start = ($page - 1) * $perpage;
} else {
$page = 0;