Example #1
0
 protected function _actionRender(Library\CommandContext $context)
 {
     if ($context->request->getFormat() == 'html') {
         return Library\ControllerView::_actionRender($context);
     }
     return parent::_actionRender($context);
 }
Example #2
0
 protected function _actionRender(Library\CommandContext $context)
 {
     $model = $this->getModel();
     if ($model->getState()->isUnique()) {
         $file = $this->getModel()->getRow();
         if (!file_exists($file->fullpath)) {
             throw new Library\ControllerExceptionNotFound(\JText::_('File not found'));
         }
         //Set the data in the response
         $context->response->attachTransport('chunked')->setPath('file://' . $file->fullpath, $file->mimetype);
     } else {
         parent::_actionRender($context);
     }
 }
Example #3
0
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('behaviors' => array('thumbnailable')));
     parent::_initialize($config);
 }