本文整理汇总了PHP中RSFormProHelper::getComponentPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP RSFormProHelper::getComponentPrice方法的具体用法?PHP RSFormProHelper::getComponentPrice怎么用?PHP RSFormProHelper::getComponentPrice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSFormProHelper
的用法示例。
在下文中一共展示了RSFormProHelper::getComponentPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendSubmissionEmails
//.........这里部分代码省略.........
$multipleFields[] = $component->ComponentId;
}
} elseif ($component->ComponentTypeId == 2) {
if ($component->PropertyName == 'WYSIWYG' && $component->PropertyValue == 'NO') {
$textareaFields[] = $component->ComponentId;
}
}
$properties[$component->ComponentId][$component->PropertyName] = $component->PropertyValue;
}
// language
$translations = RSFormProHelper::getTranslations('properties', $formId, $submission->Lang);
foreach ($properties as $componentId => $componentProperties) {
foreach ($componentProperties as $property => $value) {
$reference_id = $componentId . '.' . $property;
if (isset($translations[$reference_id])) {
$componentProperties[$property] = $translations[$reference_id];
}
}
$properties[$componentId] = $componentProperties;
}
$secret = $config->get('secret');
foreach ($properties as $ComponentId => $property) {
// {component:caption}
$placeholders[] = '{' . $property['NAME'] . ':caption}';
$values[] = isset($property['CAPTION']) ? $property['CAPTION'] : '';
// {component:description}
$placeholders[] = '{' . $property['NAME'] . ':description}';
$values[] = isset($property['DESCRIPTION']) ? $property['DESCRIPTION'] : '';
// {component:name}
$placeholders[] = '{' . $property['NAME'] . ':name}';
$values[] = $property['NAME'];
// {component:price}
$placeholders[] = '{' . $property['NAME'] . ':price}';
$values[] = RSFormProHelper::getComponentPrice($property, $submission);
// {component:value}
$placeholders[] = '{' . $property['NAME'] . ':value}';
$value = '';
if (isset($submission->values[$property['NAME']])) {
$value = $submission->values[$property['NAME']];
// Check if this is an upload field
if (in_array($property['NAME'], $uploadFields)) {
$value = '<a href="' . JURI::root() . 'index.php?option=com_rsform&task=submissions.view.file&hash=' . md5($submission->SubmissionId . $secret . $property['NAME']) . $Itemid . '">' . basename($submission->values[$property['NAME']]) . '</a>';
} elseif (in_array($ComponentId, $multipleFields)) {
$value = str_replace("\n", $form->MultipleSeparator, $value);
} elseif ($form->TextareaNewLines && in_array($ComponentId, $textareaFields)) {
$value = nl2br($value);
}
}
$values[] = $value;
if (isset($property['ITEMS'])) {
$placeholders[] = '{' . $property['NAME'] . ':text}';
if (isset($submission->values[$property['NAME']])) {
$value = $submission->values[$property['NAME']];
$all_values = explode("\n", $value);
$all_texts = array();
$items = RSFormProHelper::explode(RSFormProHelper::isCode($property['ITEMS']));
$special = array('[c]', '[g]', '[d]');
foreach ($all_values as $v => $value) {
$all_texts[$v] = $value;
foreach ($items as $item) {
$item = str_replace($special, '', $item);
@(list($item_val, $item_text) = explode("|", $item, 2));
if ($item_text && $item_val == $value) {
$all_texts[$v] = $item_text;
break;
}