Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * 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);
 }
Example #4
0
 private function _getTemplates()
 {
     $templateModel = new RM_Templates();
     $templates = $templateModel->fetchAll();
     $templateList = array();
     foreach ($templates as $template) {
         $row = new stdClass();
         $row->text = $this->_translate->_('Admin.Templates', $template->id);
         $row->id = 'Templates_EditJson_' . $template->id;
         $row->leaf = true;
         $row->iconCls = "RM_config_templates_leaf_icon";
         $templateList[] = $row;
     }
     return $templateList;
 }
Example #5
0
 /**
  * Add language to the system, laguage files need to be in there places on language folder
  *
  * @param string $iso
  */
 public function installLanguage($iso, $name)
 {
     $model = new RM_Languages();
     $language = array('iso' => $iso, 'name' => $name, 'icon' => $this->getIconPath($iso));
     $model->insert($language);
     //Here is a list of multilingual code models
     $model = new RM_UnitTypes();
     $model->addLanguage($iso);
     $unitModel = new RM_UnitLanguageDetails();
     $unitModel->addLanguage($iso);
     $templatesModel = new RM_Templates();
     $templatesModel->addLanguage($iso);
     $manager = new RM_Module_Manager();
     $manager->addLanguage($iso);
     $pluginManager = new RM_Plugin_Manager();
     $pluginManager->addLanguage($iso);
 }