Пример #1
0
 /**
  * Before any action is taken do some basic setup
  * Look for out of bounds file uploads
  * Crate a navigation instance
  * Create the default layout varialbes so the layout doesn't have to guess if they are available
  * @return null
  */
 protected function beforeAction()
 {
     parent::beforeAction();
     /*
      When the php post_max_size attribute is exceed the POST array is blanked.
      So a check has to be done using the CONTENT_LENGTH superglobal against the post_max_size value on every request
     */
     if (!empty($_SERVER['CONTENT_LENGTH'])) {
         $max = \Foundation\Utility::convertIniShorthandValue(\ini_get('post_max_size'));
         if ($_SERVER['CONTENT_LENGTH'] > $max) {
             $this->addMessage('error', 'Your input has exceeded the maximum allowed size.  If you are trying to upload a file it is too large.  Please reduce your file size and try again');
         }
     }
     //add jquery
     $this->addScript('//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js');
     $this->addScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js');
     $this->addScript($this->path('resource/foundation/scripts/jquery.json.js'));
     $this->addScript($this->path('resource/foundation/scripts/jquery.cookie.js'));
     $this->addScript($this->path('resource/foundation/scripts/jquery.qtip.js'));
     $this->addScript($this->path('resource/foundation/scripts/anytime.js'));
     $this->addCss($this->path('resource/foundation/styles/jquery.qtip.css'));
     //add the Services javascript class
     $this->addScript($this->path('resource/scripts/classes/Services.class.js'));
     if ($this->_config->getBroadcastMessage()) {
         $this->addMessage('info', $this->_config->getBroadcastMessage());
     }
 }