本文整理汇总了PHP中RSFormProHelper::isJ16方法的典型用法代码示例。如果您正苦于以下问题:PHP RSFormProHelper::isJ16方法的具体用法?PHP RSFormProHelper::isJ16怎么用?PHP RSFormProHelper::isJ16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSFormProHelper
的用法示例。
在下文中一共展示了RSFormProHelper::isJ16方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
JToolBarHelper::title('RSForm! Pro', 'rsform');
if (RSFormProHelper::isJ16()) {
$lang =& JFactory::getLanguage();
$lang->load('com_rsform.sys', JPATH_ADMINISTRATOR);
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_FORMS'), 'index.php?option=com_rsform&task=forms.manage');
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_SUBMISSIONS'), 'index.php?option=com_rsform&task=submissions.manage');
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_CONFIGURATION'), 'index.php?option=com_rsform&task=configuration.edit', true);
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_BACKUP_RESTORE'), 'index.php?option=com_rsform&task=backup.restore');
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_UPDATES'), 'index.php?option=com_rsform&task=updates.manage');
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_PLUGINS'), 'index.php?option=com_rsform&task=goto.plugins');
}
JToolBarHelper::apply('configuration.apply');
JToolBarHelper::save('configuration.save');
JToolBarHelper::cancel('');
$params = array('startOffset' => JRequest::getInt('tabposition', 0));
$tabs =& JPane::getInstance('Tabs', $params, true);
$this->assignRef('tabs', $tabs);
$this->assign('code', RSFormProHelper::getConfig('global.register.code'));
$lists['global.iis'] = JHTML::_('select.booleanlist', 'rsformConfig[global.iis]', 'class="inputbox"', RSFormProHelper::getConfig('global.iis'));
$lists['global.editor'] = JHTML::_('select.booleanlist', 'rsformConfig[global.editor]', 'class="inputbox"', RSFormProHelper::getConfig('global.editor'));
$lists['global.codemirror'] = JHTML::_('select.booleanlist', 'rsformConfig[global.codemirror]', 'class="inputbox"', RSFormProHelper::getConfig('global.codemirror'));
$lists['auto_responsive'] = JHTML::_('select.booleanlist', 'rsformConfig[auto_responsive]', 'class="inputbox"', RSFormProHelper::getConfig('auto_responsive'));
$this->assignRef('lists', $lists);
parent::display($tpl);
}
示例2: save
function save()
{
$model = $this->getModel('mappings');
$row = $model->save();
$html = '<script type="text/javascript">';
if ($row === false) {
$html .= RSFormProHelper::isJ16() ? 'window.parent.SqueezeBox.close();' : 'window.parent.document.getElementById(\'sbox-window\').close()';
} else {
$html .= 'window.parent.ShowMappings(' . $row->formId . ')' . "\n";
$html .= RSFormProHelper::isJ16() ? 'window.parent.SqueezeBox.close();' : 'window.parent.document.getElementById(\'sbox-window\').close()';
}
$html .= '</script>';
echo $html;
die;
}
示例3: display
function display($tpl = null)
{
$this->params = $this->get('Params');
$this->formId = $this->get('FormId');
$this->isJ16 = RSFormProHelper::isJ16();
if ($this->isJ16) {
$app =& JFactory::getApplication();
$doc =& JFactory::getDocument();
$title = $this->params->get('page_title', '');
if (empty($title)) {
$title = $app->getCfg('sitename');
} elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
} elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
}
$doc->setTitle($title);
}
parent::display($tpl);
}
示例4: display
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
JToolBarHelper::title('RSForm! Pro', 'rsform');
if (RSFormProHelper::isJ16()) {
$lang = JFactory::getLanguage();
$lang->load('com_rsform.sys', JPATH_ADMINISTRATOR);
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_FORMS'), 'index.php?option=com_rsform&task=forms.manage', true);
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_SUBMISSIONS'), 'index.php?option=com_rsform&task=submissions.manage');
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_CONFIGURATION'), 'index.php?option=com_rsform&task=configuration.edit');
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_BACKUP_RESTORE'), 'index.php?option=com_rsform&task=backup.restore');
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_UPDATES'), 'index.php?option=com_rsform&task=updates.manage');
JSubMenuHelper::addEntry(JText::_('COM_RSFORM_PLUGINS'), 'index.php?option=com_rsform&task=goto.plugins');
}
$this->formId = JRequest::getInt('formId');
$this->formTitle = $this->get('formtitle');
$this->menus = $this->get('menus');
$this->pagination = $this->get('pagination');
parent::display($tpl);
}
示例5: __construct
function __construct()
{
parent::__construct();
if (RSFormProHelper::isJ16()) {
JHTML::_('behavior.framework');
}
$this->_db = JFactory::getDBO();
$version = new RSFormProVersion();
$v = $version->revision;
$doc = JFactory::getDocument();
$doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/jquery.js?v=' . $v);
$doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/script.js?v=' . $v);
$doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/tablednd.js?v=' . $v);
$doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/jquery.scrollto.js?v=' . $v);
$doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style.css?v=' . $v);
if (RSFormProHelper::isJ('2.5') && !RSFormProHelper::isJ('3.0')) {
$doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style25.css?v=' . $v);
} elseif (RSFormProHelper::isJ('3.0')) {
$doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style30.css?v=' . $v);
}
$doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/rsdesign.css?v=' . $v);
}
示例6: __construct
function __construct()
{
parent::__construct();
if (RSFormProHelper::isJ16()) {
JHTML::_('behavior.framework');
}
if (!RSFormProHelper::isJ16()) {
if (!headers_sent()) {
header('Content-type: text/html; charset=utf-8');
}
}
$this->_db = JFactory::getDBO();
$doc =& JFactory::getDocument();
$doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/jquery.js');
$doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/tablednd.js');
$doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/jquery.scrollto.js');
$doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/script.js?v=44');
$doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style.css?v=44');
if (RSFormProHelper::isJ16()) {
$doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style16.css');
}
$doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/rsdesign.css');
}
示例7: sendMail
function sendMail($from, $fromname, $recipient, $subject, $body, $mode = 0, $cc = null, $bcc = null, $attachment = null, $replyto = null, $replytoname = null)
{
// for 1.5 use the default sendMail() which works correctly
if (!RSFormProHelper::isJ16()) {
return JUtility::sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cc, $bcc, $attachment, $replyto, $replytoname);
}
// until Joomla! solves all JUtility::sendMail() related issues, we're going to use our function here so that no extra reply-tos get added
// Get a JMail instance
$mail = JFactory::getMailer();
$config =& JFactory::getConfig();
$mailfrom = $config->get('mailfrom');
$mail->ClearReplyTos();
$mail->setSender(array($from, $fromname));
$mail->setSubject($subject);
$mail->setBody($body);
// Are we sending the email as HTML?
if ($mode) {
$mail->IsHTML(true);
}
$mail->addRecipient($recipient);
$mail->addCC($cc);
$mail->addBCC($bcc);
$mail->addAttachment($attachment);
// Take care of reply email addresses
if (is_array($replyto)) {
$mail->ClearReplyTos();
$numReplyTo = count($replyto);
for ($i = 0; $i < $numReplyTo; $i++) {
$mail->addReplyTo(array($replyto[$i], $replytoname[$i]));
}
} else {
if (!empty($replyto)) {
$mail->ClearReplyTos();
$mail->addReplyTo(array($replyto, $replytoname));
}
}
return $mail->Send();
}
示例8: updateCSVPreview
}
if (isChecked)
submitform(task);
else
alert('<?php
echo JText::_('RSFP_EXPORT_PLEASE_SELECT', true);
?>
');
}
else
submitform(task);
}
<?php
if (RSFormProHelper::isJ16()) {
?>
Joomla.submitbutton = submitbutton;
<?php
}
?>
function updateCSVPreview()
{
<?php
if ($this->exportType != 'csv') {
?>
return;
<?php
}
?>
示例9: formsDelete
/**
* Forms Delete Process
*/
function formsDelete()
{
$db = JFactory::getDBO();
// Get the selected items
$cid = JRequest::getVar('cid', array(0), 'post', 'array');
// Force array elements to be integers
JArrayHelper::toInteger($cid, array(0));
$model = $this->getModel('submissions');
$total = count($cid);
foreach ($cid as $formId) {
$model->deleteSubmissionFiles($formId);
$model->deleteSubmissions($formId);
//Delete Components
$db->setQuery("SELECT ComponentId FROM #__rsform_components WHERE FormId = '" . $formId . "'");
$componentIds = $db->loadResultArray();
if (!empty($componentIds)) {
$components = implode(',', $componentIds);
$db->setQuery("DELETE FROM #__rsform_properties WHERE ComponentId IN (" . $components . ")");
$db->query();
$db->setQuery("DELETE FROM #__rsform_components WHERE ComponentId IN (" . $components . ")");
$db->query();
}
//delete mappings
$db->setQuery("DELETE FROM #__rsform_mappings WHERE formId = '" . $formId . "'");
$db->query();
//delete extra emails
$db->setQuery("DELETE FROM #__rsform_emails WHERE formId = '" . $formId . "'");
$db->query();
//Delete Forms
$db->setQuery("DELETE FROM #__rsform_forms WHERE FormId = '" . $formId . "'");
$db->query();
//Delete Translations
$db->setQuery("DELETE FROM #__rsform_translations WHERE form_id = '" . $formId . "'");
$db->query();
if (RSFormProHelper::isJ16()) {
$db->setQuery("DELETE FROM `#__menu` WHERE `path` = 'rsform' AND link = 'index.php?option=com_rsform&view=forms&layout=show&formId=" . $formId . "' ");
} else {
$db->setQuery("DELETE FROM `#__components` WHERE `option` = 'com_rsform_menu' AND admin_menu_link = 'option=com_rsform&view=forms&layout=show&formId=" . $formId . "' ");
}
$db->query();
}
$msg = JText::sprintf('RSFP_FORMS_DELETED', $total);
$this->setRedirect('index.php?option=com_rsform&task=forms.manage', $msg);
}
示例10:
<td align="center" nowrap="nowrap">
<a class="rsform_icon rsform_preview" href="<?php
echo JURI::root();
?>
index.php?option=com_rsform&formId=<?php
echo $row->FormId;
?>
" target="_blank"><?php
echo JText::_('PREVIEW');
?>
</a>
<a class="rsform_icon rsform_add_menu" href="index.php?option=com_rsform&task=forms.menuadd.screen&formId=<?php
echo $row->FormId;
?>
"><?php
echo RSFormProHelper::isJ16() ? JText::_('LINK_TO_MENU') : JText::_('LINK TO MENU');
?>
</a>
<?php
if ($row->Backendmenu) {
?>
<a class="rsform_icon rsform_add_backend_menu" href="index.php?option=com_rsform&task=forms.menuremove.backend&formId=<?php
echo $row->FormId;
?>
"><?php
echo JText::_('LINK_TO_BACKEND_REMOVE_MENU');
?>
</a>
<?php
} else {
?>
示例11: mappingDBO
function mappingDBO($config)
{
$database = JFactory::getDBO();
if ($config['connection']) {
$options = array('driver' => 'mysql', 'host' => $config['host'], 'user' => $config['username'], 'password' => $config['password'], 'database' => $config['database']);
if (!strlen($config['database'])) {
return 'Please select a database first.';
}
if (RSFormProHelper::isJ('3.0')) {
$database2 = JDatabaseDriver::getInstance($options);
} else {
$database2 = JDatabase::getInstance($options);
}
try {
$database2->connect();
} catch (RuntimeException $e) {
return $e->getMessage();
}
if (is_a($database2, 'JException') || is_a($database2, 'JError')) {
return $database2->getMessage();
}
if (RSFormProHelper::isJ16() && $database2->getErrorNum()) {
return $database2->getErrorMsg();
}
return $database2;
}
return $database;
}
示例12: display
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$document->addCustomTag('<!--[if IE 7]><link href="' . JURI::root() . 'administrator/components/com_rsform/assets/css/styleie.css" rel="stylesheet" type="text/css" /><![endif]-->');
if (RSFormProHelper::getConfig('global.codemirror')) {
$document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/lib/codemirror.js');
$document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/css/css.js');
$document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/htmlmixed/htmlmixed.js');
$document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/javascript/javascript.js');
$document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/php/php.js');
$document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/clike/clike.js');
$document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/xml/xml.js');
$document->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/lib/codemirror.css');
$document->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/theme/default.css');
}
JToolBarHelper::title('RSForm! Pro', 'rsform');
// adding the toolbar on 2.5
if (!RSFormProHelper::isJ('3.0')) {
$this->addToolbar();
}
$layout = $this->getLayout();
$this->isComponent = JRequest::getVar('tmpl') == 'component';
if ($layout == 'edit') {
$submissionsIcon = RSFormProHelper::isJ('3.0') ? 'database' : 'forward';
$previewIcon = RSFormProHelper::isJ('3.0') ? 'new tab' : 'preview';
JToolBarHelper::apply('forms.apply');
JToolBarHelper::save('forms.save');
JToolBarHelper::spacer();
JToolBarHelper::custom('forms.preview', $previewIcon, $previewIcon, JText::_('JGLOBAL_PREVIEW'), false);
JToolBarHelper::custom('submissions.back', $submissionsIcon, $submissionsIcon, JText::_('RSFP_SUBMISSIONS'), false);
JToolBarHelper::custom('components.copy', 'copy', 'copy', JText::_('RSFP_COPY_TO_FORM'), false);
JToolBarHelper::custom('components.duplicate', 'copy', 'copy', JText::_('RSFP_DUPLICATE'), false);
JToolBarHelper::deleteList(JText::_('VALIDDELETEITEMS'), 'components.remove', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_DELETE') : JText::_('DELETE'));
JToolBarHelper::publishList('components.publish', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_PUBLISH') : JText::_('Publish'));
JToolBarHelper::unpublishList('components.unpublish', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_UNPUBLISH') : JText::_('Unpublish'));
JToolBarHelper::spacer();
JToolBarHelper::cancel('forms.cancel');
$this->tabposition = JRequest::getInt('tabposition', 0);
$this->tab = JRequest::getInt('tab', 0);
$this->form = $this->get('form');
$this->form_post = $this->get('formPost');
$this->hasSubmitButton = $this->get('hasSubmitButton');
JToolBarHelper::title('RSForm! Pro <small>[' . JText::sprintf('RSFP_EDITING_FORM', $this->form->FormTitle) . ']</small>', 'rsform');
$this->fields = $this->get('fields');
$this->quickfields = $this->get('quickfields');
$this->pagination = $this->get('fieldspagination');
$lists['Published'] = $this->renderHTML('select.booleanlist', 'Published', '', $this->form->Published);
$lists['ShowFormTitle'] = $this->renderHTML('select.booleanlist', 'ShowFormTitle', '', $this->form->ShowFormTitle);
$lists['keepdata'] = $this->renderHTML('select.booleanlist', 'Keepdata', '', $this->form->Keepdata);
$lists['confirmsubmission'] = $this->renderHTML('select.booleanlist', 'ConfirmSubmission', '', $this->form->ConfirmSubmission);
$lists['ShowThankyou'] = $this->renderHTML('select.booleanlist', 'ShowThankyou', 'onclick="enableThankyou(this.value);"', $this->form->ShowThankyou);
$lists['ShowContinue'] = $this->renderHTML('select.booleanlist', 'ShowContinue', !$this->form->ShowThankyou ? 'disabled="true"' : '', $this->form->ShowContinue);
$lists['UserEmailMode'] = $this->renderHTML('select.booleanlist', 'UserEmailMode', 'onclick="enableEmailMode(\'User\', this.value)"', $this->form->UserEmailMode, JText::_('HTML'), JText::_('RSFP_COMP_FIELD_TEXT'));
$lists['UserEmailAttach'] = $this->renderHTML('select.booleanlist', 'UserEmailAttach', 'onclick="enableAttachFile(this.value)"', $this->form->UserEmailAttach);
$lists['AdminEmailMode'] = $this->renderHTML('select.booleanlist', 'AdminEmailMode', 'onclick="enableEmailMode(\'Admin\', this.value)"', $this->form->AdminEmailMode, JText::_('HTML'), JText::_('RSFP_COMP_FIELD_TEXT'));
$lists['MetaTitle'] = $this->renderHTML('select.booleanlist', 'MetaTitle', '', $this->form->MetaTitle);
$lists['TextareaNewLines'] = $this->renderHTML('select.booleanlist', 'TextareaNewLines', '', $this->form->TextareaNewLines);
$lists['AjaxValidation'] = $this->renderHTML('select.booleanlist', 'AjaxValidation', '', $this->form->AjaxValidation);
$lists['FormLayoutAutogenerate'] = $this->renderHTML('select.booleanlist', 'FormLayoutAutogenerate', 'onclick="changeFormAutoGenerateLayout(' . $this->form->FormId . ', this.value);"', $this->form->FormLayoutAutogenerate);
$lists['post_enabled'] = $this->renderHTML('select.booleanlist', 'form_post[enabled]', '', $this->form_post->enabled);
$lists['post_method'] = $this->renderHTML('select.booleanlist', 'form_post[method]', '', $this->form_post->method, JText::_('RSFP_POST_METHOD_POST'), JText::_('RSFP_POST_METHOD_GET'));
$lists['post_silent'] = $this->renderHTML('select.booleanlist', 'form_post[silent]', '', $this->form_post->silent);
$this->themes = $this->get('themes');
$this->lang = $this->get('lang');
// workaround for first time visit
$session = JFactory::getSession();
$session->set('com_rsform.form.' . $this->form->FormId . '.lang', $this->lang);
$lists['Languages'] = JHTML::_('select.genericlist', $this->get('languages'), 'Language', 'onchange="submitbutton(\'changeLanguage\')"', 'value', 'text', $this->lang);
$this->mappings = $this->get('mappings');
$this->mpagination = $this->get('mpagination');
$this->conditions = $this->get('conditions');
$this->formId = $this->form->FormId;
$this->emails = $this->get('emails');
$this->lists = $lists;
} elseif ($layout == 'new') {
$nextIcon = RSFormProHelper::isJ('3.0') ? 'next' : 'forward';
JToolBarHelper::custom('forms.new.steptwo', $nextIcon, $nextIcon, JText::_('JNEXT'), false);
JToolBarHelper::cancel('forms.cancel');
} elseif ($layout == 'new2') {
$nextIcon = RSFormProHelper::isJ('3.0') ? 'next' : 'forward';
JToolBarHelper::custom('forms.new.stepthree', $nextIcon, $nextIcon, JText::_('JNEXT'), false);
JToolBarHelper::cancel('forms.cancel');
$lists['AdminEmail'] = $this->renderHTML('select.booleanlist', 'AdminEmail', 'onclick="changeAdminEmail(this.value)"', 1);
$lists['UserEmail'] = $this->renderHTML('select.booleanlist', 'UserEmail', '', 1);
$actions = array(JHTML::_('select.option', 'refresh', JText::_('RSFP_SUBMISSION_REFRESH_PAGE')), JHTML::_('select.option', 'thankyou', JText::_('RSFP_SUBMISSION_THANKYOU')), JHTML::_('select.option', 'redirect', JText::_('RSFP_SUBMISSION_REDIRECT_TO')));
$lists['SubmissionAction'] = JHTML::_('select.genericlist', $actions, 'SubmissionAction', 'onclick="changeSubmissionAction(this.value)"');
$this->adminEmail = $this->get('adminEmail');
$this->lists = $lists;
$this->editor = JFactory::getEditor();
} elseif ($layout == 'new3') {
$nextIcon = RSFormProHelper::isJ('3.0') ? 'next' : 'forward';
JToolBarHelper::custom('forms.new.stepfinal', $nextIcon, $nextIcon, JText::_('Finish'), false);
JToolBarHelper::cancel('forms.cancel');
$lists['predefinedForms'] = JHTML::_('select.genericlist', $this->get('predefinedforms'), 'predefinedForm', '');
$this->lists = $lists;
} elseif ($layout == 'component_copy') {
JToolBarHelper::custom('components.copy.process', 'copy', 'copy', 'Copy', false);
JToolBarHelper::cancel('components.copy.cancel');
$formlist = $this->get('formlist');
//.........这里部分代码省略.........
示例13: display
function display($tpl = null)
{
$lang = JFactory::getLanguage();
if (empty($lang->_metadata['pdffontname'])) {
$lang->_metadata['pdffontname'] = 'freesans';
}
$this->staticHeaders = $this->get('staticHeaders');
$this->staticFields = $this->get('staticFields');
$this->fields = $this->get('editFields');
parent::display('pdf');
if (RSFormProHelper::isJ16()) {
/*
* Setup external configuration options
*/
define('K_TCPDF_EXTERNAL_CONFIG', true);
/*
* Path options
*/
// Installation path
define("K_PATH_MAIN", JPATH_LIBRARIES . "/tcpdf");
// URL path
define("K_PATH_URL", JPATH_BASE);
// Fonts path
define("K_PATH_FONTS", K_PATH_MAIN . '/fonts/');
// Cache directory path
define("K_PATH_CACHE", K_PATH_MAIN . "/cache");
// Cache URL path
define("K_PATH_URL_CACHE", K_PATH_URL . "/cache");
// Images path
define("K_PATH_IMAGES", K_PATH_MAIN . "/images");
// Blank image path
define("K_BLANK_IMAGE", K_PATH_IMAGES . "/_blank.png");
/*
* Format options
*/
// Cell height ratio
define("K_CELL_HEIGHT_RATIO", 1.25);
// Magnification scale for titles
define("K_TITLE_MAGNIFICATION", 1.3);
// Reduction scale for small font
define("K_SMALL_RATIO", 2 / 3);
// Magnication scale for head
define("HEAD_MAGNIFICATION", 1.1);
/*
* Create the pdf document
*/
jimport('tcpdf.tcpdf');
$pdf = new TCPDF();
$pdf->SetMargins(15, 27, 15);
$pdf->SetAutoPageBreak(true, 25);
$pdf->SetHeaderMargin(5);
$pdf->SetFooterMargin(10);
$pdf->setImageScale(4);
$document = JFactory::getDocument();
// Set PDF Metadata
$pdf->SetCreator($document->getGenerator());
$pdf->SetTitle($document->getTitle());
$pdf->SetSubject($document->getDescription());
$pdf->SetKeywords($document->getMetaData('keywords'));
// Set PDF Header data
$pdf->setHeaderData('', 0, $document->getTitle(), null);
// Set RTL
$lang = JFactory::getLanguage();
$pdf->setRTL($lang->isRTL());
// Set Font
$font = 'freesans';
$pdf->setHeaderFont(array($font, '', 10));
$pdf->setFooterFont(array($font, '', 8));
// Initialize PDF Document
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->WriteHTML(ob_get_contents(), true);
$data = $pdf->Output('', 'S');
ob_end_clean();
// Build the PDF Document string from the document buffer
header('Content-Type: application/pdf; charset=utf-8');
header('Content-disposition: inline; filename="export.pdf"', true);
echo $data;
die;
}
}
示例14: getFields
function getFields()
{
$formId = JRequest::getInt('formId');
$return = array();
$this->_db->setQuery("SELECT p.PropertyValue AS ComponentName, c.*, ct.ComponentTypeName FROM #__rsform_components c LEFT JOIN #__rsform_properties p ON (c.ComponentId=p.ComponentId AND p.PropertyName='NAME') LEFT JOIN #__rsform_component_types ct ON (ct.ComponentTypeId = c.ComponentTypeId) WHERE c.FormId='" . $formId . "' ORDER BY c.Order");
$components = $this->_db->loadObjectList();
$properties = RSFormProHelper::getComponentProperties($components);
foreach ($components as $component) {
$data = $properties[$component->ComponentId];
$data['componentId'] = $component->ComponentId;
$data['componentTypeId'] = $component->ComponentTypeId;
$data['ComponentTypeName'] = $component->ComponentTypeName;
$field = new stdClass();
$field->id = $component->ComponentId;
$field->type_id = $component->ComponentTypeId;
$field->name = $component->ComponentName;
$field->published = $component->Published;
$field->ordering = $component->Order;
$field->preview = RSFormProHelper::showPreview($formId, $field->id, $data);
$field->required = isset($data['REQUIRED']) && $data['REQUIRED'] == 'YES' ? '<b>' . JText::_(RSFormProHelper::isJ16() ? 'JYES' : 'YES') . '</b>' : JText::_(RSFormProHelper::isJ16() ? 'JNO' : 'NO');
$field->validation = isset($data['VALIDATIONRULE']) && $data['VALIDATIONRULE'] != 'none' ? '<b>' . $data['VALIDATIONRULE'] . '</b>' : '-';
$return[] = $field;
}
return $return;
}
示例15: mappingDBO
function mappingDBO($config)
{
$database =& JFactory::getDBO();
if ($config['connection']) {
$options = array('host' => $config['host'], 'user' => $config['username'], 'password' => $config['password'], 'database' => $config['database']);
$database2 = JDatabase::getInstance($options);
if (is_a($database2, 'JException') || is_a($database2, 'JError')) {
return $database2->getMessage();
}
if (RSFormProHelper::isJ16() && $database2->getErrorNum()) {
return $database2->getErrorMsg();
}
return $database2;
}
return $database;
}