From fbf28d0753338c23eaa2f44fd449911ef5bf1965 Mon Sep 17 00:00:00 2001 From: cweiske Date: Sun, 26 Sep 2010 22:05:20 +0000 Subject: give bookmarks.tpl.php nice looking generated html code git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@749 b3834d28-1941-0410-a4f8-b48e95affb8f --- data/templates/bookmarks.tpl.php | 133 ++++++++++++++++++++++++++------------- 1 file changed, 88 insertions(+), 45 deletions(-) (limited to 'data') diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php index a8299fd..2eed9c3 100644 --- a/data/templates/bookmarks.tpl.php +++ b/data/templates/bookmarks.tpl.php @@ -1,14 +1,30 @@ + * @author Christian Weiske + * @author Eric Dane + * @license GPL http://www.gnu.org/licenses/gpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); -$tagservice =SemanticScuttle_Service_Factory::get('Tag'); -$cdservice =SemanticScuttle_Service_Factory::get('CommonDescription'); +$bookmarkservice = SemanticScuttle_Service_Factory::get('Bookmark'); +$tagservice = SemanticScuttle_Service_Factory::get('Tag'); +$cdservice = SemanticScuttle_Service_Factory::get('CommonDescription'); -$pageName = isset($pageName)?$pageName:""; -$user = isset($user)?$user:""; -$currenttag = isset($currenttag)?$currenttag:""; +$pageName = isset($pageName) ? $pageName : ''; +$user = isset($user) ? $user : ''; +$currenttag = isset($currenttag) ? $currenttag : ''; $this->includeTemplate($GLOBALS['top_include']); @@ -132,23 +148,23 @@ default: break; } ?> - -/ - -/ + + / + + / - -/ + + / '; echo T_('Bookmarks from other users for this tag').''; //echo T_(' for these tags'); - } else if($userservice->isLoggedOn()){ + } else if ($userservice->isLoggedOn()){ echo ' - '; echo ''; echo T_('Only your bookmarks for this tag').''; @@ -213,10 +229,8 @@ if($currenttag!= '') { -
    0 ? ' start="'. ++$start .'"' : ''); ?> - id="bookmarks"> - - 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks"> + &$row) { $addresses[$row['bId']] = $row['bAddress']; @@ -253,35 +267,52 @@ if($currenttag!= '') { $tagsForCopy = ''; $tags = $row['tags']; foreach ($tags as $tkey => &$tag) { - $cats .= ', '; - $tagsForCopy.= $tag.','; + $tagcaturl = sprintf( + $cat_url, + filter($row['username'], 'url'), + filter($tag, 'url') + ); + $cats .= sprintf( + ', ', + $tagcaturl, filter($tag) + ); + $tagsForCopy .= $tag . ','; } $cats = substr($cats, 0, -2); if ($cats != '') { - $cats = ' '.T_('Tags:').' '. $cats; + $cats = T_('Tags:') . ' ' . $cats; } // Edit and delete links $edit = ''; if ($bookmarkservice->editAllowed($row)) { - $edit = ' - '. T_('Edit') .''; + $edit = ' - ' + . T_('Edit') + . '' + . ''; } // Last update - $update = ' ('. date($GLOBALS['shortdate'], strtotime($row['bModified'])). ') '; + $update = ' ('. date($GLOBALS['shortdate'], strtotime($row['bModified'])). ') '; // User attribution - $copy = ' '. T_('by'). ' '; - if($userservice->isLoggedOn() && $currentUser->getUsername() == $row['username']) { - $copy.= T_('you'); + $copy = ' ' . T_('by') . ' '; + if ($userservice->isLoggedOn() + && $currentUser->getUsername() == $row['username'] + ) { + $copy .= T_('you'); } else { - $copy.= ''. $row['username'] .''; + $copy .= '' + . $row['username'] . ''; } // Udders! if (!isset($hash)) { $others = $otherCounts[$row['bAddress']]; - $ostart = ''; + $ostart = ''; $oend = ''; switch ($others) { case 0: @@ -300,7 +331,10 @@ if($currenttag!= '') { && !$existence[$row['bAddress']] ) { $copy .= ' - ' . T_('Copy') . ''; @@ -321,11 +355,11 @@ if($currenttag!= '') { // Admin specific design if ($userservice->isAdmin($row['username']) && $GLOBALS['enableAdminColors']) { - $adminBgClass = 'class="adminBackground"'; - $adminStar = ' '; + $adminBgClass = ' class="adminBackground"'; + $adminStar = ' '; } else { $adminBgClass = ''; - $adminStar = ''; + $adminStar = ''; } // Private Note (just visible by the owner and his/her contacts) @@ -346,13 +380,16 @@ if($currenttag!= '') { } // Output - echo '
  1. '."\n"; + echo '
  2. '."\n"; include 'bookmarks-thumbnail.inc.tpl.php'; include 'bookmarks-vote.inc.tpl.php'; - echo '
    ';; + echo ' ' . "\n"; - echo '\n"; + echo ' \n"; if ($row['bDescription'] == '') { $bkDescription = $GLOBALS['blankDescription']; } else { @@ -362,17 +399,23 @@ if($currenttag!= '') { $bkDescription = preg_replace('@((http|https|ftp)://.*?)( |\r|$)@', '$1$3', $bkDescription); // make url clickable } - echo '
    '. nl2br($bkDescription) ."
    \n"; - //if(!isset($hash)) { - echo '
    ' . shortenString($oaddress) . '
    '; - //} - - echo '
    '. $cats . $copy . $edit . $update ."
    \n"; - echo $privateNoteField!=''?'
    '.$privateNoteField."
    \n":''; + echo '
    '. nl2br($bkDescription) ."
    \n"; + echo '
    ' . shortenString($oaddress) . "
    \n"; + + echo '
    ' + . $cats . "\n" + . $copy . "\n" + . $edit . "\n" + . $update . "\n" + . "
    \n"; + echo $privateNoteField != '' + ? '
    '.$privateNoteField."
    \n" + : ''; + echo ' '; include 'bookmarks-vote-horizontal.inc.tpl.php'; - echo '
    '; + echo " \n"; - echo "
  3. \n"; + echo " \n"; } ?> -- cgit v1.2.3