/** * 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); } } }
/** * Main setup routine for displaying the form/detail view * * @param string $tpl template * * @return void */ public function display($tpl = null) { if (!JFolder::exists(COM_FABRIK_BASE . '/libraries/dompdf')) { throw new RuntimeException('Please install the dompdf library', 404); return; } if (parent::display($tpl) !== false) { $document = JFactory::getDocument(); $model = $this->getModel(); $params = $model->getParams(); $size = $params->get('pdf_size', 'A4'); $orientation = $params->get('pdf_orientation', 'portrait'); $document->setPaper($size, $orientation); $this->output(); } }
/** * display the template * * @param sting $tpl */ function display($tpl = null) { if (parent::display($tpl) !== false) { $this->output(); } }