/** * Main setup routine for displaying the form/detail view * * @param string $tpl template * * @return void */ public function display($tpl = null) { if (parent::display($tpl) !== false) { $this->setCanonicalLink(); $this->output(); if (!$this->app->isAdmin()) { $this->state = $this->get('State'); $model = $this->getModel(); $this->params = $this->state->get('params'); $row = $model->getData(); $w = new FabrikWorker(); if ($this->params->get('menu-meta_description')) { $desc = $w->parseMessageForPlaceHolder($this->params->get('menu-meta_description'), $row); $this->doc->setDescription($desc); } if ($this->params->get('menu-meta_keywords')) { $keywords = $w->parseMessageForPlaceHolder($this->params->get('menu-meta_keywords'), $row); $this->doc->setMetadata('keywords', $keywords); } if ($this->params->get('robots')) { $this->doc->setMetadata('robots', $this->params->get('robots')); } } } }
/** * Main setup routine for displaying the form/detail view * * @param string $tpl template * * @return void */ public function display($tpl = null) { if (parent::display($tpl) !== false) { $this->output(); if (!$this->app->isAdmin()) { $this->state = $this->get('State'); $model = $this->getModel(); $this->params = $this->state->get('params'); $row = $model->getData(); $w = new FabrikWorker(); if ($this->params->get('menu-meta_description')) { $desc = $w->parseMessageForPlaceHolder($this->params->get('menu-meta_description'), $row); $this->doc->setDescription($desc); } if ($this->params->get('menu-meta_keywords')) { $keywords = $w->parseMessageForPlaceHolder($this->params->get('menu-meta_keywords'), $row); $this->doc->setMetadata('keywords', $keywords); } if ($this->params->get('robots')) { $this->doc->setMetadata('robots', $this->params->get('robots')); } // Set the response to indicate a file download $this->app->setHeader('Content-Type', 'application/vnd.ms-word'); $name = $this->getModel()->getTable()->label; $name = JStringNormalise::toDashSeparated($name); $this->app->setHeader('Content-Disposition', "attachment;filename=\"" . $name . ".doc\""); $this->doc->setMimeEncoding('text/html; charset=Windows-1252', false); } } }
/** * (non-PHPdoc) * @see FabrikViewFormBase::setTitle() */ protected function setTitle($w, &$params, $model) { parent::setTitle($w, $params, $model); //set the download file name based on the document title $document = JFactory::getDocument(); $document->setName($document->getTitle() . '-' . $model->getRowId()); }
/** * Set the page title * * @param object $w parent worker * @param object &$params parameters * * @return void */ protected function setTitle($w, &$params) { parent::setTitle($w, $params); $model = $this->getModel(); // Set the download file name based on the document title /** @var JDocumentpdf $document */ $document = $this->doc; $document->setName($document->getTitle() . '-' . $model->getRowId()); }
/** * Set the page title * * @param object $w parent worker * @param object &$params parameters * * @return void */ protected function setTitle($w, &$params) { parent::setTitle($w, $params); $model = $this->getModel(); // Set the download file name based on the document title $layout = FabrikHelperHTML::getLayout('form.fabrik-pdf-title'); $displayData = new stdClass(); $displayData->doc = $this->doc; $displayData->model = $this->getModel(); $this->doc->setName($layout->render($displayData)); }
/** * Constructor * * @param array $config A named configuration array for object construction. * */ public function __construct($config = array()) { parent::__construct($config); $this->oaiModel = JModelLegacy::getInstance('Oai', 'FabrikFEModel'); }