/** * Show terms and conditions. This method returns the terms and conditons * from the terms and conditions template * * @return string html */ public function showtermsAction() { $model = new RM_Templates(); $template = $model->find('TermsConditions')->current(); $iso = RM_Environment::getInstance()->getLocale(); $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">'; $html .= '<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; $html .= '<style type="text/css">body {background-color: #FFFFFF;}</style></head><body>'; $html .= $template->{$iso}; $html .= '</body></html>'; echo $html; die; }
/** * This method save new content to the requested template * * @param request id template ID * @param request content html template content * @return json data in format * success => bool true or false * error => text if success will be false here will be error message translated with the current locale */ function updateJsonAction() { $templateID = $this->_getParam('id'); if ($templateID == null) { return array('data' => array('success' => false, 'error' => RM_Environment::getInstance()->getTranslation(RM_Environment::TRANSLATE_ERRORS)->_('Admin.Config.Templates', 'TemplateIsNotSpecified'))); } $templateModel = new RM_Templates(); $template = $templateModel->find($templateID)->current(); if ($template == null) { return array('data' => array('success' => false, 'error' => RM_Environment::getInstance()->getTranslation(RM_Environment::TRANSLATE_ERRORS)->_('Admin.Config.Templates', 'NoTemplate') . $templateID)); } $content = $this->_getParam('content'); if ($content == null) { return array('data' => array('success' => false, 'error' => RM_Environment::getInstance()->getTranslation(RM_Environment::TRANSLATE_ERRORS)->_('Admin.Config.Templates', 'ContentIsNotSpecified'))); } $iso = $this->_getParam('language', RM_Environment::getInstance()->getLocale()); if (isset($template->{$iso}) == false) { return array('data' => array('success' => false, 'error' => RM_Environment::getInstance()->getTranslation(RM_Environment::TRANSLATE_ERRORS)->_('Admin.Config.Templates', 'NoLocaleInTemplate') . $iso)); } $template->{$iso} = $content; $template->save(); return array('data' => array('success' => true)); }
function notcompleteAction() { $model = new RM_Templates(); $template = $model->find('ReservationFailed')->current(); if ($template !== null) { $iso = RM_Environment::getInstance()->getLocale(); $this->view->template = $template->{$iso}; } else { $this->view->template = ''; } // fire the not completed event $manager = RM_Reservation_Manager::getInstance(); RM_Notifications_Manager::getInstance()->fire('ReservationCompleteUnsuccessful', $manager); }