From 9fbea67de55199c6e3f9831e3a642e2b5ee819a3 Mon Sep 17 00:00:00 2001 From: "fligtar%gmail.com" Date: Thu, 17 Aug 2006 03:59:41 +0000 Subject: [PATCH] more add-on mcv stuff git-svn-id: svn://10.0.0.236/trunk@207692 18797224-902f-48f8-a5cc-f745e15eee43 --- .../remora/app/controllers/addons_controller.php | 13 ++++++++++++- mozilla/webtools/remora/app/models/addon.php | 5 +++++ .../remora/app/views/addons/add_step1.thtml | 5 +++++ .../remora/app/views/addons/add_step2.thtml | 5 +++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 mozilla/webtools/remora/app/views/addons/add_step1.thtml create mode 100644 mozilla/webtools/remora/app/views/addons/add_step2.thtml diff --git a/mozilla/webtools/remora/app/controllers/addons_controller.php b/mozilla/webtools/remora/app/controllers/addons_controller.php index d8b1b56f31d..5da62290f6a 100644 --- a/mozilla/webtools/remora/app/controllers/addons_controller.php +++ b/mozilla/webtools/remora/app/controllers/addons_controller.php @@ -18,7 +18,18 @@ class AddonsController extends AppController * @param int $id */ function add($id = 0) { - + if (isset($this->data['Addon']['add_step1'])) { + $this->render('add_step2'); + } + elseif (isset($this->data['Addon']['add_step2'])) { + $this->render('add_step3'); + } + elseif (isset($this->data['Addon']['add_step3'])) { + $this->render('add_step4'); + } + else { + $this->render('add_step1'); + } } /** diff --git a/mozilla/webtools/remora/app/models/addon.php b/mozilla/webtools/remora/app/models/addon.php index 3fce5d1b9dc..780c2f23cc2 100644 --- a/mozilla/webtools/remora/app/models/addon.php +++ b/mozilla/webtools/remora/app/models/addon.php @@ -68,5 +68,10 @@ class Addon extends AppModel ) ); + var $validate = array( + 'guid' => VALID_NOT_EMPTY, + 'name' => VALID_NOT_EMPTY, + 'description' => VALID_NOT_EMPTY, + ); } ?> diff --git a/mozilla/webtools/remora/app/views/addons/add_step1.thtml b/mozilla/webtools/remora/app/views/addons/add_step1.thtml new file mode 100644 index 00000000000..9d94ec02013 --- /dev/null +++ b/mozilla/webtools/remora/app/views/addons/add_step1.thtml @@ -0,0 +1,5 @@ +formTag('/addons/add/')?> +hidden('Addon/add_step1')?> +file('Addon/file')?> +tagErrorMsg('Addon/file', 'Please upload your add-on file.')?> +submit()?> diff --git a/mozilla/webtools/remora/app/views/addons/add_step2.thtml b/mozilla/webtools/remora/app/views/addons/add_step2.thtml new file mode 100644 index 00000000000..212ab43bcf5 --- /dev/null +++ b/mozilla/webtools/remora/app/views/addons/add_step2.thtml @@ -0,0 +1,5 @@ +formTag('/addons/add/')?> +hidden('Addon/add_step2')?> +input('Addon/Name')?> +tagErrorMsg('Addon/Name', 'Please upload your add-on file.')?> +submit()?>