aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mekanisti.fi>2010-01-03 23:35:09 +0200
committerFilipp Lepalaan <filipp@mekanisti.fi>2010-01-03 23:35:09 +0200
commiteed0004987179f1dd4e70f9f8e7d7e7c2b805865 (patch)
tree927a1f5674ab92081bd4c8dfa7c12df294827113
parent9fa1d072fd90f5c5a2132837e62f4a9dab6a06c2 (diff)
downloadmain-eed0004987179f1dd4e70f9f8e7d7e7c2b805865.tar.gz
main-eed0004987179f1dd4e70f9f8e7d7e7c2b805865.tar.bz2
main-eed0004987179f1dd4e70f9f8e7d7e7c2b805865.zip
find() fix
-rw-r--r--Controller.php11
1 files 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;
}