mirror of
https://github.com/YGGverse/Yo.git
synced 2026-04-02 10:45:29 +00:00
make extended search mode disabled by default #7
This commit is contained in:
parent
f0da3caaf5
commit
4cec81c893
3 changed files with 18 additions and 10 deletions
|
|
@ -38,6 +38,10 @@
|
||||||
"regex":"/.*/ui"
|
"regex":"/.*/ui"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"extended":
|
||||||
|
{
|
||||||
|
"enabled":false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -302,10 +302,12 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp)
|
||||||
<form name="search" method="GET" action="search.php">
|
<form name="search" method="GET" action="search.php">
|
||||||
<h1><a href="./"><?php echo _('Yo!') ?></a></h1>
|
<h1><a href="./"><?php echo _('Yo!') ?></a></h1>
|
||||||
<input type="text" name="q" placeholder="<?php echo $placeholder ?>" value="" />
|
<input type="text" name="q" placeholder="<?php echo $placeholder ?>" value="" />
|
||||||
|
<?php if ($config->webui->search->extended->enabled) { ?>
|
||||||
<label for="e">
|
<label for="e">
|
||||||
<input type="checkbox" name="e" id="e" value="true" />
|
<input type="checkbox" name="e" id="e" value="true" />
|
||||||
<?php echo _('Extended') ?>
|
<?php echo _('Extended') ?>
|
||||||
</label>
|
</label>
|
||||||
|
<?php } ?>
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
<sub>
|
<sub>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" class="bi bi-search" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" class="bi bi-search" viewBox="0 0 16 16">
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ switch (true)
|
||||||
|
|
||||||
// Allow raw requests on extended syntax mode requested
|
// Allow raw requests on extended syntax mode requested
|
||||||
// http://sphinxsearch.com/docs/current/extended-syntax.html
|
// http://sphinxsearch.com/docs/current/extended-syntax.html
|
||||||
if (isset($_GET['e']))
|
if (isset($_GET['e']) && $config->webui->search->extended->enabled)
|
||||||
{
|
{
|
||||||
$query = $index->search($q);
|
$query = $index->search($q);
|
||||||
}
|
}
|
||||||
|
|
@ -322,10 +322,12 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
|
||||||
<form name="search" method="GET" action="search.php">
|
<form name="search" method="GET" action="search.php">
|
||||||
<h1><a href="./"><?php echo _('Yo!') ?></a></h1>
|
<h1><a href="./"><?php echo _('Yo!') ?></a></h1>
|
||||||
<input type="text" name="q" placeholder="<?php echo $placeholder ?>" value="<?php echo htmlentities($q) ?>" />
|
<input type="text" name="q" placeholder="<?php echo $placeholder ?>" value="<?php echo htmlentities($q) ?>" />
|
||||||
|
<?php if ($config->webui->search->extended->enabled) { ?>
|
||||||
<label for="e">
|
<label for="e">
|
||||||
<input type="checkbox" name="e" id="e" value="true" <?php echo isset($_GET['e']) ? 'checked="checked"': false ?>/>
|
<input type="checkbox" name="e" id="e" value="true" <?php echo isset($_GET['e']) ? 'checked="checked"': false ?>/>
|
||||||
<?php echo _('Extended') ?>
|
<?php echo _('Extended') ?>
|
||||||
</label>
|
</label>
|
||||||
|
<?php } ?>
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
<sub>
|
<sub>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" class="bi bi-search" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" class="bi bi-search" viewBox="0 0 16 16">
|
||||||
|
|
@ -336,7 +338,7 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
|
||||||
</form>
|
</form>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<?php if (isset($_GET['e'])) { ?>
|
<?php if (isset($_GET['e']) && $config->webui->search->extended->enabled) { ?>
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
<?php echo _('Extended syntax enabled, follow') ?>
|
<?php echo _('Extended syntax enabled, follow') ?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue