15 public $mObject =
null;
17 public function getDefaultView(&$controller, &$xoopsUser)
19 $id = xoops_getrequest(
'tpl_id');
21 $handler =& xoops_getmodulehandler(
'tplfile');
22 $this->mObject =& $handler->get($id);
24 return null != $this->mObject ? LEGACYRENDER_FRAME_VIEW_SUCCESS : LEGACYRENDER_FRAME_VIEW_ERROR;
27 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
29 $this->mObject->loadSource();
30 if (
null == $this->mObject->Source) {
31 return LEGACYRENDER_FRAME_VIEW_ERROR;
34 $source = $this->mObject->Source->get(
'tpl_source');
36 header(
'Cache-Control: no-cache, must-revalidate');
37 header(
'Pragma: no-cache');
38 header(
'Content-Type: application/force-download');
40 if (preg_match(
'/MSIE 5.5/', $_SERVER[
'HTTP_USER_AGENT'])) {
41 header(
'Content-Disposition: filename=' . $this->mObject->getShow(
'tpl_file'));
43 header(
'Content-Disposition: attachment; filename=' . $this->mObject->getShow(
'tpl_file'));
46 header(
'Content-length: ' . strlen($source));
52 public function executeViewError(&$controller, &$xoopsUser, &$render)
54 $controller->executeRedirect(
'./index.php?action=TplsetList', 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);