From eed0004987179f1dd4e70f9f8e7d7e7c2b805865 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sun, 3 Jan 2010 23:35:09 +0200 Subject: find() fix --- Controller.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Controller.php b/Controller.php index 34f675b..dbe5e06 100644 --- a/Controller.php +++ b/Controller.php @@ -135,6 +135,11 @@ class Controller $result = Db::fetch($sql, $values); + if (empty($result)) { + $this->data = false; + return; + } + for ($i=0; $i < count($result); $i++) { $row = $result[$i]; @@ -341,7 +346,9 @@ class Controller } $type = App::type(); - $template = "../system/views/default.{$type}"; + // @very temporary hack? + $tpl = (App::url(0) == "admin") ? "admin" : "default"; + $template = "../system/views/{$tpl}.{$type}"; $file = "../system/views/{$this->table}/{$view}.{$type}"; if (!is_file($file)) { @@ -398,7 +405,7 @@ class Controller } else { $out = $this->update($data, $where); } - +// App::log($out); return $out; } -- cgit v1.2.3