From fd19335c6a521beb593ecfb9990d5f449092502e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20Tayyar=20BE=C5=9E=C4=B0K?= Date: Tue, 11 Feb 2014 17:27:59 +0200 Subject: [PATCH 1/3] Update form.php output may sometimes be undefined --- helper/form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helper/form.php b/helper/form.php index abfe9f7..dc119b4 100644 --- a/helper/form.php +++ b/helper/form.php @@ -43,7 +43,8 @@ public function createForm() // Create a form id that can be used for validation $_SESSION['form_id_' . $name] = md5(time() . $name); - + $this->output = isset($this->output)?$this->output:""; + $this->output .= '
output .= 'action="?q=' . $_GET['q'] . '" '; $this->output .= "method =\"POST\">\n"; From d580a143629a9d5b59a035323a2202e5e7f00595 Mon Sep 17 00:00:00 2001 From: hasantayyar Date: Wed, 12 Feb 2014 17:17:46 +0200 Subject: [PATCH 2/3] notifications for actions --- .gitignore | 3 ++- config.php | 4 ++-- core/router.php | 16 ++++++++++++++++ modules/index/controller/index.php | 3 ++- view/page.tpl.php | 19 ++++++++++++++++--- 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8d78e8b..ed8cc8b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ testElastica .htaccess .project -.settings \ No newline at end of file +.settings +config.php diff --git a/config.php b/config.php index e8f9a21..0852b30 100644 --- a/config.php +++ b/config.php @@ -19,6 +19,6 @@ * The users that are allowed in. Format 'username' => 'password' */ $config['users'] = array( - 'user' => 'password' + 'admin' => 'admin' ); -?> \ No newline at end of file +?> diff --git a/core/router.php b/core/router.php index 85b8634..a55def1 100644 --- a/core/router.php +++ b/core/router.php @@ -30,6 +30,22 @@ class Router */ protected static $config = array(); + + + + static function appendMessage($message){ + $_SESSION["messages"] = isset($_SESSION["messages"])?array():$_SESSION["messages"]; + $_SESSION["messages"][] = $message; + } + + static function getMessages(){ + if(isset($_SESSION["messages"])){ + $messages = $_SESSION["messages"]; + unset($_SESSION["messages"]); + return $messages; + } + return FALSE; + } /** * The main routing function. Keeps track * on which controllers and views to run. diff --git a/modules/index/controller/index.php b/modules/index/controller/index.php index c90f831..a9fe1e7 100644 --- a/modules/index/controller/index.php +++ b/modules/index/controller/index.php @@ -15,7 +15,8 @@ class controllerIndex extends router */ public function page_refresh($args) { - self::$query_loader->callWithCheck($args[0] . '/_refresh', 'POST', null, 'index/edit/' . $args[0]); + self::appendMessage("Index refreshed!"); + self::$query_loader->callWithCheck($args[0] . '/_refresh', 'POST', null, 'index/edit/' . $args[0]); } /** diff --git a/view/page.tpl.php b/view/page.tpl.php index 90a69b0..cbe4568 100644 --- a/view/page.tpl.php +++ b/view/page.tpl.php @@ -23,7 +23,7 @@
'); ?>
- > + >
@@ -41,12 +41,25 @@
- +

- + + + + + + +
From 20279846709335b7017c180b653c4ed6aa34aba2 Mon Sep 17 00:00:00 2001 From: hasantayyar Date: Wed, 12 Feb 2014 17:20:13 +0200 Subject: [PATCH 3/3] remove config.php from gitignore (again) --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index ed8cc8b..7a16f6f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ testElastica .htaccess .project .settings -config.php