summaryrefslogtreecommitdiff
path: root/history.php
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-25 15:57:29 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-25 15:57:29 +0000
commit15b91c7e661d928d8b125ec9cfbda1702319c8b4 (patch)
tree092d474c05e414bb04a8c428b8ff6cb9ccab765d /history.php
parent9aafe7551eb5a73739709e72465031db7a1531b4 (diff)
downloadsemanticscuttle-15b91c7e661d928d8b125ec9cfbda1702319c8b4.tar.gz
semanticscuttle-15b91c7e661d928d8b125ec9cfbda1702319c8b4.tar.bz2
Major refactoring: transform user into object, define parameters used into each file, ...
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@173 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'history.php')
-rw-r--r--history.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/history.php b/history.php
index f7ae927..e66973c 100644
--- a/history.php
+++ b/history.php
@@ -21,27 +21,34 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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 all possible inputs */
+isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0);
+isset($_GET['sort']) ? define('GET_SORT', $_GET['sort']): define('GET_SORT', '');
+
$tplVars = array();
@list($url, $hash) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
-$loggedon = false;
+$currentObjectUser = $userservice->getCurrentObjectUser();
+
+/*$loggedon = false;
if ($userservice->isLoggedOn()) {
$loggedon = true;
$currentUser = $userservice->getCurrentUser();
$currentUsername = $currentUser[$userservice->getFieldName('username')];
-}
+}*/
if ($usecache) {
// Generate hash for caching on
$hashtext = $_SERVER['REQUEST_URI'];
if ($userservice->isLoggedOn()) {
- $hashtext .= $currentUsername;
+ $hashtext .= $currentObjectUser->getUsername();
}
$cachehash = md5($hashtext);
@@ -51,8 +58,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;
@@ -76,6 +83,12 @@ if ($bookmark =& $bookmarkservice->getBookmarkByHash($hash)) {
//$tplVars['cat_url'] = createURL('tags', '%2$s');
$tplVars['cat_url'] = createURL('bookmarks', '%1$s/%2$s');
$tplVars['nav_url'] = createURL('history', $hash .'/%3$s');
+ $tplVars['rsschannels'] = array();
+ if($userservice->isLoggedOn()) {
+ $tplVars['user'] = $currentObjectUser->getUsername();
+ } else {
+ $tplVars['user'] = '';
+ }
$templateservice->loadTemplate('bookmarks.tpl', $tplVars);
} else {
// Throw a 404 error