Exemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     $this->options = array('date' => array('dateFormat' => 'dd-MM-yyyy', 'description' => 'dd-mm-yyyy', 'size' => 10, 'jQueryParams' => array('buttonImage' => 'datepicker.png', 'changeMonth' => true, 'changeYear' => true, 'duration' => 'fast', 'showOn' => 'button')));
     MUtil_Model_Bridge_FormBridge::setFixedOptions($this->options);
     parent::setUpBeforeClass();
 }
 protected function setUp()
 {
     parent::setup();
     // Now set some defaults
     $dateFormOptions['dateFormat'] = 'dd-MM-yyyy';
     $datetimeFormOptions['dateFormat'] = 'dd-MM-yyyy HH:mm';
     $timeFormOptions['dateFormat'] = 'HH:mm';
     MUtil_Model_Bridge_FormBridge::setFixedOptions(array('date' => $dateFormOptions, 'datetime' => $datetimeFormOptions, 'time' => $timeFormOptions));
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     // \Zend_Application: loads the autoloader
     require_once 'Zend/Application.php';
     // Create application, bootstrap, and run
     $application = new \Zend_Application(APPLICATION_ENV, GEMS_ROOT_DIR . '/configs/application.example.ini');
     $this->bootstrap = $application;
     include_once GEMS_TEST_DIR . '/library/Gems/Cookies.php';
     // Dirty fix for cookie problem during tests
     parent::setUp();
     $this->bootstrap->bootstrap('db');
     $this->bootstrap->getBootstrap()->getContainer()->db = $this->db;
     $this->bootstrap->bootstrap();
     \Zend_Registry::set('db', $this->db);
     \Zend_Db_Table::setDefaultAdapter($this->db);
     $this->loader = $this->bootstrap->getBootstrap()->getResource('loader');
     $this->tracker = $this->loader->getTracker();
     // Now set some defaults
     $dateFormOptions['dateFormat'] = 'dd-MM-yyyy';
     $datetimeFormOptions['dateFormat'] = 'dd-MM-yyyy HH:mm';
     $timeFormOptions['dateFormat'] = 'HH:mm';
     \MUtil_Model_Bridge_FormBridge::setFixedOptions(array('date' => $dateFormOptions, 'datetime' => $datetimeFormOptions, 'time' => $timeFormOptions));
 }
 /**
  * Hook 9: During action controller initialization.
  *
  * This hook is called in the constructor of the controller. Nothing is done and
  * $controller->init has not been called, so this is a good moment to change settings
  * that should influence $controller->init().
  *
  * Previous hook: preDispatch()
  * Actions since: $dispatcher->dispatch(); $controller->__construct()
  * Actions after: $controller->init(); ob_start(); $controller->dispatch()
  * Next hook: controllerBeforeAction()
  *
  * @param \Zend_Controller_Action $actionController
  * @return void
  */
 public function controllerInit(\Zend_Controller_Action $actionController = null)
 {
     $this->_copyVariables($actionController ? $actionController : $this->controllerAfterAction);
     $this->prepareController();
     $imgUrl = $this->getUtil()->getImageUri('datepicker.png');
     $jstUrl = $this->basepath->getBasePath() . '/gems/js';
     // Now set some defaults
     $dateFormOptions['dateFormat'] = 'dd-MM-yyyy';
     $dateFormOptions['description'] = $this->_('dd-mm-yyyy');
     $dateFormOptions['size'] = 10;
     if ($this->useBootstrap == true) {
         // Do not use a buttonImage, since we will use bootstrap add-on
         $basicOptions = array();
     } else {
         $basicOptions = array('buttonImage' => $imgUrl, 'showOn' => 'button');
     }
     $dateFormOptions['jQueryParams'] = $basicOptions + array('changeMonth' => true, 'changeYear' => true, 'duration' => 'fast');
     $datetimeFormOptions['dateFormat'] = 'dd-MM-yyyy HH:mm';
     $datetimeFormOptions['description'] = $this->_('dd-mm-yyyy hh:mm');
     $datetimeFormOptions['size'] = 16;
     $datetimeFormOptions['jQueryParams'] = $basicOptions + array('changeMonth' => true, 'changeYear' => true, 'duration' => 'fast', 'stepMinute' => 5, 'size' => 8, 'timeJsUrl' => $jstUrl);
     $timeFormOptions['dateFormat'] = 'HH:mm';
     $timeFormOptions['description'] = $this->_('hh:mm');
     $timeFormOptions['jQueryParams'] = $basicOptions + array('duration' => 'fast', 'stepMinute' => 5, 'size' => 8, 'timeJsUrl' => $jstUrl);
     \MUtil_Model_Bridge_FormBridge::setFixedOptions(array('date' => $dateFormOptions, 'datetime' => $datetimeFormOptions, 'time' => $timeFormOptions));
 }