Many interface changes: add 'back to the top links', a variable to display more bookmarks for admins...

git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@329 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
mensonge 2009-05-19 15:59:55 +00:00
parent 01c62e34fc
commit 1eca2d231c
17 changed files with 265 additions and 208 deletions

View file

@ -46,10 +46,9 @@ if ( !$currentUser->isAdmin() ) {
} }
@list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL; @list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
if ( $action if ( $action
&& strpos($_SERVER['HTTP_REFERER'], ROOT.'admin.php') === 0 // Prevent CSRF attacks && (strpos($_SERVER['HTTP_REFERER'], ROOT.'admin') === 0) // Prevent CSRF attacks
) { ) {
switch ( $action ) { switch ( $action ) {
case 'delete': case 'delete':

View file

@ -239,7 +239,7 @@ if ($templatename == 'editbookmark.tpl') {
$tplVars['range'] = 'user'; $tplVars['range'] = 'user';
// Pagination // Pagination
$perpage = getPerPageCount(); $perpage = getPerPageCount($currentUser);
if (intval(GET_PAGE) > 1) { if (intval(GET_PAGE) > 1) {
$page = GET_PAGE; $page = GET_PAGE;
$start = ($page - 1) * $perpage; $start = ($page - 1) * $perpage;

View file

@ -51,6 +51,7 @@ $shortdate = 'd-m-Y'; # format of short dates.
$longdate = 'j F Y'; # format of long dates. $longdate = 'j F Y'; # format of long dates.
$nofollow = true; # include rel="nofollow" attribute on bookmark links ? {true,false} $nofollow = true; # include rel="nofollow" attribute on bookmark links ? {true,false}
$defaultPerPage = 10; # default number of bookmarks per page (-1 means no limit) $defaultPerPage = 10; # default number of bookmarks per page (-1 means no limit)
$defaultPerPageForAdmins = 10; # default number of bookmarks per page for admins (-1 means no limit)
$defaultRecentDays = 14; # number of days that bookmarks or tags should be considered recent. $defaultRecentDays = 14; # number of days that bookmarks or tags should be considered recent.
# bookmarks order by (date, title, url) in order ascending or descending # bookmarks order by (date, title, url) in order ascending or descending
# date_desc - By date of entry descending. # date_desc - By date of entry descending.

View file

@ -1,4 +1,5 @@
<?php <?php
/*************************************************************************** /***************************************************************************
Copyright (C) 2004 - 2006 Scuttle project Copyright (C) 2004 - 2006 Scuttle project
http://sourceforge.net/projects/scuttle/ http://sourceforge.net/projects/scuttle/
@ -39,23 +40,27 @@ isset($_GET['popup']) ? define('GET_POPUP', $_GET['popup']): define('GET_POPUP',
isset($_POST['popup']) ? define('POST_POPUP', $_POST['popup']): define('POST_POPUP', ''); isset($_POST['popup']) ? define('POST_POPUP', $_POST['popup']): define('POST_POPUP', '');
isset($_POST['referrer']) ? define('POST_REFERRER', $_POST['referrer']): define('POST_REFERRER', ''); isset($_POST['referrer']) ? define('POST_REFERRER', $_POST['referrer']): define('POST_REFERRER', '');
// Header variables // Header variables
$tplVars['pagetitle'] = T_('Edit Bookmark'); $tplVars['pagetitle'] = T_('Edit Bookmark');
$tplVars['subtitle'] = T_('Edit Bookmark'); $tplVars['subtitle'] = T_('Edit Bookmark');
$tplVars['loadjs'] = true; $tplVars['loadjs'] = true;
list ($url, $bookmark) = explode('/', $_SERVER['PATH_INFO']); list ($url, $bookmark) = explode('/', $_SERVER['PATH_INFO']);
if (!($row = $bookmarkservice->getBookmark(intval($bookmark), true))) { if (!($row = $bookmarkservice->getBookmark(intval($bookmark), true))) {
$tplVars['error'] = sprintf(T_('Bookmark with id %s not was not found'), $bookmark); $tplVars['error'] = sprintf(T_('Bookmark with id %s not was not found'), $bookmark);
$templateservice->loadTemplate('error.404.tpl', $tplVars); $templateservice->loadTemplate('error.404.tpl', $tplVars);
exit(); exit();
} else { } else {
if (!$bookmarkservice->editAllowed($row)) { if (!$bookmarkservice->editAllowed($row)) {
$tplVars['error'] = T_('You are not allowed to edit this bookmark'); $tplVars['error'] = T_('You are not allowed to edit this bookmark');
$templateservice->loadTemplate('error.500.tpl', $tplVars); $templateservice->loadTemplate('error.500.tpl', $tplVars);
exit(); exit();
} else if (POST_SUBMITTED != '') { } else if (POST_SUBMITTED != '') {
if (!POST_TITLE || !POST_ADDRESS) { if (!POST_TITLE || !POST_ADDRESS) {
$tplVars['error'] = T_('Your bookmark must have a title and an address'); $tplVars['error'] = T_('Your bookmark must have a title and an address');
} else { } else {
@ -66,7 +71,7 @@ if (!($row = $bookmarkservice->getBookmark(intval($bookmark), true))) {
$description = trim(POST_DESCRIPTION); $description = trim(POST_DESCRIPTION);
$privateNote = trim(POST_PRIVATENOTE); $privateNote = trim(POST_PRIVATENOTE);
$status = intval(POST_STATUS); $status = intval(POST_STATUS);
$tags = trim(POST_TAGS); $tags = trim(POST_TAGS);
if (!$bookmarkservice->updateBookmark($bId, $address, $title, $description, $privateNote, $status, $tags)) { if (!$bookmarkservice->updateBookmark($bId, $address, $title, $description, $privateNote, $status, $tags)) {
$tplvars['error'] = T_('Error while saving your bookmark'); $tplvars['error'] = T_('Error while saving your bookmark');

View file

@ -35,9 +35,14 @@ function filter($data, $type = NULL) {
return $data; return $data;
} }
function getPerPageCount() { function getPerPageCount($userObject = null) {
global $defaultPerPage; global $defaultPerPage, $defaultPerPageForAdmins;
return $defaultPerPage;
if(isset($defaultPerPageForAdmins) && $userObject != null && $userObject->isAdmin()) {
return $defaultPerPageForAdmins;
} else {
return $defaultPerPage;
}
} }
function getSortOrder($override = NULL) { function getSortOrder($override = NULL) {

View file

@ -46,7 +46,7 @@ if ($usecache) {
} }
// Pagination // Pagination
$perpage = getPerPageCount(); $perpage = getPerPageCount($currentUser);
if (intval(GET_PAGE) > 1) { if (intval(GET_PAGE) > 1) {
$page = GET_PAGE; $page = GET_PAGE;
$start = ($page - 1) * $perpage; $start = ($page - 1) * $perpage;

View file

@ -34,6 +34,7 @@ isset($_GET['sort']) ? define('GET_SORT', $_GET['sort']): define('GET_SORT', '')
// Logout action // Logout action
if (GET_ACTION == "logout") { if (GET_ACTION == "logout") {
$userservice->logout(); $userservice->logout();
$tplVars['currentUser'] = null;
$tplvars['msg'] = T_('You have now logged out'); $tplvars['msg'] = T_('You have now logged out');
} }
@ -57,7 +58,7 @@ if ($usecache) {
} }
// Pagination // Pagination
$perpage = getPerPageCount(); $perpage = getPerPageCount($currentUser);
if (intval(GET_PAGE) > 1) { if (intval(GET_PAGE) > 1) {
$page = GET_PAGE; $page = GET_PAGE;
$start = ($page - 1) * $perpage; $start = ($page - 1) * $perpage;

View file

@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Scuttle\n" "Project-Id-Version: Scuttle\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-19 16:02+0200\n" "POT-Creation-Date: 2009-05-19 17:57+0200\n"
"PO-Revision-Date: 2009-05-19 16:02+0100\n" "PO-Revision-Date: 2009-05-19 17:47+0100\n"
"Last-Translator: BenjaminHKB <benjamin.huynh-kim-bang@loria.fr>\n" "Last-Translator: BenjaminHKB <benjamin.huynh-kim-bang@loria.fr>\n"
"Language-Team: fr-FR <toony.sf@chezouam.net>\n" "Language-Team: fr-FR <toony.sf@chezouam.net>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -137,49 +137,49 @@ msgstr "Erreur pendant l'enregistrement de votre signet."
msgid "Save Changes" msgid "Save Changes"
msgstr "Enregistrer les modifications" msgstr "Enregistrer les modifications"
#: ../../../functions.inc.php:139 #: ../../../functions.inc.php:144
msgid "message_die() was called multiple times." msgid "message_die() was called multiple times."
msgstr "message_die() was called multiple times. ?" msgstr "message_die() was called multiple times. ?"
#: ../../../functions.inc.php:151 #: ../../../functions.inc.php:156
msgid "SQL Error" msgid "SQL Error"
msgstr "Erreur SQL" msgstr "Erreur SQL"
#: ../../../functions.inc.php:157 #: ../../../functions.inc.php:162
msgid "Line" msgid "Line"
msgstr "Ligne" msgstr "Ligne"
#: ../../../functions.inc.php:157 ../../../templates/importDelicious.tpl.php:8 #: ../../../functions.inc.php:162 ../../../templates/importDelicious.tpl.php:8
#: ../../../templates/importNetscape.tpl.php:9 #: ../../../templates/importNetscape.tpl.php:9
#: ../../../templates/importStructure.tpl.php:10 #: ../../../templates/importStructure.tpl.php:10
msgid "File" msgid "File"
msgstr "Fichier" msgstr "Fichier"
#: ../../../functions.inc.php:163 #: ../../../functions.inc.php:168
msgid "Information" msgid "Information"
msgstr "Information" msgstr "Information"
#: ../../../functions.inc.php:168 #: ../../../functions.inc.php:173
msgid "Critical Information" msgid "Critical Information"
msgstr "Information critique." msgstr "Information critique."
#: ../../../functions.inc.php:173 #: ../../../functions.inc.php:178
msgid "An error occured" msgid "An error occured"
msgstr "Une erreur s'est produite." msgstr "Une erreur s'est produite."
#: ../../../functions.inc.php:176 #: ../../../functions.inc.php:181
msgid "General Error" msgid "General Error"
msgstr "Erreur générale." msgstr "Erreur générale."
#: ../../../functions.inc.php:184 #: ../../../functions.inc.php:189
msgid "An critical error occured" msgid "An critical error occured"
msgstr "Une erreur critique s'est produite." msgstr "Une erreur critique s'est produite."
#: ../../../functions.inc.php:187 #: ../../../functions.inc.php:192
msgid "Critical Error" msgid "Critical Error"
msgstr "Erreur critique." msgstr "Erreur critique."
#: ../../../functions.inc.php:196 #: ../../../functions.inc.php:201
msgid "DEBUG MODE" msgid "DEBUG MODE"
msgstr "Mode de débogage." msgstr "Mode de débogage."
@ -245,20 +245,20 @@ msgstr "Nouveau lien entre tags :"
msgid "Import Structure" msgid "Import Structure"
msgstr "Importer une structure" msgstr "Importer une structure"
#: ../../../index.php:37 #: ../../../index.php:38
msgid "You have now logged out" msgid "You have now logged out"
msgstr "Vous êtes maintenant déconnecté." msgstr "Vous êtes maintenant déconnecté."
#: ../../../index.php:44 #: ../../../index.php:45
#, php-format #, php-format
msgid "%s: Recent bookmarks" msgid "%s: Recent bookmarks"
msgstr "%s: Signets récents" msgstr "%s: Signets récents"
#: ../../../index.php:77 #: ../../../index.php:78
msgid "Store, share and tag your favourite links" msgid "Store, share and tag your favourite links"
msgstr "Conservez, partagez et taggez vos liens favoris" msgstr "Conservez, partagez et taggez vos liens favoris"
#: ../../../index.php:78 #: ../../../index.php:79
msgid "All Bookmarks" msgid "All Bookmarks"
msgstr "Tous les signets" msgstr "Tous les signets"
@ -686,7 +686,7 @@ msgid "bookmark(s)"
msgstr "signet(s)" msgstr "signet(s)"
#: ../../../templates/admin.tpl.php:19 #: ../../../templates/admin.tpl.php:19
#: ../../../templates/bookmarks.tpl.php:173 #: ../../../templates/bookmarks.tpl.php:227
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
@ -778,74 +778,86 @@ msgstr "Signets des autres utilisateurs pour ce tag"
msgid "Only your bookmarks for this tag" msgid "Only your bookmarks for this tag"
msgstr "Uniquement vos signets pour ce tag" msgstr "Uniquement vos signets pour ce tag"
#: ../../../templates/bookmarks.tpl.php:167 #: ../../../templates/bookmarks.tpl.php:153
msgid "Tags:" #: ../../../templates/bookmarks.tpl.php:159
msgstr "Tags:"
#: ../../../templates/bookmarks.tpl.php:173
msgid "Edit"
msgstr "Editer"
#: ../../../templates/bookmarks.tpl.php:177
msgid "Last update"
msgstr "Date de dernière mise à jour"
#: ../../../templates/bookmarks.tpl.php:180
msgid "by"
msgstr "par"
#: ../../../templates/bookmarks.tpl.php:182
msgid "you"
msgstr "vous"
#: ../../../templates/bookmarks.tpl.php:196
#, php-format
msgid " and %s1 other%s"
msgstr " et %s1 autre%s"
#: ../../../templates/bookmarks.tpl.php:199
#, php-format
msgid " and %2$s%1$s others%3$s"
msgstr " et %2$s%1$s autres%3$s"
#: ../../../templates/bookmarks.tpl.php:207
msgid "Copy"
msgstr "Copier"
#: ../../../templates/bookmarks.tpl.php:226
msgid "This bookmark is certified by an admin user."
msgstr "Ce signet est certifié par un administrateur."
#: ../../../templates/bookmarks.tpl.php:265
msgid "Private Note on this bookmark"
msgstr "Note privée sur ce signet"
#: ../../../templates/bookmarks.tpl.php:291
#: ../../../templates/bookmarks.tpl.php:297
msgid "First" msgid "First"
msgstr "Première" msgstr "Première"
#: ../../../templates/bookmarks.tpl.php:292 #: ../../../templates/bookmarks.tpl.php:154
#: ../../../templates/bookmarks.tpl.php:298 #: ../../../templates/bookmarks.tpl.php:160
msgid "Previous" msgid "Previous"
msgstr "Précédent" msgstr "Précédent"
#: ../../../templates/bookmarks.tpl.php:305 #: ../../../templates/bookmarks.tpl.php:167
#: ../../../templates/bookmarks.tpl.php:308 #: ../../../templates/bookmarks.tpl.php:170
msgid "Next" msgid "Next"
msgstr "Suivant" msgstr "Suivant"
#: ../../../templates/bookmarks.tpl.php:306 #: ../../../templates/bookmarks.tpl.php:168
#: ../../../templates/bookmarks.tpl.php:309 #: ../../../templates/bookmarks.tpl.php:171
msgid "Last" msgid "Last"
msgstr "Dernière" msgstr "Dernière"
#: ../../../templates/bookmarks.tpl.php:319 #: ../../../templates/bookmarks.tpl.php:181
#, php-format #, php-format
msgid "Page %d of %d" msgid "Page %d of %d"
msgstr "Page %d de %d" msgstr "Page %d de %d"
#: ../../../templates/bookmarks.tpl.php:325 #: ../../../templates/bookmarks.tpl.php:221
msgid "Tags:"
msgstr "Tags:"
#: ../../../templates/bookmarks.tpl.php:227
msgid "Edit"
msgstr "Editer"
#: ../../../templates/bookmarks.tpl.php:231
msgid "Last update"
msgstr "Date de dernière mise à jour"
#: ../../../templates/bookmarks.tpl.php:234
msgid "by"
msgstr "par"
#: ../../../templates/bookmarks.tpl.php:236
msgid "you"
msgstr "vous"
#: ../../../templates/bookmarks.tpl.php:250
#, php-format
msgid " and %s1 other%s"
msgstr " et %s1 autre%s"
#: ../../../templates/bookmarks.tpl.php:253
#, php-format
msgid " and %2$s%1$s others%3$s"
msgstr " et %2$s%1$s autres%3$s"
#: ../../../templates/bookmarks.tpl.php:261
msgid "Copy this bookmark to YOUR bookmarks."
msgstr "Copier ce signet dans VOS signets."
#: ../../../templates/bookmarks.tpl.php:261
msgid "Copy"
msgstr "Copier"
#: ../../../templates/bookmarks.tpl.php:280
msgid "This bookmark is certified by an admin user."
msgstr "Ce signet est certifié par un administrateur."
#: ../../../templates/bookmarks.tpl.php:319
msgid "Private Note on this bookmark"
msgstr "Note privée sur ce signet"
#: ../../../templates/bookmarks.tpl.php:330
msgid "Come back to the top of this page."
msgstr "Revenir en haut de cette page."
#: ../../../templates/bookmarks.tpl.php:330
msgid "Top of the page"
msgstr "Haut de page"
#: ../../../templates/bookmarks.tpl.php:336
msgid "No bookmarks available" msgid "No bookmarks available"
msgstr "Pas de signets disponibles." msgstr "Pas de signets disponibles."
@ -924,7 +936,7 @@ msgstr "Note : utiliser \"=\" pour rendre deux tags synonymes ex: europe=eu"
#: ../../../templates/importDelicious.tpl.php:15 #: ../../../templates/importDelicious.tpl.php:15
#: ../../../templates/importNetscape.tpl.php:16 #: ../../../templates/importNetscape.tpl.php:16
msgid "Privacy" msgid "Privacy"
msgstr "Vision" msgstr "Accès"
#: ../../../templates/editbookmark.tpl.php:87 #: ../../../templates/editbookmark.tpl.php:87
#: ../../../templates/importDelicious.tpl.php:18 #: ../../../templates/importDelicious.tpl.php:18
@ -1241,12 +1253,12 @@ msgid ""
" at least 5 characters, alphanumeric (no spaces, no dots or other special " " at least 5 characters, alphanumeric (no spaces, no dots or other special "
"ones)" "ones)"
msgstr "" msgstr ""
"au moins 5 caractères, alphanumériques (pas d'espaces, pas de points ou " " au moins 5 caractères, alphanumériques (pas d'espaces, pas de points ou "
"autre caractère spécial)" "autre caractère spécial)"
#: ../../../templates/register.tpl.php:28 #: ../../../templates/register.tpl.php:28
msgid " to send you your password if you forget it" msgid " to send you your password if you forget it"
msgstr "pour vous envoyer votre mot de passe en cas de perte" msgstr " pour vous envoyer votre mot de passe en cas de perte"
#: ../../../templates/register.tpl.php:33 #: ../../../templates/register.tpl.php:33
msgid "Antispam question" msgid "Antispam question"
@ -1329,8 +1341,8 @@ msgid "Create a link to another tag"
msgstr "Créer un lien vers un autre tag" msgstr "Créer un lien vers un autre tag"
#: ../../../templates/sidebar.block.users.php:14 #: ../../../templates/sidebar.block.users.php:14
msgid "Last Users" msgid "New Users"
msgstr "Derniers utilisateurs" msgstr "Nouveaux Utilisateurs"
#: ../../../templates/sidebar.block.users.php:23 #: ../../../templates/sidebar.block.users.php:23
#: ../../../templates/users.tpl.php:17 #: ../../../templates/users.tpl.php:17
@ -1459,6 +1471,9 @@ msgstr "Profil"
msgid "created in" msgid "created in"
msgstr "Créé en " msgstr "Créé en "
#~ msgid "Last Users"
#~ msgstr "Derniers utilisateurs"
#, fuzzy #, fuzzy
#~ msgid "Watched by" #~ msgid "Watched by"
#~ msgstr "Consultés" #~ msgstr "Consultés"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-19 16:02+0200\n" "POT-Creation-Date: 2009-05-19 17:57+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -133,49 +133,49 @@ msgstr ""
msgid "Save Changes" msgid "Save Changes"
msgstr "" msgstr ""
#: ../../../functions.inc.php:139 #: ../../../functions.inc.php:144
msgid "message_die() was called multiple times." msgid "message_die() was called multiple times."
msgstr "" msgstr ""
#: ../../../functions.inc.php:151 #: ../../../functions.inc.php:156
msgid "SQL Error" msgid "SQL Error"
msgstr "" msgstr ""
#: ../../../functions.inc.php:157 #: ../../../functions.inc.php:162
msgid "Line" msgid "Line"
msgstr "" msgstr ""
#: ../../../functions.inc.php:157 ../../../templates/importDelicious.tpl.php:8 #: ../../../functions.inc.php:162 ../../../templates/importDelicious.tpl.php:8
#: ../../../templates/importNetscape.tpl.php:9 #: ../../../templates/importNetscape.tpl.php:9
#: ../../../templates/importStructure.tpl.php:10 #: ../../../templates/importStructure.tpl.php:10
msgid "File" msgid "File"
msgstr "" msgstr ""
#: ../../../functions.inc.php:163 #: ../../../functions.inc.php:168
msgid "Information" msgid "Information"
msgstr "" msgstr ""
#: ../../../functions.inc.php:168 #: ../../../functions.inc.php:173
msgid "Critical Information" msgid "Critical Information"
msgstr "" msgstr ""
#: ../../../functions.inc.php:173 #: ../../../functions.inc.php:178
msgid "An error occured" msgid "An error occured"
msgstr "" msgstr ""
#: ../../../functions.inc.php:176 #: ../../../functions.inc.php:181
msgid "General Error" msgid "General Error"
msgstr "" msgstr ""
#: ../../../functions.inc.php:184 #: ../../../functions.inc.php:189
msgid "An critical error occured" msgid "An critical error occured"
msgstr "" msgstr ""
#: ../../../functions.inc.php:187 #: ../../../functions.inc.php:192
msgid "Critical Error" msgid "Critical Error"
msgstr "" msgstr ""
#: ../../../functions.inc.php:196 #: ../../../functions.inc.php:201
msgid "DEBUG MODE" msgid "DEBUG MODE"
msgstr "" msgstr ""
@ -241,20 +241,20 @@ msgstr ""
msgid "Import Structure" msgid "Import Structure"
msgstr "" msgstr ""
#: ../../../index.php:37 #: ../../../index.php:38
msgid "You have now logged out" msgid "You have now logged out"
msgstr "" msgstr ""
#: ../../../index.php:44 #: ../../../index.php:45
#, php-format #, php-format
msgid "%s: Recent bookmarks" msgid "%s: Recent bookmarks"
msgstr "" msgstr ""
#: ../../../index.php:77 #: ../../../index.php:78
msgid "Store, share and tag your favourite links" msgid "Store, share and tag your favourite links"
msgstr "" msgstr ""
#: ../../../index.php:78 #: ../../../index.php:79
msgid "All Bookmarks" msgid "All Bookmarks"
msgstr "" msgstr ""
@ -655,7 +655,7 @@ msgid "bookmark(s)"
msgstr "" msgstr ""
#: ../../../templates/admin.tpl.php:19 #: ../../../templates/admin.tpl.php:19
#: ../../../templates/bookmarks.tpl.php:173 #: ../../../templates/bookmarks.tpl.php:227
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
@ -745,74 +745,86 @@ msgstr ""
msgid "Only your bookmarks for this tag" msgid "Only your bookmarks for this tag"
msgstr "" msgstr ""
#: ../../../templates/bookmarks.tpl.php:167 #: ../../../templates/bookmarks.tpl.php:153
msgid "Tags:" #: ../../../templates/bookmarks.tpl.php:159
msgstr ""
#: ../../../templates/bookmarks.tpl.php:173
msgid "Edit"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:177
msgid "Last update"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:180
msgid "by"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:182
msgid "you"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:196
#, php-format
msgid " and %s1 other%s"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:199
#, php-format
msgid " and %2$s%1$s others%3$s"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:207
msgid "Copy"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:226
msgid "This bookmark is certified by an admin user."
msgstr ""
#: ../../../templates/bookmarks.tpl.php:265
msgid "Private Note on this bookmark"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:291
#: ../../../templates/bookmarks.tpl.php:297
msgid "First" msgid "First"
msgstr "" msgstr ""
#: ../../../templates/bookmarks.tpl.php:292 #: ../../../templates/bookmarks.tpl.php:154
#: ../../../templates/bookmarks.tpl.php:298 #: ../../../templates/bookmarks.tpl.php:160
msgid "Previous" msgid "Previous"
msgstr "" msgstr ""
#: ../../../templates/bookmarks.tpl.php:305 #: ../../../templates/bookmarks.tpl.php:167
#: ../../../templates/bookmarks.tpl.php:308 #: ../../../templates/bookmarks.tpl.php:170
msgid "Next" msgid "Next"
msgstr "" msgstr ""
#: ../../../templates/bookmarks.tpl.php:306 #: ../../../templates/bookmarks.tpl.php:168
#: ../../../templates/bookmarks.tpl.php:309 #: ../../../templates/bookmarks.tpl.php:171
msgid "Last" msgid "Last"
msgstr "" msgstr ""
#: ../../../templates/bookmarks.tpl.php:319 #: ../../../templates/bookmarks.tpl.php:181
#, php-format #, php-format
msgid "Page %d of %d" msgid "Page %d of %d"
msgstr "" msgstr ""
#: ../../../templates/bookmarks.tpl.php:325 #: ../../../templates/bookmarks.tpl.php:221
msgid "Tags:"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:227
msgid "Edit"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:231
msgid "Last update"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:234
msgid "by"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:236
msgid "you"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:250
#, php-format
msgid " and %s1 other%s"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:253
#, php-format
msgid " and %2$s%1$s others%3$s"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:261
msgid "Copy this bookmark to YOUR bookmarks."
msgstr ""
#: ../../../templates/bookmarks.tpl.php:261
msgid "Copy"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:280
msgid "This bookmark is certified by an admin user."
msgstr ""
#: ../../../templates/bookmarks.tpl.php:319
msgid "Private Note on this bookmark"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:330
msgid "Come back to the top of this page."
msgstr ""
#: ../../../templates/bookmarks.tpl.php:330
msgid "Top of the page"
msgstr ""
#: ../../../templates/bookmarks.tpl.php:336
msgid "No bookmarks available" msgid "No bookmarks available"
msgstr "" msgstr ""
@ -1262,7 +1274,7 @@ msgid "Create a link to another tag"
msgstr "" msgstr ""
#: ../../../templates/sidebar.block.users.php:14 #: ../../../templates/sidebar.block.users.php:14
msgid "Last Users" msgid "New Users"
msgstr "" msgstr ""
#: ../../../templates/sidebar.block.users.php:23 #: ../../../templates/sidebar.block.users.php:23

View file

@ -501,9 +501,15 @@ p#sort a:hover {
p#sort span { p#sort span {
display: none; display: none;
} }
p.backToTop{
text-align:center;
}
p.paging { p.paging {
font-size: small; font-size: small;
margin-left: 1em; margin-left: 1em;
text-align:center;
} }
p.paging a, p.paging a,
p.paging span.disable { p.paging span.disable {

View file

@ -54,7 +54,7 @@ if (POST_TERMS != '') {
$tplVars['loadjs'] = true; $tplVars['loadjs'] = true;
// Pagination // Pagination
$perpage = getPerPageCount(); $perpage = getPerPageCount($currentUser);
if (intval(GET_PAGE) > 1) { if (intval(GET_PAGE) > 1) {
$page = GET_PAGE; $page = GET_PAGE;
$start = ($page - 1) * $perpage; $start = ($page - 1) * $perpage;

View file

@ -71,7 +71,7 @@ array(filter($sitename .': '. $pagetitle), createURL('rss', 'all/'. filter($cat,
); );
// Pagination // Pagination
$perpage = getPerPageCount(); $perpage = getPerPageCount($currentUser);
if (intval(GET_PAGE) > 1) { if (intval(GET_PAGE) > 1) {
$page = GET_PAGE; $page = GET_PAGE;
$start = ($page - 1) * $perpage; $start = ($page - 1) * $perpage;

View file

@ -133,6 +133,60 @@ if($currenttag!= '') {
} }
?></p> ?></p>
<?php
// PAGINATION
// Ordering
$sortOrder = '';
if (GET_SORT != '') {
$sortOrder = 'sort='. GET_SORT;
}
$sortAmp = (($sortOrder) ? '&amp;'. $sortOrder : '');
$sortQue = (($sortOrder) ? '?'. $sortOrder : '');
// Previous
$perpage = getPerPageCount($currentUser);
if (!$page || $page < 2) {
$page = 1;
$start = 0;
$bfirst = '<span class="disable">'. T_('First') .'</span>';
$bprev = '<span class="disable">'. T_('Previous') .'</span>';
} else {
$prev = $page - 1;
$prev = 'page='. $prev;
$start = ($page - 1) * $perpage;
$bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'">'. T_('First') .'</a>';
$bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'">'. T_('Previous') .'</a>';
}
// Next
$next = $page + 1;
$totalpages = ceil($total / $perpage);
if (count($bookmarks) < $perpage || $perpage * $page == $total) {
$bnext = '<span class="disable">'. T_('Next') .'</span>';
$blast = '<span class="disable">'. T_('Last') ."</span>\n";
} else {
$bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .'</a>';
$blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') ."</a>\n";
}
// RSS
$brss = '';
$size = count($rsschannels);
for ($i = 0; $i < $size; $i++) {
$brss = '<a style="background:#FFFFFF" href="'. $rsschannels[$i][1] .'" title="'. $rsschannels[$i][0] .'"><img src="'. ROOT .'images/rss.gif" width="16" height="16" alt="'. $rsschannels[$i][0] .'" /></a>';
}
$pagesBanner = '<p class="paging">'. $bfirst .'<span> / </span>'. $bprev .'<span> / </span>'. $bnext .'<span> / </span>'. $blast .'<span> / </span>'. sprintf(T_('Page %d of %d'), $page, $totalpages) ." ". $brss ." </p>\n";
if(getPerPageCount($currentUser) > 10) {
echo $pagesBanner; // display a page banner if too many bookmarks to manage
}
?>
<ol <?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> <ol <?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?>
@ -204,7 +258,7 @@ if($currenttag!= '') {
if ($userservice->isLoggedOn() if ($userservice->isLoggedOn()
&& ($currentUser->getId() != $row['uId']) && ($currentUser->getId() != $row['uId'])
&& !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())) { && !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())) {
$copy .= ' - <a href="'. createURL('bookmarks', $currentUser->getUsername() .'?action=add&amp;copyOf='. $row['bId']) .'">'. T_('Copy') .'</a>'; $copy .= ' - <a href="'. createURL('bookmarks', $currentUser->getUsername() .'?action=add&amp;copyOf='. $row['bId']) .'" title="'.T_('Copy this bookmark to YOUR bookmarks.').'">'. T_('Copy') .'</a>';
} }
// Nofollow option // Nofollow option
@ -272,54 +326,11 @@ if($currenttag!= '') {
</ol> </ol>
<?php <?php
// PAGINATION if(getPerPageCount($currentUser)>7) {
echo '<p class="backToTop"><a href="#header" title="'.T_('Come back to the top of this page.').'">'.T_('Top of the page').'</a></p>';
// Ordering
$sortOrder = '';
if (GET_SORT != '') {
$sortOrder = 'sort='. GET_SORT;
} }
echo $pagesBanner; // display previous and next links pages + RSS link
$sortAmp = (($sortOrder) ? '&amp;'. $sortOrder : '');
$sortQue = (($sortOrder) ? '?'. $sortOrder : '');
// Previous
$perpage = getPerPageCount();
if (!$page || $page < 2) {
$page = 1;
$start = 0;
$bfirst = '<span class="disable">'. T_('First') .'</span>';
$bprev = '<span class="disable">'. T_('Previous') .'</span>';
} else {
$prev = $page - 1;
$prev = 'page='. $prev;
$start = ($page - 1) * $perpage;
$bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'">'. T_('First') .'</a>';
$bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'">'. T_('Previous') .'</a>';
}
// Next
$next = $page + 1;
$totalpages = ceil($total / $perpage);
if (count($bookmarks) < $perpage || $perpage * $page == $total) {
$bnext = '<span class="disable">'. T_('Next') .'</span>';
$blast = '<span class="disable">'. T_('Last') ."</span>\n";
} else {
$bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .'</a>';
$blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') ."</a>\n";
}
// RSS
$brss = '';
$size = count($rsschannels);
for ($i = 0; $i < $size; $i++) {
$brss = '<a style="background:#FFFFFF" href="'. $rsschannels[$i][1] .'" title="'. $rsschannels[$i][0] .'"><img src="'. ROOT .'images/rss.gif" width="16" height="16" alt="'. $rsschannels[$i][0] .'" /></a>';
}
echo '<p class="paging">'. $bfirst .'<span> / </span>'. $bprev .'<span> / </span>'. $bnext .'<span> / </span>'. $blast .'<span> / </span>'. sprintf(T_('Page %d of %d'), $page, $totalpages) ." ". $brss ." </p>\n";
} else { } else {
echo '<p class="error">'.T_('No bookmarks available').'</p>'; echo '<p class="error">'.T_('No bookmarks available').'</p>';

View file

@ -11,7 +11,7 @@ $lastUsers = $userservice->getUsers(3);
if ($lastUsers && count($lastUsers) > 0) { if ($lastUsers && count($lastUsers) > 0) {
?> ?>
<h2><?php echo T_('Last Users'); ?></h2> <h2><?php echo T_('New Users'); ?></h2>
<div id="users"> <div id="users">
<table> <table>
<?php <?php

View file

@ -11,6 +11,8 @@ $sidebarTopMessage = ''; #HTML message appearing at the top of the sidebar
$sidebarBottomMessage = ''; #HTML message appearing at the bottom of the sidebar $sidebarBottomMessage = ''; #HTML message appearing at the bottom of the sidebar
$adminsCanModifyBookmarksFromOtherUsers = true; # 'true' if admin users can edit or delete bookmarks belonging to other users. Else 'false'. $adminsCanModifyBookmarksFromOtherUsers = true; # 'true' if admin users can edit or delete bookmarks belonging to other users. Else 'false'.
$adminsAreAdvisedTagsFromOtherAdmins = false; # 'true' if tags from other admins are proposed to each admin (in add/edit a bookmark page). Else 'false'. $adminsAreAdvisedTagsFromOtherAdmins = false; # 'true' if tags from other admins are proposed to each admin (in add/edit a bookmark page). Else 'false'.
$defaultPerPageForAdmins = 20; # default number of bookmarks per page for admins (-1 means no limit)
=== From version 0.91 to 0.92 === === From version 0.91 to 0.92 ===

View file

@ -76,7 +76,7 @@ if ($user) {
$tplVars['userinfo'] =& $userinfo; $tplVars['userinfo'] =& $userinfo;
// Pagination // Pagination
$perpage = getPerPageCount(); $perpage = getPerPageCount($currentUser);
if (intval(GET_PAGE) > 1) { if (intval(GET_PAGE) > 1) {
$page = GET_PAGE; $page = GET_PAGE;
$start = ($page - 1) * $perpage; $start = ($page - 1) * $perpage;