Changes in [2320:89c91e538879:2406:325f49056c79]
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
locales/en/main.po
r2285 r2404 223 223 msgstr "" 224 224 225 msgid "Title (optional)" 226 msgstr "" 227 225 228 msgid "Title, Date" 226 229 msgstr "" -
locales/fr/help/index.html
r2298 r2406 13 13 </div> 14 14 15 <p>Sur chaque page de l'administration, vous retrouverez les mêmes bandeauhaut, menu principal et pied de page. <em>(Les emplacements de chacun de ces éléments sont indiqués ici pour une consultation sur ordinateur ; sur un mobile ou une tablette, leur emplacement varie selon la place disponible.)</em></p>15 <p>Sur chaque page de l'administration, vous retrouverez les mêmes volet en haut, menu principal et pied de page. <em>(Les emplacements de chacun de ces éléments sont indiqués ici pour une consultation sur ordinateur ; sur un mobile ou une tablette, leur emplacement varie selon la place disponible.)</em></p> 16 16 17 17 <h4 class="pretty-title">Bandeau haut</h4> 18 <p>Le bandeauen haut de chaque page est composé de trois éléments :</p>18 <p>Le volet en haut de chaque page est composé de trois éléments :</p> 19 19 <h5 class="as_h4">Logo</h5> 20 20 <p>Par défaut, ce logo est celui de Dotclear et son lien conduit vers l'accueil de l'administration. Toutefois, un gestionnaire de plate-forme peut choisir un autre logo et diriger le lien vers autre chose que l'accueil (en général la page d'accueil du service).</p> … … 25 25 26 26 <h5 class="as_h4">Utilisateur</h5> 27 <p>À l'extrême droite du bandeauhaut, le lien <em>Mon tableau de bord</em> permet de revenir à l'accueil du blog.</p>27 <p>À l'extrême droite du volet haut, le lien <em>Mon tableau de bord</em> permet de revenir à l'accueil du blog.</p> 28 28 <p>Le lien suivant, <em>Mes préférences</em> dirige vers la page où vous pourrez modifier vos informations personnelles, configurer votre tableau de bord et choisir vos options d'interface et d'édition.</p> 29 29 <p>Étonnamment, le lien <em>Déconnecter [votre login]</em> permet de… se déconnecter, si si. (Chez Dotclear, on est trop forts en ergo.)</p> … … 70 70 <ul><li>Créer un sous-répertoire</li><li>Ajouter des fichiers</li><li>Télécharger une archive zip du dossier courant</li><li>Modifier ou compléter les informations d'un fichier</li><li>Ajout direct de fichiers</li><li>Types de fichier particuliers</li><li>Pièces jointes</li></ul></li> 71 71 <li><a href="http://fr.dotclear.org/documentation/2.0/usage/widgets">Contenu du menu du blog (widgets)</a> 72 <ul><li>Bandeau de navigation, bandeaud'extra</li><li>Les widgets par défaut</li><li>Ajouter/Supprimer un widget</li><li>Paramétrage des widgets</li></ul></li>72 <ul><li>Bandeau de navigation, volet d'extra</li><li>Les widgets par défaut</li><li>Ajouter/Supprimer un widget</li><li>Paramétrage des widgets</li></ul></li> 73 73 <li><a href="http://fr.dotclear.org/documentation/2.0/usage/blogroll">Blogroll</a> 74 74 <ul><li>Liste des liens</li><li>Ajouter un lien</li><li>Ajouter une catégorie de liens</li><li>XFN</li><li>Importer depuis un fichier OPML ou XBEL</li></ul></li> -
locales/fr/main.po
r2311 r2406 229 229 msgstr "Titre" 230 230 231 msgid "Title (optional)" 232 msgstr "Titre (optionnel)" 233 231 234 msgid "Title, Date" 232 235 msgstr "Titre, date" … … 3745 3748 3746 3749 #~ msgid "List of last entries published" 3747 #~ msgstr " Derniers billets publiés"3748 3749 #~ msgid "List of last comments p osted"3750 #~ msgstr " Derniers commentaires postés"3750 #~ msgstr "Liste des derniers billets publiés" 3751 3752 #~ msgid "List of last comments published" 3753 #~ msgstr "Liste des derniers commentaires publiés" 3751 3754 3752 3755 #~ msgid "List of published pages" -
locales/fr/plugins.po
r2311 r2406 88 88 msgstr "Liste des catégories" 89 89 90 msgid " RSS or Atom feed subscription links"91 msgstr "Liens d 'abonnements aux flux RSS ou Atom"92 93 msgid "L ast entries from feed"94 msgstr " Derniers billets d'un flux"90 msgid "Feed subscription links (RSS or Atom)" 91 msgstr "Liens de souscription aux flux (RSS ou Atom)" 92 93 msgid "List of last entries from feed (RSS or Atom)" 94 msgstr "Liste des derniers billets d'un flux (RSS or Atom)" 95 95 96 96 msgid "Simple text" … … 98 98 99 99 msgid "List of last entries published" 100 msgstr " Derniers billets publiés"101 102 msgid "List of last comments p osted"103 msgstr "Liste des derniers commentaires p ostés"100 msgstr "Liste des derniers billets publiés" 101 102 msgid "List of last comments published" 103 msgstr "Liste des derniers commentaires publiés" 104 104 105 105 msgid "Tags cloud" … … 1889 1889 msgstr "Widgets disponibles" 1890 1890 1891 msgid " Move widgets from this list to one of the sidebars."1892 msgstr "Déplacez des widgets de cette liste vers l'un des volets ."1891 msgid "Drag widgets from this list to one of the sidebars, for add." 1892 msgstr "Déplacez des widgets de cette liste vers l'un des volets, pour les ajouter." 1893 1893 1894 1894 msgid "order" … … 1899 1899 1900 1900 msgid "Add widgets to sidebars" 1901 msgstr "Ajouter les widgets aux bandeaux"1901 msgstr "Ajouter les widgets aux volets" 1902 1902 1903 1903 msgid "Navigation sidebar" … … 1920 1920 1921 1921 msgid "Widgets may be used to add various blocks of content to be displayed on your public pages. To add a widget, drag it from the Available widgets list on the left to one of the sidebars on the right of this page. You can order your widgets in a sidebar by dragging them up or down. You must update sidebars to apply your changes." 1922 msgstr "Les widgets sont utilisés pour ajouter des blocs de contenus divers dans vos pages publiques. Pour ajouter un widget, faites-le glisser depuis la liste des Widgets disponibles à gauche jusqu'à l'un des bandeaux sur la droite de la page. Vous pouvez ré-ordonner vos widgets dans un bandeau en le faisant glisser vers le haut ou vers le bas. Vous devez mettre à jour les bandeauxpour enregistrer vos modifications."1922 msgstr "Les widgets sont utilisés pour ajouter des blocs de contenus divers dans vos pages publiques. Pour ajouter un widget, faites-le glisser depuis la liste des Widgets disponibles à gauche jusqu'à l'un des volets sur la droite de la page. Vous pouvez ré-ordonner vos widgets dans un volet en le faisant glisser vers le haut ou vers le bas. Vous devez mettre à jour les volets pour enregistrer vos modifications." 1923 1923 1924 1924 msgid "Once included in a sidebar, widgets have configuration options that you can reach by clicking on the arrow next to their name." 1925 msgstr "Une fois inclus dans un bandeau, les widgets ont généralement des options que vous pouvez configurer. Cliquez sur la flèche à côté de leur nom pour y accéder."1925 msgstr "Une fois inclus dans un volet, les widgets ont généralement des options que vous pouvez configurer. Cliquez sur la flèche à côté de leur nom pour y accéder." 1926 1926 1927 1927 msgid "Reset sidebars to get back to default widgets installation." 1928 msgstr "Réinitialisez les bandeauxpour retrouver les widgets par défaut de votre installation."1928 msgstr "Réinitialisez les volets pour retrouver les widgets par défaut de votre installation." 1929 1929 1930 1930 msgid "Widget templates tags" … … 1970 1970 msgstr "Nom de l'élément de réglage :" 1971 1971 1972 msgid "No widget ."1973 msgstr "Aucun widget ."1972 msgid "No widget for now." 1973 msgstr "Aucun widget pour le moment." 1974 1974 1975 1975 msgid "Remove widget" 1976 1976 msgstr "Retirer le widget" 1977 1977 1978 msgid "Drag widgets here to remove them from this sidebar."1979 msgstr "Glisser les widgets ici pour les retirer du volet."1978 msgid "Drag widgets here to remove." 1979 msgstr "Glisser les widgets ici pour les retirer." 1980 1980 1981 1981 #~ msgid "Antispam" -
plugins/blogroll/_widgets.php
r1179 r2397 20 20 { 21 21 $w->create('links',__('Blogroll'),array('tplBlogroll','linksWidget'),null,'Blogroll list'); 22 $w->links->setting('title',__('Title :'),__('Links'));22 $w->links->setting('title',__('Title (optional)').' :',__('Links')); 23 23 24 24 $br = new dcBlogroll($GLOBALS['core']->blog); … … 41 41 ) 42 42 ); 43 $w->links-> setting('content_only',__('Content only'),0,'check');44 $w->links-> setting('class',__('CSS class:'),'');43 $w->links->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 44 $w->links->advanced_setting('class',__('CSS class:'),''); 45 45 } 46 46 -
plugins/blogroll/locales/fr/help/blogroll.html
r1971 r2402 19 19 l'endroit désiré. Une fois vos liens ordonnés, cliquez sur "enregistrer l'ordre" 20 20 afin d'appliquer les changements. L'ordre que vous choisissez sur cet écran sera 21 l'ordre dans lequel s'afficheront les liens sur vos bandeauxde navigation par21 l'ordre dans lequel s'afficheront les liens sur vos volets de navigation par 22 22 le biais du widget 'liens'.<br /> 23 23 Cliquer sur un lien vous mènera à sa fenêtre d'édition.</dd> -
plugins/pages/_widgets.php
r1179 r2397 20 20 { 21 21 $w->create('pages',__('Pages'),array('tplPages','pagesWidget'),null,'List of published pages'); 22 $w->pages->setting('title',__('Title :'),__('Pages'));22 $w->pages->setting('title',__('Title (optional)').' :',__('Pages')); 23 23 $w->pages->setting('homeonly',__('Display on:'),1,'combo', 24 24 array( … … 38 38 array(__('Ascending') => 'asc', __('Descending') => 'desc') 39 39 ); 40 $w->pages-> setting('content_only',__('Content only'),0,'check');41 $w->pages-> setting('class',__('CSS class:'),'');40 $w->pages->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 41 $w->pages->advanced_setting('class',__('CSS class:'),''); 42 42 } 43 43 -
plugins/simpleMenu/_widgets.php
r1179 r2397 19 19 { 20 20 $w->create('simplemenu',__('Simple menu'),array('tplSimpleMenu','simpleMenuWidget'),null,'List of simple menu items'); 21 $w->simplemenu->setting('title',__('Title :'),__('Menu'));21 $w->simplemenu->setting('title',__('Title (optional)').' :',__('Menu')); 22 22 $w->simplemenu->setting('homeonly',__('Display on:'),0,'combo', 23 23 array( … … 27 27 ) 28 28 ); 29 $w->simplemenu-> setting('content_only',__('Content only'),0,'check');30 $w->simplemenu-> setting('class',__('CSS class:'),'');29 $w->simplemenu->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 30 $w->simplemenu->advanced_setting('class',__('CSS class:'),''); 31 31 } 32 32 } -
plugins/tags/_widgets.php
r1179 r2397 20 20 { 21 21 $w->create('tags',__('Tags'),array('tplTags','tagsWidget'),null,'Tags cloud'); 22 $w->tags->setting('title',__('Title :'),__('Tags'));22 $w->tags->setting('title',__('Title (optional)').' :',__('Tags')); 23 23 $w->tags->setting('limit',__('Limit (empty means no limit):'),'20'); 24 24 $w->tags->setting('sortby',__('Order by:'),'meta_id_lower','combo', … … 36 36 ) 37 37 ); 38 $w->tags-> setting('content_only',__('Content only'),0,'check');39 $w->tags-> setting('class',__('CSS class:'),'');38 $w->tags->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 39 $w->tags->advanced_setting('class',__('CSS class:'),''); 40 40 } 41 41 -
plugins/widgets/_default_widgets.php
r2198 r2402 19 19 20 20 $__widgets->create('search',__('Search engine'),array('defaultWidgets','search'),null,'Search engine form'); 21 $__widgets->search->setting('title',__('Title :'),__('Search'));21 $__widgets->search->setting('title',__('Title (optional)').' :',__('Search')); 22 22 $__widgets->search->setting('homeonly',__('Display on:'),0,'combo', 23 23 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 24 $__widgets->search-> setting('content_only',__('Content only'),0,'check');25 $__widgets->search-> setting('class',__('CSS class:'),'');24 $__widgets->search->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 25 $__widgets->search->advanced_setting('class',__('CSS class:'),''); 26 26 27 27 $__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation'),null,'List of navigation links'); 28 $__widgets->navigation->setting('title',__('Title :'),'');28 $__widgets->navigation->setting('title',__('Title (optional)').' :',''); 29 29 $__widgets->navigation->setting('homeonly',__('Display on:'),0,'combo', 30 30 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 31 $__widgets->navigation-> setting('content_only',__('Content only'),0,'check');32 $__widgets->navigation-> setting('class',__('CSS class:'),'');31 $__widgets->navigation->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 32 $__widgets->navigation->advanced_setting('class',__('CSS class:'),''); 33 33 34 34 $__widgets->create('bestof',__('Selected entries'),array('defaultWidgets','bestof'),null,'List of selected entries'); 35 $__widgets->bestof->setting('title',__('Title :'),__('Best of me'));35 $__widgets->bestof->setting('title',__('Title (optional)').' :',__('Best of me')); 36 36 $__widgets->bestof->setting('orderby',__('Sort:'),'asc','combo',array(__('Ascending') => 'asc', __('Descending') => 'desc')); 37 37 $__widgets->bestof->setting('homeonly',__('Display on:'),1,'combo', 38 38 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 39 $__widgets->bestof-> setting('content_only',__('Content only'),0,'check');40 $__widgets->bestof-> setting('class',__('CSS class:'),'');39 $__widgets->bestof->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 40 $__widgets->bestof->advanced_setting('class',__('CSS class:'),''); 41 41 42 42 $__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs'),null,'List of available languages'); 43 $__widgets->langs->setting('title',__('Title :'),__('Languages'));43 $__widgets->langs->setting('title',__('Title (optional)').' :',__('Languages')); 44 44 $__widgets->langs->setting('homeonly',__('Display on:'),1,'combo', 45 45 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 46 $__widgets->langs-> setting('content_only',__('Content only'),0,'check');47 $__widgets->langs-> setting('class',__('CSS class:'),'');46 $__widgets->langs->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 47 $__widgets->langs->advanced_setting('class',__('CSS class:'),''); 48 48 49 49 $__widgets->create('categories',__('Categories'),array('defaultWidgets','categories'),null,'List of categories'); 50 $__widgets->categories->setting('title',__('Title :'),__('Categories'));50 $__widgets->categories->setting('title',__('Title (optional)').' :',__('Categories')); 51 51 $__widgets->categories->setting('postcount',__('With entries counts'),0,'check'); 52 52 $__widgets->categories->setting('subcatscount', __('Include sub cats in count'), false, 'check'); … … 54 54 $__widgets->categories->setting('homeonly',__('Display on:'),0,'combo', 55 55 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 56 $__widgets->categories-> setting('content_only',__('Content only'),0,'check');57 $__widgets->categories-> setting('class',__('CSS class:'),'');56 $__widgets->categories->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 57 $__widgets->categories->advanced_setting('class',__('CSS class:'),''); 58 58 59 $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,' RSS or Atom feed subscription links');60 $__widgets->subscribe->setting('title',__('Title :'),__('Subscribe'));59 $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,'Feed subscription links (RSS or Atom)'); 60 $__widgets->subscribe->setting('title',__('Title (optional)').' :',__('Subscribe')); 61 61 $__widgets->subscribe->setting('type',__('Feeds type:'),'atom','combo',array('Atom' => 'atom', 'RSS' => 'rss2')); 62 62 $__widgets->subscribe->setting('homeonly',__('Display on:'),1,'combo', 63 63 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 64 $__widgets->subscribe-> setting('content_only',__('Content only'),0,'check');65 $__widgets->subscribe-> setting('class',__('CSS class:'),'');64 $__widgets->subscribe->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 65 $__widgets->subscribe->advanced_setting('class',__('CSS class:'),''); 66 66 67 $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'L ast entries from feed');68 $__widgets->feed->setting('title',__('Title :'),__('Somewhere else'));67 $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'List of last entries from feed (RSS or Atom)'); 68 $__widgets->feed->setting('title',__('Title (optional)').' :',__('Somewhere else')); 69 69 $__widgets->feed->setting('url',__('Feed URL:'),''); 70 70 $__widgets->feed->setting('limit',__('Entries limit:'),10); 71 71 $__widgets->feed->setting('homeonly',__('Display on:'),1,'combo', 72 72 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 73 $__widgets->feed-> setting('content_only',__('Content only'),0,'check');74 $__widgets->feed-> setting('class',__('CSS class:'),'');73 $__widgets->feed->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 74 $__widgets->feed->advanced_setting('class',__('CSS class:'),''); 75 75 76 76 $__widgets->create('text',__('Text'),array('defaultWidgets','text'),null,'Simple text'); 77 $__widgets->text->setting('title',__('Title :'),'');77 $__widgets->text->setting('title',__('Title (optional)').' :',''); 78 78 $__widgets->text->setting('text',__('Text:'),'','textarea'); 79 79 $__widgets->text->setting('homeonly',__('Display on:'),0,'combo', 80 80 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 81 $__widgets->text-> setting('content_only',__('Content only'),0,'check');82 $__widgets->text-> setting('class',__('CSS class:'),'');81 $__widgets->text->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 82 $__widgets->text->advanced_setting('class',__('CSS class:'),''); 83 83 84 84 $__widgets->create('lastposts',__('Last entries'),array('defaultWidgets','lastposts'),null,'List of last entries published'); 85 $__widgets->lastposts->setting('title',__('Title :'),__('Last entries'));85 $__widgets->lastposts->setting('title',__('Title (optional)').' :',__('Last entries')); 86 86 $rs = $core->blog->getCategories(array('post_type'=>'post')); 87 87 $categories = array('' => '', __('Uncategorized') => 'null'); … … 97 97 $__widgets->lastposts->setting('homeonly',__('Display on:'),1,'combo', 98 98 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 99 $__widgets->lastposts-> setting('content_only',__('Content only'),0,'check');100 $__widgets->lastposts-> setting('class',__('CSS class:'),'');99 $__widgets->lastposts->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 100 $__widgets->lastposts->advanced_setting('class',__('CSS class:'),''); 101 101 102 $__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments'),null,'List of last comments p osted');103 $__widgets->lastcomments->setting('title',__('Title :'),__('Last comments'));102 $__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments'),null,'List of last comments published'); 103 $__widgets->lastcomments->setting('title',__('Title (optional)').' :',__('Last comments')); 104 104 $__widgets->lastcomments->setting('limit',__('Comments limit:'),10); 105 105 $__widgets->lastcomments->setting('homeonly',__('Display on:'),1,'combo', 106 106 array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 107 $__widgets->lastcomments-> setting('content_only',__('Content only'),0,'check');108 $__widgets->lastcomments-> setting('class',__('CSS class:'),'');107 $__widgets->lastcomments->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); 108 $__widgets->lastcomments->advanced_setting('class',__('CSS class:'),''); 109 109 110 110 # --BEHAVIOR-- initWidgets -
plugins/widgets/class.widgets.php
r1474 r2395 139 139 public $append_callback = null; 140 140 private $settings = array(); 141 private $advance_id; 142 private $advanced_settings = array(); 141 143 142 144 public function serialize($order) { … … 144 146 foreach ($this->settings as $k=>$v) 145 147 $values[$k]=$v['value']; 148 foreach ($this->advanced_settings as $k=>$v) 149 $values[$k]=$v['value']; 146 150 $values['id']=$this->id; 147 151 $values['order']=$order; … … 189 193 public function __get($n) 190 194 { 195 $setting = null; 191 196 if (isset($this->settings[$n])) { 192 return $this->settings[$n]['value']; 193 } 194 return null; 197 $setting = $this->settings[$n]['value']; 198 } else if (isset($this->advanced_settings[$n])) { 199 $setting = $this->advanced_settings[$n]['value']; 200 } 201 return $setting; 195 202 } 196 203 … … 199 206 if (isset($this->settings[$n])) { 200 207 $this->settings[$n]['value'] = $v; 208 } else if (isset($this->advanced_settings[$n])) { 209 $this->advanced_settings[$n]['value'] = $v; 201 210 } 202 211 } … … 222 231 } 223 232 233 public function advanced_setting($name,$title,$value,$type='text') 234 { 235 if ($type == 'combo' || $type == 'radio') { 236 $options = @func_get_arg(4); 237 if (!is_array($options)) { 238 return false; 239 } 240 } 241 242 $this->advanced_settings[$name] = array( 243 'title' => $title, 244 'type' => $type, 245 'value' => $value 246 ); 247 248 if (isset($options)) { 249 $this->advanced_settings[$name]['options'] = $options; 250 } 251 } 252 253 public function advance_settings() 254 { 255 return $this->advanced_settings; 256 } 257 224 258 public function settings() 225 259 { … … 232 266 foreach ($this->settings as $id => $s) 233 267 { 234 $wfid = "wf-".$i; 235 $iname = $pr ? $pr.'['.$id.']' : $id; 236 switch ($s['type']) 268 $res .= $this->formSetting($id,$s,$pr,$i=0); 269 $i++; 270 } 271 272 if ( count($this->advanced_settings) > 0 ) 273 { 274 $res .= '<div class="widgetAdvancedSettings">'; 275 $res .= '<h5>'.__('Réglages avancés').'</h5>'; 276 277 foreach ($this->advanced_settings as $id => $s) 237 278 { 238 case 'text': 239 $res .= 240 '<p><label for="'.$wfid.'">'.$s['title'].'</label> '. 241 form::field(array($iname,$wfid),20,255,html::escapeHTML($s['value']),'maximal'). 242 '</p>'; 243 break; 244 case 'textarea': 245 $res .= 246 '<p><label for="'.$wfid.'">'.$s['title'].'</label> '. 247 form::textarea(array($iname,$wfid),30,5,html::escapeHTML($s['value']),'maximal'). 248 '</p>'; 249 break; 250 case 'check': 251 $res .= 252 '<p>'.form::hidden(array($iname),'0'). 253 '<label class="classic" for="'.$wfid.'">'. 254 form::checkbox(array($iname,$wfid),'1',$s['value']).' '.$s['title']. 255 '</label></p>'; 256 break; 257 case 'combo': 258 $res .= 259 '<p><label for="'.$wfid.'">'.$s['title'].'</label> '. 260 form::combo(array($iname,$wfid),$s['options'],$s['value']). 261 '</p>'; 262 break; 263 } 264 $i++; 279 $res .= $this->formSetting($id,$s,$pr,$i); 280 $i++; 281 } 282 283 $res .= '</div>'; 284 } 285 286 return $res; 287 } 288 289 public function formSetting($id,$s,$pr='',&$i=0) 290 { 291 $res = ''; 292 $wfid = "wf-".$i; 293 $iname = $pr ? $pr.'['.$id.']' : $id; 294 switch ($s['type']) 295 { 296 case 'text': 297 $res .= 298 '<p><label for="'.$wfid.'">'.$s['title'].'</label> '. 299 form::field(array($iname,$wfid),20,255,html::escapeHTML($s['value']),'maximal'). 300 '</p>'; 301 break; 302 case 'textarea': 303 $res .= 304 '<p><label for="'.$wfid.'">'.$s['title'].'</label> '. 305 form::textarea(array($iname,$wfid),30,5,html::escapeHTML($s['value']),'maximal'). 306 '</p>'; 307 break; 308 case 'check': 309 $res .= 310 '<p>'.form::hidden(array($iname),'0'). 311 '<label class="classic" for="'.$wfid.'">'. 312 form::checkbox(array($iname,$wfid),'1',$s['value']).' '.$s['title']. 313 '</label></p>'; 314 break; 315 case 'radio': 316 $res .= '<p>'.($s['title'] ? '<label class="classic">'.$s['title'].'</label><br/>' : ''); 317 if(!empty($s['options'])) { 318 foreach ($s['options'] as $k => $v) { 319 $res .= $k > 0 ? '<br/>' : ''; 320 $res .= 321 '<label class="classic" for="'.$wfid.'-'.$k.'">'. 322 form::radio(array($iname,$wfid.'-'.$k),$v[1],$s['value'] == $v[1]).' '.$v[0]. 323 '</label>'; 324 } 325 } 326 $res .= '</p>'; 327 break; 328 case 'combo': 329 $res .= 330 '<p><label for="'.$wfid.'">'.$s['title'].'</label> '. 331 form::combo(array($iname,$wfid),$s['options'],$s['value']). 332 '</p>'; 333 break; 265 334 } 266 335 -
plugins/widgets/dragdrop.js
r1766 r2401 27 27 handle: ".widget-name", 28 28 placeholder: "ui-sortable-placeholder", 29 items: "li:not(.sortable-delete-placeholder )",29 items: "li:not(.sortable-delete-placeholder,.empty-widgets)", 30 30 connectWith: ".connected, .sortable-delete", 31 31 start: function( event, ui ) { … … 43 43 44 44 // signale les zones vides 45 if( ul.find('li').length == 0 ) 46 field.find('.empty-widgets').show(); 47 else field.find('.empty-widgets').hide(); 45 if( ul.find('li:not(.empty-widgets)').length == 0 ) { 46 ul.find('li.empty-widgets').show(); 47 field.find('ul.sortable-delete').hide(); 48 } else { 49 ul.find('li.empty-widgets').hide(); 50 field.find('ul.sortable-delete').show(); 51 } 48 52 49 53 // remove … … 55 59 56 60 // réordonne 57 if( ul.attr('id') ) { 58 ul.find('li').each(function(i) { 59 60 // trouve la zone de réception 61 var name = ul.attr('id').split('dnd').join(''); 62 63 // modifie le name en conséquence 64 $(this).find('*[name^=w]').each(function(){ 65 tab = $(this).attr('name').split(']['); 66 tab[0] = "w["+name; 67 tab[1] = i; 68 $(this).attr('name', tab.join('][')); 69 }); 70 71 // ainssi que le champ d'ordre sans js (au cas ou) 72 $(this).find('input[title=ordre]').val(i); 73 74 }); 75 } 61 reorder(ul); 76 62 77 63 // expand … … 95 81 } 96 82 }); 97 $("li.ui-draggable, ul.ui-sortable li").css({'cursor':'move'}); 83 84 $("li.ui-draggable, ul.ui-sortable li") 85 .not('ul.sortable-delete li, li.empty-widgets') 86 .css({'cursor':'move'}); 98 87 }); -
plugins/widgets/index.php
r2256 r2403 53 53 } 54 54 } 55 56 # Append 1 widget 57 $wid = false; 58 if( gettype($_POST['append']) == 'array' && count($_POST['append']) == 1 ) { 59 $wid = array_keys($_POST['append']); 60 $wid = $wid[0]; 61 } 55 62 56 63 # Append widgets … … 69 76 foreach ($addw as $k => $v) 70 77 { 71 switch ($v) { 72 case 'nav': 73 $widgets_nav->append($__widgets->{$k}); 74 break; 75 case 'extra': 76 $widgets_extra->append($__widgets->{$k}); 77 break; 78 case 'custom': 79 $widgets_custom->append($__widgets->{$k}); 80 break; 81 } 78 if( !$wid || $wid == $k ) 79 { 80 switch ($v) { 81 case 'nav': 82 $widgets_nav->append($__widgets->{$k}); 83 break; 84 case 'extra': 85 $widgets_extra->append($__widgets->{$k}); 86 break; 87 case 'custom': 88 $widgets_custom->append($__widgets->{$k}); 89 break; 90 } 91 } 92 82 93 } 83 94 … … 95 106 } 96 107 108 # Removing ? 109 $removing = false; 110 if ( isset($_POST['w']) && is_array($_POST['w']) ) { 111 foreach ($_POST['w'] as $nsid => $nsw) { 112 foreach ($nsw as $i => $v) { 113 if (!empty($v['_rem'])) { 114 $removing = true; 115 break 2; 116 } 117 } 118 } 119 } 120 121 # Move ? 122 $move = false; 123 if ( isset($_POST['w']) && is_array($_POST['w']) ) { 124 foreach ($_POST['w'] as $nsid => $nsw) { 125 foreach ($nsw as $i => $v) { 126 if (!empty($v['down'])) { 127 $oldorder = $_POST['w'][$nsid][$i]['order']; 128 $neworder = $oldorder + 1; 129 if( isset($_POST['w'][$nsid][$neworder]) ) { 130 $_POST['w'][$nsid][$i]['order'] = $neworder; 131 $_POST['w'][$nsid][$neworder]['order'] = $oldorder; 132 $move = true; 133 } 134 } 135 if (!empty($v['up'])) { 136 $oldorder = $_POST['w'][$nsid][$i]['order']; 137 $neworder = $oldorder - 1; 138 if( isset($_POST['w'][$nsid][$neworder]) ) { 139 $_POST['w'][$nsid][$i]['order'] = $neworder; 140 $_POST['w'][$nsid][$neworder]['order'] = $oldorder; 141 $move = true; 142 } 143 } 144 } 145 } 146 } 147 97 148 # Update sidebars 98 if (!empty($_POST['wup']) )149 if (!empty($_POST['wup']) || $removing || $move ) 99 150 { 100 151 if (!isset($_POST['w']) || !is_array($_POST['w'])) { … … 104 155 try 105 156 { 157 106 158 # Removing mark as _rem widgets 107 159 foreach ($_POST['w'] as $nsid => $nsw) { … … 198 250 '<form id="listWidgets" action="'.$p_url.'" method="post" class="widgets">'. 199 251 '<h3>'.__('Available widgets').'</h3>'. 200 '<p>'.__(' Move widgets from this list to one of the sidebars.').'</p>'.252 '<p>'.__('Drag widgets from this list to one of the sidebars, for add.').'</p>'. 201 253 '<ul id="widgets-ref">'; 202 254 … … 208 260 ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</p>'. 209 261 '<p class="manual-move remove-if-drag"><label class="classic">'.__('Append to:').'</label> '. 210 form::combo(array('addw['.$w->id().']'),$append_combo).'</p>'. 262 form::combo(array('addw['.$w->id().']'),$append_combo). 263 '<input type="submit" name="append['.$w->id().']" value="'.__('Add').'" /></p>'. 211 264 '<div class="widgetSettings hidden-if-drag">'.$w->formSettings('w[void][0]',$j).'</div>'. 212 265 '</li>'; … … 323 376 } 324 377 325 $res .= '<p class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget.').'</p>';326 327 378 $res .= '<ul id="'.$id.'" class="connected">'; 379 380 $res .= '<li class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget for now.').'</li>'; 328 381 329 382 $i = 0; 330 383 foreach ($widgets->elements() as $w) 331 384 { 385 $upDisabled = $i == 0 ? '" disabled="" src="images/disabled_' : '" src="images/'; 386 $downDisabled = $i == count($widgets->elements())-1 ? '" disabled="" src="images/disabled_' : '" src="images/'; 387 332 388 $iname = 'w['.$pr.']['.$i.']'; 333 389 334 390 $res .= 335 391 '<li>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())). 336 '<p class="widget-name">'.form::field(array($iname.'[order]'),2,3,(string) $i,'hidden-if-drag','',0,'title="'.__('order').'"').' '.$w->name(). 337 ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</p>'. 338 '<p class="removeWidget remove-if-drag"><label class="classic">'. 339 form::checkbox(array($iname.'[_rem]'),'1',0).' '.__('Remove widget'). 340 '</label></p>'. 392 '<p class="widget-name">'.form::field(array($iname.'[order]'),2,3,(string) $i,'hidden','',0,'title="'.__('order').'"'). 393 ' '.$w->name(). 394 ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : ''). 395 '<span class="toolsWidget remove-if-drag">'. 396 '<input type="image" class="upWidget'.$upDisabled.'up.png" name="'.$iname.'[up]" value="'.__('Up the widget').'" />'. 397 '<input type="image" class="downWidget'.$downDisabled.'down.png" name="'.$iname.'[down]" value="'.__('Down the widget').'" />'.' '. 398 '<input type="image" class="removeWidget" src="images/trash.png" name="'.$iname.'[_rem]" value="'.__('Remove widget').'" />'. 399 '</span>'. 400 '<br class="clear"/></p>'. 341 401 '<div class="widgetSettings hidden-if-drag">'.$w->formSettings($iname,$j).'</div>'. 342 402 '</li>'; … … 347 407 348 408 $res .= '</ul>'; 349 350 if ($i > 0) { 351 $res .= '<ul class="sortable-delete"><li class="sortable-delete-placeholder">'. 352 __('Drag widgets here to remove them from this sidebar.').'</li></ul>'; 353 } 409 410 $res .= '<ul class="sortable-delete"'.($i > 0 ? '':' style="display: none;"').'><li class="sortable-delete-placeholder">'. 411 __('Drag widgets here to remove.').'</li></ul>'; 354 412 355 413 return $res; -
plugins/widgets/style.css
r1669 r2401 38 38 margin-bottom: 1em; 39 39 list-style: none; 40 } 41 #dndnav > li.empty-widgets, 42 #dndextra > li.empty-widgets, 43 #dndcustom > li.empty-widgets { 44 border: 0; 40 45 } 41 46 #dndnav > li.ui-sortable-placeholder, … … 97 102 display: none; 98 103 } 99 .removeWidget { 100 padding: 8px 6px; 101 margin: 0; 104 .toolsWidget { 105 float: right; 102 106 } 103 107 .widgetSettings { -
plugins/widgets/widgets.js
r1661 r2401 17 17 order = title.find('input[name*=order]'); 18 18 link = $('<a href="#" alt="expand" class="aexpand"/>').append(title.text()); 19 title.empty().append(order).append(link); 19 tools = title.find('.toolsWidget'); 20 br = title.find('br'); 21 title.empty().append(order).append(link).append(tools).append(br); 20 22 21 23 var img = document.createElement('img'); … … 50 52 }; 51 53 52 $(function() { 54 function reorder(ul) { 55 // réordonne 56 if( ul.attr('id') ) { 57 $list = ul.find('li').not('.empty-widgets'); 58 $list.each(function(i) { 59 $this = $(this); 60 61 // trouve la zone de réception 62 var name = ul.attr('id').split('dnd').join(''); 63 64 // modifie le name en conséquence 65 $this.find('*[name^=w]').each(function(){ 66 tab = $(this).attr('name').split(']['); 67 tab[0] = "w["+name; 68 tab[1] = i; 69 $(this).attr('name', tab.join('][')); 70 }); 71 72 // ainsi que le champ d'ordre sans js (au cas ou) 73 $this.find('input[title=ordre]').val(i); 74 75 // active ou désactive les fléches 76 if( i == 0 ) { 77 $this.find('input.upWidget').prop('disabled', true); 78 $this.find('input.upWidget').prop('src', 'images/disabled_up.png' ); 79 } else { 80 $this.find('input.upWidget').removeAttr('disabled'); 81 $this.find('input.upWidget').prop('src', 'images/up.png' ); 82 } 83 if( i == $list.length-1 ) { 84 $this.find('input.downWidget').prop('disabled', true); 85 $this.find('input.downWidget').prop('src', 'images/disabled_down.png' ); 86 } else { 87 $this.find('input.downWidget').removeAttr('disabled'); 88 $this.find('input.downWidget').prop('src', 'images/down.png' ); 89 } 90 91 }); 92 } 93 } 94 95 $(function() { 53 96 // reset 54 97 $('input[name="wreset"]').click(function() { … … 63 106 64 107 // remove 65 $('input[name*=rem]').change(function () { 66 if ($(this).attr("checked")) { 67 $(this).parents('li').remove(); 68 } 108 $('input[name*=rem]').click(function (e) { 109 e.preventDefault(); 110 $(this).parents('li').remove(); 69 111 }); 70 112 113 // move 114 $('input[name*=down]').click(function (e) { 115 e.preventDefault(); 116 $this = $(this); 117 $li = $this.parents('li'); 118 $li.next().after($li); 119 reorder($this.parents('ul.connected')); 120 }); 121 $('input[name*=up]').click(function (e) { 122 e.preventDefault(); 123 $this = $(this); 124 $li = $this.parents('li'); 125 $li.prev().before($li); 126 reorder($this.parents('ul.connected')); 127 }); 71 128 });
Note: See TracChangeset
for help on using the changeset viewer.