当前位置: 首页>>代码示例>>PHP>>正文


PHP RSFormProHelper::showThankYouMessage方法代码示例

本文整理汇总了PHP中RSFormProHelper::showThankYouMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP RSFormProHelper::showThankYouMessage方法的具体用法?PHP RSFormProHelper::showThankYouMessage怎么用?PHP RSFormProHelper::showThankYouMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RSFormProHelper的用法示例。


在下文中一共展示了RSFormProHelper::showThankYouMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayForm

 public static function displayForm($formId, $is_module = false)
 {
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     $db->setQuery("SELECT Published, FormTitle, MetaTitle, MetaDesc, MetaKeywords, ShowThankyou, Access FROM #__rsform_forms WHERE FormId='" . (int) $formId . "'");
     $form = $db->loadObject();
     if (empty($form) || !$form->Published) {
         JError::raiseWarning(500, JText::_('_NOT_EXIST'));
         return;
     }
     // Check form access level
     if (!$is_module && $form->Access != '') {
         $canView = false;
         $menu = $mainframe->getMenu();
         $active = $menu->getActive();
         if ($active) {
             if ($query = $active->query) {
                 if (isset($query['option']) && isset($query['view']) && isset($query['formId'])) {
                     if ($query['option'] == 'com_rsform' && $query['view'] == 'rsform' && $query['formId'] == $formId) {
                         $canView = true;
                     }
                 }
             }
         }
         $rseventspro = $mainframe->input->get('option') == 'com_rseventspro' && $mainframe->input->get('layout') == 'subscribe';
         if ($rseventspro || $mainframe->isAdmin()) {
             $canView = true;
         }
         if (!$canView) {
             $user = JFactory::getUser();
             if (!in_array($form->Access, $user->getAuthorisedViewLevels())) {
                 JError::raiseWarning(500, JText::_('_NOT_EXIST'));
                 $mainframe->redirect(JURI::root());
                 return;
             }
         }
     }
     $lang = RSFormProHelper::getCurrentLanguage($formId);
     $translations = RSFormProHelper::getTranslations('forms', $formId, $lang);
     if ($translations) {
         foreach ($translations as $field => $value) {
             if (isset($form->{$field})) {
                 $form->{$field} = $value;
             }
         }
     }
     $doc = JFactory::getDocument();
     if (!$is_module) {
         if ($form->MetaDesc) {
             $doc->setMetaData('description', $form->MetaDesc);
         }
         if ($form->MetaKeywords) {
             $doc->setMetaData('keywords', $form->MetaKeywords);
         }
         if ($form->MetaTitle) {
             $doc->setTitle($form->FormTitle);
         }
     }
     $session = JFactory::getSession();
     $formparams = $session->get('com_rsform.formparams.' . $formId);
     // Form has been processed ?
     if ($formparams && $formparams->formProcessed) {
         // Must show Thank You Message
         if ($form->ShowThankyou) {
             return RSFormProHelper::showThankYouMessage($formId);
         }
         // Clear
         $session->clear('com_rsform.formparams.' . $formId);
         // Must show small message
         $mainframe->enqueueMessage(JText::_('RSFP_THANKYOU_SMALL'));
     }
     // Must process form
     $post = JRequest::getVar('form', array(), 'post', 'none', JREQUEST_ALLOWRAW);
     if (isset($post['formId']) && $post['formId'] == $formId) {
         $invalid = RSFormProHelper::processForm($formId);
         // Did not pass validation - show the form
         if ($invalid) {
             $mainframe->triggerEvent('rsfp_f_onBeforeShowForm');
             return RSFormProHelper::showForm($formId, $post, $invalid);
         }
     }
     // Default - show the form
     $mainframe->triggerEvent('rsfp_f_onBeforeShowForm');
     return RSFormProHelper::showForm($formId);
 }
开发者ID:renekreijveld,项目名称:rsformpro-bootstrapped,代码行数:85,代码来源:rsform.php

示例2: displayForm

 public static function displayForm($formId, $is_module = false)
 {
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     $db->setQuery("SELECT Published, FormTitle, MetaTitle, MetaDesc, MetaKeywords, ShowThankyou FROM #__rsform_forms WHERE FormId='" . (int) $formId . "'");
     $form = $db->loadObject();
     if (empty($form) || !$form->Published) {
         JError::raiseWarning(500, JText::_('_NOT_EXIST'));
         return;
     }
     $lang = RSFormProHelper::getCurrentLanguage($formId);
     $translations = RSFormProHelper::getTranslations('forms', $formId, $lang);
     if ($translations) {
         foreach ($translations as $field => $value) {
             if (isset($form->{$field})) {
                 $form->{$field} = $value;
             }
         }
     }
     $doc = JFactory::getDocument();
     if (!$is_module) {
         if ($form->MetaDesc) {
             $doc->setMetaData('description', $form->MetaDesc);
         }
         if ($form->MetaKeywords) {
             $doc->setMetaData('keywords', $form->MetaKeywords);
         }
         if ($form->MetaTitle) {
             $doc->setTitle($form->FormTitle);
         }
     }
     $session = JFactory::getSession();
     $formparams = $session->get('com_rsform.formparams.' . $formId);
     // Form has been processed ?
     if ($formparams && $formparams->formProcessed) {
         // Must show Thank You Message
         if ($form->ShowThankyou) {
             return RSFormProHelper::showThankYouMessage($formId);
         }
         // Clear
         $session->clear('com_rsform.formparams.' . $formId);
         // Must show small message
         $mainframe->enqueueMessage(JText::_('RSFP_THANKYOU_SMALL'));
     }
     // Must process form
     $post = JRequest::getVar('form', array(), 'post', 'none', JREQUEST_ALLOWRAW);
     if (isset($post['formId']) && $post['formId'] == $formId) {
         $invalid = RSFormProHelper::processForm($formId);
         // Did not pass validation - show the form
         if ($invalid) {
             $mainframe->triggerEvent('rsfp_f_onBeforeShowForm');
             return RSFormProHelper::showForm($formId, $post, $invalid);
         }
     }
     // Default - show the form
     $mainframe->triggerEvent('rsfp_f_onBeforeShowForm');
     return RSFormProHelper::showForm($formId);
 }
开发者ID:alvarovladimir,项目名称:messermeister_ab_rackservers,代码行数:58,代码来源:rsform.php


注:本文中的RSFormProHelper::showThankYouMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。