|
@ -89,10 +89,14 @@ abstract class Search |
|
|
if(empty($app->class)) continue; |
|
|
if(empty($app->class)) continue; |
|
|
if(($provider = Item::isSearchProvider($app->class)) !== false) { |
|
|
if(($provider = Item::isSearchProvider($app->class)) !== false) { |
|
|
$name = Item::nameFromClass($app->class); |
|
|
$name = Item::nameFromClass($app->class); |
|
|
$providers[strtolower($name)] = [ |
|
|
$providers[$app->id] = [ |
|
|
'type' => $provider->type, |
|
|
'type' => $provider->type, |
|
|
'class' => $app->class, |
|
|
'class' => $app->class, |
|
|
'url' => $app->url, |
|
|
'url' => $app->url, |
|
|
|
|
|
'title' => $app->title, |
|
|
|
|
|
'colour' => $app->colour, |
|
|
|
|
|
'icon' => $app->icon, |
|
|
|
|
|
'description' => $app->description |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -130,8 +134,12 @@ abstract class Search |
|
|
$output .= '<select name="provider">'; |
|
|
$output .= '<select name="provider">'; |
|
|
foreach(self::providers() as $key => $searchprovider) { |
|
|
foreach(self::providers() as $key => $searchprovider) { |
|
|
$selected = ($key === $user_search_provider) ? ' selected="selected"' : ''; |
|
|
$selected = ($key === $user_search_provider) ? ' selected="selected"' : ''; |
|
|
|
|
|
if (is_numeric($key)) { |
|
|
|
|
|
$output .= '<option value="'.$key.'"'.$selected.'>'.$searchprovider['title'].'</option>'; |
|
|
|
|
|
} else { |
|
|
$output .= '<option value="'.$key.'"'.$selected.'>'.__('app.options.'.$key).'</option>'; |
|
|
$output .= '<option value="'.$key.'"'.$selected.'>'.__('app.options.'.$key).'</option>'; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
$output .= '</select>'; |
|
|
$output .= '</select>'; |
|
|
$output .= Form::text('q', null, ['class' => 'homesearch', 'autofocus' => 'autofocus', 'placeholder' => __('app.settings.search').'...']); |
|
|
$output .= Form::text('q', null, ['class' => 'homesearch', 'autofocus' => 'autofocus', 'placeholder' => __('app.settings.search').'...']); |
|
|
$output .= '<button type="submit">'.ucwords(__('app.settings.search')).'</button>'; |
|
|
$output .= '<button type="submit">'.ucwords(__('app.settings.search')).'</button>'; |
|
|