Table editor fills the new entry form with the default values of the fields
[platal.git] / modules / core.php
index 820fb60..b7def03 100644 (file)
@@ -29,6 +29,7 @@ class CoreModule extends PLModule
             'purge_cache' => $this->make_hook('purge_cache', AUTH_COOKIE, 'admin'),
 
             'valid.html'  => $this->make_hook('valid', AUTH_PUBLIC),
+            'favicon.ico' => $this->make_hook('favicon', AUTH_PUBLIC),
         );
     }
 
@@ -40,16 +41,22 @@ class CoreModule extends PLModule
 
     function handler_403(&$page)
     {
-        header('HTTP/1.0 403 Forbidden');
+        header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
         $page->changeTpl('403.tpl');
-        return PL_OK;
     }
 
     function handler_404(&$page)
     {
-        header('HTTP/1.0 404 Not Found');
+        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
         $page->changeTpl('404.tpl');
-        return PL_OK;
+    }
+
+    function handler_favicon(&$page)
+    {
+        $data = file_get_contents(dirname(__FILE__).'/../htdocs/images/favicon.png');
+        header('Content-Type: image/png');
+        echo $data;
+        exit;
     }
 
     function handler_purge_cache(&$page)
@@ -59,7 +66,7 @@ class CoreModule extends PLModule
         $page->clear_compiled_tpl();
         wiki_clear_all_cache();
 
-        redirect(empty($_SERVER['HTTP_REFERER']) ? './' : $_SERVER['HTTP_REFERER']);
+        http_redirect(empty($_SERVER['HTTP_REFERER']) ? './' : $_SERVER['HTTP_REFERER']);
     }
 }