本文整理汇总了PHP中RSFormProHelper::displayForm方法的典型用法代码示例。如果您正苦于以下问题:PHP RSFormProHelper::displayForm方法的具体用法?PHP RSFormProHelper::displayForm怎么用?PHP RSFormProHelper::displayForm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSFormProHelper
的用法示例。
在下文中一共展示了RSFormProHelper::displayForm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForm
function showForm()
{
$mainframe =& JFactory::getApplication();
if (!($formId = JRequest::getInt('formId', 0, 'get'))) {
$params = clone $mainframe->getParams('com_rsform');
$formId = $params->get('formId');
}
echo RSFormProHelper::displayForm($formId);
}
示例2: defined
<?php
/**
* @version 1.3.0
* @package RSform!Pro 1.3.0
* @copyright (C) 2007-2010 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
?>
<div class="rsform<?php
echo $moduleclass_sfx;
?>
">
<?php
echo RSFormProHelper::displayForm($formId, true);
?>
</div>
示例3: defined
<?php
/**
* @package RSForm! Pro
* @copyright (C) 2007-2014 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/
defined('_JEXEC') or die('Restricted access');
echo RSFormProHelper::displayForm($this->formId);
示例4: onAfterRender
function onAfterRender()
{
$mainframe = JFactory::getApplication();
if ($mainframe->isAdmin()) {
return;
}
$option = JRequest::getVar('option');
$task = JRequest::getVar('task');
if ($option == 'com_content' && $task == 'edit') {
return;
}
if (!$this->canRun()) {
return true;
}
$content = JResponse::getBody();
if (strpos($content, '{rsform ') === false) {
return true;
}
// expression to search for
$pattern = '#\\{rsform ([0-9]+)\\}#i';
if (preg_match_all($pattern, $content, $matches)) {
static $found_textarea;
$lang = JFactory::getLanguage();
$lang->load('com_rsform', JPATH_SITE);
$db = JFactory::getDBO();
$head = array('js' => array(), 'css' => array());
foreach ($matches[0] as $j => $match) {
// within <textarea>
$before = strtolower(reset(explode($match, $content, 2)));
$before = preg_replace('#\\s+#', ' ', $before);
// we have a textarea
if (strpos($before, '<textarea') !== false) {
// find last occurrence
$textarea = end(explode('<textarea', $before));
// found & no closing tag
if (!empty($textarea) && strpos($textarea, '</textarea>') === false) {
continue;
}
}
$formId = $matches[1][$j];
$db->setQuery("SELECT `FormId`, `FormLayout`, `ScriptDisplay`, `ErrorMessage`, `FormTitle`, `CSS`, `JS`, `CSSClass`, `CSSId`, `CSSName`, `CSSAction`, `CSSAdditionalAttributes`, `AjaxValidation`, `ThemeParams` FROM #__rsform_forms WHERE FormId='" . $formId . "' AND `Published`='1'");
$form = $db->loadObject();
if (!empty($form)) {
if ($form->JS) {
$head['js'][md5($form->JS)] = $form->JS;
}
if ($form->CSS) {
$head['css'][md5($form->CSS)] = $form->CSS;
}
if ($form->ThemeParams) {
$registry = new JRegistry();
$registry->loadString($form->ThemeParams, 'INI');
$form->ThemeParams = $registry;
if ($form->ThemeParams->get('num_css', 0) > 0) {
for ($i = 0; $i < $form->ThemeParams->get('num_css'); $i++) {
$css = $form->ThemeParams->get('css' . $i);
$css = JURI::root(true) . '/components/com_rsform/assets/themes/' . $form->ThemeParams->get('name') . '/' . $css;
$head['css'][md5($css)] = '<link rel="stylesheet" href="' . $css . '" type="text/css" />';
}
}
if ($form->ThemeParams->get('num_js', 0) > 0) {
for ($i = 0; $i < $form->ThemeParams->get('num_js'); $i++) {
$js = $form->ThemeParams->get('js' . $i);
$js = JURI::root(true) . '/components/com_rsform/assets/themes/' . $form->ThemeParams->get('name') . '/' . $js;
$head['js'][md5($js)] = '<script type="text/javascript" src="' . $js . '"></script>';
}
}
}
$content = str_replace($matches[0][$j], RSFormProHelper::displayForm($formId, true), $content);
}
}
if (count($head['css'])) {
$content = str_replace('</head>', "\n" . implode("\n", $head['css']) . "\n" . '</head>', $content);
}
if (count($head['js'])) {
$content = str_replace('</head>', "\n" . implode("\n", $head['js']) . "\n" . '</head>', $content);
}
}
JResponse::setBody($content);
}