aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-12-05 07:25:04 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-12-05 07:25:04 +0000
commitd6889066c0d285bf59e89b484800443304585b68 (patch)
tree8cc9aa5011a6e6a66061995a6f8186653be9695e /templates
parentf7ccbde31062488cbf04b3e4c06a9aa590ebfedd (diff)
downloadsemanticscuttle-d6889066c0d285bf59e89b484800443304585b68.tar.gz
semanticscuttle-d6889066c0d285bf59e89b484800443304585b68.tar.bz2
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
Diffstat (limited to 'templates')
-rw-r--r--templates/about.tpl.php8
-rw-r--r--templates/admin.tpl.php7
-rw-r--r--templates/bookmarkcommondescriptionedit.tpl.php3
-rw-r--r--templates/bookmarks.tpl.php11
-rw-r--r--templates/dynamictags.inc.php2
-rw-r--r--templates/profile.tpl.php1
-rw-r--r--templates/sidebar.block.linked.php2
-rw-r--r--templates/sidebar.block.menu.php3
-rw-r--r--templates/sidebar.block.menu2.php2
-rw-r--r--templates/sidebar.block.popular.php3
-rw-r--r--templates/sidebar.block.profile.php23
-rw-r--r--templates/sidebar.block.recent.php2
-rw-r--r--templates/sidebar.block.related.php3
-rw-r--r--templates/sidebar.block.search.php2
-rw-r--r--templates/sidebar.block.tagactions.php7
-rw-r--r--templates/sidebar.block.users.php3
-rw-r--r--templates/sidebar.block.watchlist.php3
-rw-r--r--templates/sidebar.block.watchstatus.php9
-rw-r--r--templates/tagcommondescriptionedit.tpl.php2
-rw-r--r--templates/tagedit.tpl.php1
-rw-r--r--templates/toolbar.inc.php8
21 files changed, 31 insertions, 74 deletions
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 @@
<?php
-
-/* Service creation: only useful services are created */
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-//$currentUser = $userservice->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 @@
<?php
-
-/* Service creation: only useful services are created */
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-
-$currentObjectUser = $userservice->getCurrentObjectUser();
$this->includeTemplate($GLOBALS['top_include']);
@@ -18,7 +13,7 @@ foreach($users as $user) {
echo '<a href="'.createURL('profile', $user->getUsername()).'">'.$user->getUsername().'</a>';
echo '</div>';
- if($user->getUsername() != $currentObjectUser->getUsername()) {
+ if($user->getUsername() != $currentUser->getUsername()) {
echo '<div class="meta">';
echo '<a href="'.createURL('admin','delete/'.$user->getUsername()).'" onclick="return confirm(\''.T_('Are you sure?').'\');">'.T_('Delete').'</a>';
echo '</div>';
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 @@
<?php
-/* Service creation: only useful services are created */
-$userservice = & ServiceFactory :: getServiceInstance('UserService');
$this->includeTemplate($GLOBALS['top_include']);
@@ -47,7 +45,6 @@ window.onload = function() {
<td></td>
</tr>
</table>
-</p>
<?php if (isset($referrer)): ?>
<div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div>
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 @@
<?php
/* Service creation: only useful services are created */
-$userservice =& ServiceFactory::getServiceInstance('UserService');
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
$tagservice =& ServiceFactory::getServiceInstance('TagService');
$cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
-// Momentary useful to go to object code
-$currentObjectUser = $userservice->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 '<a href="'. createURL('bookmarks', $currentObjectUser->getUsername().'/'.$currenttag) .'">';
+ echo '<a href="'. createURL('bookmarks', $currentUser->getUsername().'/'.$currenttag) .'">';
echo T_('Only your bookmarks for this tag').'</a>';
//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 .= ' - <a href="'. createURL('bookmarks', $currentObjectUser->getUsername() .'?action=add&amp;address='. urlencode($row['bAddress']) .'&amp;title='. urlencode($row['bTitle'])). '&amp;description='.urlencode($row['bDescription']). '&amp;tags='.$tagsForCopy .'">'. T_('Copy') .'</a>';
+ && ($currentUser->getId() != $row['uId'])
+ && !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())) {
+ $copy .= ' - <a href="'. createURL('bookmarks', $currentUser->getUsername() .'?action=add&amp;address='. urlencode($row['bAddress']) .'&amp;title='. urlencode($row['bTitle'])). '&amp;description='.urlencode($row['bDescription']). '&amp;tags='.$tagsForCopy .'">'. T_('Copy') .'</a>';
}
// 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 @@
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
$this->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 @@
<?php
+/* Service creation: only useful services are created */
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
require_once('sidebar.linkedtags.inc.php');
diff --git a/templates/sidebar.block.menu.php b/templates/sidebar.block.menu.php
index 9012872..ed1069a 100644
--- a/templates/sidebar.block.menu.php
+++ b/templates/sidebar.block.menu.php
@@ -1,6 +1,7 @@
<?php
+/* Service creation: only useful services are created */
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+
require_once('sidebar.linkedtags.inc.php');
diff --git a/templates/sidebar.block.menu2.php b/templates/sidebar.block.menu2.php
index 439ed33..8759f1b 100644
--- a/templates/sidebar.block.menu2.php
+++ b/templates/sidebar.block.menu2.php
@@ -1,6 +1,6 @@
<?php
+/* Service creation: only useful services are created */
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
require_once('sidebar.linkedtags.inc.php');
diff --git a/templates/sidebar.block.popular.php b/templates/sidebar.block.popular.php
index b9c029f..4279620 100644
--- a/templates/sidebar.block.popular.php
+++ b/templates/sidebar.block.popular.php
@@ -1,6 +1,7 @@
<?php
+/* Service creation: only useful services are created */
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+
if(!isset($user)) {
$user = '';
diff --git a/templates/sidebar.block.profile.php b/templates/sidebar.block.profile.php
deleted file mode 100644
index 4fd61ff..0000000
--- a/templates/sidebar.block.profile.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-// Menu moved to toolbar.inc.php
-
-/*
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-if (utf8_strlen($userinfo['name']) > 0) {
- $name = $userinfo['name'];
-} else {
- $name = $userinfo['username'];
-}
-
-
-<h2><?php echo $name; ?></h2>
-<div id="profile">
- <ul>
- <li><a href="<?php echo $userservice->getProfileUrl($userid, $user); ?>"><?php echo T_('Profile'); ?></a> &rarr;</li>
- <li><a href="<?php echo createURL('alltags', $user); ?>"><?php echo T_('Tags'); ?></a> &rarr;</li>
- <li><a href="<?php echo createURL('watchlist', $user); ?>"><?php echo T_('Watchlist'); ?></a> &rarr;</li>
- </ul>
-</div>
-
-*/
-?>
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 @@
<?php
+/* Service creation: only useful services are created */
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
/* Manage input */
$userid = isset($userid)?$userid:NULL;
diff --git a/templates/sidebar.block.related.php b/templates/sidebar.block.related.php
index 81336f9..31c817a 100644
--- a/templates/sidebar.block.related.php
+++ b/templates/sidebar.block.related.php
@@ -1,6 +1,7 @@
<?php
+/* Service creation: only useful services are created */
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+
if(!isset($user)) $user="";
diff --git a/templates/sidebar.block.search.php b/templates/sidebar.block.search.php
index 921b0b9..7979ebf 100644
--- a/templates/sidebar.block.search.php
+++ b/templates/sidebar.block.search.php
@@ -1,5 +1,5 @@
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+/* Service creation: only useful services are created */
$searchhistoryservice =& ServiceFactory::getServiceInstance('SearchHistoryService');
$logged_on_userid = $userservice->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 @@
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+/* Service creation: only useful services are created */
+//No specific services
if ($userservice->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 @@
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+/* Service creation: only useful services are created */
+//No specific services
$logged_on_userid = $userservice->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 @@
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+/* Service creation: only useful services are created */
+//No specific services
$watching = $userservice->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 @@
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+/* Service creation: only useful services are created */
+//No specific services
+
+
if ($userservice->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 @@
<?php
$this->includeTemplate($GLOBALS['top_include']);
-$userservice = & ServiceFactory :: getServiceInstance('UserService');
+
?>
<script type="text/javascript">
window.onload = function() {
diff --git a/templates/tagedit.tpl.php b/templates/tagedit.tpl.php
index fbfe48c..5edfbc7 100644
--- a/templates/tagedit.tpl.php
+++ b/templates/tagedit.tpl.php
@@ -1,6 +1,5 @@
<?php
$this->includeTemplate($GLOBALS['top_include']);
-$userservice = & ServiceFactory :: getServiceInstance('UserService');
?>
<script type="text/javascript">
window.onload = function() {
diff --git a/templates/toolbar.inc.php b/templates/toolbar.inc.php
index 0b052e0..a04b6a0 100644
--- a/templates/toolbar.inc.php
+++ b/templates/toolbar.inc.php
@@ -1,10 +1,7 @@
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
if ($userservice->isLoggedOn()) {
- $cUser = $userservice->getCurrentUser();
$cUserId = $userservice->getCurrentUserId();
- $cUsername = $cUser[$userservice->getFieldName('username')];
- $isAdmin = $userservice->isAdmin($cUser[$userservice->getFieldname('primary')]);
+ $cUsername = $currentUser->getUsername();
?>
<ul id="navigation">
@@ -15,7 +12,7 @@ if ($userservice->isLoggedOn()) {
<li><a href="<?php echo createURL('bookmarks', $cUsername . '?action=add'); ?>"><?php echo T_('Add a Bookmark'); ?></a></li>
<li class="access"><?php echo $cUsername?><a href="<?php echo ROOT ?>?action=logout">(<?php echo T_('Log Out'); ?>)</a></li>
<li><a href="<?php echo createURL('about'); ?>"><?php echo T_('About'); ?></a></li>
- <?php if($isAdmin): ?>
+ <?php if($currentUser->isAdmin()): ?>
<li><a href="<?php echo createURL('admin', ''); ?>"><?php echo '['.T_('Admin').']'; ?></a></li>
<?php endif; ?>
@@ -24,7 +21,6 @@ if ($userservice->isLoggedOn()) {
<?php
} else {
?>
-
<ul id="navigation">
<li><a href="<?php echo createURL('populartags'); ?>"><?php echo T_('Popular Tags'); ?></a></li>
<li><a href="<?php echo createURL('about'); ?>"><?php echo T_('About'); ?></a></li>