X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fsearchaction.php;h=34fe9373f43832cc793a59484a62f7f007b05620;hb=65ef1cb72a7d93dc2d031e0d9766ed1fb5c27edc;hp=70e63146a61ee793e0acc6cf585541a955a2fac4;hpb=69183c445d8305ad74db72cca3ced01323973cc5;p=quix0rs-gnu-social.git diff --git a/lib/searchaction.php b/lib/searchaction.php index 70e63146a6..34fe9373f4 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -12,7 +12,7 @@ * @link http://laconi.ca/ * * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. + * Copyright (C) 2008, 2009, Control Yourself, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -51,7 +51,7 @@ class SearchAction extends Action * * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } @@ -79,10 +79,11 @@ class SearchAction extends Action function showTop($arr=null) { + $error = null; if ($arr) { $error = $arr[1]; } - if ($error) { + if (!empty($error)) { $this->element('p', 'error', $error); } else { $instr = $this->getInstructions(); @@ -109,26 +110,54 @@ class SearchAction extends Action function showForm($error=null) { - global $config; - $q = $this->trimmed('q'); $page = $this->trimmed('page', 1); $this->elementStart('form', array('method' => 'get', - 'id' => 'login', + 'id' => 'form_search', + 'class' => 'form_settings', 'action' => common_local_url($this->trimmed('action')))); - $this->elementStart('p'); - if (!isset($config['site']['fancy']) || !$config['site']['fancy']) { + $this->elementStart('fieldset'); + $this->element('legend', null, _('Search site')); + $this->elementStart('ul', 'form_data'); + $this->elementStart('li'); + if (!common_config('site', 'fancy')) { $this->hidden('action', $this->trimmed('action')); } - $this->input('q', '', $q); - $this->text(' '); + $this->input('q', 'Keyword(s)', $q); $this->submit('search', 'Search'); - - $this->elementEnd('p'); + $this->elementEnd('li'); + $this->elementEnd('ul'); + $this->elementEnd('fieldset'); $this->elementEnd('form'); if ($q) { $this->showResults($q, $page); } } + + function searchSuggestions($q) { + $qe = urlencode($q); + $message = sprintf(_(<<elementStart('dl', array('id' => 'help_search', 'class' => 'help')); + $this->element('dt', null, _('Search help')); + $this->elementStart('dd', 'instructions'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('dd'); + $this->elementEnd('div'); + } }