Example #1
0
}
?>
<h4>Options</h4>
<p>The options are the choices the user has to pick from when using the form.</p>

<h4>Adding an option</h4>
<p>To add an option, click the <img src="<?php 
echo iphorm_plugin_url();
?>
/admin/images/small-add-round-for-help.png" /> next to
the element and the new option will appear below the this option.</p>

<h4>Deleting an option</h4>
<p>To delete an option, click the <img src="<?php 
echo iphorm_plugin_url();
?>
/admin/images/small-delete-round-for-help.png" /> next to the option.</p>

<h4>Customize values</h4>
<p>This allows you to have a different value submitted than the value that is displayed to the user
of the form. The label is what the user will see and the value is what is submitted to the form and will
be shown in the email and when viewing entries.</p>

<h4>Default value</h4>
<p>The radio buttons in the first column are used to specify the default value. The radio button
checked here will also be checked when the form is first loaded. If you want to remove the default
value, click the <img src="<?php 
echo iphorm_plugin_url();
?>
/admin/images/small-delete-round-for-help.png" />
above the column.</p>
Example #2
0
/**
 * Enqueue the frontend scripts
 */
function iphorm_enqueue_scripts()
{
    if (!apply_filters('iphorm_enqueue_scripts', true)) {
        return;
    }
    wp_enqueue_script('iphorm', iphorm_plugin_url() . '/js/iphorm.js', array('jquery'), IPHORM_VERSION, false);
    // jQuery is not a dependency but this will force it to the head
    if (!get_option('iphorm_disable_swfupload_output')) {
        wp_enqueue_script('iphorm-swfupload', iphorm_plugin_url() . '/js/swfupload.min.js', array(), IPHORM_VERSION, true);
    }
    wp_enqueue_script('iphorm-plugin', iphorm_plugin_url() . '/js/jquery.iphorm.js', array('jquery'), IPHORM_VERSION, true);
    wp_deregister_script('jquery-form');
    wp_enqueue_script('jquery-form', iphorm_plugin_url() . '/js/jquery.form.min.js', array('jquery'), 'v20130616', true);
    if (!get_option('iphorm_disable_smoothscroll_output')) {
        wp_enqueue_script('jquery-smooth-scroll', iphorm_plugin_url() . '/js/jquery.smooth-scroll.min.js', array('jquery'), '1.4.9', true);
    }
    if (!get_option('iphorm_disable_qtip_output')) {
        wp_enqueue_script('qtip', iphorm_plugin_url() . '/js/qtip2/jquery.qtip.min.js', array('jquery'), '2.2.1', true);
    }
    if (get_option('iphorm_fancybox_requested') && !get_option('iphorm_disable_fancybox_output')) {
        wp_enqueue_script('fancybox', iphorm_plugin_url() . '/js/fancybox/jquery.fancybox-1.3.4.pack.js', array('jquery'), '1.3.4', true);
    }
    $activeUniformThemes = maybe_unserialize(get_option('iphorm_active_uniform_themes'));
    if (!get_option('iphorm_disable_uniform_output') && (is_array($activeUniformThemes) && count($activeUniformThemes))) {
        wp_enqueue_script('uniform', iphorm_plugin_url() . '/js/uniform/jquery.uniform.min.js', array('jquery'), '2.1.2', true);
    }
    if (!get_option('iphorm_disable_infieldlabels_output')) {
        wp_enqueue_script('infield-label', iphorm_plugin_url() . '/js/jquery.infieldlabel.min.js', array('jquery'), '0.1', true);
    }
    $activeDatepickers = maybe_unserialize(get_option('iphorm_active_datepickers'));
    if (!get_option('iphorm_disable_jqueryui_output') && (is_array($activeDatepickers) && count($activeDatepickers))) {
        if (version_compare(get_bloginfo('version'), '3.3') >= 0) {
            wp_enqueue_script('jquery-ui-datepicker');
        } else {
            wp_enqueue_script('iphorm-jquery-ui-core', iphorm_plugin_url() . '/js/jqueryui/jquery.ui.core.min.js', array('jquery'), '1.8.24', true);
            wp_enqueue_script('iphorm-jquery-ui-datepicker', iphorm_plugin_url() . '/js/jqueryui/jquery.ui.datepicker.min.js', array('jquery', 'iphorm-jquery-ui-core'), '1.8.24', true);
        }
    }
    $activeThemes = maybe_unserialize(get_option('iphorm_active_themes'));
    $activeThemes = is_array($activeThemes) ? array_unique($activeThemes) : array();
    foreach ($activeThemes as $key => $activeTheme) {
        $themeInfo = explode('|', $activeTheme);
        if (file_exists(IPHORM_PLUGIN_DIR . "/themes/" . $themeInfo[0] . "/" . $themeInfo[1] . ".js")) {
            wp_enqueue_script('iphorm-theme-' . $key, iphorm_plugin_url() . "/themes/" . $themeInfo[0] . "/" . $themeInfo[1] . ".js", array(), IPHORM_VERSION, true);
        }
    }
    wp_localize_script('iphorm-plugin', 'iphormL10n', iphorm_js_l10n());
}
Example #3
0
/**
 * Localisation function to pass translations and other data to
 * the admin JavaScript
 *
 * @return array
 */
function iphorm_admin_l10n()
{
    $data = array('captcha_url' => iphorm_plugin_url() . '/includes/captcha.php', 'preview_url' => admin_url('?iphorm_preview=1'), 'tmp_dir' => iphorm_get_temp_dir(), 'admin_images_url' => iphorm_admin_url() . '/images', 'months' => iphorm_get_all_months(), 'date_formats' => iphorm_get_date_formats(), 'time_formats' => iphorm_get_time_formats(), 'error_adding_element' => __('Error adding the element', 'iphorm'), 'confirm_delete_element' => __('Are you sure you want to delete this element? Any associated entry data for this element will also be deleted.', 'iphorm'), 'confirm_convert_element' => __('Are you sure you want to convert this element? Most of your settings will be copied over, however you may lose some settings that are not shared between the element types.', 'iphorm'), 'error_saving_form' => __('Error saving the form', 'iphorm'), 'element_deleted' => __('Element deleted', 'iphorm'), 'option_1' => __('Option 1', 'iphorm'), 'option_2' => __('Option 2', 'iphorm'), 'option_3' => __('Option 3', 'iphorm'), 'at_least_one_option' => __('There must be at least one option', 'iphorm'), 'error_adding_filter' => __('Error adding the filter', 'iphorm'), 'error_adding_validator' => __('Error adding the validator', 'iphorm'), 'error_adding_style' => __('Error adding the style', 'iphorm'), 'insert_variable' => _x('Insert variable...', 'variable piece of data', 'iphorm'), 'submitted_form_value' => __('Submitted form value', 'iphorm'), 'user_ip_address' => __('User IP address', 'iphorm'), 'form_post_page_id' => __('Form post/page ID', 'iphorm'), 'form_post_page_title' => __('Form post/page title', 'iphorm'), 'entry_id' => __('Entry ID', 'iphorm'), 'form_url' => __('Form URL', 'iphorm'), 'user_display_name' => __('User display name', 'iphorm'), 'user_email' => __('User email', 'iphorm'), 'user_login' => _x('User login', 'username', 'iphorm'), 'referring_url' => __('Referring URL', 'iphorm'), 'date_select_format' => __('Date (select a format)', 'iphorm'), 'time_select_format' => __('Time (select a format)', 'iphorm'), 'send_to_email' => __('Send to', 'iphorm'), 'conditional_if' => _x('if', 'conditional', 'iphorm'), 'is_equal_to' => __('is equal to', 'iphorm'), 'is_not_equal_to' => __('is not equal to', 'iphorm'), 'day' => __('Day', 'iphorm'), 'month' => __('Month', 'iphorm'), 'year' => __('Year', 'iphorm'), 'example_tooltip' => __('This is an example tooltip!', 'iphorm'), 'more_information' => __('More information', 'iphorm'), 'remove' => _x('Remove', 'delete', 'iphorm'), 'hh_string' => _x('HH', 'select hour', 'iphorm'), 'mm_string' => _x('MM', 'select minute', 'iphorm'), 'ampm_string' => _x('am/pm', 'select morning/afternoon', 'iphorm'), 'am_string' => _x('am', 'time, morning', 'iphorm'), 'pm_string' => _x('pm', 'time, evening', 'iphorm'), 'add_bulk_options' => __('Add bulk options', 'iphorm'), 'bulk_options' => iphorm_get_bulk_options(), 'need_multi_element' => __('The form must have at least one Dropdown Menu, Checkboxes or Multiple Choice element to use this feature.', 'iphorm'), 'this_group_if' => __('this group if', 'iphorm'), 'this_field_if' => __('this field if', 'iphorm'), 'show' => __('Show', 'iphorm'), 'hide' => __('Hide', 'iphorm'), 'all' => __('all', 'iphorm'), 'any' => __('any', 'iphorm'), 'these_rules_match' => __('of these rules match:', 'iphorm'), 'is' => __('is', 'iphorm'), 'is_not' => __('is not', 'iphorm'), 'unsaved_changes' => __('You have unsaved changes.', 'iphorm'));
    $params = array('l10n_print_after' => 'iphormL10n = ' . iphorm_json_encode($data) . ';');
    return $params;
}
Example #4
0
if (!isset($element['options']['font'])) {
    $element['options']['font'] = 'Typist.ttf';
}
if (!isset($element['options']['minFontSize'])) {
    $element['options']['minFontSize'] = 12;
}
if (!isset($element['options']['maxFontSize'])) {
    $element['options']['maxFontSize'] = 19;
}
if (!isset($element['options']['minAngle'])) {
    $element['options']['minAngle'] = 0;
}
if (!isset($element['options']['maxAngle'])) {
    $element['options']['maxAngle'] = 20;
}
$captchaImagePath = iphorm_plugin_url() . '/includes/captcha.php';
$captchaConfig = array('uniqId' => 1, 'tmpDir' => iphorm_get_temp_dir(), 'options' => $element['options']);
$captchaConfig = base64_encode(iphorm_json_encode($captchaConfig));
$helpUrl = iphorm_help_link('element-captcha');
?>
<div id="ifb-element-wrap-<?php 
echo $id;
?>
" class="ifb-element-wrap ifb-element-wrap-captcha <?php 
if (!$element['required']) {
    echo 'ifb-element-optional';
}
?>
 <?php 
echo "ifb-label-placement-{$form['label_placement']}";
?>
Example #5
0
include IPHORM_INCLUDES_DIR . '/elements/_description.php';
?>
        </div>
        <div class="iphorm-captcha-image-wrap iphorm-clearfix <?php 
echo $name;
?>
-captcha-image-wrap" <?php 
echo $element->getCss(null, $leftMarginCss);
?>
>
            <div class="ifb-captcha-image-inner">
                <img id="iphorm-captcha-image-<?php 
echo esc_attr($uniqueId);
?>
" class="iphorm-captcha-image" src="<?php 
echo iphorm_plugin_url() . '/includes/captcha.php?c=' . urlencode($captchaConfig) . '&amp;t=' . microtime(true);
?>
" alt="CAPTCHA" />
            </div>
        </div>

        <script type="text/javascript">
        jQuery(document).ready(function ($) {
            $('#iphorm-captcha-image-<?php 
echo esc_js($uniqueId);
?>
').hover(function () {
                $(this).stop().fadeTo('slow', '0.3');
            }, function () {
                $(this).stop().fadeTo('slow', '1.0');
            }).click(function () {
Example #6
0
    ?>
"></script>
<?php 
}
if (!get_option('iphorm_disable_jqueryui_output')) {
    if (version_compare(get_bloginfo('version'), '3.3') >= 0) {
        ?>
    <?php 
        wp_print_scripts(array('jquery-ui-datepicker'));
    } else {
        ?>
<script type="text/javascript" src="<?php 
        echo iphorm_plugin_url() . '/js/jqueryui/jquery.ui.core.min.js';
        ?>
"></script>
<script type="text/javascript" src="<?php 
        echo iphorm_plugin_url() . '/js/jqueryui/jquery.ui.datepicker.min.js';
        ?>
"></script>
<?php 
    }
}
$allThemes = iphorm_get_all_themes();
foreach ($allThemes as $theme) {
    if (file_exists(IPHORM_PLUGIN_DIR . "/themes/" . $theme['Folder'] . "/" . $theme['Filename'] . ".js")) {
        echo '<script type="text/javascript" src="' . iphorm_plugin_url() . "/themes/" . $theme['Folder'] . "/" . $theme['Filename'] . '.js"></script>' . PHP_EOL;
    }
}
?>
</body>
</html>