Merge pull request #1144 from ArthurHoaro/feature/sticky

Add a button to set links as sticky
This commit is contained in:
ArthurHoaro 2018-10-06 13:22:59 +02:00 committed by GitHub
commit 86e1bc713f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 407 additions and 276 deletions

View file

@ -537,6 +537,9 @@ public function reorder($order = 'DESC')
$order = $order === 'ASC' ? -1 : 1; $order = $order === 'ASC' ? -1 : 1;
// Reorder array by dates. // Reorder array by dates.
usort($this->links, function($a, $b) use ($order) { usort($this->links, function($a, $b) use ($order) {
if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
return $a['sticky'] ? -1 : 1;
}
return $a['created'] < $b['created'] ? 1 * $order : -1 * $order; return $a['created'] < $b['created'] ? 1 * $order : -1 * $order;
}); });

View file

@ -37,6 +37,8 @@ class Router
public static $PAGE_DELETELINK = 'delete_link'; public static $PAGE_DELETELINK = 'delete_link';
public static $PAGE_PINLINK = 'pin';
public static $PAGE_EXPORT = 'export'; public static $PAGE_EXPORT = 'export';
public static $PAGE_IMPORT = 'import'; public static $PAGE_IMPORT = 'import';
@ -146,6 +148,10 @@ public static function findPage($query, $get, $loggedIn)
return self::$PAGE_DELETELINK; return self::$PAGE_DELETELINK;
} }
if (startsWith($query, 'do='. self::$PAGE_PINLINK)) {
return self::$PAGE_PINLINK;
}
if (startsWith($query, 'do='. self::$PAGE_EXPORT)) { if (startsWith($query, 'do='. self::$PAGE_EXPORT)) {
return self::$PAGE_EXPORT; return self::$PAGE_EXPORT;
} }

View file

@ -517,6 +517,26 @@ public function updateMethodWebThumbnailer()
return true; return true;
} }
/**
* Set sticky = false on all links
*
* @return bool true if the update is successful, false otherwise.
*/
public function updateMethodSetSticky()
{
foreach ($this->linkDB as $key => $link) {
if (isset($link['sticky'])) {
return true;
}
$link['sticky'] = false;
$this->linkDB[$key] = $link;
}
$this->linkDB->save($this->conf->get('resource.page_cache'));
return true;
}
} }
/** /**

View file

@ -755,6 +755,14 @@ body,
font-size: 1.3em; font-size: 1.3em;
} }
.pin-link {
font-size: 1.3em;
}
.pinned-link {
color: $blue !important;
}
.linklist-item-description { .linklist-item-description {
position: relative; position: relative;
padding: 0 10px; padding: 0 10px;
@ -848,6 +856,10 @@ body,
margin: 0 7px; margin: 0 7px;
} }
.ctrl-delete {
margin: 0 7px 0 0;
}
// 64em -> lg // 64em -> lg
@media screen and (max-width: 64em) { @media screen and (max-width: 64em) {
.linklist-item-infos-url { .linklist-item-infos-url {

View file

@ -1,15 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Shaarli\n" "Project-Id-Version: Shaarli\n"
"POT-Creation-Date: 2018-07-17 13:04+0200\n" "POT-Creation-Date: 2018-10-06 13:08+0200\n"
"PO-Revision-Date: 2018-07-17 13:07+0200\n" "PO-Revision-Date: 2018-10-06 13:08+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: Shaarli\n" "Language-Team: Shaarli\n"
"Language: fr_FR\n" "Language: fr_FR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.9\n" "X-Generator: Poedit 2.1.1\n"
"X-Poedit-Basepath: ../../../..\n" "X-Poedit-Basepath: ../../../..\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
@ -101,8 +101,6 @@ msgid "Array offset and link ID must be equal."
msgstr "La clé du tableau et l'ID du lien doivent être identiques." msgstr "La clé du tableau et l'ID du lien doivent être identiques."
#: application/LinkDB.php:251 #: application/LinkDB.php:251
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:14 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:14
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:48 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:48
msgid "" msgid ""
@ -125,8 +123,8 @@ msgstr ""
"Bienvenue sur Shaarli ! Ceci est votre premier marque-page public. Pour me " "Bienvenue sur Shaarli ! Ceci est votre premier marque-page public. Pour me "
"modifier ou me supprimer, vous devez d'abord vous connecter.\n" "modifier ou me supprimer, vous devez d'abord vous connecter.\n"
"\n" "\n"
"Pour apprendre à utiliser Shaarli, consultez le lien « Documentation » " "Pour apprendre à utiliser Shaarli, consultez le lien « Documentation » en "
"en bas de page.\n" "bas de page.\n"
"\n" "\n"
"Vous utilisez la version supportée par la communauté du projet original " "Vous utilisez la version supportée par la communauté du projet original "
"Shaarli de Sébastien Sauvage." "Shaarli de Sébastien Sauvage."
@ -185,14 +183,14 @@ msgid ""
"php-gd extension must be loaded to use thumbnails. Thumbnails are now " "php-gd extension must be loaded to use thumbnails. Thumbnails are now "
"disabled. Please reload the page." "disabled. Please reload the page."
msgstr "" msgstr ""
"l'extension php-gd doit être chargée pour utiliser les miniatures. Les miniatures sont désormais " "l'extension php-gd doit être chargée pour utiliser les miniatures. Les "
"désactivées. Rechargez la page." "miniatures sont désormais désactivées. Rechargez la page."
#: application/Updater.php:86 #: application/Updater.php:86
msgid "Couldn't retrieve Updater class methods." msgid "Couldn't retrieve Updater class methods."
msgstr "Impossible de récupérer les méthodes de la classe Updater." msgstr "Impossible de récupérer les méthodes de la classe Updater."
#: application/Updater.php:514 index.php:1023 #: application/Updater.php:514 index.php:1022
msgid "" msgid ""
"You have enabled or changed thumbnails mode. <a href=\"?do=thumbs_update" "You have enabled or changed thumbnails mode. <a href=\"?do=thumbs_update"
"\">Please synchronize them</a>." "\">Please synchronize them</a>."
@ -200,17 +198,17 @@ msgstr ""
"Vous avez activé ou changé le mode de miniatures. <a href=\"?do=thumbs_update" "Vous avez activé ou changé le mode de miniatures. <a href=\"?do=thumbs_update"
"\">Merci de les synchroniser</a>." "\">Merci de les synchroniser</a>."
#: application/Updater.php:566 #: application/Updater.php:586
msgid "An error occurred while running the update " msgid "An error occurred while running the update "
msgstr "Une erreur s'est produite lors de l'exécution de la mise à jour " msgstr "Une erreur s'est produite lors de l'exécution de la mise à jour "
#: application/Updater.php:606 #: application/Updater.php:626
msgid "Updates file path is not set, can't write updates." msgid "Updates file path is not set, can't write updates."
msgstr "" msgstr ""
"Le chemin vers le fichier de mise à jour n'est pas défini, impossible " "Le chemin vers le fichier de mise à jour n'est pas défini, impossible "
"d'écrire les mises à jour." "d'écrire les mises à jour."
#: application/Updater.php:611 #: application/Updater.php:631
msgid "Unable to write updates in " msgid "Unable to write updates in "
msgstr "Impossible d'écrire les mises à jour dans " msgstr "Impossible d'écrire les mises à jour dans "
@ -288,72 +286,64 @@ msgstr "NON. Vous êtes banni pour le moment. Revenez plus tard."
msgid "Wrong login/password." msgid "Wrong login/password."
msgstr "Nom d'utilisateur ou mot de passe incorrect(s)." msgstr "Nom d'utilisateur ou mot de passe incorrect(s)."
#: index.php:483 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46 #: index.php:482 tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:46
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:46
msgid "Daily" msgid "Daily"
msgstr "Quotidien" msgstr "Quotidien"
#: index.php:589 tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28 #: index.php:588 tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44 #: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:75
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:99
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:75 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:75
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:99 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:99
msgid "Login" msgid "Login"
msgstr "Connexion" msgstr "Connexion"
#: index.php:606 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41 #: index.php:605 tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:41
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:41
msgid "Picture wall" msgid "Picture wall"
msgstr "Mur d'images" msgstr "Mur d'images"
#: index.php:683 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36 #: index.php:682 tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:36
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:36
#: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19 #: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
msgid "Tag cloud" msgid "Tag cloud"
msgstr "Nuage de tags" msgstr "Nuage de tags"
#: index.php:716 tmp/tag.list.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19 #: index.php:715 tmp/tag.list.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
msgid "Tag list" msgid "Tag list"
msgstr "Liste des tags" msgstr "Liste des tags"
#: index.php:941 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:31 #: index.php:940 tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:31
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:31
msgid "Tools" msgid "Tools"
msgstr "Outils" msgstr "Outils"
#: index.php:950 #: index.php:949
msgid "You are not supposed to change a password on an Open Shaarli." msgid "You are not supposed to change a password on an Open Shaarli."
msgstr "" msgstr ""
"Vous n'êtes pas censé modifier le mot de passe d'un Shaarli en mode ouvert." "Vous n'êtes pas censé modifier le mot de passe d'un Shaarli en mode ouvert."
#: index.php:955 index.php:997 index.php:1085 index.php:1116 index.php:1221 #: index.php:954 index.php:996 index.php:1084 index.php:1116 index.php:1221
msgid "Wrong token." msgid "Wrong token."
msgstr "Jeton invalide." msgstr "Jeton invalide."
#: index.php:960 #: index.php:959
msgid "The old password is not correct." msgid "The old password is not correct."
msgstr "L'ancien mot de passe est incorrect." msgstr "L'ancien mot de passe est incorrect."
#: index.php:980 #: index.php:979
msgid "Your password has been changed" msgid "Your password has been changed"
msgstr "Votre mot de passe a été modifié" msgstr "Votre mot de passe a été modifié"
#: index.php:985 #: index.php:984 tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
msgid "Change password" msgid "Change password"
msgstr "Modifier le mot de passe" msgstr "Modifier le mot de passe"
#: index.php:1043 #: index.php:1042
msgid "Configuration was saved." msgid "Configuration was saved."
msgstr "La configuration a été sauvegardée." msgstr "La configuration a été sauvegardée."
#: index.php:1068 tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24 #: index.php:1067 tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
msgid "Configure" msgid "Configure"
msgstr "Configurer" msgstr "Configurer"
#: index.php:1079 tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13 #: index.php:1078 tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
msgid "Manage tags" msgid "Manage tags"
msgstr "Gérer les tags" msgstr "Gérer les tags"
@ -381,7 +371,6 @@ msgid "Edit"
msgstr "Modifier" msgstr "Modifier"
#: index.php:1281 index.php:1351 #: index.php:1281 index.php:1351
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:26 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:26
msgid "Shaare" msgid "Shaare"
msgstr "Shaare" msgstr "Shaare"
@ -390,15 +379,19 @@ msgstr "Shaare"
msgid "Note: " msgid "Note: "
msgstr "Note : " msgstr "Note : "
#: index.php:1360 tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:65 #: index.php:1359
msgid "Invalid link ID provided"
msgstr ""
#: index.php:1379
msgid "Export" msgid "Export"
msgstr "Exporter" msgstr "Exporter"
#: index.php:1422 tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:83 #: index.php:1441
msgid "Import" msgid "Import"
msgstr "Importer" msgstr "Importer"
#: index.php:1432 #: index.php:1451
#, php-format #, php-format
msgid "" msgid ""
"The file you are trying to upload is probably bigger than what this " "The file you are trying to upload is probably bigger than what this "
@ -408,20 +401,20 @@ msgstr ""
"le serveur web peut accepter (%s). Merci de l'envoyer en parties plus " "le serveur web peut accepter (%s). Merci de l'envoyer en parties plus "
"légères." "légères."
#: index.php:1471 tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26 #: index.php:1490 tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
msgid "Plugin administration" msgid "Plugin administration"
msgstr "Administration des plugins" msgstr "Administration des plugins"
#: index.php:1523 tmp/thumbnails.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14 #: index.php:1542 tmp/thumbnails.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
msgid "Thumbnails update" msgid "Thumbnails update"
msgstr "Mise à jour des miniatures" msgstr "Mise à jour des miniatures"
#: index.php:1695 #: index.php:1714
msgid "Search: " msgid "Search: "
msgstr "Recherche : " msgstr "Recherche : "
#: index.php:1735 #: index.php:1754
#, php-format #, php-format
msgid "" msgid ""
"<pre>Sessions do not seem to work correctly on your server.<br>Make sure the " "<pre>Sessions do not seem to work correctly on your server.<br>Make sure the "
@ -431,16 +424,16 @@ msgid ""
"custom hostname without a dot causes cookie storage to fail. We recommend " "custom hostname without a dot causes cookie storage to fail. We recommend "
"accessing your server via it's IP address or Fully Qualified Domain Name.<br>" "accessing your server via it's IP address or Fully Qualified Domain Name.<br>"
msgstr "" msgstr ""
"<pre>Les sesssions ne semblent pas fonctionner sur ce serveur.<br>Assurez vous " "<pre>Les sesssions ne semblent pas fonctionner sur ce serveur.<br>Assurez "
"que la variable « session.save_path » est correctement définie dans votre " "vous que la variable « session.save_path » est correctement définie dans "
"fichier de configuration PHP, et que vous avez les droits d'écriture dessus." "votre fichier de configuration PHP, et que vous avez les droits d'écriture "
"<br>Ce paramètre pointe actuellement sur %s.<br>Sur certains navigateurs, " "dessus.<br>Ce paramètre pointe actuellement sur %s.<br>Sur certains "
"accéder à votre serveur depuis un nom d'hôte comme « localhost » ou autre " "navigateurs, accéder à votre serveur depuis un nom d'hôte comme « localhost "
"nom personnalisé sans point '.' entraine l'échec de la sauvegarde des " "» ou autre nom personnalisé sans point '.' entraine l'échec de la sauvegarde "
"cookies. Nous vous recommandons d'accéder à votre serveur depuis son adresse " "des cookies. Nous vous recommandons d'accéder à votre serveur depuis son "
"IP ou un <em>Fully Qualified Domain Name</em>.<br>" "adresse IP ou un <em>Fully Qualified Domain Name</em>.<br>"
#: index.php:1745 #: index.php:1764
msgid "Click to try again." msgid "Click to try again."
msgstr "Cliquer ici pour réessayer." msgstr "Cliquer ici pour réessayer."
@ -481,12 +474,13 @@ msgstr ""
"Erreur de l'extension Isso : Merci de définir le paramètre « ISSO_SERVER » " "Erreur de l'extension Isso : Merci de définir le paramètre « ISSO_SERVER » "
"dans la page d'administration des extensions." "dans la page d'administration des extensions."
#: plugins/isso/isso.php:63 #: plugins/isso/isso.php:90
msgid "Let visitor comment your shaares on permalinks with Isso." msgid "Let visitor comment your shaares on permalinks with Isso."
msgstr "" msgstr ""
"Permettre aux visiteurs de commenter vos shaares sur les permaliens avec Isso." "Permettre aux visiteurs de commenter vos shaares sur les permaliens avec "
"Isso."
#: plugins/isso/isso.php:64 #: plugins/isso/isso.php:91
msgid "Isso server URL (without 'http://')" msgid "Isso server URL (without 'http://')"
msgstr "URL du serveur Isso (sans 'http://')" msgstr "URL du serveur Isso (sans 'http://')"
@ -603,35 +597,17 @@ msgstr "Version de l'API Wallabag (1 ou 2)"
#: tests/LanguagesTest.php:214 tests/LanguagesTest.php:227 #: tests/LanguagesTest.php:214 tests/LanguagesTest.php:227
#: tests/languages/fr/LanguagesFrTest.php:160 #: tests/languages/fr/LanguagesFrTest.php:160
#: tests/languages/fr/LanguagesFrTest.php:173 #: tests/languages/fr/LanguagesFrTest.php:173
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:85
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:85 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:85
msgid "Search" msgid "Search"
msgid_plural "Search" msgid_plural "Search"
msgstr[0] "Rechercher" msgstr[0] "Rechercher"
msgstr[1] "Rechercher" msgstr[1] "Rechercher"
#: tmp/404.b91ef64efc3688266305ea9b42e5017e.rtpl.php:12
msgid "Sorry, nothing to see here."
msgstr "Désolé, il y a rien à voir ici."
#: tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16 #: tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
msgid "URL or leave empty to post a note" msgid "URL or leave empty to post a note"
msgstr "URL ou laisser vide pour créer une note" msgstr "URL ou laisser vide pour créer une note"
#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
msgid "Current password"
msgstr "Mot de passe actuel"
#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
msgid "New password"
msgstr "Nouveau mot de passe"
#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:23
msgid "Change"
msgstr "Changer"
#: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16 #: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:77
msgid "Tag" msgid "Tag"
msgstr "Tag" msgstr "Tag"
@ -661,6 +637,34 @@ msgstr "Vous pouvez aussi modifier les tags dans la"
msgid "tag list" msgid "tag list"
msgstr "liste des tags" msgstr "liste des tags"
#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:143
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:296
msgid "All"
msgstr "Tous"
#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:147
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:300
msgid "Only common media hosts"
msgstr "Seulement les hébergeurs de média connus"
#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:151
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:304
msgid "None"
msgstr "Aucune"
#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:158
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:281
msgid "You need to enable the extension <code>php-gd</code> to use thumbnails."
msgstr ""
"Vous devez activer l'extension <code>php-gd</code> pour utiliser les "
"miniatures."
#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:162
#, fuzzy
#| msgid "Enable thumbnails"
msgid "Synchonize thumbnails"
msgstr "Activer les miniatures"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
msgid "title" msgid "title"
msgstr "titre" msgstr "titre"
@ -678,22 +682,18 @@ msgid "Theme"
msgstr "Thème" msgstr "Thème"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:87 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:87
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:78
msgid "Language" msgid "Language"
msgstr "Langue" msgstr "Langue"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:116 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:116
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:102
msgid "Timezone" msgid "Timezone"
msgstr "Fuseau horaire" msgstr "Fuseau horaire"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:103
msgid "Continent" msgid "Continent"
msgstr "Continent" msgstr "Continent"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:103
msgid "City" msgid "City"
msgstr "Ville" msgstr "Ville"
@ -734,22 +734,18 @@ msgid "Do not show any links if the user is not logged in"
msgstr "N'afficher aucun lien sans être connecté" msgstr "N'afficher aucun lien sans être connecté"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:231 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:231
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:150
msgid "Check updates" msgid "Check updates"
msgstr "Vérifier les mises à jour" msgstr "Vérifier les mises à jour"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:232 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:232
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:152
msgid "Notify me when a new release is ready" msgid "Notify me when a new release is ready"
msgstr "Me notifier lorsqu'une nouvelle version est disponible" msgstr "Me notifier lorsqu'une nouvelle version est disponible"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:247 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:247
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:169
msgid "Enable REST API" msgid "Enable REST API"
msgstr "Activer l'API REST" msgstr "Activer l'API REST"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:248 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:248
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:170
msgid "Allow third party software to use Shaarli such as mobile application" msgid "Allow third party software to use Shaarli such as mobile application"
msgstr "" msgstr ""
"Permet aux applications tierces d'utiliser Shaarli, par exemple les " "Permet aux applications tierces d'utiliser Shaarli, par exemple les "
@ -763,30 +759,11 @@ msgstr "Clé d'API secrète"
msgid "Enable thumbnails" msgid "Enable thumbnails"
msgstr "Activer les miniatures" msgstr "Activer les miniatures"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:281
msgid "You need to enable the extension <code>php-gd</code> to use thumbnails."
msgstr ""
"Vous devez activer l'extension <code>php-gd</code> pour utiliser les "
"miniatures."
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:285 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:285
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:56 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:56
msgid "Synchronize thumbnails" msgid "Synchronize thumbnails"
msgstr "Synchroniser les miniatures" msgstr "Synchroniser les miniatures"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:296
#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:31
msgid "All"
msgstr "Tous"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:300
msgid "Only common media hosts"
msgstr "Seulement les hébergeurs de média connus"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:304
msgid "None"
msgstr "Aucune"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:312 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:312
#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72 #: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
#: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139 #: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139
@ -847,7 +824,6 @@ msgid "Tags"
msgstr "Tags" msgstr "Tags"
#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:57 #: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:57
#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:167 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:167
msgid "Private" msgid "Private"
msgstr "Privé" msgstr "Privé"
@ -856,99 +832,6 @@ msgstr "Privé"
msgid "Apply Changes" msgid "Apply Changes"
msgstr "Appliquer les changements" msgstr "Appliquer les changements"
#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
msgid "Export Database"
msgstr "Exporter les données"
#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
msgid "Selection"
msgstr "Choisir"
#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
msgid "Public"
msgstr "Publics"
#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:52
msgid "Prepend note permalinks with this Shaarli instance's URL"
msgstr "Préfixer les liens de note avec l'URL de l'instance de Shaarli"
#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:53
msgid "Useful to import bookmarks in a web browser"
msgstr "Utile pour importer les marques-pages dans un navigateur"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
msgid "Import Database"
msgstr "Importer des données"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:23
msgid "Maximum size allowed:"
msgstr "Taille maximum autorisée :"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
msgid "Visibility"
msgstr "Visibilité"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
msgid "Use values from the imported file, default to public"
msgstr ""
"Utiliser les valeurs présentes dans le fichier d'import, public par défaut"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
msgid "Import all bookmarks as private"
msgstr "Importer tous les liens comme privés"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46
msgid "Import all bookmarks as public"
msgstr "Importer tous les liens comme publics"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:57
msgid "Overwrite existing bookmarks"
msgstr "Remplacer les liens existants"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:58
msgid "Duplicates based on URL"
msgstr "Les doublons s'appuient sur les URL"
#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
msgid "Add default tags"
msgstr "Ajouter des tags par défaut"
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
msgid "Install Shaarli"
msgstr "Installation de Shaarli"
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:25
msgid "It looks like it's the first time you run Shaarli. Please configure it."
msgstr ""
"Il semblerait que ça soit la première fois que vous lancez Shaarli. Merci de "
"le configurer."
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:33
#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:151
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:151
msgid "Username"
msgstr "Nom d'utilisateur"
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:34
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:152
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:152
msgid "Password"
msgstr "Mot de passe"
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:63
msgid "Shaarli title"
msgstr "Titre du Shaarli"
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:69
msgid "My links"
msgstr "Mes liens"
#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:182
msgid "Install"
msgstr "Installer"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:79 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:79
msgid "shaare" msgid "shaare"
@ -964,13 +847,11 @@ msgstr[0] "lien privé"
msgstr[1] "liens privés" msgstr[1] "liens privés"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:121
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:121 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:121
msgid "Search text" msgid "Search text"
msgstr "Recherche texte" msgstr "Recherche texte"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:37 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:37
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:128
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:128 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:128
#: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36 #: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
#: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:64 #: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:64
@ -1011,7 +892,6 @@ msgid "without any tag"
msgstr "sans tag" msgstr "sans tag"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:173 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:173
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:42 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:42
msgid "Fold" msgid "Fold"
msgstr "Replier" msgstr "Replier"
@ -1028,36 +908,36 @@ msgstr "permalien"
msgid "Add tag" msgid "Add tag"
msgstr "Ajouter un tag" msgstr "Ajouter un tag"
#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:7 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:183
msgid "Toggle sticky"
msgstr "Changer statut épinglé"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:185
msgid "Sticky"
msgstr "Épinglé"
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:7 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:7
msgid "Filters" msgid "Filters"
msgstr "Filtres" msgstr "Filtres"
#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:12
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:12 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:12
msgid "Only display private links" msgid "Only display private links"
msgstr "Afficher uniquement les liens privés" msgstr "Afficher uniquement les liens privés"
#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:15 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:15
msgid "Only display public links" msgid "Only display public links"
msgstr "Afficher uniquement les liens publics" msgstr "Afficher uniquement les liens publics"
#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:20
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:20 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:20
msgid "Filter untagged links" msgid "Filter untagged links"
msgstr "Filtrer par liens privés" msgstr "Filtrer par liens privés"
#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:76
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:24 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:24
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:76 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:76
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:43
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:43 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:43
msgid "Fold all" msgid "Fold all"
msgstr "Replier tout" msgstr "Replier tout"
#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:69
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:69 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:69
msgid "Links per page" msgid "Links per page"
msgstr "Liens par page" msgstr "Liens par page"
@ -1069,59 +949,56 @@ msgstr ""
"Vous avez été banni après trop d'échecs d'authentification. Merci de " "Vous avez été banni après trop d'échecs d'authentification. Merci de "
"réessayer plus tard." "réessayer plus tard."
#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:151
msgid "Username"
msgstr "Nom d'utilisateur"
#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:34
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:152
msgid "Password"
msgstr "Mot de passe"
#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41 #: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:155
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:155 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:155
msgid "Remember me" msgid "Remember me"
msgstr "Rester connecté" msgstr "Rester connecté"
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:14 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:14
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:48 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:48
msgid "by the Shaarli community" msgid "by the Shaarli community"
msgstr "par la communauté Shaarli" msgstr "par la communauté Shaarli"
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:15 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:15
msgid "Documentation" msgid "Documentation"
msgstr "Documentation" msgstr "Documentation"
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:44 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:44
msgid "Expand" msgid "Expand"
msgstr "Déplier" msgstr "Déplier"
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:45
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:45 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:45
msgid "Expand all" msgid "Expand all"
msgstr "Déplier tout" msgstr "Déplier tout"
#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:46 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:46
msgid "Are you sure you want to delete this link?" msgid "Are you sure you want to delete this link?"
msgstr "Êtes-vous sûr de vouloir supprimer ce lien ?" msgstr "Êtes-vous sûr de vouloir supprimer ce lien ?"
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:65
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:90
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:65 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:65
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:90 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:90
msgid "RSS Feed" msgid "RSS Feed"
msgstr "Flux RSS" msgstr "Flux RSS"
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:70
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:106
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:70 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:70
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:106 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:106
msgid "Logout" msgid "Logout"
msgstr "Déconnexion" msgstr "Déconnexion"
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:173
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:173 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:173
msgid "is available" msgid "is available"
msgstr "est disponible" msgstr "est disponible"
#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:180
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:180 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:180
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
@ -1221,22 +1098,18 @@ msgstr "tags"
msgid "List all links with those tags" msgid "List all links with those tags"
msgstr "Lister tous les liens avec ces tags" msgstr "Lister tous les liens avec ces tags"
#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:3
#: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:3 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:3
msgid "Sort by:" msgid "Sort by:"
msgstr "Trier par :" msgstr "Trier par :"
#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:5
#: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:5 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:5
msgid "Cloud" msgid "Cloud"
msgstr "Nuage" msgstr "Nuage"
#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:6
#: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:6 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:6
msgid "Most used" msgid "Most used"
msgstr "Plus utilisés" msgstr "Plus utilisés"
#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:7
#: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:7 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:7
msgid "Alphabetical" msgid "Alphabetical"
msgstr "Alphabétique" msgstr "Alphabétique"
@ -1266,9 +1139,13 @@ msgid "Rename or delete a tag in all links"
msgstr "Renommer ou supprimer un tag dans tous les liens" msgstr "Renommer ou supprimer un tag dans tous les liens"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
#, fuzzy
#| msgid ""
#| "Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, "
#| "delicious…)"
msgid "" msgid ""
"Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, " "Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, "
"delicious…)" "delicious...)"
msgstr "" msgstr ""
"Importer des marques pages au format Netscape HTML (comme exportés depuis " "Importer des marques pages au format Netscape HTML (comme exportés depuis "
"Firefox, Chrome, Opera, delicious…)" "Firefox, Chrome, Opera, delicious…)"
@ -1278,9 +1155,13 @@ msgid "Import links"
msgstr "Importer des liens" msgstr "Importer des liens"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:47 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:47
#, fuzzy
#| msgid ""
#| "Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, "
#| "Opera, delicious…)"
msgid "" msgid ""
"Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, " "Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, "
"Opera, delicious…)" "Opera, delicious...)"
msgstr "" msgstr ""
"Exporter les marques pages au format Netscape HTML (comme exportés depuis " "Exporter les marques pages au format Netscape HTML (comme exportés depuis "
"Firefox, Chrome, Opera, delicious…)" "Firefox, Chrome, Opera, delicious…)"
@ -1339,33 +1220,16 @@ msgstr ""
msgid "Add Note" msgid "Add Note"
msgstr "Ajouter une Note" msgstr "Ajouter une Note"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:136
msgid ""
"You need to browse your Shaarli over <strong>HTTPS</strong> to use this "
"functionality."
msgstr ""
"Vous devez utiliser Shaarli en <strong>HTTPS</strong> pour utiliser cette "
"fonctionalité."
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:144
msgid "Add to"
msgstr "Ajouter à"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:155
msgid "3rd party" msgid "3rd party"
msgstr "Applications tierces" msgstr "Applications tierces"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:157 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:163 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:144
msgid "Plugin"
msgstr "Extension"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:158
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:164
msgid "plugin" msgid "plugin"
msgstr "extension" msgstr "extension"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:191 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:169
msgid "" msgid ""
"Drag this link to your bookmarks toolbar, or right-click it and choose " "Drag this link to your bookmarks toolbar, or right-click it and choose "
"Bookmark This Link" "Bookmark This Link"
@ -1373,10 +1237,91 @@ msgstr ""
"Glisser ce lien dans votre barre de favoris ou cliquer droit dessus et « " "Glisser ce lien dans votre barre de favoris ou cliquer droit dessus et « "
"Ajouter aux favoris »" "Ajouter aux favoris »"
#, fuzzy #~ msgid "Sorry, nothing to see here."
#~| msgid "Enable thumbnails" #~ msgstr "Désolé, il y a rien à voir ici."
#~ msgid "Synchonize thumbnails"
#~ msgstr "Activer les miniatures" #~ msgid "Current password"
#~ msgstr "Mot de passe actuel"
#~ msgid "New password"
#~ msgstr "Nouveau mot de passe"
#~ msgid "Change"
#~ msgstr "Changer"
#~ msgid "Export Database"
#~ msgstr "Exporter les données"
#~ msgid "Selection"
#~ msgstr "Choisir"
#~ msgid "Public"
#~ msgstr "Publics"
#~ msgid "Prepend note permalinks with this Shaarli instance's URL"
#~ msgstr "Préfixer les liens de note avec l'URL de l'instance de Shaarli"
#~ msgid "Useful to import bookmarks in a web browser"
#~ msgstr "Utile pour importer les marques-pages dans un navigateur"
#~ msgid "Import Database"
#~ msgstr "Importer des données"
#~ msgid "Maximum size allowed:"
#~ msgstr "Taille maximum autorisée :"
#~ msgid "Visibility"
#~ msgstr "Visibilité"
#~ msgid "Use values from the imported file, default to public"
#~ msgstr ""
#~ "Utiliser les valeurs présentes dans le fichier d'import, public par défaut"
#~ msgid "Import all bookmarks as private"
#~ msgstr "Importer tous les liens comme privés"
#~ msgid "Import all bookmarks as public"
#~ msgstr "Importer tous les liens comme publics"
#~ msgid "Overwrite existing bookmarks"
#~ msgstr "Remplacer les liens existants"
#~ msgid "Duplicates based on URL"
#~ msgstr "Les doublons s'appuient sur les URL"
#~ msgid "Add default tags"
#~ msgstr "Ajouter des tags par défaut"
#~ msgid "Install Shaarli"
#~ msgstr "Installation de Shaarli"
#~ msgid ""
#~ "It looks like it's the first time you run Shaarli. Please configure it."
#~ msgstr ""
#~ "Il semblerait que ça soit la première fois que vous lancez Shaarli. Merci "
#~ "de le configurer."
#~ msgid "Shaarli title"
#~ msgstr "Titre du Shaarli"
#~ msgid "My links"
#~ msgstr "Mes liens"
#~ msgid "Install"
#~ msgstr "Installer"
#~ msgid ""
#~ "You need to browse your Shaarli over <strong>HTTPS</strong> to use this "
#~ "functionality."
#~ msgstr ""
#~ "Vous devez utiliser Shaarli en <strong>HTTPS</strong> pour utiliser cette "
#~ "fonctionalité."
#~ msgid "Add to"
#~ msgstr "Ajouter à"
#~ msgid "Plugin"
#~ msgstr "Extension"
#~ msgid "Warning: " #~ msgid "Warning: "
#~ msgstr "Attention : " #~ msgstr "Attention : "
@ -1450,7 +1395,8 @@ msgstr ""
#~ "\n" #~ "\n"
#~ msgid "Sessions do not seem to work correctly on your server." #~ msgid "Sessions do not seem to work correctly on your server."
#~ msgstr "Les sessions ne semblent pas fonctionner correctement sur votre serveur." #~ msgstr ""
#~ "Les sessions ne semblent pas fonctionner correctement sur votre serveur."
#~ msgid "Tag was renamed in " #~ msgid "Tag was renamed in "
#~ msgstr "Le tag a été renommé dans " #~ msgstr "Le tag a été renommé dans "

View file

@ -1353,6 +1353,25 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
exit; exit;
} }
if ($targetPage == Router::$PAGE_PINLINK) {
if (! isset($_GET['id']) || empty($LINKSDB[$_GET['id']])) {
// FIXME! Use a proper error system.
$msg = t('Invalid link ID provided');
echo '<script>alert("'. $msg .'");document.location=\''. index_url($_SERVER) .'\';</script>';
exit;
}
if (! $sessionManager->checkToken($_GET['token'])) {
die('Wrong token.');
}
$link = $LINKSDB[$_GET['id']];
$link['sticky'] = ! $link['sticky'];
$LINKSDB[(int) $_GET['id']] = $link;
$LINKSDB->save($conf->get('resource.page_cache'));
header('Location: '.index_url($_SERVER));
exit;
}
if ($targetPage == Router::$PAGE_EXPORT) { if ($targetPage == Router::$PAGE_EXPORT) {
// Export links as a Netscape Bookmarks file // Export links as a Netscape Bookmarks file

View file

@ -82,8 +82,8 @@ public function testRSSBuildData()
$this->assertFalse($data['usepermalinks']); $this->assertFalse($data['usepermalinks']);
$this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links'])); $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links']));
// Test first link (note link) // Test first not pinned link (note link)
$link = reset($data['links']); $link = $data['links'][array_keys($data['links'])[2]];
$this->assertEquals(41, $link['id']); $this->assertEquals(41, $link['id']);
$this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']); $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
$this->assertEquals('http://host.tld/?WDWyig', $link['guid']); $this->assertEquals('http://host.tld/?WDWyig', $link['guid']);
@ -119,7 +119,7 @@ public function testAtomBuildData()
$data = $feedBuilder->buildData(); $data = $feedBuilder->buildData();
$this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links'])); $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links']));
$this->assertRegExp('/2016-08-03T09:30:33\+\d{2}:\d{2}/', $data['last_update']); $this->assertRegExp('/2016-08-03T09:30:33\+\d{2}:\d{2}/', $data['last_update']);
$link = reset($data['links']); $link = $data['links'][array_keys($data['links'])[2]];
$this->assertRegExp('/2015-03-10T11:46:51\+\d{2}:\d{2}/', $link['pub_iso_date']); $this->assertRegExp('/2015-03-10T11:46:51\+\d{2}:\d{2}/', $link['pub_iso_date']);
$this->assertRegExp('/2016-08-03T09:30:33\+\d{2}:\d{2}/', $data['links'][8]['up_iso_date']); $this->assertRegExp('/2016-08-03T09:30:33\+\d{2}:\d{2}/', $data['links'][8]['up_iso_date']);
} }
@ -148,13 +148,13 @@ public function testBuildDataFiltered()
public function testBuildDataCount() public function testBuildDataCount()
{ {
$criteria = array( $criteria = array(
'nb' => '1', 'nb' => '3',
); );
$feedBuilder = new FeedBuilder(self::$linkDB, FeedBuilder::$FEED_ATOM, self::$serverInfo, $criteria, false); $feedBuilder = new FeedBuilder(self::$linkDB, FeedBuilder::$FEED_ATOM, self::$serverInfo, $criteria, false);
$feedBuilder->setLocale(self::$LOCALE); $feedBuilder->setLocale(self::$LOCALE);
$data = $feedBuilder->buildData(); $data = $feedBuilder->buildData();
$this->assertEquals(1, count($data['links'])); $this->assertEquals(3, count($data['links']));
$link = array_shift($data['links']); $link = $data['links'][array_keys($data['links'])[2]];
$this->assertEquals(41, $link['id']); $this->assertEquals(41, $link['id']);
$this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']); $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
} }
@ -171,7 +171,7 @@ public function testBuildDataPermalinks()
$this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links'])); $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links']));
$this->assertTrue($data['usepermalinks']); $this->assertTrue($data['usepermalinks']);
// First link is a permalink // First link is a permalink
$link = array_shift($data['links']); $link = $data['links'][array_keys($data['links'])[2]];
$this->assertEquals(41, $link['id']); $this->assertEquals(41, $link['id']);
$this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']); $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
$this->assertEquals('http://host.tld/?WDWyig', $link['guid']); $this->assertEquals('http://host.tld/?WDWyig', $link['guid']);
@ -179,7 +179,7 @@ public function testBuildDataPermalinks()
$this->assertContains('Direct link', $link['description']); $this->assertContains('Direct link', $link['description']);
$this->assertContains('http://host.tld/?WDWyig', $link['description']); $this->assertContains('http://host.tld/?WDWyig', $link['description']);
// Second link is a direct link // Second link is a direct link
$link = array_shift($data['links']); $link = $data['links'][array_keys($data['links'])[3]];
$this->assertEquals(8, $link['id']); $this->assertEquals(8, $link['id']);
$this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114633'), $link['created']); $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114633'), $link['created']);
$this->assertEquals('http://host.tld/?RttfEw', $link['guid']); $this->assertEquals('http://host.tld/?RttfEw', $link['guid']);
@ -237,7 +237,7 @@ public function testBuildDataServerSubdir()
); );
// Test first link (note link) // Test first link (note link)
$link = array_shift($data['links']); $link = $data['links'][array_keys($data['links'])[2]];
$this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['guid']); $this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['guid']);
$this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['url']); $this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['url']);
$this->assertContains('http://host.tld:8080/~user/shaarli/?addtag=hashtag', $link['description']); $this->assertContains('http://host.tld:8080/~user/shaarli/?addtag=hashtag', $link['description']);

View file

@ -239,12 +239,12 @@ public function testCountHiddenPublic()
public function testDays() public function testDays()
{ {
$this->assertEquals( $this->assertEquals(
array('20100310', '20121206', '20130614', '20150310'), array('20100309', '20100310', '20121206', '20121207', '20130614', '20150310'),
self::$publicLinkDB->days() self::$publicLinkDB->days()
); );
$this->assertEquals( $this->assertEquals(
array('20100310', '20121206', '20130614', '20141125', '20150310'), array('20100309', '20100310', '20121206', '20121207', '20130614', '20141125', '20150310'),
self::$privateLinkDB->days() self::$privateLinkDB->days()
); );
} }
@ -475,13 +475,15 @@ public function testFilterHashInValid()
public function testReorderLinksDesc() public function testReorderLinksDesc()
{ {
self::$privateLinkDB->reorder('ASC'); self::$privateLinkDB->reorder('ASC');
$linkIds = array(42, 4, 9, 1, 0, 7, 6, 8, 41); $stickyIds = [11, 10];
$standardIds = [42, 4, 9, 1, 0, 7, 6, 8, 41];
$linkIds = array_merge($stickyIds, $standardIds);
$cpt = 0; $cpt = 0;
foreach (self::$privateLinkDB as $key => $value) { foreach (self::$privateLinkDB as $key => $value) {
$this->assertEquals($linkIds[$cpt++], $key); $this->assertEquals($linkIds[$cpt++], $key);
} }
self::$privateLinkDB->reorder('DESC'); self::$privateLinkDB->reorder('DESC');
$linkIds = array_reverse($linkIds); $linkIds = array_merge(array_reverse($stickyIds), array_reverse($standardIds));
$cpt = 0; $cpt = 0;
foreach (self::$privateLinkDB as $key => $value) { foreach (self::$privateLinkDB as $key => $value) {
$this->assertEquals($linkIds[$cpt++], $key); $this->assertEquals($linkIds[$cpt++], $key);

View file

@ -110,7 +110,7 @@ public function testFilterAndFormatDoNotPrependNoteUrl()
$links = NetscapeBookmarkUtils::filterAndFormat(self::$linkDb, 'public', false, ''); $links = NetscapeBookmarkUtils::filterAndFormat(self::$linkDb, 'public', false, '');
$this->assertEquals( $this->assertEquals(
'?WDWyig', '?WDWyig',
$links[0]['url'] $links[2]['url']
); );
} }
@ -128,7 +128,7 @@ public function testFilterAndFormatPrependNoteUrl()
); );
$this->assertEquals( $this->assertEquals(
$indexUrl . '?WDWyig', $indexUrl . '?WDWyig',
$links[0]['url'] $links[2]['url']
); );
} }
} }

View file

@ -688,6 +688,7 @@ public function testUpdateMethodDownloadSizeAndTimeoutConfOnlyTimeout()
} }
/** /**
<<<<<<< HEAD
* Test updateMethodWebThumbnailer with thumbnails enabled. * Test updateMethodWebThumbnailer with thumbnails enabled.
*/ */
public function testUpdateMethodWebThumbnailerEnabled() public function testUpdateMethodWebThumbnailerEnabled()
@ -732,4 +733,64 @@ public function testUpdateMethodWebThumbnailerNothingToDo()
$this->assertEquals(53, $this->conf->get('thumbnails.height')); $this->assertEquals(53, $this->conf->get('thumbnails.height'));
$this->assertTrue(empty($_SESSION['warnings'])); $this->assertTrue(empty($_SESSION['warnings']));
} }
/**
* Test updateMethodSetSticky().
*/
public function testUpdateStickyValid()
{
$blank = [
'id' => 1,
'url' => 'z',
'title' => '',
'description' => '',
'tags' => '',
'created' => new DateTime(),
];
$links = [
1 => ['id' => 1] + $blank,
2 => ['id' => 2] + $blank,
];
$refDB = new ReferenceLinkDB();
$refDB->setLinks($links);
$refDB->write(self::$testDatastore);
$linkDB = new LinkDB(self::$testDatastore, true, false);
$updater = new Updater(array(), $linkDB, $this->conf, true);
$this->assertTrue($updater->updateMethodSetSticky());
$linkDB = new LinkDB(self::$testDatastore, true, false);
foreach ($linkDB as $link) {
$this->assertFalse($link['sticky']);
}
}
/**
* Test updateMethodSetSticky().
*/
public function testUpdateStickyNothingToDo()
{
$blank = [
'id' => 1,
'url' => 'z',
'title' => '',
'description' => '',
'tags' => '',
'created' => new DateTime(),
];
$links = [
1 => ['id' => 1, 'sticky' => true] + $blank,
2 => ['id' => 2] + $blank,
];
$refDB = new ReferenceLinkDB();
$refDB->setLinks($links);
$refDB->write(self::$testDatastore);
$linkDB = new LinkDB(self::$testDatastore, true, false);
$updater = new Updater(array(), $linkDB, $this->conf, true);
$this->assertTrue($updater->updateMethodSetSticky());
$linkDB = new LinkDB(self::$testDatastore, true, false);
$this->assertTrue($linkDB[1]['sticky']);
}
} }

View file

@ -95,7 +95,7 @@ public function testGetLinks()
$this->assertEquals($this->refDB->countLinks(), count($data)); $this->assertEquals($this->refDB->countLinks(), count($data));
// Check order // Check order
$order = [41, 8, 6, 7, 0, 1, 9, 4, 42]; $order = [10, 11, 41, 8, 6, 7, 0, 1, 9, 4, 42];
$cpt = 0; $cpt = 0;
foreach ($data as $link) { foreach ($data as $link) {
$this->assertEquals(self::NB_FIELDS_LINK, count($link)); $this->assertEquals(self::NB_FIELDS_LINK, count($link));
@ -103,7 +103,7 @@ public function testGetLinks()
} }
// Check first element fields // Check first element fields
$first = $data[0]; $first = $data[2];
$this->assertEquals('http://domain.tld/?WDWyig', $first['url']); $this->assertEquals('http://domain.tld/?WDWyig', $first['url']);
$this->assertEquals('WDWyig', $first['shorturl']); $this->assertEquals('WDWyig', $first['shorturl']);
$this->assertEquals('Link title: @website', $first['title']); $this->assertEquals('Link title: @website', $first['title']);
@ -120,7 +120,7 @@ public function testGetLinks()
$this->assertEmpty($first['updated']); $this->assertEmpty($first['updated']);
// Multi tags // Multi tags
$link = $data[1]; $link = $data[3];
$this->assertEquals(7, count($link['tags'])); $this->assertEquals(7, count($link['tags']));
// Update date // Update date
@ -138,7 +138,7 @@ public function testGetLinksOffsetLimit()
{ {
$env = Environment::mock([ $env = Environment::mock([
'REQUEST_METHOD' => 'GET', 'REQUEST_METHOD' => 'GET',
'QUERY_STRING' => 'offset=1&limit=1' 'QUERY_STRING' => 'offset=3&limit=1'
]); ]);
$request = Request::createFromEnvironment($env); $request = Request::createFromEnvironment($env);
$response = $this->controller->getLinks($request, new Response()); $response = $this->controller->getLinks($request, new Response());
@ -164,7 +164,7 @@ public function testGetLinksLimitAll()
$data = json_decode((string) $response->getBody(), true); $data = json_decode((string) $response->getBody(), true);
$this->assertEquals($this->refDB->countLinks(), count($data)); $this->assertEquals($this->refDB->countLinks(), count($data));
// Check order // Check order
$order = [41, 8, 6, 7, 0, 1, 9, 4, 42]; $order = [10, 11, 41, 8, 6, 7, 0, 1, 9, 4, 42];
$cpt = 0; $cpt = 0;
foreach ($data as $link) { foreach ($data as $link) {
$this->assertEquals(self::NB_FIELDS_LINK, count($link)); $this->assertEquals(self::NB_FIELDS_LINK, count($link));
@ -205,7 +205,8 @@ public function testGetLinksVisibilityAll()
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
$data = json_decode((string)$response->getBody(), true); $data = json_decode((string)$response->getBody(), true);
$this->assertEquals($this->refDB->countLinks(), count($data)); $this->assertEquals($this->refDB->countLinks(), count($data));
$this->assertEquals(41, $data[0]['id']); $this->assertEquals(10, $data[0]['id']);
$this->assertEquals(41, $data[2]['id']);
$this->assertEquals(self::NB_FIELDS_LINK, count($data[0])); $this->assertEquals(self::NB_FIELDS_LINK, count($data[0]));
} }
@ -243,7 +244,8 @@ public function testGetLinksVisibilityPublic()
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
$data = json_decode((string)$response->getBody(), true); $data = json_decode((string)$response->getBody(), true);
$this->assertEquals($this->refDB->countPublicLinks(), count($data)); $this->assertEquals($this->refDB->countPublicLinks(), count($data));
$this->assertEquals(41, $data[0]['id']); $this->assertEquals(10, $data[0]['id']);
$this->assertEquals(41, $data[2]['id']);
$this->assertEquals(self::NB_FIELDS_LINK, count($data[0])); $this->assertEquals(self::NB_FIELDS_LINK, count($data[0]));
} }
@ -413,8 +415,9 @@ public function testGetLinksSearchTags()
$response = $this->controller->getLinks($request, new Response()); $response = $this->controller->getLinks($request, new Response());
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
$data = json_decode((string) $response->getBody(), true); $data = json_decode((string) $response->getBody(), true);
$this->assertEquals(9, count($data)); $this->assertEquals(\ReferenceLinkDB::$NB_LINKS_TOTAL, count($data));
$this->assertEquals(41, $data[0]['id']); $this->assertEquals(10, $data[0]['id']);
$this->assertEquals(41, $data[2]['id']);
// wildcard: optional ('*' does not need to expand) // wildcard: optional ('*' does not need to expand)
$env = Environment::mock([ $env = Environment::mock([

View file

@ -4,7 +4,7 @@
*/ */
class ReferenceLinkDB class ReferenceLinkDB
{ {
public static $NB_LINKS_TOTAL = 9; public static $NB_LINKS_TOTAL = 11;
private $_links = array(); private $_links = array();
private $_publicCount = 0; private $_publicCount = 0;
@ -15,6 +15,32 @@ class ReferenceLinkDB
*/ */
public function __construct() public function __construct()
{ {
$this->addLink(
11,
'Pined older',
'?PCRizQ',
'This is an older pinned link',
0,
DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20100309_101010'),
'',
null,
'PCRizQ',
true
);
$this->addLink(
10,
'Pined',
'?0gCTjQ',
'This is a pinned link',
0,
DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121207_152312'),
'',
null,
'0gCTjQ',
true
);
$this->addLink( $this->addLink(
41, 41,
'Link title: @website', 'Link title: @website',
@ -114,7 +140,17 @@ public function __construct()
/** /**
* Adds a new link * Adds a new link
*/ */
protected function addLink($id, $title, $url, $description, $private, $date, $tags, $updated = '', $shorturl = '') protected function addLink(
$id,
$title,
$url,
$description,
$private,
$date,
$tags,
$updated = '',
$shorturl = '',
$pinned = false)
{ {
$link = array( $link = array(
'id' => $id, 'id' => $id,
@ -126,6 +162,7 @@ protected function addLink($id, $title, $url, $description, $private, $date, $ta
'created' => $date, 'created' => $date,
'updated' => $updated, 'updated' => $updated,
'shorturl' => $shorturl ? $shorturl : smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id), 'shorturl' => $shorturl ? $shorturl : smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id),
'sticky' => $pinned
); );
$this->_links[$id] = $link; $this->_links[$id] = $link;
@ -165,6 +202,10 @@ public function reorder($order = 'DESC')
$order = $order === 'ASC' ? -1 : 1; $order = $order === 'ASC' ? -1 : 1;
// Reorder array by dates. // Reorder array by dates.
usort($this->_links, function($a, $b) use ($order) { usort($this->_links, function($a, $b) use ($order) {
if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
return $a['sticky'] ? -1 : 1;
}
return $a['created'] < $b['created'] ? 1 * $order : -1 * $order; return $a['created'] < $b['created'] ? 1 * $order : -1 * $order;
}); });
} }

View file

@ -125,6 +125,8 @@
{$strPermalink=t('Permalink')} {$strPermalink=t('Permalink')}
{$strPermalinkLc=t('permalink')} {$strPermalinkLc=t('permalink')}
{$strAddTag=t('Add tag')} {$strAddTag=t('Add tag')}
{$strToggleSticky=t('Toggle sticky')}
{$strSticky=t('Sticky')}
{ignore}End of translations{/ignore} {ignore}End of translations{/ignore}
{loop="links"} {loop="links"}
<div class="anchor" id="{$value.shorturl}"></div> <div class="anchor" id="{$value.shorturl}"></div>
@ -201,7 +203,23 @@ <h2>
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
</a> </a>
</span> </span>
<span class="linklist-item-infos-controls-item ctrl-pin">
<a href="?do=pin&amp;id={$value.id}&amp;token={$token}"
title="{$strToggleSticky}" class="pin-link {if="$value.sticky"}pinned-link{/if} pure-u-0 pure-u-lg-visible">
<i class="fa fa-thumb-tack"></i>
</a>
</span>
</div> </div>
{else}
{if="$value.sticky"}
<div class="linklist-item-infos-controls-group pure-u-0 pure-u-lg-visible">
<span class="linklist-item-infos-controls-item ctrl-pin">
<span title="{$strSticky}" class="pin-link pinned-link pure-u-0 pure-u-lg-visible">
<i class="fa fa-thumb-tack"></i>
</span>
</span>
</div>
{/if}
{/if} {/if}
<a href="?{$value.shorturl}" title="{$strPermalink}"> <a href="?{$value.shorturl}" title="{$strPermalink}">
{if="!$hide_timestamps || $is_logged_in"} {if="!$hide_timestamps || $is_logged_in"}