From d6889066c0d285bf59e89b484800443304585b68 Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 5 Dec 2008 07:25:04 +0000 Subject: Major Refactoring: finish transforming into object . Put and into header.inc.php. git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@199 b3834d28-1941-0410-a4f8-b48e95affb8f --- templates/about.tpl.php | 8 -------- templates/admin.tpl.php | 7 +------ templates/bookmarkcommondescriptionedit.tpl.php | 3 --- templates/bookmarks.tpl.php | 11 ++++------- templates/dynamictags.inc.php | 2 +- templates/profile.tpl.php | 1 - templates/sidebar.block.linked.php | 2 +- templates/sidebar.block.menu.php | 3 ++- templates/sidebar.block.menu2.php | 2 +- templates/sidebar.block.popular.php | 3 ++- templates/sidebar.block.profile.php | 23 ----------------------- templates/sidebar.block.recent.php | 2 +- templates/sidebar.block.related.php | 3 ++- templates/sidebar.block.search.php | 2 +- templates/sidebar.block.tagactions.php | 7 +++---- templates/sidebar.block.users.php | 3 ++- templates/sidebar.block.watchlist.php | 3 ++- templates/sidebar.block.watchstatus.php | 9 +++++---- templates/tagcommondescriptionedit.tpl.php | 2 +- templates/tagedit.tpl.php | 1 - templates/toolbar.inc.php | 8 ++------ 21 files changed, 31 insertions(+), 74 deletions(-) delete mode 100644 templates/sidebar.block.profile.php (limited to 'templates') diff --git a/templates/about.tpl.php b/templates/about.tpl.php index a4bc718..77c34bc 100644 --- a/templates/about.tpl.php +++ b/templates/about.tpl.php @@ -1,12 +1,4 @@ getCurrentUser(); -//$currentUserId = $userservice->getCurrentUserId(); - -$currentObjectUser = $userservice->getCurrentObjectUser(); - $this->includeTemplate($GLOBALS['top_include']); ?> diff --git a/templates/admin.tpl.php b/templates/admin.tpl.php index 35b97c7..ac288bd 100644 --- a/templates/admin.tpl.php +++ b/templates/admin.tpl.php @@ -1,9 +1,4 @@ getCurrentObjectUser(); $this->includeTemplate($GLOBALS['top_include']); @@ -18,7 +13,7 @@ foreach($users as $user) { echo ''.$user->getUsername().''; echo ''; - if($user->getUsername() != $currentObjectUser->getUsername()) { + if($user->getUsername() != $currentUser->getUsername()) { echo '
'; echo ''.T_('Delete').''; echo '
'; diff --git a/templates/bookmarkcommondescriptionedit.tpl.php b/templates/bookmarkcommondescriptionedit.tpl.php index ac3f540..af5909a 100644 --- a/templates/bookmarkcommondescriptionedit.tpl.php +++ b/templates/bookmarkcommondescriptionedit.tpl.php @@ -1,6 +1,4 @@ includeTemplate($GLOBALS['top_include']); @@ -47,7 +45,6 @@ window.onload = function() { -

diff --git a/templates/bookmarks.tpl.php b/templates/bookmarks.tpl.php index 341358d..efec240 100644 --- a/templates/bookmarks.tpl.php +++ b/templates/bookmarks.tpl.php @@ -1,13 +1,10 @@ getCurrentObjectUser(); $pageName = isset($pageName)?$pageName:""; $user = isset($user)?$user:""; @@ -94,7 +91,7 @@ if(isset($currenttag) && $currenttag!= '') { //echo T_(' for these tags'); } else if($userservice->isLoggedOn()){ echo ' - '; - echo ''; + echo ''; echo T_('Only your bookmarks for this tag').''; //echo T_(' for these tags'); } @@ -165,9 +162,9 @@ if(isset($currenttag) && $currenttag!= '') { // Copy link if ($userservice->isLoggedOn() - && ($currentObjectUser->getId() != $row['uId']) - && !$bookmarkservice->bookmarkExists($row['bAddress'], $currentObjectUser->getId())) { - $copy .= ' - '. T_('Copy') .''; + && ($currentUser->getId() != $row['uId']) + && !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())) { + $copy .= ' - '. T_('Copy') .''; } // Nofollow option diff --git a/templates/dynamictags.inc.php b/templates/dynamictags.inc.php index b317e9f..07e3ee9 100644 --- a/templates/dynamictags.inc.php +++ b/templates/dynamictags.inc.php @@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ +/* Service creation: only useful services are created */ $b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService'); -$userservice = & ServiceFactory :: getServiceInstance('UserService'); $logged_on_userid = $userservice->getCurrentUserId(); diff --git a/templates/profile.tpl.php b/templates/profile.tpl.php index a544fb4..a7a92ba 100644 --- a/templates/profile.tpl.php +++ b/templates/profile.tpl.php @@ -1,5 +1,4 @@ includeTemplate($GLOBALS['top_include']); ?> diff --git a/templates/sidebar.block.linked.php b/templates/sidebar.block.linked.php index efe75a8..13a8319 100644 --- a/templates/sidebar.block.linked.php +++ b/templates/sidebar.block.linked.php @@ -1,6 +1,6 @@ 0) { - $name = $userinfo['name']; -} else { - $name = $userinfo['username']; -} - - -

-
- -
- -*/ -?> diff --git a/templates/sidebar.block.recent.php b/templates/sidebar.block.recent.php index 9e4df08..71f9aa9 100644 --- a/templates/sidebar.block.recent.php +++ b/templates/sidebar.block.recent.php @@ -1,6 +1,6 @@ getCurrentUserId(); diff --git a/templates/sidebar.block.tagactions.php b/templates/sidebar.block.tagactions.php index fd13d98..37bf5c6 100644 --- a/templates/sidebar.block.tagactions.php +++ b/templates/sidebar.block.tagactions.php @@ -1,11 +1,10 @@ isLoggedOn()) { - $currentUser = $userservice->getCurrentUser(); - $currentUsername = $currentUser[$userservice->getFieldName('username')]; - if ($currentUsername == $user) { + if ($currentUser->getUsername() == $user) { $tags = explode('+', $currenttag); $renametext = T_ngettext('Rename Tag', 'Rename Tags', count($tags)); $renamelink = createURL('tagrename', $currenttag); diff --git a/templates/sidebar.block.users.php b/templates/sidebar.block.users.php index 7c61acc..b6eef24 100644 --- a/templates/sidebar.block.users.php +++ b/templates/sidebar.block.users.php @@ -1,5 +1,6 @@ getCurrentUserId(); if ($logged_on_userid === false) { diff --git a/templates/sidebar.block.watchlist.php b/templates/sidebar.block.watchlist.php index e35fa76..a42acba 100644 --- a/templates/sidebar.block.watchlist.php +++ b/templates/sidebar.block.watchlist.php @@ -1,5 +1,6 @@ getWatchNames($userid); if ($watching) { diff --git a/templates/sidebar.block.watchstatus.php b/templates/sidebar.block.watchstatus.php index d912846..99574aa 100644 --- a/templates/sidebar.block.watchstatus.php +++ b/templates/sidebar.block.watchstatus.php @@ -1,10 +1,11 @@ isLoggedOn()) { - $currentUser = $userservice->getCurrentUser(); - $currentUsername = $currentUser[$userservice->getFieldName('username')]; - if ($currentUsername != $user) { + if ($currentUser->getUsername() != $user) { $result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId()); if ($result) { $linkText = T_('Remove from Watchlist'); diff --git a/templates/tagcommondescriptionedit.tpl.php b/templates/tagcommondescriptionedit.tpl.php index 158142e..d3a006a 100644 --- a/templates/tagcommondescriptionedit.tpl.php +++ b/templates/tagcommondescriptionedit.tpl.php @@ -1,6 +1,6 @@ includeTemplate($GLOBALS['top_include']); -$userservice = & ServiceFactory :: getServiceInstance('UserService'); + ?>