Example #1
0
 /**
  * Class constructor
  *
  * @param One_Controller $controller
  * @param array $options
  */
 public function __construct(One_Controller_Interface $controller, $options = array())
 {
     parent::__construct($controller, $options);
     $view = $this->getVariable('view', 'detail');
     $this->view = new One_View($this->scheme, $view);
     $this->id = $this->getVariable('id');
 }
Example #2
0
 /**
  * Class constructor
  *
  * @param One_Controller $controller
  * @param array $options
  */
 public function __construct(One_Controller $controller, $options = array())
 {
     parent::__construct($controller, $options);
     $view = '' != trim($this->getVariable('view', 'search')) ? trim($this->getVariable('view', 'search')) : 'search';
     $this->searchform = '' != trim($this->getVariable('formfile', 'search')) ? trim($this->getVariable('formfile', 'search')) : 'search';
     $this->view = new One_View($this->scheme, $view);
 }
Example #3
0
 /**
  * Class constructor
  *
  * @param One_Controller $controller
  * @param array $options
  */
 public function __construct(One_Controller $controller, $options = array())
 {
     parent::__construct($controller, $options);
     $this->id = $this->getVariable('id');
     if (!is_array($this->id)) {
         $this->id = array($this->id);
     }
 }
Example #4
0
 /**
  * Class constructor
  *
  * @param One_Controller_Interface $parent The parent action
  * @param array $options Additional options
  */
 public function __construct(One_Controller $controller, $options = array())
 {
     parent::__construct($controller, $options);
     $this->id = $this->getVariable('id', null);
     if ($this->id === null) {
         $id = $this->scheme->getIdentityAttribute();
         $id = $id->getName();
         $this->id = $this->getVariable($id, null);
     }
 }
Example #5
0
 /**
  * Class constructor
  *
  * @param One_Controller $controller
  * @param array $options
  */
 public function __construct(One_Controller $controller, $options = array())
 {
     parent::__construct($controller, $options);
     $view = $this->getVariable('view', 'edit');
     //    echo 'Looking for view ', $view, ' in scheme ', $this->scheme->getName();
     $this->view = new One_View($this->scheme, $view);
     $this->id = $this->getVariable('id', null);
     if ($this->id === null) {
         $id = $this->scheme->getIdentityAttribute();
         $id = $id->getName();
         $this->id = $this->getVariable($id, null);
     }
 }
Example #6
0
 /**
  * Class constructor
  *
  * @param One_Controller $controller
  * @param array $options
  */
 public function __construct(One_Controller $controller, $options = array())
 {
     set_include_path(get_include_path() . PATH_SEPARATOR . One_Vendor::getInstance()->getFilePath() . '/zend');
     if (!class_exists('Zend_Locale', false)) {
         require_once 'Zend/Locale.php';
     }
     parent::__construct($controller, $options);
     $this->scheme = $options['scheme'];
     $scheme = One_Repository::getScheme($this->scheme);
     $calendarOptions = $scheme->get('behaviorOptions.calendar');
     $date = $calendarOptions['date'];
     $enddate = $calendarOptions['enddate'];
     $time = $calendarOptions['time'];
     $title = $calendarOptions['title'];
     $this->dateAttribute = $this->getVariable('dateAttribute', $date ? $date : 'date');
     $this->enddateAttribute = $this->getVariable('enddateAttribute', $enddate ? $enddate : NULL);
     $this->timeAttribute = !is_null($time) ? $this->getVariable('timeAttribute', $time ? $time : 'time') : NULL;
     $this->titleAttribute = $this->getVariable('titleAttribute', $title ? $title : 'title');
     // determine currently requested date
     $day = trim($this->getVariable('day', ''));
     $month = trim($this->getVariable('month', ''));
     $year = trim($this->getVariable('year', ''));
     if (isset($calendarOptions['startdate']) && $day == '' && $month == '' && $year == '') {
         if (preg_match('/([0-9]{4}).([0-9]{1,2}).([0-9]{1,2})/', $calendarOptions['startdate'], $matches) > 0 && checkdate($matches[2], $matches[3], $matches[1]) && mktime(0, 0, 0, $matches[2], $matches[3], $matches[1]) > time()) {
             $day = $matches[3];
             $month = $matches[2];
             $year = $matches[1];
         } else {
             $day = date('d');
             $month = date('m');
             $year = date('Y');
         }
     } else {
         if ($day != '' || $month != '' || $year != '') {
             $day = $this->getVariable('day', date('d'));
             $month = $this->getVariable('month', date('m'));
             $year = $this->getVariable('year', date('Y'));
         } else {
             $day = date('d');
             $month = date('m');
             $year = date('Y');
         }
     }
     $this->day = $day;
     $this->month = $month;
     $this->year = $year;
 }
Example #7
0
 /**
  * Class constructor
  *
  * @param One_Controller $controller
  * @param array $options
  */
 public function __construct(One_Controller $controller, array $options = array())
 {
     parent::__construct($controller, $options);
     $this->scheme = $this->getVariable('scheme');
 }
Example #8
0
 /**
  * Class constructor
  *
  * @param One_Controller $controller
  * @param array $options
  */
 public function __construct(One_Controller $controller, $options = array())
 {
     parent::__construct($controller, $options);
     $view = $this->getVariable('view', 'rss');
     $this->view = new One_View($this->scheme, $view);
 }
Example #9
0
 /**
  * Class constructor
  *
  * @param One_Controller $controller
  * @param array $options
  */
 public function __construct(One_Controller $controller, $options = array())
 {
     parent::__construct($controller, $options);
     $this->view = new One_View($this->scheme, 'jgrid');
 }