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 @@ +
View script for controller Config and script/action name addclient
\ No newline at end of file diff --git a/application/views/scripts/config/deleteclient.phtml b/application/views/scripts/config/deleteclient.phtml new file mode 100644 index 0000000..3a8b1a9 --- /dev/null +++ b/application/views/scripts/config/deleteclient.phtml @@ -0,0 +1 @@ +

View script for controller Config and script/action name deleteclient
\ No newline at end of file diff --git a/application/views/scripts/config/editclient.phtml b/application/views/scripts/config/editclient.phtml new file mode 100644 index 0000000..14a7690 --- /dev/null +++ b/application/views/scripts/config/editclient.phtml @@ -0,0 +1 @@ +

View script for controller Config and script/action name editclient
\ No newline at end of file diff --git a/application/views/scripts/config/index.phtml b/application/views/scripts/config/index.phtml new file mode 100644 index 0000000..4d9a1fb --- /dev/null +++ b/application/views/scripts/config/index.phtml @@ -0,0 +1 @@ +

View script for controller Config and script/action name index
\ No newline at end of file diff --git a/application/views/scripts/index/config.phtml b/application/views/scripts/index/config.phtml new file mode 100644 index 0000000..dd77c9c --- /dev/null +++ b/application/views/scripts/index/config.phtml @@ -0,0 +1 @@ +

View script for controller Index and script/action name config
\ No newline at end of file diff --git a/data/db/pbs b/data/db/pbs new file mode 100644 index 0000000..f771f57 Binary files /dev/null and b/data/db/pbs differ diff --git a/pbs b/pbs new file mode 100644 index 0000000..e69de29 diff --git a/public/index.php b/public/index.php index c8b5cde..5aea4f0 100644 --- a/public/index.php +++ b/public/index.php @@ -11,7 +11,7 @@ defined('APPLICATION_ENV') // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), - '/opt/ZF/library', +// '/opt/ZF/library', get_include_path(), ))); diff --git a/public/js/config.js b/public/js/config.js new file mode 100644 index 0000000..caf1822 --- /dev/null +++ b/public/js/config.js @@ -0,0 +1,12 @@ + +var configCreate = function () { + +}; + +var configEdit = function () { + +}; + +var configDelete = function () { + +}; diff --git a/tests/application/controllers/ConfigControllerTest.php b/tests/application/controllers/ConfigControllerTest.php new file mode 100644 index 0000000..40c5bfe --- /dev/null +++ b/tests/application/controllers/ConfigControllerTest.php @@ -0,0 +1,20 @@ +