示例#1
0
/**
 * Updgrade fixes for versions before DB version 4 (plugin versions before 1.3.3)
 */
function iphorm_upgrade_4()
{
    $forms = iphorm_get_all_forms();
    foreach ($forms as $form) {
        if (isset($form['conditional_recipients'])) {
            foreach ($form['conditional_recipients'] as &$recipient) {
                $crElement = iphorm_get_element_config($recipient['element'], $form);
                if ($crElement['type'] == 'radio') {
                    $recipient['value'] = _wp_specialchars($recipient['value'], ENT_NOQUOTES);
                }
            }
        }
        foreach ($form['elements'] as &$element) {
            // Go through the logic rules and escape the value if the element that the rule is referring to is a checkbox or radio element
            if (isset($element['logic_rules']) && is_array($element['logic_rules'])) {
                foreach ($element['logic_rules'] as &$logicRule) {
                    $lrElement = iphorm_get_element_config($logicRule['element_id'], $form);
                    if (in_array($lrElement['type'], array('checkbox', 'radio'))) {
                        $logicRule['value'] = _wp_specialchars($logicRule['value'], ENT_NOQUOTES);
                    }
                }
            }
            if ($element['type'] == 'groupstart') {
                // Escape Group title and description
                $element['title'] = _wp_specialchars($element['title'], ENT_NOQUOTES);
                $element['description'] = _wp_specialchars($element['description'], ENT_NOQUOTES);
            } elseif (in_array($element['type'], array('radio', 'checkbox'))) {
                // Escape options labels and values for radio and checkbox elements
                foreach ($element['options'] as &$option) {
                    $option['label'] = _wp_specialchars($option['label'], ENT_NOQUOTES);
                    $option['value'] = _wp_specialchars($option['value'], ENT_NOQUOTES);
                }
            }
        }
        iphorm_save_form($form);
    }
}
示例#2
0
<?php

if (!defined('IPHORM_VERSION')) {
    exit;
}
$id = absint($element['id']);
$groupStartElement = iphorm_get_element_config($id - 1, $form);
$name = isset($groupStartElement['admin_title']) ? $groupStartElement['admin_title'] : __('New', 'iphorm');
?>
<div id="ifb-element-wrap-<?php 
echo $id;
?>
" class="ifb-element-wrap ifb-element-wrap-groupend">
    <div class="ifb-top-element-wrap qfb-cf">
        <?php 
include IPHORM_ADMIN_INCLUDES_DIR . '/elements/_actions.php';
?>
        <div class="ifb-element-preview ifb-element-preview-groupend">
            	<div class="ifb-group-end">
                    <span class="ifb-group-end-text"><?php 
printf(esc_html__('End of group: %s', 'iphorm'), '<span class="ifb-group-end-name">' . $name . '</span>');
?>
</span>
                </div>
            <span class="ifb-handle"></span>
        </div>
    </div>
</div>