Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class BlackoutController extends Zend_Controller_Action {
- function __call($name, $var) {
- $this->_redirect('/', array('exit' => 1));
- }
- function init() {
- }
- function preDispatch() {
- $auth = Zend_Auth::getInstance();
- if (!$auth->hasIdentity()) {
- $this->_redirect('auth/login');
- }
- }
- function indexAction() {
- $this->_redirect($this->_request->getBaseUrl());
- }
- function editAction() {
- Zend_Dojo::enableView($this->view);
- $this->view->dojo()
- ->addStyleSheetModule('dijit.themes.tundra')
- ->setDjConfigOption('usePlainJson', true)
- ->enable();
- $auth = Zend_Auth::getInstance();
- $user = $auth->getStorage()->read($data);
- $acl = Zend_Registry::get('acl');
- if (!($acl->isAllowed($user->role, 'district', 'edit'))) {
- $this->_redirect($this->_request->getBaseUrl());
- }
- $db = Zend_Registry::get('db');
- $this->view->title = "Edit Blackout Dates";
- // quarter start selector
- $this->view->quarterform = $this->formQuarter();
- // blackout entries
- }
- function formQuarter() {
- $form = new Zend_Dojo_Form(array('name' => 'quarter_dates'));
- $form->setAction('/blackout/edit')->setMethod('post');
- $q1 = new Zend_Dojo_Form_Element_DateTextBox('q1');
- $q1->setLabel('q1');
- $q2 = new Zend_Dojo_Form_Element_DateTextBox('q2');
- $q2->setLabel('q2');
- $q3 = new Zend_Dojo_Form_Element_DateTextBox('q3');
- $q3->setLabel('q3');
- $q4 = new Zend_Dojo_Form_Element_DateTextBox('q4');
- $q4->setLabel('q4');
- $form->addElements(array($q1, $q2, $q3, $q4));
- $form->addElement('submit', 'process', array('label' => 'process'));
- return $form;
- }
- }
Add Comment
Please, Sign In to add comment