31if (!defined(
'NOCSRFCHECK')) {
32 define(
'NOCSRFCHECK', 1);
34if (!defined(
'NOTOKENRENEWAL')) {
35 define(
'NOTOKENRENEWAL', 1);
38if (!defined(
'NOREQUIREMENU')) {
39 define(
'NOREQUIREMENU', 1);
43require_once
'../main.inc.php';
54 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
57$langs->loadLangs(array(
"main",
"other"));
59$action =
GETPOST(
'action',
'aZ09');
69if ($action ==
'redirect') {
70 global $dolibarr_main_url_root;
78 $tmpurlrootwithouthttp = preg_replace(
'/^http(s?):\/\//i',
'', DOL_MAIN_URL_ROOT);
82 $url = preg_replace(
'/'.preg_quote($dolibarr_main_url_root,
'/').
'/',
'', $url);
83 $url = preg_replace(
'/'.preg_quote(DOL_MAIN_URL_ROOT,
'/').
'/',
'', $url);
84 $url = preg_replace(
'/'.preg_quote($tmpurlrootwithouthttp,
'/').
'/',
'', $url);
85 $urlrelativeforredirect = (DOL_URL_ROOT.(preg_match(
'/\//', $url) ?
'' :
'/').$url);
89 dol_syslog(
"Ask search form to redirect on URL: ".$urlrelativeforredirect);
90 header(
"Location: ".$urlrelativeforredirect);
100if (empty($dolibarr_nocache) &&
GETPOSTINT(
'cache')) {
101 header(
'Cache-Control: max-age='.
GETPOSTINT(
'cache').
', public');
103 header(
'Expires: '.gmdate(
'D, d M Y H:i:s',
dol_now(
'gmt') +
GETPOSTINT(
'cache')).
' GMT');
105 header(
'Pragma: token=public');
108 header(
'Cache-Control: no-cache');
111$title = $langs->trans(
"Search");
114$head =
'<!-- Quick access -->'.
"\n";
116$arrayofcss = array();
117top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
126$hookmanager->initHooks(array(
'searchform'));
131if (
$conf->use_javascript_ajax && 1 == 2) {
132 if (!is_object($form)) {
133 $form =
new Form($db);
136 $searchform .=
'<br><br>'.$form->selectArrayAjax(
'searchselectcombo', DOL_URL_ROOT.
'/core/ajax/selectsearchbox.php', $selected,
'',
'', 0, 1,
'minwidth300', 1, $langs->trans(
"Search"), 0);
139 $showtitlebefore =
GETPOSTINT(
'showtitlebefore');
140 $arrayresult = array();
141 include DOL_DOCUMENT_ROOT.
'/core/ajax/selectsearchbox.php';
144 $accesskeyalreadyassigned = array();
145 foreach ($arrayresult as $key => $val) {
146 $tmp = explode(
'?', $val[
'url']);
147 $urlaction = $tmp[0];
148 $keysearch =
'search_all';
151 if (empty($accesskeyalreadyassigned[$val[
'label'][0]])) {
152 $accesskey = $val[
'label'][0];
153 $accesskeyalreadyassigned[$accesskey] = $accesskey;
157 $searchform .=
printSearchForm($urlaction, $urlaction, $val[
'label'],
'minwidth200', $keysearch, $accesskey, $key, $val[
'img'], $showtitlebefore, ($i > 0 ? 0 : 1));
165$parameters = array(
'searchform'=>$searchform);
166$reshook = $hookmanager->executeHooks(
'printSearchForm', $parameters);
167if (empty($reshook)) {
168 $searchform .= $hookmanager->resPrint;
170 $searchform = $hookmanager->resPrint;
173$searchform .=
'<br>';
177if (
$conf->dol_use_jmobile) {
179 $ret .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" class="searchform nowraponall tagtr">';
180 $ret .=
'<input type="hidden" name="token" value="'.newToken().
'">';
181 $ret .=
'<input type="hidden" name="savelogin" value="'.dol_escape_htmltag($user->login).
'">';
182 $ret .=
'<input type="hidden" name="action" value="redirect">';
183 $ret .=
'<div class="tagtd">';
184 $ret .=
img_picto(
'',
'url',
'', 0, 0, 0,
'',
'paddingright width20');
185 $ret .=
'<input type="text" class="flat minwidth200"';
186 $ret .=
' style="background-repeat: no-repeat; background-position: 3px;"';
187 $ret .=
' placeholder="'.strip_tags($langs->trans(
"OrPasteAnURL")).
'"';
188 $ret .=
' name="url" id="url" />';
189 $ret .=
'<button type="submit" class="button bordertransp" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">';
190 $ret .=
'<span class="fa fa-search"></span>';
201print
"<!-- Begin SearchForm -->\n";
202print
'<div class="center"><div class="center" style="padding: 30px;">';
203print
'<style>.menu_titre { padding-top: 7px; }</style>';
204print
'<div id="blockvmenusearch" class="tagtable center searchpage">'.
"\n";
208print
"\n<!-- End SearchForm -->\n";
212print
'</body></html>'.
"\n";
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_now($mode='auto')
Return date for now.
dol_sanitizeUrl($stringtoclean, $type=1)
Clean a string to use it as an URL (into a href or src attribute)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey='', $prefhtmlinputname='', $img='', $showtitlebefore=0, $autofocus=0)
Show a search area.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...