[art-web] Initialise the template variables in the correct place



commit 90ad82199c8abf7b82cd2ea9757407dbed8e8ff9
Author: Thomas Wood <thos gnome org>
Date:   Tue Nov 3 23:51:43 2009 +0000

    Initialise the template variables in the correct place
    
    Template variables need to be initialised in the controller, before the
    view is run.

 controllers/backgrounds.php |    4 ++++
 controllers/themes.php      |    4 ++++
 views/backgrounds.php       |    4 ----
 views/themes.php            |    4 ----
 4 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/controllers/backgrounds.php b/controllers/backgrounds.php
index a6aba3c..b008752 100644
--- a/controllers/backgrounds.php
+++ b/controllers/backgrounds.php
@@ -23,6 +23,10 @@ require ("common.inc.php");
 /* load model */
 require ("models/backgrounds.php");
 
+/* initialise some variables */
+$search_text = '';
+$total_backgrounds = 0;
+
 $bg = new BackgroundsModel();
 
 preg_match ('/^\/backgrounds\/(abstract|gnome|nature|other|search)\/?([0-9]+)?$/', $_SERVER['PHP_SELF'], $params);
diff --git a/controllers/themes.php b/controllers/themes.php
index 4cff0d1..998941f 100644
--- a/controllers/themes.php
+++ b/controllers/themes.php
@@ -23,6 +23,10 @@ require ("common.inc.php");
 /* load model */
 require ("models/themes.php");
 
+/* initialise some vairables */
+$search_text = '';
+$total_themes = 0;
+
 $themes = new ThemesModel();
 
 preg_match ('/^\/themes\/(gtk2|metacity|icon|gdm_greeter|splash_screens|gtk_engines|search)\/?([0-9]+)?$/',
diff --git a/views/backgrounds.php b/views/backgrounds.php
index 1a58f83..c8d0191 100644
--- a/views/backgrounds.php
+++ b/views/backgrounds.php
@@ -17,10 +17,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* initialise some variables */
-$search_text = '';
-$total_backgrounds = 0;
-
 require ("lib/pagination.php");
 require ("lib/template.php");
 
diff --git a/views/themes.php b/views/themes.php
index 03b1a0b..685ba21 100644
--- a/views/themes.php
+++ b/views/themes.php
@@ -17,10 +17,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* initialise some vairables */
-$search_text = '';
-$total_themes = 0;
-
 require ("lib/pagination.php");
 require ("lib/template.php");
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]