Plugin Directory

Changeset 1858428


Ignore:
Timestamp:
04/14/2018 11:33:59 PM (8 years ago)
Author:
bgin
Message:

Amélioration de l'ergonomie.
L'opération d'agencement des posts sur la page d'accueil est centralisée dans la page Réglages du plugin.

Location:
org-frontpage/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • org-frontpage/trunk/languages/org-frontpage-fr_FR.po

    r1578103 r1858428  
    11msgid ""
    22msgstr ""
    3 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
    43"Project-Id-Version: Organisation FrontPage\n"
    5 "POT-Creation-Date: 2017-01-19 12:46+0100\n"
    6 "PO-Revision-Date: 2017-01-19 12:52+0100\n"
     4"POT-Creation-Date: 2018-04-15 00:39+0200\n"
     5"PO-Revision-Date: 2018-04-15 00:42+0200\n"
     6"Last-Translator: \n"
    77"Language-Team: \n"
     8"Language: fr_FR\n"
    89"MIME-Version: 1.0\n"
    910"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
    11 "X-Generator: Poedit 1.8.11\n"
     12"Plural-Forms: nplurals=2; plural=(n > 1);\n"
     13"X-Generator: Poedit 2.0.5\n"
    1214"X-Poedit-Basepath: ..\n"
    1315"X-Poedit-WPHeader: org-frontpage.php\n"
     
    1618"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
    1719"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
    18 "Last-Translator: \n"
    19 "Language: fr_FR\n"
    2020"X-Poedit-SearchPath-0: .\n"
    2121"X-Poedit-SearchPathExcluded-0: *.js\n"
    2222
    23 #: org-frontpage-plugin-admin.php:8
     23#: org-frontpage-plugin-admin.php:35
    2424msgid "Action denied"
    2525msgstr "Action rejetée"
    2626
    27 #: org-frontpage-plugin-admin.php:27
     27#: org-frontpage-plugin-admin.php:71
    2828msgid "Homepage Settings"
    2929msgstr "Paramètres de la page d’accueil"
    3030
    31 #: org-frontpage-plugin-admin.php:30
     31#: org-frontpage-plugin-admin.php:74
    3232msgid "Posts on the home page"
    3333msgstr "Articles affichés sur la page d'accueil"
    3434
    35 #: org-frontpage-plugin-admin.php:39
     35#: org-frontpage-plugin-admin.php:83
    3636msgid "Total number of posts on the home page"
    3737msgstr "Nombre total d'articles sur la page d'accueil"
    3838
    39 #: org-frontpage-plugin-admin.php:42
     39#: org-frontpage-plugin-admin.php:86
    4040msgid "Number of posts at the top of the home page"
    4141msgstr "Nombre d'articles en haut de la page d'accueil"
    4242
    43 #: org-frontpage-plugin-admin.php:46
     43#: org-frontpage-plugin-admin.php:90 org-frontpage-plugin-admin.php:101
     44msgid "Save changes"
     45msgstr "Sauvegarder les modifications"
     46
     47#: org-frontpage-plugin-admin.php:93
     48msgid "Selection of posts"
     49msgstr "Choix des articles de la page d'accueil"
     50
     51#: org-frontpage-plugin-admin.php:95
    4452msgid "The posts displayed on the home page are summarized below"
    4553msgstr ""
    4654"Les articles affichés sur la page d'accueil sont récapitulés ci-dessous"
    4755
    48 #: org-frontpage-plugin-admin.php:47
     56#: org-frontpage-plugin-admin.php:96
    4957msgid ""
    50 "The selection of these posts cannot be done on this page: it takes place in "
    51 "the edit page of the post"
     58"The selection of these posts can be done on this page: it also takes place "
     59"in the edit page of the post"
    5260msgstr ""
    53 "Le choix de ces articles ne peut pas être fait sur cette page : il "
    54 "s'effectue dans la page d'édition de l'article"
     61"Le choix de ces articles peut être modifié sur cette page : il peut "
     62"s'effectuer aussi dans la page d'édition de l'article"
    5563
    56 #: org-frontpage-plugin-admin.php:60 org-frontpage-plugin-admin.php:64
    57 #: org-frontpage.php:135 org-frontpage.php:139
     64#: org-frontpage-plugin-admin.php:99
     65msgid "Nombre d'articles de la liste de choix"
     66msgstr ""
     67
     68#: org-frontpage-plugin-admin.php:125 org-frontpage.php:166
     69#: org-frontpage.php:170
    5870msgid "Rank"
    5971msgstr "Rang"
    6072
    61 #: org-frontpage-plugin-admin.php:64 org-frontpage.php:139
     73#: org-frontpage-plugin-admin.php:126 org-frontpage.php:170
    6274msgid "Not set"
    6375msgstr "Non défini"
    6476
    65 #: org-frontpage-plugin-admin.php:69
    66 msgid "Save changes"
    67 msgstr "Sauvegarder les modifications"
     77#: org-frontpage-plugin-admin.php:141
     78msgid "Modify post range"
     79msgstr "Actualiser l'article de rang"
    6880
    69 #: org-frontpage.php:75
     81#: org-frontpage.php:92
    7082msgid "Not on the homepage"
    7183msgstr "Pas sur la page d'accueil"
    7284
    73 #: org-frontpage.php:78
     85#: org-frontpage.php:95
    7486msgid "#"
    7587msgstr "N°"
    7688
    77 #: org-frontpage.php:78
     89#: org-frontpage.php:95
    7890msgid "Home Page"
    7991msgstr "Page d’accueil"
    8092
    81 #: org-frontpage.php:92
     93#: org-frontpage.php:111
    8294msgid "Location on home page"
    8395msgstr "Position sur la page d'accueil"
    8496
    85 #: org-frontpage.php:114
     97#: org-frontpage.php:140
    8698msgid "Post location"
    8799msgstr "Position de l'article"
    88100
    89 #: org-frontpage.php:122
     101#: org-frontpage.php:148
    90102msgid "Posts currently selected"
    91103msgstr "Articles actuellement sélectionnés"
    92104
    93 #: org-frontpage.php:190
     105#: org-frontpage.php:281
    94106msgid "Rank / home page"
    95107msgstr "Rang / page d'accueil"
    96108
    97 #: org-frontpage.php:218
     109#: org-frontpage.php:309
    98110msgid "Front page organization"
    99111msgstr "Organisation de la page d'accueil"
    100112
    101 #: org-frontpage.php:218
     113#: org-frontpage.php:309
    102114msgid "Org Frontpage"
    103115msgstr "Org Frontpage"
  • org-frontpage/trunk/org-frontpage-plugin-admin.php

    r1782839 r1858428  
    22// Inclus dans org-frontpage.php
    33// Options de la page d'accueil (frontpage)
     4
     5
     6//Définir la valeur par défaut du nombre d'articles à proposer pour la front page
     7if (empty($_SESSION['nbposts'])) {
     8    $_SESSION['nbposts'] = 15;
     9}
     10
     11//Si on a modifié le nombre de posts à afficher dans la liste déroulante
     12if (isset($_POST['nb_posts_a_choisir'])) {
     13    $_SESSION['nbposts'] = $_POST['nb_posts_a_choisir'];
     14}
     15
     16// table des derniers articles
     17$p=0;
     18$arts=array();
     19
     20global $args;
     21$args = array('numberposts' => $_SESSION['nbposts']);
     22global $post;
     23
     24$lesposts = get_posts( $args );
     25foreach ( $lesposts as $post ) : setup_postdata( $post );
     26    $arts[$p]=array('ID' => $post->ID, 'Titre' => $post->post_title);
     27    $p++;
     28endforeach;
     29wp_reset_postdata();
     30
    431
    532// Pourquoi utiliser$_request au lieu de $_post, puisqu'on sait que la méthode est "post" ?
     
    2249       
    2350}
     51
     52// On récupère le Rang de l'article éventuellement modifié
     53if (!empty($this->_nb_posts_frontpage)) {
     54$article = -1;
     55
     56    for ($i = 1; $i <= $this->_nb_posts_frontpage; $i++) {
     57        if (isset($_POST['article-'.$i])) {
     58            $article = intval(htmlspecialchars($_POST['article-'.$i]));
     59            $rg = $i;
     60            break;
     61        }
     62    }
     63    if ($article > -1) {
     64        update_option("ofp_post_frontpage_".$rg, $arts[$article]['ID']);
     65    }
     66}
     67
    2468?>
    2569
     
    3781
    3882<table class="optiontable">
    39 <tr valign="top"><th scope="row"><?php _e("Total number of posts on the home page", 'org-frontpage'); ?>:</th><td>
     83<tr valign="center"><th scope="row"><?php _e("Total number of posts on the home page", 'org-frontpage'); ?>:</th><td>
    4084<input type="number" name="nb_posts_frontpage" id="nb_posts_frontpage" min="1" value="<?php echo $this->_nb_posts_frontpage; ?>">
    4185</td></tr>
    42 <tr valign="top"><th scope="row"><?php _e("Number of posts at the top of the home page", 'org-frontpage'); ?>:</th><td>
     86<tr valign="center"><th scope="row"><?php _e("Number of posts at the top of the home page", 'org-frontpage'); ?>:</th><td>
    4387<input type="number" name="nb_posts_lead" id="nb_posts_lead" min="0" value="<?php echo $this->_nb_posts_lead; ?>">
    4488</td></tr>
    4589</table>
     90<p class="submit"><input name="save" type="submit" value="<?php _e("Save changes",'org-frontpage'); ?>" /></p>
     91</form>
     92
     93<h3><?php _e("Selection of posts", 'org-frontpage'); ?></h3>
     94
    4695<p><?php _e("The posts displayed on the home page are summarized below",'org-frontpage'); ?><br />
    47 <?php _e("The selection of these posts cannot be done on this page: it takes place in the edit page of the post",'org-frontpage'); ?><br /></p>
    48 <table class="optiontable">
     96<?php _e("The selection of these posts can be done on this page: it also takes place in the edit page of the post",'org-frontpage'); ?><br /></p>
     97
     98<form method="post">
     99    <label><?php _e("Nombre d'articles de la liste de choix") ?> </label>
     100    <input type="number" name="nb_posts_a_choisir" min="3" value="<?php echo $_SESSION['nbposts']; ?>" />
     101    <input name="save_nb_choix" type="submit" value="<?php _e("Save changes",'org-frontpage'); ?>" />
     102</form>
     103
    49104<?php
    50 // Affichage des articles de la page d'accueil
     105//var_dump($arts);
     106
     107// Affichage  et modification des articles de la page d'accueil
    51108    for ($i=1;$i<=$this->_nb_posts_frontpage;$i++) {
    52109        $nom_option = "ofp_post_frontpage_".$i;
     
    59116        if (!empty($article)) {
    60117            $titre = $article->post_title;
    61        
     118        }
    62119?>
    63120<!--Articles -->
    64 <tr valign="top">
    65 <th scope="row"><?php _e("Rank", 'org-frontpage'); echo " ".$i ; ?> : </th><td style="background-color: #FFFFFF;"><?php echo $titre; ?></td>
     121<div style="margin: 18px 0; padding: 6px 0; background-color: #CCCCCC;" >
     122<form method="post">
     123<table class="optiontable">
     124<tr valign="center">
     125<th scope="row"><?php _e("Rank", 'org-frontpage'); echo " ".$i ; ?> : </th><td style="background-color: #FFFFFF;">
     126<?php if($titre=="") { _e("Not set", 'org-frontpage'); } else { echo $titre;} ?></td>
     127<td>
     128  <select id="article-<?php echo $i; ?>" name="article-<?php echo $i; ?>" style="max-width: 100%;">
     129  <?php
     130  $a=0;
     131  foreach($arts as $art) {
     132      ?>
     133      <option value="<?php echo $a; $a++; ?>"><?php echo $art['Titre'] ; ?></option>
     134  <?php
     135  }
     136  ?>
     137  </select>
     138</td>
    66139</tr>
    67         <?php } else { ?>
    68 <tr valign="top">
    69 <th scope="row"><?php _e("Rank", 'org-frontpage'); echo " ".$i ; ?> : </th><td style="background-color: #FFFFFF;"><?php _e("Not set", 'org-frontpage'); ?></td>
    70 </tr>
    71     <?php }} ?>
     140</table>
     141<input name="modif-<?php echo $i; ?>" type="submit" value="<?php _e("Modify post range",'org-frontpage'); echo' '; echo $i; ?>" />
     142</form>
     143</div>
     144    <?php } ?>
    72145
    73 </table>
    74 <p class="submit"><input name="save" type="submit" value="<?php _e("Save changes",'org-frontpage'); ?>" /></p>
    75 </form>
    76146
     147
  • org-frontpage/trunk/org-frontpage.php

    r1844214 r1858428  
    33Plugin Name: Organisation FrontPage
    44Description: Adding a meta box in the post editor to set the rank of post in the home page
    5 Version: 1.6
     5Version: 2.0
    66Author:      B Gineste
    77Text Domain: org-frontpage
  • org-frontpage/trunk/readme.txt

    r1844214 r1858428  
    33Tags: frontpage, front page, theme, template, frontpage, magazine, post, themes, posts
    44Requires at least: 4.4.0
    5 Tested up to: 4.9.4
    6 Stable tag: 1.6
     5Tested up to: 4.9.5
     6Stable tag: 2.0
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1616**Ce plugin permet d'assigner à un post le rang qu'il doit occuper sur la page d'accueil.**
    1717
    18 Pour cela, le plugin ajoute une meta box dans la page d'édition des posts
    19 grâce à laquelle on peut choisir, au moyen d'une combolist, le rang du post en cours d'édition.
     18Pour cela, le plugin ajoute une page "OrgFrontpage" dans le menu "Réglages" du tableau de bord.
    2019
    21 Le nombre de posts à faire figurer sur la page d'accueil est défini dans le sous-menu *Org frontpage* du menu *Réglages*
    22 de l'interface d'administration. Par défaut, ce nombre est fixé à 5.
     20On peut y définir le nombre de posts à faire figurer sur la page d'accueil. Par défaut, ce nombre est fixé à 5.
    2321Dans ce même sous-menu, il est possible de définir le nombre d'articles à mettre en évidence en tête de page. Par défaut, il y en a zéro.
    2422(Remarque : Le nombre de posts défini pour figurer sur la page d'accueil inclut les posts d'entête).
    2523
    26 Une colonne a été ajoutée dans la liste des posts de l'interface d'administration :
     24Une fois ces paramètres définis, on peut choisir dans une liste déroulante les articles à afficher sur la page d'accueil. La liste contient, par défaut, les 15 derniers articles publiées. Ce nombre est paramétrable.
     25
     26De plus, le plugin ajoute une meta box dans la page d'édition des posts
     27grâce à laquelle on peut choisir, au moyen d'une combolist, le rang du post en cours d'édition.
     28
     29Enfin, une colonne a été ajoutée dans la liste des posts de l'interface d'administration :
    2730elle indique, le cas échéant, le rang des posts sur la page d'accueil.
    2831
     
    9194== Changelog ==
    9295
     96= 2.0 =
     97* Améliartion de l'ergonomie : le chois de tous les articles à ranger sur la page d'accueil peut désormais se faire à un endroit unique, la page des réglages du plugin.
     98Toutefois, le choix de l'emplacement d'un article reste possible à partir de la page d'édition de celui-ci.
     99
    93100= 1.6 =
    94101* Correction d'un bug : l'affichage de la liste des articles de la page d'accueil, présente sur la page d'édition d'un article, provoquait un warning lorsqu'un article de cette liste avait été supprimé.
Note: See TracChangeset for help on using the changeset viewer.