Changes in [2406:325f49056c79:2320:89c91e538879]
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
locales/en/main.po
r2404 r2285 223 223 msgstr "" 224 224 225 msgid "Title (optional)"226 msgstr ""227 228 225 msgid "Title, Date" 229 226 msgstr "" -
locales/fr/help/index.html
r2406 r2298 13 13 </div> 14 14 15 <p>Sur chaque page de l'administration, vous retrouverez les mêmes volet enhaut, 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 bandeau 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 voleten haut de chaque page est composé de trois éléments :</p>18 <p>Le bandeau 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 volethaut, le lien <em>Mon tableau de bord</em> permet de revenir à l'accueil du blog.</p>27 <p>À l'extrême droite du bandeau 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, voletd'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, bandeau 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
r2406 r2311 229 229 msgstr "Titre" 230 230 231 msgid "Title (optional)"232 msgstr "Titre (optionnel)"233 234 231 msgid "Title, Date" 235 232 msgstr "Titre, date" … … 3748 3745 3749 3746 #~ msgid "List of last entries published" 3750 #~ msgstr " Liste des derniers billets publiés"3751 3752 #~ msgid "List of last comments p ublished"3753 #~ msgstr " Liste des derniers commentaires publiés"3747 #~ msgstr "Derniers billets publiés" 3748 3749 #~ msgid "List of last comments posted" 3750 #~ msgstr "Derniers commentaires postés" 3754 3751 3755 3752 #~ msgid "List of published pages" -
locales/fr/plugins.po
r2406 r2311 88 88 msgstr "Liste des catégories" 89 89 90 msgid " Feed subscription links (RSS or Atom)"91 msgstr "Liens d e souscription aux flux (RSS ou Atom)"92 93 msgid "L ist of last entries from feed (RSS or Atom)"94 msgstr " Liste des derniers billets d'un flux (RSS or Atom)"90 msgid "RSS or Atom feed subscription links" 91 msgstr "Liens d'abonnements aux flux RSS ou Atom" 92 93 msgid "Last entries from feed" 94 msgstr "Derniers billets d'un flux" 95 95 96 96 msgid "Simple text" … … 98 98 99 99 msgid "List of last entries published" 100 msgstr " Liste des derniers billets publiés"101 102 msgid "List of last comments p ublished"103 msgstr "Liste des derniers commentaires p ubliés"100 msgstr "Derniers billets publiés" 101 102 msgid "List of last comments posted" 103 msgstr "Liste des derniers commentaires postés" 104 104 105 105 msgid "Tags cloud" … … 1889 1889 msgstr "Widgets disponibles" 1890 1890 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."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." 1893 1893 1894 1894 msgid "order" … … 1899 1899 1900 1900 msgid "Add widgets to sidebars" 1901 msgstr "Ajouter les widgets aux volets"1901 msgstr "Ajouter les widgets aux bandeaux" 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 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 voletspour 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 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 bandeaux 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 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."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." 1926 1926 1927 1927 msgid "Reset sidebars to get back to default widgets installation." 1928 msgstr "Réinitialisez les voletspour retrouver les widgets par défaut de votre installation."1928 msgstr "Réinitialisez les bandeaux 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 for now."1973 msgstr "Aucun widget pour le moment."1972 msgid "No widget." 1973 msgstr "Aucun widget." 1974 1974 1975 1975 msgid "Remove widget" 1976 1976 msgstr "Retirer le widget" 1977 1977 1978 msgid "Drag widgets here to remove ."1979 msgstr "Glisser les widgets ici pour les retirer ."1978 msgid "Drag widgets here to remove them from this sidebar." 1979 msgstr "Glisser les widgets ici pour les retirer du volet." 1980 1980 1981 1981 #~ msgid "Antispam" -
plugins/blogroll/_widgets.php
r2397 r1179 20 20 { 21 21 $w->create('links',__('Blogroll'),array('tplBlogroll','linksWidget'),null,'Blogroll list'); 22 $w->links->setting('title',__('Title (optional)').' :',__('Links'));22 $w->links->setting('title',__('Title:'),__('Links')); 23 23 24 24 $br = new dcBlogroll($GLOBALS['core']->blog); … … 41 41 ) 42 42 ); 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:'),'');43 $w->links->setting('content_only',__('Content only'),0,'check'); 44 $w->links->setting('class',__('CSS class:'),''); 45 45 } 46 46 -
plugins/blogroll/locales/fr/help/blogroll.html
r2402 r1971 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 voletsde navigation par21 l'ordre dans lequel s'afficheront les liens sur vos bandeaux 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
r2397 r1179 20 20 { 21 21 $w->create('pages',__('Pages'),array('tplPages','pagesWidget'),null,'List of published pages'); 22 $w->pages->setting('title',__('Title (optional)').' :',__('Pages'));22 $w->pages->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));41 $w->pages-> advanced_setting('class',__('CSS class:'),'');40 $w->pages->setting('content_only',__('Content only'),0,'check'); 41 $w->pages->setting('class',__('CSS class:'),''); 42 42 } 43 43 -
plugins/simpleMenu/_widgets.php
r2397 r1179 19 19 { 20 20 $w->create('simplemenu',__('Simple menu'),array('tplSimpleMenu','simpleMenuWidget'),null,'List of simple menu items'); 21 $w->simplemenu->setting('title',__('Title (optional)').' :',__('Menu'));21 $w->simplemenu->setting('title',__('Title:'),__('Menu')); 22 22 $w->simplemenu->setting('homeonly',__('Display on:'),0,'combo', 23 23 array( … … 27 27 ) 28 28 ); 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:'),'');29 $w->simplemenu->setting('content_only',__('Content only'),0,'check'); 30 $w->simplemenu->setting('class',__('CSS class:'),''); 31 31 } 32 32 } -
plugins/tags/_widgets.php
r2397 r1179 20 20 { 21 21 $w->create('tags',__('Tags'),array('tplTags','tagsWidget'),null,'Tags cloud'); 22 $w->tags->setting('title',__('Title (optional)').' :',__('Tags'));22 $w->tags->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));39 $w->tags-> advanced_setting('class',__('CSS class:'),'');38 $w->tags->setting('content_only',__('Content only'),0,'check'); 39 $w->tags->setting('class',__('CSS class:'),''); 40 40 } 41 41 -
plugins/widgets/_default_widgets.php
r2402 r2198 19 19 20 20 $__widgets->create('search',__('Search engine'),array('defaultWidgets','search'),null,'Search engine form'); 21 $__widgets->search->setting('title',__('Title (optional)').' :',__('Search'));21 $__widgets->search->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));25 $__widgets->search-> advanced_setting('class',__('CSS class:'),'');24 $__widgets->search->setting('content_only',__('Content only'),0,'check'); 25 $__widgets->search->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 (optional)').' :','');28 $__widgets->navigation->setting('title',__('Title:'),''); 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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));32 $__widgets->navigation-> advanced_setting('class',__('CSS class:'),'');31 $__widgets->navigation->setting('content_only',__('Content only'),0,'check'); 32 $__widgets->navigation->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 (optional)').' :',__('Best of me'));35 $__widgets->bestof->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));40 $__widgets->bestof-> advanced_setting('class',__('CSS class:'),'');39 $__widgets->bestof->setting('content_only',__('Content only'),0,'check'); 40 $__widgets->bestof->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 (optional)').' :',__('Languages'));43 $__widgets->langs->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));47 $__widgets->langs-> advanced_setting('class',__('CSS class:'),'');46 $__widgets->langs->setting('content_only',__('Content only'),0,'check'); 47 $__widgets->langs->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 (optional)').' :',__('Categories'));50 $__widgets->categories->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));57 $__widgets->categories-> advanced_setting('class',__('CSS class:'),'');56 $__widgets->categories->setting('content_only',__('Content only'),0,'check'); 57 $__widgets->categories->setting('class',__('CSS class:'),''); 58 58 59 $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,' Feed subscription links (RSS or Atom)');60 $__widgets->subscribe->setting('title',__('Title (optional)').' :',__('Subscribe'));59 $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,'RSS or Atom feed subscription links'); 60 $__widgets->subscribe->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));65 $__widgets->subscribe-> advanced_setting('class',__('CSS class:'),'');64 $__widgets->subscribe->setting('content_only',__('Content only'),0,'check'); 65 $__widgets->subscribe->setting('class',__('CSS class:'),''); 66 66 67 $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'L ist of last entries from feed (RSS or Atom)');68 $__widgets->feed->setting('title',__('Title (optional)').' :',__('Somewhere else'));67 $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'Last entries from feed'); 68 $__widgets->feed->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));74 $__widgets->feed-> advanced_setting('class',__('CSS class:'),'');73 $__widgets->feed->setting('content_only',__('Content only'),0,'check'); 74 $__widgets->feed->setting('class',__('CSS class:'),''); 75 75 76 76 $__widgets->create('text',__('Text'),array('defaultWidgets','text'),null,'Simple text'); 77 $__widgets->text->setting('title',__('Title (optional)').' :','');77 $__widgets->text->setting('title',__('Title:'),''); 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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));82 $__widgets->text-> advanced_setting('class',__('CSS class:'),'');81 $__widgets->text->setting('content_only',__('Content only'),0,'check'); 82 $__widgets->text->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 (optional)').' :',__('Last entries'));85 $__widgets->lastposts->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));100 $__widgets->lastposts-> advanced_setting('class',__('CSS class:'),'');99 $__widgets->lastposts->setting('content_only',__('Content only'),0,'check'); 100 $__widgets->lastposts->setting('class',__('CSS class:'),''); 101 101 102 $__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments'),null,'List of last comments p ublished');103 $__widgets->lastcomments->setting('title',__('Title (optional)').' :',__('Last comments'));102 $__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments'),null,'List of last comments posted'); 103 $__widgets->lastcomments->setting('title',__('Title:'),__('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-> advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0')));108 $__widgets->lastcomments-> advanced_setting('class',__('CSS class:'),'');107 $__widgets->lastcomments->setting('content_only',__('Content only'),0,'check'); 108 $__widgets->lastcomments->setting('class',__('CSS class:'),''); 109 109 110 110 # --BEHAVIOR-- initWidgets -
plugins/widgets/class.widgets.php
r2395 r1474 139 139 public $append_callback = null; 140 140 private $settings = array(); 141 private $advance_id;142 private $advanced_settings = array();143 141 144 142 public function serialize($order) { … … 146 144 foreach ($this->settings as $k=>$v) 147 145 $values[$k]=$v['value']; 148 foreach ($this->advanced_settings as $k=>$v)149 $values[$k]=$v['value'];150 146 $values['id']=$this->id; 151 147 $values['order']=$order; … … 193 189 public function __get($n) 194 190 { 195 $setting = null;196 191 if (isset($this->settings[$n])) { 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; 192 return $this->settings[$n]['value']; 193 } 194 return null; 202 195 } 203 196 … … 206 199 if (isset($this->settings[$n])) { 207 200 $this->settings[$n]['value'] = $v; 208 } else if (isset($this->advanced_settings[$n])) {209 $this->advanced_settings[$n]['value'] = $v;210 201 } 211 202 } … … 231 222 } 232 223 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' => $value246 );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 258 224 public function settings() 259 225 { … … 266 232 foreach ($this->settings as $id => $s) 267 233 { 268 $res .= $this->formSetting($id,$s,$pr,$i=0); 234 $wfid = "wf-".$i; 235 $iname = $pr ? $pr.'['.$id.']' : $id; 236 switch ($s['type']) 237 { 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 } 269 264 $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)278 {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;334 265 } 335 266 -
plugins/widgets/dragdrop.js
r2401 r1766 27 27 handle: ".widget-name", 28 28 placeholder: "ui-sortable-placeholder", 29 items: "li:not(.sortable-delete-placeholder ,.empty-widgets)",29 items: "li:not(.sortable-delete-placeholder)", 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: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 } 45 if( ul.find('li').length == 0 ) 46 field.find('.empty-widgets').show(); 47 else field.find('.empty-widgets').hide(); 52 48 53 49 // remove … … 59 55 60 56 // réordonne 61 reorder(ul); 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 } 62 76 63 77 // expand … … 81 95 } 82 96 }); 83 84 $("li.ui-draggable, ul.ui-sortable li") 85 .not('ul.sortable-delete li, li.empty-widgets') 86 .css({'cursor':'move'}); 97 $("li.ui-draggable, ul.ui-sortable li").css({'cursor':'move'}); 87 98 }); -
plugins/widgets/index.php
r2403 r2256 53 53 } 54 54 } 55 56 # Append 1 widget57 $wid = false;58 if( gettype($_POST['append']) == 'array' && count($_POST['append']) == 1 ) {59 $wid = array_keys($_POST['append']);60 $wid = $wid[0];61 }62 55 63 56 # Append widgets … … 76 69 foreach ($addw as $k => $v) 77 70 { 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 } 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; 91 81 } 92 93 82 } 94 83 … … 106 95 } 107 96 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 148 97 # Update sidebars 149 if (!empty($_POST['wup']) || $removing || $move)98 if (!empty($_POST['wup'])) 150 99 { 151 100 if (!isset($_POST['w']) || !is_array($_POST['w'])) { … … 155 104 try 156 105 { 157 158 106 # Removing mark as _rem widgets 159 107 foreach ($_POST['w'] as $nsid => $nsw) { … … 250 198 '<form id="listWidgets" action="'.$p_url.'" method="post" class="widgets">'. 251 199 '<h3>'.__('Available widgets').'</h3>'. 252 '<p>'.__(' Drag widgets from this list to one of the sidebars, for add.').'</p>'.200 '<p>'.__('Move widgets from this list to one of the sidebars.').'</p>'. 253 201 '<ul id="widgets-ref">'; 254 202 … … 260 208 ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</p>'. 261 209 '<p class="manual-move remove-if-drag"><label class="classic">'.__('Append to:').'</label> '. 262 form::combo(array('addw['.$w->id().']'),$append_combo). 263 '<input type="submit" name="append['.$w->id().']" value="'.__('Add').'" /></p>'. 210 form::combo(array('addw['.$w->id().']'),$append_combo).'</p>'. 264 211 '<div class="widgetSettings hidden-if-drag">'.$w->formSettings('w[void][0]',$j).'</div>'. 265 212 '</li>'; … … 376 323 } 377 324 325 $res .= '<p class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget.').'</p>'; 326 378 327 $res .= '<ul id="'.$id.'" class="connected">'; 379 380 $res .= '<li class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget for now.').'</li>';381 328 382 329 $i = 0; 383 330 foreach ($widgets->elements() as $w) 384 331 { 385 $upDisabled = $i == 0 ? '" disabled="" src="images/disabled_' : '" src="images/';386 $downDisabled = $i == count($widgets->elements())-1 ? '" disabled="" src="images/disabled_' : '" src="images/';387 388 332 $iname = 'w['.$pr.']['.$i.']'; 389 333 390 334 $res .= 391 335 '<li>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())). 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>'. 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>'. 401 341 '<div class="widgetSettings hidden-if-drag">'.$w->formSettings($iname,$j).'</div>'. 402 342 '</li>'; … … 407 347 408 348 $res .= '</ul>'; 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>'; 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 } 412 354 413 355 return $res; -
plugins/widgets/style.css
r2401 r1669 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;45 40 } 46 41 #dndnav > li.ui-sortable-placeholder, … … 102 97 display: none; 103 98 } 104 .toolsWidget { 105 float: right; 99 .removeWidget { 100 padding: 8px 6px; 101 margin: 0; 106 102 } 107 103 .widgetSettings { -
plugins/widgets/widgets.js
r2401 r1661 17 17 order = title.find('input[name*=order]'); 18 18 link = $('<a href="#" alt="expand" class="aexpand"/>').append(title.text()); 19 tools = title.find('.toolsWidget'); 20 br = title.find('br'); 21 title.empty().append(order).append(link).append(tools).append(br); 19 title.empty().append(order).append(link); 22 20 23 21 var img = document.createElement('img'); … … 52 50 }; 53 51 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() { 52 $(function() { 96 53 // reset 97 54 $('input[name="wreset"]').click(function() { … … 106 63 107 64 // remove 108 $('input[name*=rem]').click(function (e) { 109 e.preventDefault(); 110 $(this).parents('li').remove(); 65 $('input[name*=rem]').change(function () { 66 if ($(this).attr("checked")) { 67 $(this).parents('li').remove(); 68 } 111 69 }); 112 70 113 // move114 $('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 });128 71 });
Note: See TracChangeset
for help on using the changeset viewer.