Dotclear

Changeset 3382


Ignore:
Timestamp:
04/09/15 20:31:04 (9 years ago)
Author:
brol
Message:

0.2 voir changelog

Location:
plugins/widgetExternalSearch
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgetExternalSearch/_define.php

    r2376 r3382  
    2626     /* Description*/         'External search in a widget', 
    2727     /* Author */                  'Moe (http://gniark.net/)', 
    28      /* Version */                 '0.1.1', 
    29      /* Permissions */        'usage,contentadmin' 
     28     /* Version */                 '0.2', 
     29     /* Properties */ 
     30     array( 
     31          'permissions' => 'usage,contentadmin', 
     32          'type' => 'plugin', 
     33          'dc_min' => '2.7', 
     34          'support' => 'http://lab.dotclear.org/wiki/plugin/widgetExternalSearch', 
     35          'details' => 'http://plugins.dotaddict.org/dc2/details/widgetExternalSearch' 
     36          ) 
    3037); 
    31 ?> 
  • plugins/widgetExternalSearch/_prepend.php

    r1608 r3382  
    2222if (!defined('DC_RC_PATH')) {return;} 
    2323 
    24 # inspired by contactMe/_public.php 
    2524$core->url->register('externalSearch','externalSearch', 
    2625     '^externalSearch$',array('externalSearchDocument','page')); 
    2726 
    2827require_once(dirname(__FILE__).'/_widgets.php'); 
    29  
    30 ?> 
  • plugins/widgetExternalSearch/_public.php

    r1212 r3382  
    5353     } 
    5454} 
    55 ?> 
  • plugins/widgetExternalSearch/_widgets.php

    r2376 r3382  
    3838     { 
    3939          $w->create('externalSearchWidget',__('External search engine'), 
    40                array('externalSearchWidget','show')); 
     40               array('externalSearchWidget','show'), 
     41               null, 
     42               __('External search engine form')); 
    4143           
    42           $w->externalSearchWidget->setting('title', 
    43                __('Title:').' ('.__('optional').')', 
    44                __('Search'),'text'); 
     44          $w->externalSearchWidget->setting('title',__('Title (optional)').' :',__('Search')); 
    4545           
    4646          $w->externalSearchWidget->setting('engine',__('Search engine:'), 
     
    5151                    ) 
    5252               ); 
    53            
    54           $w->externalSearchWidget->setting('homeonly',__('Home page only'), 
    55                false,'check'); 
     53          $w->externalSearchWidget->setting('homeonly',__('Display on:'),0,'combo', 
     54               array( 
     55                    __('All pages') => 0, 
     56                    __('Home page only') => 1, 
     57                    __('Except on home page') => 2 
     58                    ) 
     59          ); 
     60    $w->externalSearchWidget->setting('content_only',__('Content only'),0,'check'); 
     61    $w->externalSearchWidget->setting('class',__('CSS class:'),''); 
     62          $w->externalSearchWidget->setting('offline',__('Offline'),0,'check'); 
    5663     } 
    5764      
     
    6572          global $core; 
    6673 
    67           if ($w->homeonly && $core->url->type != 'default') { 
     74          if ($w->offline) 
     75               return; 
     76 
     77          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     78               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    6879               return; 
    6980          } 
     
    7182          $url = preg_replace('/^(http([s]*)\:\/\/)/i','', 
    7283               $core->blog->url); 
    73                                
    74           # output 
    75           $header = (strlen($w->title) > 0) 
    76                ? '<h2>'.html::escapeHTML($w->title).'</h2>' : null; 
    7784           
    7885          switch($w->engine) 
     
    9097               case 'google' : 
    9198                    $form = 
    92                          '<form method="get" action="http://www.google.com/search">'. 
     99                         '<form method="get" action="https://www.google.com/search">'. 
    93100                         '<p><input type="text" size="10" maxlength="255" '. 
    94101                         'name="q" />'. 
     
    112119                    break; 
    113120          } 
    114            
    115           return '<div class="externalSearch">'.$header.$form.'</div>'; 
     121 
     122          $res = 
     123          ($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : ''). 
     124          $form; 
     125 
     126          return $w->renderDiv($w->content_only,'externalSearch '.$w->class,'',$res); 
    116127     } 
    117128} 
    118 ?> 
  • plugins/widgetExternalSearch/locales/fr/main.po

    r1212 r3382  
    2626msgstr "Moteur de recherche externe" 
    2727 
    28 #: _widgets.php:46 
    29 msgid "Title:" 
    30 msgstr "" 
     28msgid "External search engine form" 
     29msgstr "Formulaire de recherche externe" 
    3130 
    3231#: _widgets.php:46 
    33 msgid "optional" 
    34 msgstr "facultatif" 
    35  
    36 #: _widgets.php:47 
    37 msgid "Search" 
    38 msgstr "" 
     32msgid "External search in a widget" 
     33msgstr "Recherche externe dans un widget" 
    3934 
    4035#: _widgets.php:49 
    4136msgid "Search engine:" 
    4237msgstr "Moteur de recherche&nbsp;:" 
    43  
    44 #: _widgets.php:57 
    45 msgid "Home page only" 
    46 msgstr "" 
    47  
Note: See TracChangeset for help on using the changeset viewer.

Sites map