Example #1
0
 public function preDispatch()
 {
     parent::preDispatch();
     // Disable session creation.
     \DF\Session::disable();
     // Disable rendering.
     $this->doNotRender();
     // Allow AJAX retrieval.
     $this->response->setHeader('Access-Control-Allow-Origin', '*');
     // Fix the base URL prefixed with '//'.
     \DF\Url::forceSchemePrefix(true);
     $this->_time_start = microtime(true);
     // Set all API calls to be public cache-controlled by default.
     $this->setCachePrivacy('public');
     $this->setCacheLifetime(30);
 }
Example #2
0
 public function tuneinAction()
 {
     $this->forceInsecure();
     // Disable session creation.
     \DF\Session::disable();
     // Switch to maintenance theme.
     $this->view->setTemplateAfter('maintenance');
     $this->view->embed_mode = $this->getParam('embed', 'false') == 'true';
     $this->view->skin = $this->getParam('skin');
     $autoplay = $this->getParam('autoplay');
     if ($this->hasParam('autoplay')) {
         $autoplay = $autoplay === 'true' || $autoplay === '1';
     } else {
         $autoplay = false;
     }
     $this->view->autoplay = $autoplay;
     $this->view->standalone = true;
     $this->_initStations();
 }