From 100572c23d79d2648ef4ac0560007866e5625c65 Mon Sep 17 00:00:00 2001
From: bd54
Date: Mon, 30 Aug 2010 11:49:18 +0200
Subject: Extension for client configuration (structure) added
---
application/Bootstrap.php | 1 +
application/controllers/ConfigController.php | 47 +++++++++++++++++
application/controllers/IndexController.php | 57 ++++++++++++---------
application/forms/Login.php | 38 ++++++++++++++
application/models/Config.php | 8 +++
application/views/scripts/config/addclient.phtml | 1 +
.../views/scripts/config/deleteclient.phtml | 1 +
application/views/scripts/config/editclient.phtml | 1 +
application/views/scripts/config/index.phtml | 1 +
application/views/scripts/index/config.phtml | 1 +
data/db/pbs | Bin 0 -> 14336 bytes
pbs | 0
public/index.php | 2 +-
public/js/config.js | 12 +++++
.../controllers/ConfigControllerTest.php | 20 ++++++++
15 files changed, 164 insertions(+), 26 deletions(-)
create mode 100644 application/controllers/ConfigController.php
create mode 100644 application/forms/Login.php
create mode 100644 application/models/Config.php
create mode 100644 application/views/scripts/config/addclient.phtml
create mode 100644 application/views/scripts/config/deleteclient.phtml
create mode 100644 application/views/scripts/config/editclient.phtml
create mode 100644 application/views/scripts/config/index.phtml
create mode 100644 application/views/scripts/index/config.phtml
create mode 100644 data/db/pbs
create mode 100644 pbs
create mode 100644 public/js/config.js
create mode 100644 tests/application/controllers/ConfigControllerTest.php
diff --git a/application/Bootstrap.php b/application/Bootstrap.php
index 35400b1..088bd84 100644
--- a/application/Bootstrap.php
+++ b/application/Bootstrap.php
@@ -4,6 +4,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initAutoload()
{
+
$moduleLoader = new Zend_Application_Module_Autoloader(
array(
'namespace' => '',
diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php
new file mode 100644
index 0000000..0c8a825
--- /dev/null
+++ b/application/controllers/ConfigController.php
@@ -0,0 +1,47 @@
+getRequest();
+ if ($request->isPost()) {
+ if ($form->isValid($request->getPost())) {
+ // do something here to log in
+ }
+ }
+ $this->view->form = $form;
+ }
+
+ public function addclientAction()
+ {
+ // action body
+ }
+
+ public function editclientAction()
+ {
+ // action body
+ }
+
+ public function deleteclientAction()
+ {
+ // action body
+ }
+
+
+}
+
+
+
+
+
+
+
diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php
index def0377..018ebe6 100644
--- a/application/controllers/IndexController.php
+++ b/application/controllers/IndexController.php
@@ -6,57 +6,62 @@ class IndexController extends Zend_Controller_Action
public function init()
{
$burl = $this->view->baseUrl();
- $v = $this->view;
-
- $v->headLink()
- ->prependStylesheet($burl .'/styles/site.css')
- ->appendStylesheet($burl.'/styles/smoothness/jquery-ui-1.7.2.custom.css');
- $v->headScript()
- ->setFile($burl.'/js/jquery-1.3.2.min.js')
- ->appendFile($burl.'/js/jquery-ui-1.7.2.custom.min.js')
- ->appendFile($burl.'/js/pbs.js');
-
- $v->menubar = array(
- "Home" => "/",
- "Bootmedia" => "/index/bootmedia",
- "Menus" => "/index/menu",
- "Menu Assignment" => "/index/menuassignment"#,
-# "Systeminfo" => "/index/sysinfo"
- );
+ $v = $this->view;
+
+ $v->headLink()
+ ->prependStylesheet($burl .'/styles/site.css')
+ ->appendStylesheet($burl.'/styles/smoothness/jquery-ui-1.7.2.custom.css');
+ $v->headScript()
+ ->setFile($burl.'/js/jquery-1.3.2.min.js')
+ ->appendFile($burl.'/js/jquery-ui-1.7.2.custom.min.js')
+ ->appendFile($burl.'/js/pbs.js')
+ ->appendFile($burl.'/js/config.js');
+
+ $v->menubar = array(
+ "Home" => "/",
+ "Bootmedia" => "/index/bootmedia",
+ "Menus" => "/index/menu",
+ "Menu Assignment" => "/index/menuassignment",
+ "Configuration" => "/index/configuration"
+ #,
+ # "Systeminfo" => "/index/sysinfo"
+ );
}
public function indexAction()
{
$this->view->title = "Home";
- $this->view->headTitle($this->view->title, 'APPEND');
+ $this->view->headTitle($this->view->title, 'APPEND');
}
public function menuAction()
{
$this->view->title = "Menus";
- $this->view->headTitle($this->view->title, 'APPEND');
-
+ $this->view->headTitle($this->view->title, 'APPEND');
}
public function bootmediaAction()
{
$this->view->title = "Bootmedia";
- $this->view->headTitle($this->view->title, 'APPEND');
-
+ $this->view->headTitle($this->view->title, 'APPEND');
}
public function menuassignmentAction()
{
$this->view->title = "Menu Assignment";
- $this->view->headTitle($this->view->title, 'APPEND');
-
+ $this->view->headTitle($this->view->title, 'APPEND');
}
public function sysinfoAction()
{
$this->view->title = "System Information";
- $this->view->headTitle($this->view->title, 'APPEND');
+ $this->view->headTitle($this->view->title, 'APPEND');
+ }
+ public function configAction()
+ {
+ $this->view->title = "Client Configuration";
+ $this->view->headTitle($this->view->title, 'APPEND');
}
@@ -64,3 +69,5 @@ class IndexController extends Zend_Controller_Action
+
+
diff --git a/application/forms/Login.php b/application/forms/Login.php
new file mode 100644
index 0000000..170b100
--- /dev/null
+++ b/application/forms/Login.php
@@ -0,0 +1,38 @@
+setName("Login");
+ $this->setMethod('post');
+
+ $this->addElement('text', 'username', array(
+ 'filters' => array('StringTrim', 'StringToLower'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => true,
+ 'label' => 'Username:',
+ ));
+
+ $this->addElement('password', 'password', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => true,
+ 'label' => 'Password:',
+ ));
+
+ $this->addElement('submit', 'login', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Login',
+ ));
+ }
+
+
+}
+
diff --git a/application/models/Config.php b/application/models/Config.php
new file mode 100644
index 0000000..5750d71
--- /dev/null
+++ b/application/models/Config.php
@@ -0,0 +1,8 @@
+