aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/class/Controllerhome.php3
-rw-r--r--app/class/Controllerpage.php1
-rw-r--r--app/class/Modelhome.php3
-rw-r--r--app/class/Page.php2
-rw-r--r--app/view/templates/home.php2
5 files changed, 8 insertions, 3 deletions
diff --git a/app/class/Controllerhome.php b/app/class/Controllerhome.php
index 71f110e..907bef7 100644
--- a/app/class/Controllerhome.php
+++ b/app/class/Controllerhome.php
@@ -74,8 +74,9 @@ class Controllerhome extends Controllerpage
public function deepsearch() : array
{
if (!isset($_GET['search'])) {
- $searchopt = ['title' => 1, 'description' => 1, 'content' => 1, 'other' => 0, 'casesensitive' => 0];
+ $searchopt = ['id' => 1, 'title' => 1, 'description' => 1, 'content' => 1, 'other' => 0, 'casesensitive' => 0];
} else {
+ $searchopt['id'] = $_GET['id'] ?? 0;
$searchopt['title'] = $_GET['title'] ?? 0;
$searchopt['description'] = $_GET['description'] ?? 0;
$searchopt['content'] = $_GET['content'] ?? 0;
diff --git a/app/class/Controllerpage.php b/app/class/Controllerpage.php
index 881f1d3..c6983af 100644
--- a/app/class/Controllerpage.php
+++ b/app/class/Controllerpage.php
@@ -221,7 +221,6 @@ class Controllerpage extends Controller
if ($this->user->iseditor() && !$this->importpage()) {
$this->page->reset();
$this->page->addauthor($this->user->id());
- $this->page->setbody(Config::defaultbody());
$this->pagemanager->add($this->page);
$this->routedirect('pageedit', ['page' => $this->page->id()]);
} else {
diff --git a/app/class/Modelhome.php b/app/class/Modelhome.php
index 949c4f7..8d7a38b 100644
--- a/app/class/Modelhome.php
+++ b/app/class/Modelhome.php
@@ -142,6 +142,9 @@ class Modelhome extends Modelpage
$count += preg_match($regex, $page->css());
$count += preg_match($regex, $page->javascript());
}
+ if ($options['id']) {
+ $count += preg_match($regex, $page->id());
+ }
if ($options['title']) {
$count += preg_match($regex, $page->title());
}
diff --git a/app/class/Page.php b/app/class/Page.php
index cf73e98..d936671 100644
--- a/app/class/Page.php
+++ b/app/class/Page.php
@@ -78,7 +78,7 @@ class Page extends Dbitem
$this->setdaterender($now);
$this->setcss('');
$this->setjavascript('');
- $this->setbody('');
+ $this->setbody(Config::defaultbody());
$this->setheader('');
$this->setmain('');
$this->setnav('');
diff --git a/app/view/templates/home.php b/app/view/templates/home.php
index 6c3ad62..75e466e 100644
--- a/app/view/templates/home.php
+++ b/app/view/templates/home.php
@@ -67,6 +67,8 @@
<div id="deepsearchbar" class="hidephone">
<form action="<?= $this->url('home') ?>" method="get">
<input type="text" name="search" value="<?= $deepsearch ?>" id="deepsearch" placeholder="deep search">
+ <input type="checkbox" name="id" id="deepid" value="1" <?= $searchopt['id'] ? 'checked' : '' ?>>
+ <label for="deepid">id</label>
<input type="checkbox" name="title" id="deeptitle" value="1" <?= $searchopt['title'] ? 'checked' : '' ?>>
<label for="deeptitle">title</label>
<input type="checkbox" name="description" id="deepdescription" value="1" <?= $searchopt['description'] ? 'checked' : '' ?>>