widget: unnamed options as placeholders instead of path
[minimedit.git] / widget / search.php
index 20c89f8625a5f25f7511e5b6057a9a244da7a5ae..fe3b54ee0a9b416f331309c417aff6d79ebfae88 100644 (file)
@@ -1,11 +1,11 @@
 <?php
-$limit = @$Place['limit'] ?: 10;
+$limit = @$Page->place['limit'] ?: 10;
 $path = ' '.escapeshellarg('*.html');
-$query = @$_REQUEST['q'] ?: $Args ?: $Page;
+$query = @$_REQUEST['q'] ?: $Page->place[0] ?? $Page->link;
 
 if (!trim($query, '/')) return;
 
-if (!empty($Place['suggest'])) {
+if (!empty($Page->place['suggest'])) {
        $cmd = "git ls-files -- $path";
        exec($cmd, $ls);
        if (!$ls) {
@@ -28,7 +28,7 @@ else {
        }
 }
 
-if (isset($Place['verbose'])) {
+if (isset($Page->place['verbose'])) {
        printf("<p>%s gevonden voor <q>%s</q>:</p>\n",
                $results ? count($results).' resultaten' : 'Niets',
                htmlspecialchars($query)