Changeset 3382
- Timestamp:
- 04/09/15 20:31:04 (9 years ago)
- Location:
- plugins/widgetExternalSearch
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/widgetExternalSearch/_define.php
r2376 r3382 26 26 /* Description*/ 'External search in a widget', 27 27 /* 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 ) 30 37 ); 31 ?> -
plugins/widgetExternalSearch/_prepend.php
r1608 r3382 22 22 if (!defined('DC_RC_PATH')) {return;} 23 23 24 # inspired by contactMe/_public.php25 24 $core->url->register('externalSearch','externalSearch', 26 25 '^externalSearch$',array('externalSearchDocument','page')); 27 26 28 27 require_once(dirname(__FILE__).'/_widgets.php'); 29 30 ?> -
plugins/widgetExternalSearch/_public.php
r1212 r3382 53 53 } 54 54 } 55 ?> -
plugins/widgetExternalSearch/_widgets.php
r2376 r3382 38 38 { 39 39 $w->create('externalSearchWidget',__('External search engine'), 40 array('externalSearchWidget','show')); 40 array('externalSearchWidget','show'), 41 null, 42 __('External search engine form')); 41 43 42 $w->externalSearchWidget->setting('title', 43 __('Title:').' ('.__('optional').')', 44 __('Search'),'text'); 44 $w->externalSearchWidget->setting('title',__('Title (optional)').' :',__('Search')); 45 45 46 46 $w->externalSearchWidget->setting('engine',__('Search engine:'), … … 51 51 ) 52 52 ); 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'); 56 63 } 57 64 … … 65 72 global $core; 66 73 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')) { 68 79 return; 69 80 } … … 71 82 $url = preg_replace('/^(http([s]*)\:\/\/)/i','', 72 83 $core->blog->url); 73 74 # output75 $header = (strlen($w->title) > 0)76 ? '<h2>'.html::escapeHTML($w->title).'</h2>' : null;77 84 78 85 switch($w->engine) … … 90 97 case 'google' : 91 98 $form = 92 '<form method="get" action="http ://www.google.com/search">'.99 '<form method="get" action="https://www.google.com/search">'. 93 100 '<p><input type="text" size="10" maxlength="255" '. 94 101 'name="q" />'. … … 112 119 break; 113 120 } 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); 116 127 } 117 128 } 118 ?> -
plugins/widgetExternalSearch/locales/fr/main.po
r1212 r3382 26 26 msgstr "Moteur de recherche externe" 27 27 28 #: _widgets.php:46 29 msgid "Title:" 30 msgstr "" 28 msgid "External search engine form" 29 msgstr "Formulaire de recherche externe" 31 30 32 31 #: _widgets.php:46 33 msgid "optional" 34 msgstr "facultatif" 35 36 #: _widgets.php:47 37 msgid "Search" 38 msgstr "" 32 msgid "External search in a widget" 33 msgstr "Recherche externe dans un widget" 39 34 40 35 #: _widgets.php:49 41 36 msgid "Search engine:" 42 37 msgstr "Moteur de recherche :" 43 44 #: _widgets.php:5745 msgid "Home page only"46 msgstr ""47
Note: See TracChangeset
for help on using the changeset viewer.