Dotclear


Ignore:
Timestamp:
11/02/12 22:48:36 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add description to widget, fixes #990

Location:
plugins/widgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/_default_widgets.php

    r945 r954  
    1818$__widgets = new dcWidgets; 
    1919 
    20 $__widgets->create('search',__('Search engine'),array('defaultWidgets','search')); 
     20$__widgets->create('search',__('Search engine'),array('defaultWidgets','search'),null,'Search engine form'); 
    2121$__widgets->search->setting('title',__('Title:'),__('Search')); 
    2222$__widgets->search->setting('homeonly',__('Display on:'),0,'combo', 
     
    2424$__widgets->search->setting('class',__('CSS class:'),''); 
    2525 
    26 $__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation')); 
     26$__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation'),null,'List of navigation links'); 
    2727$__widgets->navigation->setting('title',__('Title:'),''); 
    2828$__widgets->navigation->setting('homeonly',__('Display on:'),0,'combo', 
     
    3030$__widgets->navigation->setting('class',__('CSS class:'),''); 
    3131 
    32 $__widgets->create('bestof',__('Selected entries'),array('defaultWidgets','bestof')); 
     32$__widgets->create('bestof',__('Selected entries'),array('defaultWidgets','bestof'),null,'List of selected entries'); 
    3333$__widgets->bestof->setting('title',__('Title:'),__('Best of me')); 
    3434$__widgets->bestof->setting('orderby',__('Sort:'),'asc','combo',array(__('Ascending') => 'asc', __('Descending') => 'desc')); 
     
    3737$__widgets->bestof->setting('class',__('CSS class:'),''); 
    3838 
    39 $__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs')); 
     39$__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs'),null,'List of available languages'); 
    4040$__widgets->langs->setting('title',__('Title:'),__('Languages')); 
    4141$__widgets->langs->setting('homeonly',__('Display on:'),1,'combo', 
     
    4343$__widgets->langs->setting('class',__('CSS class:'),''); 
    4444 
    45 $__widgets->create('categories',__('Categories list'),array('defaultWidgets','categories')); 
     45$__widgets->create('categories',__('Categories list'),array('defaultWidgets','categories'),null,'List of categories'); 
    4646$__widgets->categories->setting('title',__('Title:'),__('Categories')); 
    4747$__widgets->categories->setting('postcount',__('With entries counts'),0,'check'); 
     
    5050$__widgets->categories->setting('class',__('CSS class:'),''); 
    5151 
    52 $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe')); 
     52$__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,'RSS or Atom feed subscription links'); 
    5353$__widgets->subscribe->setting('title',__('Title:'),__('Subscribe')); 
    5454$__widgets->subscribe->setting('type',__('Feeds type:'),'atom','combo',array('Atom' => 'atom', 'RSS' => 'rss2')); 
     
    5757$__widgets->subscribe->setting('class',__('CSS class:'),''); 
    5858 
    59 $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed')); 
     59$__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'Last entries from feed'); 
    6060$__widgets->feed->setting('title',__('Title:'),__('Somewhere else')); 
    6161$__widgets->feed->setting('url',__('Feed URL:'),''); 
     
    6565$__widgets->feed->setting('class',__('CSS class:'),''); 
    6666 
    67 $__widgets->create('text',__('Text'),array('defaultWidgets','text')); 
     67$__widgets->create('text',__('Text'),array('defaultWidgets','text'),null,'Simple text'); 
    6868$__widgets->text->setting('title',__('Title:'),''); 
    6969$__widgets->text->setting('text',__('Text:'),'','textarea'); 
     
    7272$__widgets->text->setting('class',__('CSS class:'),''); 
    7373 
    74 $__widgets->create('lastposts',__('Last entries'),array('defaultWidgets','lastposts')); 
     74$__widgets->create('lastposts',__('Last entries'),array('defaultWidgets','lastposts'),null,'List of last entries published'); 
    7575$__widgets->lastposts->setting('title',__('Title:'),__('Last entries')); 
    7676$rs = $core->blog->getCategories(array('post_type'=>'post')); 
     
    8989$__widgets->lastposts->setting('class',__('CSS class:'),''); 
    9090 
    91 $__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments')); 
     91$__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments'),null,'List of last comments posted'); 
    9292$__widgets->lastcomments->setting('title',__('Title:'),__('Last comments')); 
    9393$__widgets->lastcomments->setting('limit',__('Comments limit:'),10); 
  • plugins/widgets/class.widgets.php

    r270 r954  
    3636     } 
    3737      
    38      public function create($id,$name,$callback,$append_callback=null) 
    39      { 
    40           $this->__widgets[$id] = new dcWidget($id,$name,$callback); 
     38     public function create($id,$name,$callback,$append_callback=null,$desc='') 
     39     { 
     40          $this->__widgets[$id] = new dcWidget($id,$name,$callback,$desc); 
    4141          $this->__widgets[$id]->append_callback = $append_callback; 
    4242     } 
     
    135135     private $id; 
    136136     private $name; 
     137     private $desc; 
    137138     private $public_callback = null; 
    138139     public $append_callback = null; 
     
    148149     } 
    149150      
    150      public function __construct($id,$name,$callback) 
     151     public function __construct($id,$name,$callback,$desc='') 
    151152     { 
    152153          $this->public_callback = $callback; 
    153154          $this->id = $id; 
    154155          $this->name = $name; 
     156          $this->desc = $desc; 
    155157     } 
    156158      
     
    163165     { 
    164166          return $this->name; 
     167     } 
     168 
     169     public function desc() 
     170     { 
     171          return $this->desc; 
    165172     } 
    166173      
  • plugins/widgets/index.php

    r904 r954  
    201201     '<div>'.form::hidden(array('w[void][0][id]'),html::escapeHTML($w->id())). 
    202202     '<p class="widget-name">'.form::field(array('w[void][0][order]'),2,3,0,'hideControl').' '. 
    203      $w->name().'</p>'. 
     203     $w->name().($w->desc() != '' ? ' <span class="form-note">('.__($w->desc()).')</span>' : '').'</p>'. 
    204204     '<p class="js-remove"><label class="classic">'.__('Append to:').' '. 
    205205     form::combo(array('addw['.$w->id().']'),$append_combo).'</label></p>'. 
     
    267267     $widget_elements->content .= 
    268268     '<dt><strong>'.html::escapeHTML($w->name()).'</strong> ('. 
    269      __('Widget ID:').' <strong>'.html::escapeHTML($w->id()).'</strong>)</dt>'. 
     269     __('Widget ID:').' <strong>'.html::escapeHTML($w->id()).'</strong>)'. 
     270     ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</dt>'. 
    270271     '<dd>'; 
    271272      
     
    330331          '<div>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())). 
    331332          '<p class="widget-name">'.form::field(array($iname.'[order]'),2,3,(string) $i,'js-hide','',0,'title="'.__('order').'"').' '. 
    332           $w->name().'</p>'. 
     333          $w->name().($w->desc() != '' ? ' <span class="form-note">('.__($w->desc()).')</span>' : '').'</p>'. 
    333334          '<p class="removeWidget js-remove"><label class="classic">'. 
    334335          form::checkbox(array($iname.'[_rem]'),'1',0).' '.__('Remove widget'). 
Note: See TracChangeset for help on using the changeset viewer.

Sites map