public static function init() { if (basename($_SERVER['PHP_SELF']) == "plugins.php") { //loading translations load_plugin_textdomain('gravityformsmailchimp', FALSE, '/gravityformsmailchimp/languages'); add_action('after_plugin_row_' . self::$path, array('GFMailChimp', 'plugin_row')); //force new remote request for version info on the plugin page self::flush_version_info(); } if (!self::is_gravityforms_supported()) { return; } if (is_admin()) { //loading translations load_plugin_textdomain('gravityformsmailchimp', FALSE, '/gravityformsmailchimp/languages'); add_filter("transient_update_plugins", array('GFMailChimp', 'check_update')); add_filter("site_transient_update_plugins", array('GFMailChimp', 'check_update')); add_action('install_plugins_pre_plugin-information', array('GFMailChimp', 'display_changelog')); // paypal plugin integration hooks add_action("gform_paypal_action_fields", array("GFMailChimp", "add_paypal_settings"), 10, 2); add_filter("gform_paypal_save_config", array("GFMailChimp", "save_paypal_settings")); //creates a new Settings page on Gravity Forms' settings screen if (self::has_access("gravityforms_mailchimp")) { RGForms::add_settings_page("MailChimp", array("GFMailChimp", "settings_page"), self::get_base_url() . "/images/mailchip_wordpress_icon_32.png"); } } //integrating with Members plugin if (function_exists('members_get_capabilities')) { add_filter('members_get_capabilities', array("GFMailChimp", "members_get_capabilities")); } //creates the subnav left menu add_filter("gform_addon_navigation", array('GFMailChimp', 'create_menu')); if (self::is_mailchimp_page()) { //enqueueing sack for AJAX requests wp_enqueue_script(array("sack")); //loading data lib require_once self::get_base_path() . "/data.php"; //loading upgrade lib if (!class_exists("RGMailChimpUpgrade")) { require_once "plugin-upgrade.php"; } //loading Gravity Forms tooltips require_once GFCommon::get_base_path() . "/tooltips.php"; add_filter('gform_tooltips', array('GFMailChimp', 'tooltips')); //runs the setup when version changes self::setup(); } else { if (in_array(RG_CURRENT_PAGE, array("admin-ajax.php"))) { //loading data class require_once self::get_base_path() . "/data.php"; add_action('wp_ajax_rg_update_feed_active', array('GFMailChimp', 'update_feed_active')); add_action('wp_ajax_gf_select_mailchimp_form', array('GFMailChimp', 'select_mailchimp_form')); } else { //handling post submission. add_action("gform_after_submission", array('GFMailChimp', 'export'), 10, 2); //handling paypal fulfillment add_action("gform_paypal_fulfillment", array("GFMailChimp", "paypal_fulfillment"), 10, 4); } } }
public static function init() { global $pagenow; load_plugin_textdomain('gravity-forms-marketo', FALSE, '/gravity-forms-marketo/languages'); if ($pagenow === 'plugins.php') { add_action("admin_notices", array('GFMarketo', 'is_gravity_forms_installed'), 10); } if (self::is_gravity_forms_installed(false, false) === 0) { add_action('after_plugin_row_' . self::$path, array('GFMarketo', 'plugin_row')); return; } add_filter('plugin_action_links', array('GFMarketo', 'settings_link'), 10, 2); if (!self::is_gravityforms_supported()) { return; } if (is_admin()) { //loading translations load_plugin_textdomain('gravity-forms-marketo', FALSE, '/gravity-forms-marketo/languages'); //creates a new Settings page on Gravity Forms' settings screen if (self::has_access("gravityforms_marketo")) { RGForms::add_settings_page("Marketo", array("GFMarketo", "settings_page"), self::get_base_url() . "/images/marketo_wordpress_icon_32.png"); } } //integrating with Members plugin if (function_exists('members_get_capabilities')) { add_filter('members_get_capabilities', array("GFMarketo", "members_get_capabilities")); } //creates the subnav left menu add_filter("gform_addon_navigation", array('GFMarketo', 'create_menu')); if (self::is_marketo_page()) { //enqueueing sack for AJAX requests wp_enqueue_script(array("sack")); wp_enqueue_script("gforms_gravityforms", GFCommon::get_base_url() . "/js/gravityforms.js", null, GFCommon::$version); wp_enqueue_style("gforms_css", GFCommon::get_base_url() . "/css/forms.css", null, GFCommon::$version); //loading data lib require_once self::get_base_path() . "/data.php"; self::setup_tooltips(); //runs the setup when version changes self::setup(); } else { if (in_array(RG_CURRENT_PAGE, array("admin-ajax.php"))) { //loading data class require_once self::get_base_path() . "/data.php"; add_action('wp_ajax_rg_update_feed_active', array('GFMarketo', 'update_feed_active')); add_action('wp_ajax_gf_select_marketo_form', array('GFMarketo', 'select_marketo_form')); } else { //handling post submission. add_action('gform_after_submission', array('GFMarketo', 'export'), 10, 2); } } add_action('gform_entry_info', array('GFMarketo', 'entry_info_link_to_marketo'), 1, 2); add_filter('gform_save_field_value', array('GFMarketo', 'save_field_value'), 10, 4); add_filter('gform_entry_post_save', array('GFMarketo', 'gform_entry_post_save'), 1, 2); add_filter('gform_replace_merge_tags', array('GFMarketo', 'replace_merge_tag'), 1, 7); add_action("gform_custom_merge_tags", array('GFMarketo', "_deprecated_add_merge_tags"), 1, 4); add_action("gform_admin_pre_render", array('GFMarketo', "add_merge_tags")); add_filter('gform_pre_render', array('GFMarketo', 'merge_tag_gform_pre_render_filter'), 1, 4); add_action('gform_enqueue_scripts', array('GFMarketo', 'add_munchkin_js'), 10, 2); add_action('wp_footer', array('GFMarketo', 'add_munchkin_js')); }
public function admin_init() { if ('gf_edit_forms' == RGForms::get('page') && 1 == count($_GET)) { $this->show_page_on_form_list(); add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts')); } }
public static function init() { add_action("admin_notices", array('GFSalesforce', 'is_gravity_forms_installed'), 10); if (!self::is_gravityforms_supported()) { return; } if (is_admin()) { //creates a new Settings page on Gravity Forms' settings screen if (self::has_access("gravityforms_salesforce")) { RGForms::add_settings_page("Salesforce", array("GFSalesforce", "settings_page"), self::get_base_url() . "/salesforce-50x50.png"); } } //creates the subnav left menu add_filter("gform_addon_navigation", array('GFSalesforce', 'create_menu')); if (self::is_salesforce_page()) { //enqueueing sack for AJAX requests wp_enqueue_script(array("sack")); wp_enqueue_style('gravityforms-admin', GFCommon::get_base_url() . '/css/admin.css'); } else { if (in_array(RG_CURRENT_PAGE, array("admin-ajax.php"))) { add_action('wp_ajax_rg_update_feed_active', array('GFSalesforce', 'update_feed_active')); add_action('wp_ajax_gf_select_salesforce_form', array('GFSalesforce', 'select_salesforce_form')); } elseif (in_array(RG_CURRENT_PAGE, array('admin.php'))) { add_action('admin_head', array('GFSalesforce', 'show_salesforce_status')); } else { add_action("gform_pre_submission", array('GFSalesforce', 'push'), 10, 2); //handling post submission. } } #add_action("gform_field_advanced_settings", array('GFSalesforce',"add_salesforce_editor_field"), 10, 2); // For future use add_action("gform_editor_js", array('GFSalesforce', 'add_form_option_js'), 10); add_filter('gform_tooltips', array('GFSalesforce', 'add_form_option_tooltip')); add_filter("gform_confirmation", array('GFSalesforce', 'confirmation_error')); }
public static function init() { self::include_logger(); if (defined('RG_CURRENT_PAGE') && RG_CURRENT_PAGE == "plugins.php") { //loading translations load_plugin_textdomain('gravityformslogging', FALSE, '/gravityformslogging/languages'); add_action('after_plugin_row_' . self::$path, array('GFLogging', 'plugin_row')); //force new remote request for version info on the plugin page self::flush_version_info(); } if (!self::is_gravityforms_supported()) { return; } if (is_admin()) { //loading translations load_plugin_textdomain('gravityformslogging', FALSE, '/gravityformslogging/languages'); add_filter("transient_update_plugins", array('GFLogging', 'check_update')); add_filter("site_transient_update_plugins", array('GFLogging', 'check_update')); add_action('install_plugins_pre_plugin-information', array('GFLogging', 'display_changelog')); //creates a new Settings page on Gravity Forms' settings screen if (self::has_access("gravityforms_logging")) { RGForms::add_settings_page("Logging", array("GFLogging", "settings_page"), ""); } } //integrating with Members plugin if (function_exists('members_get_capabilities')) { add_filter('members_get_capabilities', array("GFLogging", "members_get_capabilities")); } if (self::is_logging_page()) { //loading upgrade lib require_once "plugin-upgrade.php"; } }
public static function settings_page() { $addon_name = RGForms::get("addon"); $icon_path = empty($addon_name) ? "" : self::$addon_pages[$addon_name]["icon"]; $page_title = empty($addon_name) ? __("Gravity Forms Settings", "gravityforms") : $addon_name . " " . __("Settings", "gravityforms"); $icon_path = empty($icon_path) ? GFCommon::get_base_url() . "/images/gravity-settings-icon-32.png" : $icon_path; echo GFCommon::get_remote_message(); ?> <link rel="stylesheet" href="<?php echo GFCommon::get_base_url(); ?> /css/admin.css" /> <div class="wrap"> <img alt="<?php $page_title; ?> " src="<?php echo $icon_path; ?> " style="float:left; margin:15px 7px 0 0;"/> <h2><?php echo $page_title; ?> </h2> <?php if (!empty(self::$addon_pages)) { ?> <ul class="subsubsub"> <li><a href="?page=gf_settings">Gravity Forms</a> |</li> <?php $count = sizeof(self::$addon_pages); for ($i = 0; $i < $count; $i++) { $addon_keys = array_keys(self::$addon_pages); $addon = $addon_keys[$i]; ?> <li><a href="?page=gf_settings&addon=<?php echo urlencode($addon); ?> "><?php echo esc_html($addon); ?> </a> <?php echo $i < $count - 1 ? "|" : ""; ?> </li> <?php } ?> </ul> <br style="clear:both;"/> <?php } if (empty($addon_name)) { self::gravityforms_settings_page(); } else { do_action("gform_settings_" . str_replace(" ", "_", $addon_name)); } }
protected function plugin_settings_init() { $subview = rgget("subview"); RGForms::add_settings_page(array('name' => __("Gravity Forms API Settings", "gravityforms"), 'tab_label' => $this->get_short_title(), 'handler' => array($this, 'plugin_settings_page'))); if (rgget("page") == "gf_settings" && $subview == $this->get_short_title() && $this->current_user_can_any($this->_capabilities_settings_page)) { require_once GFCommon::get_base_path() . "/tooltips.php"; } }
public function admin_init() { if ('gf_edit_forms' == RGForms::get('page') && '' == rgget('view') && is_numeric(rgget('id'))) { add_filter('gform_toolbar_menu', array($this, 'gform_toolbar_menu'), 10, 2); add_action('gform_editor_js', array($this, 'gform_editor_js')); add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts')); } }
public function add_field_option() { if (is_admin() && 'gf_edit_forms' == RGForms::get('page')) { add_action('gform_field_advanced_settings', array($this, 'gform_field_advanced_settings'), 10, 2); add_filter('gform_tooltips', array($this, 'gform_tooltips')); add_action('gform_editor_js', array($this, 'gform_editor_js')); add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts')); } }
function get_form_parent_post_id($form) { foreach ($form['fields'] as $field) { if ($field['type'] == 'select' && $field['setParentPost']) { $parent_id = RGForms::post('input_' . $field['id']); return $parent_id; } } return 0; }
public static function settings_page() { if (class_exists('RGForms') && RGForms::get("page") == "gf_settings") { /* * Tell Gravity Forms to initiate our settings page * Using the following Class/Model */ RGForms::add_settings_page('PDF', array(self::$model, 'gfpdf_settings_page')); } }
/** * load JS for fields. * * @param string $hook The admin page we are on. * * @return void */ public function scripts_styles($hook) { // Bail if not on the GF page. if (!RGForms::is_gravity_page()) { return; } // Enqueue our items. wp_enqueue_script('gftips-admin', plugins_url('/js/gftips.admin.js', __FILE__), array('jquery'), GFT_VER, true); wp_localize_script('gftips-admin', 'gftipsAdmin', array('fldTypes' => self::show_field_item_types())); }
/** * handle admin init action */ public function adminInit() { if (isset($_GET['page'])) { switch ($_GET['page']) { case 'gf_settings': // add our settings page to the Gravity Forms settings menu RGForms::add_settings_page('eWAY Payments', array($this, 'settingsPage')); break; } } add_settings_section(GFEWAY_PLUGIN_OPTIONS, false, false, GFEWAY_PLUGIN_OPTIONS); register_setting(GFEWAY_PLUGIN_OPTIONS, GFEWAY_PLUGIN_OPTIONS, array($this, 'settingsValidate')); }
public static function init() { global $pagenow; if ($pagenow == 'plugins.php' || defined('RG_CURRENT_PAGE') && RG_CURRENT_PAGE == "plugins.php") { //loading translations load_plugin_textdomain('gravity-forms-exacttarget', FALSE, '/gravity-forms-exacttarget/languages'); add_action('after_plugin_row_' . self::$path, array('GFExactTarget', 'plugin_row')); add_filter('plugin_action_links', array('GFExactTarget', 'settings_link'), 10, 2); } if (!self::is_gravityforms_supported()) { return; } if (is_admin()) { //loading translations load_plugin_textdomain('gravity-forms-exacttarget', FALSE, '/gravity-forms-exacttarget/languages'); add_filter("transient_update_plugins", array('GFExactTarget', 'check_update')); #add_filter("site_transient_update_plugins", array('GFExactTarget', 'check_update')); //creates a new Settings page on Gravity Forms' settings screen if (self::has_access("gravityforms_exacttarget")) { RGForms::add_settings_page("ExactTarget", array("GFExactTarget", "settings_page"), self::get_base_url() . "/images/exacttarget_wordpress_icon_32.png"); } } //integrating with Members plugin if (function_exists('members_get_capabilities')) { add_filter('members_get_capabilities', array("GFExactTarget", "members_get_capabilities")); } //creates the subnav left menu add_filter("gform_addon_navigation", array('GFExactTarget', 'create_menu')); if (self::is_exacttarget_page()) { //enqueueing sack for AJAX requests wp_enqueue_script(array("sack")); //loading data lib require_once self::get_base_path() . "/data.php"; //loading Gravity Forms tooltips require_once GFCommon::get_base_path() . "/tooltips.php"; add_filter('gform_tooltips', array('GFExactTarget', 'tooltips')); //runs the setup when version changes self::setup(); } else { if (in_array(RG_CURRENT_PAGE, array("admin-ajax.php"))) { //loading data class require_once self::get_base_path() . "/data.php"; add_action('wp_ajax_rg_update_feed_active', array('GFExactTarget', 'update_feed_active')); add_action('wp_ajax_gf_select_exacttarget_form', array('GFExactTarget', 'select_exacttarget_form')); } else { //handling post submission. add_action("gform_post_submission", array('GFExactTarget', 'export'), 10, 2); } } }
/** * Hook in our plugin's settings page also on the Gravity Forms settings page as * a sub page. * * @since 1.6.0 * * @uses is_admin() * @uses RGForms::add_settings_page() */ function ddw_gftb_add_gfsettings() { if (is_admin() && class_exists('RGForms')) { global $pagenow; $gftb_gf_settings_string = array('name' => 'Toolbar', 'tab_label' => _x('Toolbar', 'Translators: Settings (sub) title within Gravity Forms settings page', 'gravity-forms-toolbar'), 'handler' => 'ddw_gftb_options_page', 'icon_path' => ''); RGForms::add_settings_page($gftb_gf_settings_string, 'ddw_gftb_options_page', ''); /** Add & display message on saving options */ if (isset($_GET['subview']) && 'Toolbar' == $_GET['subview'] && isset($_GET['settings-updated'])) { add_action('admin_notices', 'ddw_gftb_settings_message'); } // end if } // end if }
function content($block) { $form_id = parent::get_setting($block, 'form-id', null); //If no form ID is present, display the message and stop this function. if (!$form_id) { echo '<p>There is no form to display.</p>'; return; } $display_title = parent::get_setting($block, 'display-title', true); $display_description = parent::get_setting($block, 'display-description', true); $force_display = true; $field_values = null; $use_ajax = parent::get_setting($block, 'use-ajax', false); echo RGForms::get_form($form_id, $display_title, $display_description, $force_display, null, $use_ajax); }
public function get_field_input($form, $value = '', $entry = null) { if (is_array($value)) { $value = array_values($value); } $form_id = $form['id']; $is_entry_detail = $this->is_entry_detail(); $is_form_editor = $this->is_form_editor(); $is_admin = $is_entry_detail || $is_form_editor; $id = (int) $this->id; $field_id = $is_entry_detail || $is_form_editor || $form_id == 0 ? "input_{$id}" : 'input_' . $form_id . "_{$id}"; $class_suffix = $is_entry_detail ? '_admin' : ''; $form_sub_label_placement = rgar($form, 'subLabelPlacement'); $field_sub_label_placement = $this->subLabelPlacement; $is_sub_label_above = $field_sub_label_placement == 'above' || empty($field_sub_label_placement) && $form_sub_label_placement == 'above'; $sub_label_class_attribute = $field_sub_label_placement == 'hidden_label' ? "class='hidden_sub_label'" : ''; $disabled_text = $is_form_editor ? 'disabled="disabled"' : ''; $first_tabindex = $this->get_tabindex(); $last_tabindex = $this->get_tabindex(); $strength_style = !$this->passwordStrengthEnabled ? "style='display:none;'" : ''; $strength_indicator_label = __('Strength indicator', 'gravityforms'); $strength = $this->passwordStrengthEnabled || $is_admin ? "<div id='{$field_id}_strength_indicator' class='gfield_password_strength' {$strength_style}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{$strength_indicator_label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type='hidden' class='gform_hidden' id='{$field_id}_strength' name='input_{$id}_strength' />" : ''; $action = !$is_admin ? "gformShowPasswordStrength(\"{$field_id}\");" : ''; $onchange = $this->passwordStrengthEnabled ? "onchange='{$action}'" : ''; $onkeyup = $this->passwordStrengthEnabled ? "onkeyup='{$action}'" : ''; $confirmation_value = RGForms::post('input_' . $id . '_2'); $password_value = is_array($value) ? $value[0] : $value; $password_value = esc_attr($password_value); $confirmation_value = esc_attr($confirmation_value); $enter_password_field_input = GFFormsModel::get_input($this, $this->id . ''); $confirm_password_field_input = GFFormsModel::get_input($this, $this->id . '.2'); $enter_password_label = rgar($enter_password_field_input, 'customLabel') != '' ? $enter_password_field_input['customLabel'] : __('Enter Password', 'gravityforms'); $enter_password_label = apply_filters("gform_password_{$form_id}", apply_filters('gform_password', $enter_password_label, $form_id), $form_id); $confirm_password_label = rgar($confirm_password_field_input, 'customLabel') != '' ? $confirm_password_field_input['customLabel'] : __('Confirm Password', 'gravityforms'); $confirm_password_label = apply_filters("gform_password_confirm_{$form_id}", apply_filters('gform_password_confirm', $confirm_password_label, $form_id), $form_id); $enter_password_placeholder_attribute = GFCommon::get_input_placeholder_attribute($enter_password_field_input); $confirm_password_placeholder_attribute = GFCommon::get_input_placeholder_attribute($confirm_password_field_input); if ($is_sub_label_above) { return "<div class='ginput_complex{$class_suffix} ginput_container' id='{$field_id}_container'>\n\t\t\t\t\t<span id='{$field_id}_container' class='ginput_left'>\n\t\t\t\t\t\t<label for='{$field_id}' {$sub_label_class_attribute}>{$enter_password_label}</label>\n\t\t\t\t\t\t<input type='password' name='input_{$id}' id='{$field_id}' {$onkeyup} {$onchange} value='{$password_value}' {$first_tabindex} {$enter_password_placeholder_attribute} {$disabled_text}/>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span id='{$field_id}_2_container' class='ginput_right'>\n\t\t\t\t\t\t<label for='{$field_id}_2' {$sub_label_class_attribute}>{$confirm_password_label}</label>\n\t\t\t\t\t\t<input type='password' name='input_{$id}_2' id='{$field_id}_2' {$onkeyup} {$onchange} value='{$confirmation_value}' {$last_tabindex} {$confirm_password_placeholder_attribute} {$disabled_text}/>\n\t\t\t\t\t</span>\n\t\t\t\t\t<div class='gf_clear gf_clear_complex'></div>\n\t\t\t\t</div>{$strength}"; } else { return "<div class='ginput_complex{$class_suffix} ginput_container' id='{$field_id}_container'>\n\t\t\t\t\t<span id='{$field_id}_container' class='ginput_left'>\n\t\t\t\t\t\t<input type='password' name='input_{$id}' id='{$field_id}' {$onkeyup} {$onchange} value='{$password_value}' {$first_tabindex} {$enter_password_placeholder_attribute} {$disabled_text}/>\n\t\t\t\t\t\t<label for='{$field_id}' {$sub_label_class_attribute}>{$enter_password_label}</label>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span id='{$field_id}_2_container' class='ginput_right'>\n\t\t\t\t\t\t<input type='password' name='input_{$id}_2' id='{$field_id}_2' {$onkeyup} {$onchange} value='{$confirmation_value}' {$last_tabindex} {$confirm_password_placeholder_attribute} {$disabled_text}/>\n\t\t\t\t\t\t<label for='{$field_id}_2' {$sub_label_class_attribute}>{$confirm_password_label}</label>\n\t\t\t\t\t</span>\n\t\t\t\t\t<div class='gf_clear gf_clear_complex'></div>\n\t\t\t\t</div>{$strength}"; } }
function widget($args, $instance) { extract($args); echo $before_widget; $title = apply_filters('widget_title', $instance['title']); if ($title) { echo $before_title . $title . $after_title; } $tabindex = is_numeric($instance['tabindex']) ? $instance['tabindex'] : 1; //creating form $form = RGFormsModel::get_form_meta($instance['form_id']); if (empty($instance['disable_scripts']) && !is_admin()) { RGForms::print_form_scripts($form, $instance['ajax']); } $form_markup = RGForms::get_form($instance['form_id'], $instance['showtitle'], $instance['showdescription'], false, null, $instance['ajax'], $tabindex); //display form echo $form_markup; echo $after_widget; }
/** * Constructor: setup callbacks and plugin-specific options * * @author James Inman */ public function __construct() { parent::__construct(); // Set the plugin's Clockwork SMS menu to load the contact forms $this->plugin_callback = array($this, 'clockwork_gravityforms'); $this->plugin_dir = basename(dirname(__FILE__)); // Convert the old settings $this->convert_old_settings(); // Setup all forms into a local variable if (!class_exists('RGForms')) { require_once dirname(dirname(__FILE__)) . '/gravityforms/gravityforms.php'; } if (!class_exists('RGFormsModel')) { require_once dirname(dirname(__FILE__)) . '/gravityforms/forms_model.php'; } $active = RGForms::get('active') == '' ? null : RGForms::get('active'); $this->forms = RGFormsModel::get_forms($active, 'title'); // Options and callbacks add_action('gform_post_submission', array(&$this, 'do_form_processing'), 10, 2); }
function widget($args, $instance) { extract($args); echo $before_widget; $title = apply_filters('widget_title', $instance['title']); if ($title) { echo $before_title . $title . $after_title; } $form = RGForms::get_form($instance['form'], $instance['showtitle'], $instance['showdesc']); // Fix the tab indices preg_match_all("/tabindex='([0-9]+)'/", $form, $matches, PREG_SET_ORDER); $diff = $instance['tabindex'] - $matches[0][1]; foreach ($matches as $match) { $newtabindex = str_replace($match[1], $match[1] + $diff, $match[0]); $form = str_replace($match[0], $newtabindex, $form); } // Output the form echo $form; echo $after_widget; }
function widget($args, $instance) { extract($args); echo $before_widget; $title = apply_filters('widget_title', $instance['title']); if ($title) { echo $before_title . $title . $after_title; } //setting tabindex based on configured value if (is_numeric($instance['tabindex'])) { add_filter("gform_tabindex_{$instance['form_id']}", create_function("", "return {$instance['tabindex']};")); } //creating form $form = RGFormsModel::get_form_meta($instance['form_id']); if (empty($instance["disable_scripts"]) && !is_admin()) { RGForms::print_form_scripts($form, $instance["ajax"]); } $form_markup = RGForms::get_form($instance['form_id'], $instance['showtitle'], $instance['showdescription'], false, null, $instance["ajax"]); //display form echo $form_markup; echo $after_widget; }
public static function all_entries_page() { if (!GFCommon::ensure_wp_version()) { return; } $forms = RGFormsModel::get_forms(null, 'title'); $form_id = RGForms::get('id'); if (sizeof($forms) == 0) { ?> <div style="margin:50px 0 0 10px;"> <?php echo sprintf(esc_html__("You don't have any active forms. Let's go %screate one%s", 'gravityforms'), '<a href="?page=gf_new_form">', '</a>'); ?> </div> <?php } else { if (empty($form_id)) { $form_id = $forms[0]->id; } /** * Fires before the entry list content is generated. * * Echoed content would appear above the page title. * * @param int $form_id The ID of the form that the entry list is being displayed for. */ do_action('gform_pre_entry_list', $form_id); self::leads_page($form_id); /** * Fires after the entry list content is generated. * * Echoed content would appear after the bulk actions/paging links below the entry list table. * * @param int $form_id The ID of the form that the entry list is being displayed for. */ do_action('gform_post_entry_list', $form_id); } }
public static function process_bulk_update() { global $process_bulk_update_message; if (RGForms::post("action") === 'bulk') { check_admin_referer('gforms_entry_list', 'gforms_entry_list'); $bulk_action = !empty($_POST["bulk_action"]) ? $_POST["bulk_action"] : $_POST["bulk_action2"]; $leads = $_POST["lead"]; $entry_count = count($leads) > 1 ? sprintf(__("%d entries", "gravityforms"), count($leads)) : __("1 entry", "gravityforms"); $bulk_action = explode('-', $bulk_action); if (!isset($bulk_action[1]) || empty($leads)) { return false; } switch ($bulk_action[0]) { case "approve": self::directory_update_bulk($leads, 1, $bulk_action[1]); $process_bulk_update_message = sprintf(__("%s approved.", "gravity-forms-addons"), $entry_count); break; case "unapprove": self::directory_update_bulk($leads, 0, $bulk_action[1]); $process_bulk_update_message = sprintf(__("%s disapproved.", "gravity-forms-addons"), $entry_count); break; } } }
public function results_page($form_id, $page_title, $gf_page, $gf_view) { if (empty($form_id)) { $forms = RGFormsModel::get_forms(); if (!empty($forms)) { $form_id = $forms[0]->id; } } $form = GFFormsModel::get_form_meta($form_id); $form = gf_apply_filters(array('gform_form_pre_results', $form_id), $form); // set up filter vars $start_date = rgget('start'); $end_date = rgget('end'); $all_fields = $form['fields']; $filter_settings = GFCommon::get_field_filter_settings($form); $filter_settings = apply_filters('gform_filters_pre_results', $filter_settings, $form); $filter_settings = array_values($filter_settings); // reset the numeric keys in case some filters have been unset $filter_fields = rgget('f'); $filter_operators = rgget('o'); $filter_values = rgget('v'); $filters = array(); $init_vars = array(); if (!empty($filter_fields)) { $init_vars['mode'] = rgget('mode'); foreach ($filter_fields as $i => $filter_field) { $filters[$i]['field'] = $filter_field; $filters[$i]['operator'] = $filter_operators[$i]; $filters[$i]['value'] = $filter_values[$i]; } $init_vars['filters'] = $filters; } ?> <script type="text/javascript"> var gresultsFields = <?php echo json_encode($all_fields); ?> ; var gresultsFilterSettings = <?php echo json_encode($filter_settings); ?> ; var gresultsInitVars = <?php echo json_encode($init_vars); ?> ; <?php GFCommon::gf_global(); ?> <?php GFCommon::gf_vars(); ?> </script> <link rel="stylesheet" href="<?php echo GFCommon::get_base_url(); ?> /css/admin.css?ver=<?php echo GFCommon::$version; ?> " type="text/css"/> <div class="wrap gforms_edit_form <?php echo GFCommon::get_browser_class(); ?> "> <h2 class="gf_admin_page_title"> <span><?php echo empty($form_id) ? $page_title : $page_title . ' : ' . esc_html($form['title']); ?> </span><span class="gf_admin_page_subtitle"><span class="gf_admin_page_formid">ID: <?php echo $form['id']; ?> </span><span class="gf_admin_page_formname"><?php esc_html_e('Form Name', 'gravityforms'); ?> : <?php echo $form['title']; ?> </span></span> </h2> <?php RGForms::top_toolbar(); ?> <?php if (false === empty($all_fields)) { ?> <div id="poststuff" class="metabox-holder has-right-sidebar"> <div id="side-info-column" class="inner-sidebar"> <div id="gresults-results-filter" class="postbox"> <h3 style="cursor: default;"><?php echo $this->_search_title; ?> </h3> <div id="gresults-results-filter-content"> <form id="gresults-results-filter-form" action="" method="GET"> <input type="hidden" id="gresults-page-slug" name="page" value="<?php echo esc_attr($gf_page); ?> "> <input type="hidden" id="gresults-view-slug" name="view" value="<?php echo esc_attr($gf_view); ?> "> <input type="hidden" id="gresults-form-id" name="id" value="<?php echo esc_attr($form_id); ?> "> <?php $filter_ui = array('fields' => array('label' => esc_attr__('Filters', 'gravityforms'), 'tooltip' => 'gresults_filters', 'markup' => '<div id="gresults-results-field-filters-container"> <!-- placeholder populated by js --> </div>'), 'date_range' => array('label' => esc_attr__('Date Range', 'gravityforms'), 'tooltip' => 'gresults_date_range', 'markup' => '<div style="width:90px; float:left; "> <label for="gresults-results-filter-date-start">' . esc_html__('Start', 'gravityforms') . '</label> <input type="text" id="gresults-results-filter-date-start" name="start" style="width:80px" class="gresults-datepicker" value="' . $start_date . '"/> </div> <div style="width:90px; float:left; "> <label for="gresults-results-filter-date-end">' . esc_html__('End', 'gravityforms') . '</label> <input type="text" id="gresults-results-filter-date-end" name="end" style="width:80px" class="gresults-datepicker" value="' . $end_date . '"/> </div>')); $filter_ui = apply_filters('gform_filter_ui', $filter_ui, $form_id, $page_title, $gf_page, $gf_view); foreach ($filter_ui as $name => $filter) { ?> <div class='gresults-results-filter-section-label'> <?php echo $filter['label']; ?> <?php gform_tooltip(rgar($filter, 'tooltip'), 'tooltip_bottomleft'); ?> </div> <?php echo $filter['markup']; } ?> <br style="clear:both"/> <div id="gresults-results-filter-buttons"> <input type="submit" id="gresults-results-filter-submit-button" class="button button-primary button-large" value="<?php esc_attr_e('Apply filters', 'gravityforms'); ?> "> <input type="button" id="gresults-results-filter-clear-button" class="button button-secondary button-large" value="<?php esc_attr_e('Clear', 'gravityforms'); ?> " onclick="gresults.clearFilterForm();"> <div class="gresults-filter-loading" style="display:none; float:right; margin-top:5px;"> <i class='gficon-gravityforms-spinner-icon gficon-spin'></i> <?php esc_html_e('Loading', 'gravityforms'); ?> </div> </div> </form> </div> </div> </div> </div> <div class="gresults-filter-loading" style="display:none;margin:0 5px 10px 0;"> <i class='gficon-gravityforms-spinner-icon gficon-spin'></i> <a href="javascript:void(0);" onclick="javascript:gresultsAjaxRequest.abort()"><?php esc_html_e('Cancel', 'gravityforms'); ?> </a> </div> <div id="gresults-results-wrapper"> <div id="gresults-results"> </div> </div> <?php } else { _e('This form does not have any fields that can be used for results', 'gravityforms'); } ?> </div> <?php }
public static function forms() { if (!GFCommon::ensure_wp_version()) { return; } if (self::maybe_display_installation_wizard()) { return; } $id = RGForms::get('id'); $view = RGForms::get('view'); if ($view == 'entries') { require_once GFCommon::get_base_path() . '/entry_list.php'; GFEntryList::leads_page($id); } else { if ($view == 'entry') { require_once GFCommon::get_base_path() . '/entry_detail.php'; GFEntryDetail::lead_detail_page(); } else { if ($view == 'notification') { require_once GFCommon::get_base_path() . '/notification.php'; //GFNotification::notification_page($id); } else { if ($view == 'settings') { require_once GFCommon::get_base_path() . '/form_settings.php'; GFFormSettings::form_settings_page($id); } else { if (empty($view)) { if (is_numeric($id)) { self::forms_page($id); } else { self::form_list_page(); } } } } } } do_action('gform_view', $view, $id); }
public static function lead_detail_page() { global $current_user; if (!GFCommon::ensure_wp_version()) { return; } echo GFCommon::get_remote_message(); $form = RGFormsModel::get_form_meta(absint($_GET['id'])); $form_id = absint($form['id']); $form = apply_filters('gform_admin_pre_render_' . $form_id, apply_filters('gform_admin_pre_render', $form)); $lead_id = absint(rgget('lid')); $filter = rgget('filter'); $status = in_array($filter, array('trash', 'spam')) ? $filter : 'active'; $position = rgget('pos') ? rgget('pos') : 0; $sort_direction = rgget('dir') ? rgget('dir') : 'DESC'; $sort_field = empty($_GET['sort']) ? 0 : $_GET['sort']; $sort_field_meta = RGFormsModel::get_field($form, $sort_field); $is_numeric = $sort_field_meta['type'] == 'number'; $star = $filter == 'star' ? 1 : null; $read = $filter == 'unread' ? 0 : null; $search_criteria['status'] = $status; if ($star) { $search_criteria['field_filters'][] = array('key' => 'is_starred', 'value' => (bool) $star); } if (!is_null($read)) { $search_criteria['field_filters'][] = array('key' => 'is_read', 'value' => (bool) $read); } $search_field_id = rgget('field_id'); if (isset($_GET['field_id']) && $_GET['field_id'] !== '') { $key = $search_field_id; $val = rgget('s'); $strpos_row_key = strpos($search_field_id, '|'); if ($strpos_row_key !== false) { //multi-row likert $key_array = explode('|', $search_field_id); $key = $key_array[0]; $val = $key_array[1] . ':' . $val; } $search_criteria['field_filters'][] = array('key' => $key, 'operator' => rgempty('operator', $_GET) ? 'is' : rgget('operator'), 'value' => $val); $type = rgget('type'); if (empty($type)) { if (rgget('field_id') == '0') { $search_criteria['type'] = 'global'; } } } $paging = array('offset' => $position, 'page_size' => 1); if (!empty($sort_field)) { $sorting = array('key' => $_GET['sort'], 'direction' => $sort_direction, 'is_numeric' => $is_numeric); } else { $sorting = array(); } $total_count = 0; $leads = GFAPI::get_entries($form['id'], $search_criteria, $sorting, $paging, $total_count); $prev_pos = !rgblank($position) && $position > 0 ? $position - 1 : false; $next_pos = !rgblank($position) && $position < $total_count - 1 ? $position + 1 : false; // unread filter requires special handling for pagination since entries are filter out of the query as they are read if ($filter == 'unread') { $next_pos = $position; if ($next_pos + 1 == $total_count) { $next_pos = false; } } if (!$lead_id) { $lead = !empty($leads) ? $leads[0] : false; } else { $lead = GFAPI::get_entry($lead_id); } if (!$lead) { esc_html_e("Oops! We couldn't find your entry. Please try again", 'gravityforms'); return; } RGFormsModel::update_lead_property($lead['id'], 'is_read', 1); switch (RGForms::post('action')) { case 'update': check_admin_referer('gforms_save_entry', 'gforms_save_entry'); //Loading files that have been uploaded to temp folder $files = GFCommon::json_decode(stripslashes(RGForms::post('gform_uploaded_files'))); if (!is_array($files)) { $files = array(); } GFFormsModel::$uploaded_files[$form_id] = $files; GFFormsModel::save_lead($form, $lead); do_action('gform_after_update_entry', $form, $lead['id']); do_action("gform_after_update_entry_{$form['id']}", $form, $lead['id']); $lead = RGFormsModel::get_lead($lead['id']); $lead = GFFormsModel::set_entry_meta($lead, $form); break; case 'add_note': check_admin_referer('gforms_update_note', 'gforms_update_note'); $user_data = get_userdata($current_user->ID); RGFormsModel::add_note($lead['id'], $current_user->ID, $user_data->display_name, stripslashes($_POST['new_note'])); //emailing notes if configured if (rgpost('gentry_email_notes_to')) { GFCommon::log_debug('GFEntryDetail::lead_detail_page(): Preparing to email entry notes.'); $email_to = $_POST['gentry_email_notes_to']; $email_from = $current_user->user_email; $email_subject = stripslashes($_POST['gentry_email_subject']); $body = stripslashes($_POST['new_note']); $headers = "From: \"{$email_from}\" <{$email_from}> \r\n"; GFCommon::log_debug("GFEntryDetail::lead_detail_page(): Emailing notes - TO: {$email_to} SUBJECT: {$email_subject} BODY: {$body} HEADERS: {$headers}"); $is_success = wp_mail($email_to, $email_subject, $body, $headers); $result = is_wp_error($is_success) ? $is_success->get_error_message() : $is_success; GFCommon::log_debug("GFEntryDetail::lead_detail_page(): Result from wp_mail(): {$result}"); if (!is_wp_error($is_success) && $is_success) { GFCommon::log_debug('GFEntryDetail::lead_detail_page(): Mail was passed from WordPress to the mail server.'); } else { GFCommon::log_error('GFEntryDetail::lead_detail_page(): The mail message was passed off to WordPress for processing, but WordPress was unable to send the message.'); } if (has_filter('phpmailer_init')) { GFCommon::log_debug(__METHOD__ . '(): The WordPress phpmailer_init hook has been detected, usually used by SMTP plugins, it can impact mail delivery.'); } do_action('gform_post_send_entry_note', $result, $email_to, $email_from, $email_subject, $body, $form, $lead); } break; case 'add_quick_note': check_admin_referer('gforms_save_entry', 'gforms_save_entry'); $user_data = get_userdata($current_user->ID); RGFormsModel::add_note($lead['id'], $current_user->ID, $user_data->display_name, stripslashes($_POST['quick_note'])); break; case 'bulk': check_admin_referer('gforms_update_note', 'gforms_update_note'); if ($_POST['bulk_action'] == 'delete') { if (!GFCommon::current_user_can_any('gravityforms_edit_entry_notes')) { die(esc_html__("You don't have adequate permission to delete notes.", 'gravityforms')); } RGFormsModel::delete_notes($_POST['note']); } break; case 'trash': check_admin_referer('gforms_save_entry', 'gforms_save_entry'); RGFormsModel::update_lead_property($lead['id'], 'status', 'trash'); $lead = RGFormsModel::get_lead($lead['id']); break; case 'restore': case 'unspam': check_admin_referer('gforms_save_entry', 'gforms_save_entry'); RGFormsModel::update_lead_property($lead['id'], 'status', 'active'); $lead = RGFormsModel::get_lead($lead['id']); break; case 'spam': check_admin_referer('gforms_save_entry', 'gforms_save_entry'); RGFormsModel::update_lead_property($lead['id'], 'status', 'spam'); $lead = RGFormsModel::get_lead($lead['id']); break; case 'delete': check_admin_referer('gforms_save_entry', 'gforms_save_entry'); if (!GFCommon::current_user_can_any('gravityforms_delete_entries')) { die(esc_html__("You don't have adequate permission to delete entries.", 'gravityforms')); } RGFormsModel::delete_lead($lead['id']); ?> <script type="text/javascript"> document.location.href = '<?php echo 'admin.php?page=gf_entries&view=entries&id=' . absint($form['id']); ?> '; </script> <?php break; } $mode = empty($_POST['screen_mode']) ? 'view' : $_POST['screen_mode']; $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min'; ?> <link rel="stylesheet" href="<?php echo GFCommon::get_base_url(); ?> /css/admin<?php echo $min; ?> .css" /> <script type="text/javascript"> jQuery(document).ready(function () { toggleNotificationOverride(true); jQuery('#gform_update_button').prop('disabled', false); }); function DeleteFile(leadId, fieldId, deleteButton) { if (confirm(<?php echo json_encode(__("Would you like to delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityforms')); ?> )) { var fileIndex = jQuery(deleteButton).parent().index(); var mysack = new sack("<?php echo admin_url('admin-ajax.php'); ?> "); mysack.execute = 1; mysack.method = 'POST'; mysack.setVar("action", "rg_delete_file"); mysack.setVar("rg_delete_file", "<?php echo wp_create_nonce('rg_delete_file'); ?> "); mysack.setVar("lead_id", leadId); mysack.setVar("field_id", fieldId); mysack.setVar("file_index", fileIndex); mysack.onError = function () { alert(<?php echo json_encode(__('Ajax error while deleting field.', 'gravityforms')); ?> ) }; mysack.runAJAX(); return true; } } function EndDeleteFile(fieldId, fileIndex) { var previewFileSelector = "#preview_existing_files_" + fieldId + " .ginput_preview"; var $previewFiles = jQuery(previewFileSelector); var rr = $previewFiles.eq(fileIndex); $previewFiles.eq(fileIndex).remove(); var $visiblePreviewFields = jQuery(previewFileSelector); if ($visiblePreviewFields.length == 0) { jQuery('#preview_' + fieldId).hide(); jQuery('#upload_' + fieldId).show('slow'); } } function ToggleShowEmptyFields() { if (jQuery("#gentry_display_empty_fields").is(":checked")) { createCookie("gf_display_empty_fields", true, 10000); document.location = document.location.href; } else { eraseCookie("gf_display_empty_fields"); document.location = document.location.href; } } function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; } function eraseCookie(name) { createCookie(name, "", -1); } function ResendNotifications() { var selectedNotifications = new Array(); jQuery(".gform_notifications:checked").each(function () { selectedNotifications.push(jQuery(this).val()); }); var sendTo = jQuery('#notification_override_email').val(); if (selectedNotifications.length <= 0) { displayMessage(<?php echo json_encode(__('You must select at least one type of notification to resend.', 'gravityforms')); ?> , 'error', '#notifications_container'); return; } jQuery('#please_wait_container').fadeIn(); jQuery.post(ajaxurl, { action : "gf_resend_notifications", gf_resend_notifications: '<?php echo wp_create_nonce('gf_resend_notifications'); ?> ', notifications : jQuery.toJSON(selectedNotifications), sendTo : sendTo, leadIds : '<?php echo absint($lead['id']); ?> ', formId : '<?php echo absint($form['id']); ?> ' }, function (response) { if (response) { displayMessage(response, "error", "#notifications_container"); } else { displayMessage(<?php echo json_encode(esc_html__('Notifications were resent successfully.', 'gravityforms')); ?> , "updated", "#notifications_container" ); // reset UI jQuery(".gform_notifications").attr( 'checked', false ); jQuery('#notification_override_email').val(''); toggleNotificationOverride(); } jQuery('#please_wait_container').hide(); setTimeout(function () { jQuery('#notifications_container').find('.message').slideUp(); }, 5000); } ); } function displayMessage( message, messageClass, container ) { jQuery( container ).find( '.message' ).hide().html( message ).attr( 'class', 'message ' + messageClass ).slideDown(); } function toggleNotificationOverride(isInit) { if (isInit) jQuery('#notification_override_email').val(''); if (jQuery(".gform_notifications:checked").length > 0) { jQuery('#notifications_override_settings').slideDown(); } else { jQuery('#notifications_override_settings').slideUp(function () { jQuery('#notification_override_email').val(''); }); } } </script> <form method="post" id="entry_form" enctype='multipart/form-data'> <?php wp_nonce_field('gforms_save_entry', 'gforms_save_entry'); ?> <input type="hidden" name="action" id="action" value="" /> <input type="hidden" name="screen_mode" id="screen_mode" value="<?php echo esc_attr(rgpost('screen_mode')); ?> " /> <div class="wrap gf_entry_wrap"> <h2 class="gf_admin_page_title"> <span><?php echo esc_html__('Entry #', 'gravityforms') . absint($lead['id']); ?> </span><span class="gf_admin_page_subtitle"><span class="gf_admin_page_formid">ID: <?php echo absint($form['id']); ?> </span><span class='gf_admin_page_formname'><?php esc_html_e('Form Name', 'gravityforms'); ?> : <?php echo esc_html($form['title']); $gf_entry_locking = new GFEntryLocking(); $gf_entry_locking->lock_info($lead_id); ?> </span></span></h2> <?php if (isset($_GET['pos'])) { ?> <div class="gf_entry_detail_pagination"> <ul> <li class="gf_entry_count"> <span>entry <strong><?php echo $position + 1; ?> </strong> of <strong><?php echo $total_count; ?> </strong></span> </li> <li class="gf_entry_prev gf_entry_pagination"><?php echo GFEntryDetail::entry_detail_pagination_link($prev_pos, 'Previous Entry', 'gf_entry_prev_link', 'fa fa-arrow-circle-o-left'); ?> </li> <li class="gf_entry_next gf_entry_pagination"><?php echo GFEntryDetail::entry_detail_pagination_link($next_pos, 'Next Entry', 'gf_entry_next_link', 'fa fa-arrow-circle-o-right'); ?> </li> </ul> </div> <?php } ?> <?php RGForms::top_toolbar(); ?> <div id="poststuff" class="metabox-holder has-right-sidebar"> <div id="side-info-column" class="inner-sidebar"> <?php do_action('gform_entry_detail_sidebar_before', $form, $lead); ?> <!-- INFO BOX --> <div id="submitdiv" class="stuffbox"> <h3 class="hndle" style="cursor:default;"> <span><?php esc_html_e('Entry', 'gravityforms'); ?> </span> </h3> <div class="inside"> <div id="submitcomment" class="submitbox"> <div id="minor-publishing" style="padding:10px;"> <?php esc_html_e('Entry Id', 'gravityforms'); ?> : <?php echo absint($lead['id']); ?> <br /><br /> <?php esc_html_e('Submitted on', 'gravityforms'); ?> : <?php echo esc_html(GFCommon::format_date($lead['date_created'], false, 'Y/m/d')); ?> <br /><br /> <?php esc_html_e('User IP', 'gravityforms'); ?> : <?php echo esc_html($lead['ip']); ?> <br /><br /> <?php if (!empty($lead['created_by']) && ($usermeta = get_userdata($lead['created_by']))) { ?> <?php esc_html_e('User', 'gravityforms'); ?> : <a href="user-edit.php?user_id=<?php echo absint($lead['created_by']); ?> " alt="<?php esc_attr_e('View user profile', 'gravityforms'); ?> " title="<?php esc_attr_e('View user profile', 'gravityforms'); ?> "><?php echo esc_html($usermeta->user_login); ?> </a> <br /><br /> <?php } ?> <?php esc_html_e('Embed Url', 'gravityforms'); ?> : <a href="<?php echo esc_url($lead['source_url']); ?> " target="_blank" alt="<?php echo esc_attr($lead['source_url']); ?> " title="<?php echo esc_attr($lead['source_url']); ?> ">.../<?php echo esc_html(GFCommon::truncate_url($lead['source_url'])); ?> </a> <br /><br /> <?php if (!empty($lead['post_id'])) { $post = get_post($lead['post_id']); ?> <?php esc_html_e('Edit Post', 'gravityforms'); ?> : <a href="post.php?action=edit&post=<?php echo absint($post->ID); ?> " alt="<?php esc_attr_e('Click to edit post', 'gravityforms'); ?> " title="<?php esc_attr_e('Click to edit post', 'gravityforms'); ?> "><?php echo esc_html($post->post_title); ?> </a> <br /><br /> <?php } if (do_action('gform_enable_entry_info_payment_details', true, $lead)) { if (!empty($lead['payment_status'])) { echo $lead['transaction_type'] != 2 ? esc_html__('Payment Status', 'gravityforms') : esc_html__('Subscription Status', 'gravityforms'); ?> : <span id="gform_payment_status"><?php echo apply_filters('gform_payment_status', $lead['payment_status'], $form, $lead); ?> </span> <br /><br /> <?php if (!empty($lead['payment_date'])) { echo $lead['transaction_type'] != 2 ? esc_html__('Payment Date', 'gravityforms') : esc_html__('Start Date', 'gravityforms'); ?> : <?php echo GFCommon::format_date($lead['payment_date'], false, 'Y/m/d', $lead['transaction_type'] != 2); ?> <br /><br /> <?php } if (!empty($lead['transaction_id'])) { echo $lead['transaction_type'] != 2 ? esc_html__('Transaction Id', 'gravityforms') : esc_html__('Subscriber Id', 'gravityforms'); ?> : <?php echo esc_html($lead['transaction_id']); ?> <br /><br /> <?php } if (!rgblank($lead['payment_amount'])) { echo $lead['transaction_type'] != 2 ? esc_html__('Payment Amount', 'gravityforms') : esc_html__('Subscription Amount', 'gravityforms'); ?> : <?php echo GFCommon::to_money($lead['payment_amount'], $lead['currency']); ?> <br /><br /> <?php } } } do_action('gform_entry_info', $form['id'], $lead); ?> </div> <div id="major-publishing-actions"> <div id="delete-action"> <?php switch ($lead['status']) { case 'spam': if (GFCommon::spam_enabled($form['id'])) { ?> <a onclick="jQuery('#action').val('unspam'); jQuery('#entry_form').submit()" href="#"><?php esc_html_e('Not Spam', 'gravityforms'); ?> </a> <?php echo GFCommon::current_user_can_any('gravityforms_delete_entries') ? '|' : ''; } if (GFCommon::current_user_can_any('gravityforms_delete_entries')) { ?> <a class="submitdelete deletion" onclick="if ( confirm('<?php echo esc_js(__("You are about to delete this entry. 'Cancel' to stop, 'OK' to delete.", 'gravityforms')); ?> ') ) {jQuery('#action').val('delete'); jQuery('#entry_form').submit(); return true;} return false;" href="#"><?php esc_html_e('Delete Permanently', 'gravityforms'); ?> </a> <?php } break; case 'trash': ?> <a onclick="jQuery('#action').val('restore'); jQuery('#entry_form').submit()" href="#"><?php esc_html_e('Restore', 'gravityforms'); ?> </a> <?php if (GFCommon::current_user_can_any('gravityforms_delete_entries')) { ?> | <a class="submitdelete deletion" onclick="if ( confirm('<?php echo esc_js(__("You are about to delete this entry. 'Cancel' to stop, 'OK' to delete.", 'gravityforms')); ?> ') ) {jQuery('#action').val('delete'); jQuery('#entry_form').submit(); return true;} return false;" href="#"><?php esc_html_e('Delete Permanently', 'gravityforms'); ?> </a> <?php } break; default: if (GFCommon::current_user_can_any('gravityforms_delete_entries')) { ?> <a class="submitdelete deletion" onclick="jQuery('#action').val('trash'); jQuery('#entry_form').submit()" href="#"><?php esc_html_e('Move to Trash', 'gravityforms'); ?> </a> <?php echo GFCommon::spam_enabled($form['id']) ? '|' : ''; } if (GFCommon::spam_enabled($form['id'])) { ?> <a class="submitdelete deletion" onclick="jQuery('#action').val('spam'); jQuery('#entry_form').submit()" href="#"><?php esc_html_e('Mark as Spam', 'gravityforms'); ?> </a> <?php } } ?> </div> <div id="publishing-action"> <?php if (GFCommon::current_user_can_any('gravityforms_edit_entries') && $lead['status'] != 'trash') { $button_text = $mode == 'view' ? __('Edit', 'gravityforms') : __('Update', 'gravityforms'); $disabled = $mode == 'view' ? '' : ' disabled="disabled" '; $update_button_id = $mode == 'view' ? 'gform_edit_button' : 'gform_update_button'; $button_click = $mode == 'view' ? "jQuery('#screen_mode').val('edit');" : "jQuery('#action').val('update'); jQuery('#screen_mode').val('view');"; $update_button = '<input id="' . $update_button_id . '" ' . $disabled . ' class="button button-large button-primary" type="submit" tabindex="4" value="' . esc_attr($button_text) . '" name="save" onclick="' . $button_click . '"/>'; echo apply_filters('gform_entrydetail_update_button', $update_button); if ($mode == 'edit') { echo ' <input class="button button-large" type="submit" tabindex="5" value="' . esc_attr__('Cancel', 'gravityforms') . '" name="cancel" onclick="jQuery(\'#screen_mode\').val(\'view\');"/>'; } } ?> </div> <div class="clear"></div> </div> </div> </div> </div> <?php if (!empty($lead['payment_status']) && !apply_filters('gform_enable_entry_info_payment_details', true, $lead)) { self::payment_details_box($lead, $form); } ?> <?php do_action('gform_entry_detail_sidebar_middle', $form, $lead); ?> <?php if (GFCommon::current_user_can_any('gravityforms_edit_entry_notes')) { ?> <!-- start notifications --> <div class="postbox" id="notifications_container"> <h3 class="hndle" style="cursor:default;"> <span><?php esc_html_e('Notifications', 'gravityforms'); ?> </span> </h3> <div class="inside"> <div class="message" style="display:none;padding:10px;"></div> <div> <?php $notifications = GFCommon::get_notifications('resend_notifications', $form); if (!is_array($notifications) || count($form['notifications']) <= 0) { ?> <p class="description"><?php esc_html_e('You cannot resend notifications for this entry because this form does not currently have any notifications configured.', 'gravityforms'); ?> </p> <a href="<?php echo admin_url("admin.php?page=gf_edit_forms&view=settings&subview=notification&id={$form_id}"); ?> " class="button"><?php esc_html_e('Configure Notifications', 'gravityforms'); ?> </a> <?php } else { foreach ($notifications as $notification) { ?> <input type="checkbox" class="gform_notifications" value="<?php echo esc_attr($notification['id']); ?> " id="notification_<?php echo esc_attr($notification['id']); ?> " onclick="toggleNotificationOverride();" /> <label for="notification_<?php echo esc_attr($notification['id']); ?> "><?php echo esc_html($notification['name']); ?> </label> <br /><br /> <?php } ?> <div id="notifications_override_settings" style="display:none;"> <p class="description" style="padding-top:0; margin-top:0; width:99%;">You may override the default notification settings by entering a comma delimited list of emails to which the selected notifications should be sent.</p> <label for="notification_override_email"><?php esc_html_e('Send To', 'gravityforms'); ?> <?php gform_tooltip('notification_override_email'); ?> </label><br /> <input type="text" name="notification_override_email" id="notification_override_email" style="width:99%;" /> <br /><br /> </div> <input type="button" name="notification_resend" value="<?php esc_attr_e('Resend Notifications', 'gravityforms'); ?> " class="button" style="" onclick="ResendNotifications();" /> <span id="please_wait_container" style="display:none; margin-left: 5px;"> <i class='gficon-gravityforms-spinner-icon gficon-spin'></i> <?php esc_html_e('Resending...', 'gravityforms'); ?> </span> <?php } ?> </div> </div> </div> <!-- / end notifications --> <?php } ?> <!-- begin print button --> <div class="detail-view-print"> <a href="javascript:;" onclick="var notes_qs = jQuery('#gform_print_notes').is(':checked') ? '¬es=1' : ''; var url='<?php echo trailingslashit(site_url()); ?> ?gf_page=print-entry&fid=<?php echo absint($form['id']); ?> &lid=<?php echo absint($lead['id']); ?> ' + notes_qs; window.open (url,'printwindow');" class="button"><?php esc_html_e('Print', 'gravityforms'); ?> </a> <?php if (GFCommon::current_user_can_any('gravityforms_view_entry_notes')) { ?> <input type="checkbox" name="print_notes" value="print_notes" checked="checked" id="gform_print_notes" /> <label for="print_notes"><?php esc_html_e('include notes', 'gravityforms'); ?> </label> <?php } ?> </div> <!-- end print button --> <?php do_action('gform_entry_detail_sidebar_after', $form, $lead); ?> </div> <div id="post-body" class="has-sidebar"> <div id="post-body-content" class="has-sidebar-content"> <?php do_action('gform_entry_detail_content_before', $form, $lead); if ($mode == 'view') { self::lead_detail_grid($form, $lead, true); } else { self::lead_detail_edit($form, $lead); } do_action('gform_entry_detail', $form, $lead); if (GFCommon::current_user_can_any('gravityforms_view_entry_notes')) { ?> <div class="postbox"> <h3> <label for="name"><?php esc_html_e('Notes', 'gravityforms'); ?> </label> </h3> <form method="post"> <?php wp_nonce_field('gforms_update_note', 'gforms_update_note'); ?> <div class="inside"> <?php $notes = RGFormsModel::get_lead_notes($lead['id']); //getting email values $email_fields = GFCommon::get_email_fields($form); $emails = array(); foreach ($email_fields as $email_field) { if (!empty($lead[$email_field->id])) { $emails[] = $lead[$email_field->id]; } } //displaying notes grid $subject = ''; self::notes_grid($notes, true, $emails, $subject); ?> </div> </form> </div> <?php } do_action('gform_entry_detail_content_after', $form, $lead); ?> </div> </div> </div> </div> </form> <?php if (rgpost('action') == 'update') { ?> <div class="updated fade" style="padding:6px;"> <?php esc_html_e('Entry Updated.', 'gravityforms'); ?> </div> <?php } }
public static function update_page() { if (!GFCommon::current_user_can_any('gravityforms_view_updates')) { wp_die(__("You don't have permissions to view this page", 'gravityforms')); } if (!GFCommon::ensure_wp_version()) { return; } GFCommon::cache_remote_message(); echo GFCommon::get_remote_message(); wp_print_styles(array('thickbox')); ?> <link rel="stylesheet" href="<?php echo GFCommon::get_base_url() . '/css/admin.css'; ?> " /> <div class="wrap <?php echo GFCommon::get_browser_class(); ?> "> <h2><?php _e('Gravity Forms Updates', 'gravityforms'); ?> </h2> <?php $version_info = GFCommon::get_version_info(false); do_action('gform_after_check_update'); if (version_compare(GFCommon::$version, $version_info['version'], '<')) { $plugin_file = 'gravityforms/gravityforms.php'; $upgrade_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . urlencode($plugin_file), 'upgrade-plugin_' . $plugin_file); $message = __('There is a new version of Gravity Forms available.', 'gravityforms'); if (rgar($version_info, 'is_valid_key')) { ?> <div class="gf_update_outdated alert_yellow"> <?php echo $message . ' ' . sprintf(__('<p>You can update to the latest version automatically or download the update and install it manually. %sUpdate Automatically%s %sDownload Update%s', 'gravityforms'), "</p><a class='button-primary' href='{$upgrade_url}'>", '</a>', " <a class='button' href='{$version_info["url"]}'>", '</a>'); ?> </div> <?php } else { ?> <div class="gf_update_expired alert_red"> <?php echo $message . ' ' . __(sprintf('%sRegister%s your copy of Gravity Forms to receive access to automatic updates and support. Need a license key? %sPurchase one now%s.', '<a href="admin.php?page=gf_settings">', '</a>', '<a href="http://www.gravityforms.com">', '</a>'), 'gravityforms'); ?> </div> <?php } echo '<br/><br/>'; $changelog = RGForms::get_changelog(); echo $changelog; } else { ?> <div class="gf_update_current alert_green"> <?php _e('Your version of Gravity Forms is up to date.', 'gravityforms'); ?> </div> <?php } do_action('gform_updates'); ?> <div id='gform_upgrade_license' style="display:none;"></div> <script type="text/javascript"> jQuery(document).ready(function () { jQuery.post(ajaxurl, { action : "gf_upgrade_license", gf_upgrade_license: "<?php echo wp_create_nonce('gf_upgrade_license'); ?> "}, function (data) { if (data.trim().length > 0) jQuery("#gform_upgrade_license").replaceWith(data); } ); }); </script> </div> <?php }
/** * validate inputs * @param array $validation_result an array with elements is_valid (boolean) and form (array of form elements) * @param string $value * @param array $form * @param array $field * @return array */ public function gformFieldValidation($validation_result, $value, $form, $field) { if ($field['type'] == GFEWAY_FIELD_RECURRING) { if (!RGFormsModel::is_field_hidden($form, $field, RGForms::post('gform_field_values'))) { // get the real values $value = self::getPost($field['id']); if (!is_array($value)) { $validation_result['is_valid'] = false; $validation_result['message'] = __("This field is required.", "gravityforms"); } else { $messages = array(); if ($value['amountInit'] === false || $value['amountInit'] < 0) { $messages[] = 'Please enter a valid initial amount.'; } if (empty($value['dateInit'])) { $messages[] = 'Please enter a valid initial date in the format dd/mm/yyyy.'; } if (empty($value['amountRecur']) || $value['amountRecur'] < 0) { $messages[] = 'Please enter a valid recurring amount.'; } if (empty($value['dateStart'])) { $messages[] = 'Please enter a valid start date in the format dd/mm/yyyy.'; } if (empty($value['dateEnd'])) { $messages[] = 'Please enter a valid end date in the format dd/mm/yyyy.'; } if ($value['intervalType'] === -1) { $messages[] = 'Please select a valid interval type.'; } if (count($messages) > 0) { $validation_result['is_valid'] = false; $validation_result['message'] = implode("<br />\n", $messages); } } } } return $validation_result; }
public static function get_current_page_url($force_ssl = false) { $pageURL = 'http'; if (RGForms::get('HTTPS', $_SERVER) == 'on' || $force_ssl) { $pageURL .= 's'; } $pageURL .= '://'; $pageURL .= RGForms::get('HTTP_HOST', $_SERVER) . rgget('REQUEST_URI', $_SERVER); return $pageURL; }
public static function forms_page($form_id) { global $wpdb; if (!GFCommon::ensure_wp_version()) { return; } $update_result = ''; if (rgpost('operation') == 'trash') { check_admin_referer('gforms_trash_form', 'gforms_trash_form'); GFFormsModel::trash_form($form_id); ?> <script type="text/javascript"> jQuery(document).ready( function () { document.location.href = '?page=gf_edit_forms'; } ); </script> <?php exit; } else { if (!rgempty('gform_meta')) { check_admin_referer("gforms_update_form_{$form_id}", 'gforms_update_form'); $update_result = self::save_form_info($form_id, rgpost('gform_meta', false)); } } require_once GFCommon::get_base_path() . '/currency.php'; wp_print_styles(array('thickbox')); /* @var GF_Field_Address $gf_address_field */ $gf_address_field = GF_Fields::get('address'); ?> <link rel="stylesheet" href="<?php echo GFCommon::get_base_url(); ?> /css/admin.css?ver=<?php echo GFCommon::$version; ?> " type="text/css" /> <script type="text/javascript"> <?php GFCommon::gf_global(); ?> <?php GFCommon::gf_vars(); ?> </script> <script type="text/javascript"> function has_entry(fieldNumber) { var submitted_fields = [<?php echo RGFormsModel::get_submitted_fields($form_id); ?> ]; for (var i = 0; i < submitted_fields.length; i++) { if (submitted_fields[i] == fieldNumber) return true; } return false; } function InsertPostImageVariable(element_id, callback) { var variable = jQuery('#' + element_id + '_image_size_select').attr("variable"); var size = jQuery('#' + element_id + '_image_size_select').val(); if (size) { variable = "{" + variable + ":" + size + "}"; InsertVariable(element_id, callback, variable); jQuery('#' + element_id + '_image_size_select').hide(); jQuery('#' + element_id + '_image_size_select')[0].selectedIndex = 0; } } function InsertPostContentVariable(element_id, callback) { var variable = jQuery('#' + element_id + '_variable_select').val(); var regex = /{([^{]*?: *(\d+\.?\d*).*?)}/; matches = regex.exec(variable); if (!matches) { InsertVariable(element_id, callback); return; } variable = matches[1]; field_id = matches[2]; for (var i = 0; i < form["fields"].length; i++) { if (form["fields"][i]["id"] == field_id) { if (form["fields"][i]["type"] == "post_image") { jQuery('#' + element_id + '_image_size_select').attr("variable", variable); jQuery('#' + element_id + '_image_size_select').show(); return; } } } InsertVariable(element_id, callback); } function IsValidFormula(formula) { if (formula == '') return true; var patt = /{([^}]+)}/i, exprPatt = /^[0-9 -/*\(\)]+$/i, expr = formula.replace(/(\r\n|\n|\r)/gm, ''), match; while (match = patt.exec(expr)) { expr = expr.replace(match[0], 1); } if (exprPatt.test(expr)) { try { var r = eval(expr); return !isNaN(parseFloat(r)) && isFinite(r); } catch (e) { return false; } } else { return false; } } </script> <?php $form = !rgempty('meta', $update_result) ? rgar($update_result, 'meta') : GFFormsModel::get_form_meta($form_id); if (!isset($form['fields']) || !is_array($form['fields'])) { $form['fields'] = array(); } $form = apply_filters('gform_admin_pre_render_' . $form_id, apply_filters('gform_admin_pre_render', $form)); if (isset($form['id'])) { echo "<script type=\"text/javascript\">var form = " . json_encode($form) . ';</script>'; } else { echo "<script type=\"text/javascript\">var form = new Form();</script>"; } ?> <?php echo GFCommon::get_remote_message(); ?> <div class="wrap gforms_edit_form <?php echo GFCommon::get_browser_class(); ?> "> <?php if (empty($form_id)) { ?> <h2 class="gf_admin_page_title"><?php _e('New Form', 'gravityforms'); ?> </h2> <?php } else { ?> <h2 class="gf_admin_page_title"> <span><?php _e('Form Editor', 'gravityforms'); ?> </span><span class="gf_admin_page_subtitle"><span class="gf_admin_page_formid">ID: <?php echo absint($form['id']); ?> </span><span class="gf_admin_page_formname"><?php _e('Form Name', 'gravityforms'); ?> : <?php echo esc_html($form['title']); ?> </span></span> </h2> <?php } ?> <?php RGForms::top_toolbar(); ?> <?php switch (rgar($update_result, 'status')) { case 'invalid_json': ?> <div class="error_base gform_editor_status" id="after_update_error_dialog"> <?php _e('There was an error while saving your form.', 'gravityforms'); ?> <?php printf(__('Please %scontact our support team%s.', 'gravityforms'), '<a href="http://www.gravityhelp.com">', '</a>'); ?> </div> <?php break; case 'duplicate_title': ?> <div class="error_base gform_editor_status" id="after_update_error_dialog"> <?php _e('The form title you have entered is already taken. Please enter a unique form title.', 'gravityforms'); ?> </div> <?php break; default: if (!empty($update_result)) { ?> <div class="updated_base gform_editor_status" id="after_update_dialog"> <strong><?php _e('Form updated successfully.', 'gravityforms'); ?> </strong> </div> <?php } break; } ?> <?php // link to the google webfont library ?> <style type="text/css"> @import url('//fonts.googleapis.com/css?family=Shadows+Into+Light+Two'); </style> <form method="post" id="form_trash"> <?php wp_nonce_field('gforms_trash_form', 'gforms_trash_form'); ?> <input type="hidden" value="trash" name="operation" /> </form> <table width="100%"> <tr> <td class="pad_top" valign="top"> <?php $has_pages = GFCommon::has_pages($form); ?> <div id="gform_pagination" class="selectable gform_settings_container" style="display:<?php echo $has_pages ? 'block' : 'none'; ?> ;"> <div class="settings_control_container"> <a href="javascript:void(0);" class="form_edit_icon edit_icon_collapsed" title="<?php _e('click to edit page options', 'gravityforms'); ?> "><i class='fa fa-caret-down fa-lg'></i></a> </div> <div class="gf-pagebreak-first gf-pagebreak-container"> <div class="gf-pagebreak-text-before"><?php _e('begin form', 'gravityforms'); ?> </div> <div class="gf-pagebreak-text-main"><span><?php _e('START PAGING', 'gravityforms'); ?> </span></div> <div class="gf-pagebreak-text-after"><?php _e('top of the first page', 'gravityforms'); ?> </div> </div> <div id="pagination_settings" style="display: none;"> <ul> <li style="width:100px; padding:0px;"> <a href="#gform_pagination_settings_tab_1"><?php _e('Properties', 'gravityforms'); ?> </a></li> <li style="width:100px; padding:0px;"> <a href="#gform_pagination_settings_tab_2"><?php _e('Advanced', 'gravityforms'); ?> </a></li> </ul> <div id="gform_pagination_settings_tab_1"> <ul class="gforms_form_settings"> <li> <label for="pagination_type_container"> <?php _e('Progress Indicator', 'gravityforms'); ?> <?php gform_tooltip('form_progress_indicator'); ?> </label> <div id="pagination_type_container" class="pagination_container"> <input type="radio" id="pagination_type_percentage" name="pagination_type" value="percentage" onclick='InitPaginationOptions();' /> <label for="pagination_type_percentage" class="inline"> <?php _e('Progress Bar', 'gravityforms'); ?> </label> <input type="radio" id="pagination_type_steps" name="pagination_type" value="steps" onclick='InitPaginationOptions();' /> <label for="pagination_type_steps" class="inline"> <?php _e('Steps', 'gravityforms'); ?> </label> <input type="radio" id="pagination_type_none" name="pagination_type" value="none" onclick='InitPaginationOptions();' /> <label for="pagination_type_none" class="inline"> <?php _e('None', 'gravityforms'); ?> </label> </div> </li> <li id="percentage_style_setting"> <div class="percentage_style_setting" style="float:left; z-index: 99;"> <label for="percentage_style" style="display:block;"> <?php _e('Style', 'gravityforms'); ?> <?php gform_tooltip('form_percentage_style'); ?> </label> <select id="percentage_style" onchange="TogglePercentageStyle();"> <option value="blue"> <?php _e('Blue', 'gravityforms'); ?> </option> <option value="gray"> <?php _e('Gray', 'gravityforms'); ?> </option> <option value="green"> <?php _e('Green', 'gravityforms'); ?> </option> <option value="orange"> <?php _e('Orange', 'gravityforms'); ?> </option> <option value="red"> <?php _e('Red', 'gravityforms'); ?> </option> <option value="custom"> <?php _e('Custom', 'gravityforms'); ?> </option> </select> </div> <div class="percentage_custom_container" style="float:left; padding-left:20px;"> <label for="percentage_background_color" style="display:block;"> <?php _e('Text Color', 'gravityforms'); ?> </label> <?php self::color_picker('percentage_style_custom_color', ''); ?> </div> <div class="percentage_custom_container" style="float:left; padding-left:20px;"> <label for="percentage_background_bgcolor" style="display:block;"> <?php _e('Background Color', 'gravityforms'); ?> </label> <?php self::color_picker('percentage_style_custom_bgcolor', ''); ?> </div> </li> <li id="page_names_setting"> <label for="page_names_container"> <?php _e('Page Names', 'gravityforms'); ?> <?php gform_tooltip('form_page_names'); ?> </label> <div id="page_names_container" style="margin-top:5px;"> <!-- Populated dynamically from js.php --> </div> </li> <li id="percentage_confirmation_display_setting"> <div class="percentage_confirmation_display_setting"> <input type="checkbox" id="percentage_confirmation_display" onclick="TogglePercentageConfirmationText()"> <label for="percentage_confirmation_display" class="inline"> <?php _e('Display completed progress bar on confirmation', 'gravityforms'); ?> <?php gform_tooltip('form_percentage_confirmation_display'); ?> </label> </div> </li> <li id="percentage_confirmation_page_name_setting"> <div class="percentage_confirmation_page_name_setting"> <label for="percentage_confirmation_page_name" style="display:block;"> <?php _e('Completion Text', 'gravityforms'); ?> <?php gform_tooltip('percentage_confirmation_page_name'); ?> </label> <input type="text" id="percentage_confirmation_page_name" class="fieldwidth-3" /> </div> </li> </ul> </div> <div id="gform_pagination_settings_tab_2"> <ul class="gforms_form_settings"> <li> <label for="first_page_css_class" style="display:block;"> <?php _e('CSS Class Name', 'gravityforms'); ?> <?php gform_tooltip('form_field_css_class'); ?> </label> <input type="text" id="first_page_css_class" size="30" /> </li> </ul> </div> </div> </div> <ul id="gform_fields" class="<?php echo GFCommon::get_ul_classes($form); ?> " style="position: relative;"> <?php if (empty($form['fields'])) { ?> <?php // link to the google webfont library ?> <style type="text/css"> @import url('//fonts.googleapis.com/css?family=Shadows+Into+Light+Two'); </style> <li id="no-fields"> <div class="newform_notice"><?php _e("This form doesn't have any fields yet. Follow the steps below to get started.", 'gravityforms'); ?> <span></span></div> <?php // first step ?> <h4 class="gf_nofield_header gf_nofield_1">1. <?php _e('Select A Field Type', 'gravityforms'); ?> </h4> <p><?php _e('Start by seleting a field type from the nifty floating panels on the right.', 'gravityforms'); ?> </p> <div id="gf_nofield_1_instructions"> <span class="gf_nofield_1_instructions_heading gf_tips"><?php _e('Start Over There', 'gravityforms'); ?> </span> <span class="gf_nofield_1_instructions_copy gf_tips"><?php _e('Pick a field.. any field. Don\'t be shy.', 'gravityforms'); ?> </span> </div> <?php // second step ?> <h4 class="gf_nofield_header gf_nofield_2">2. <?php _e('Click to Add A Field', 'gravityforms'); ?> </h4> <p><?php _e('Once you've found the field type you want, click to add it to the form editor here on the left side of your screen.', 'gravityforms'); ?> </p> <div id="gf_nofield_2_instructions"> <span class="gf_nofield_2_instructions_copy gf_tips"><?php _e('Now your new field magically appears over here.', 'gravityforms'); ?> </span> </div> <?php // third step ?> <h4 class="gf_nofield_header gf_nofield_3">3. <?php _e('Edit Field Options', 'gravityforms'); ?> </h4> <p><?php _e('Click on the edit link to configure the various field options', 'gravityforms'); ?> </p> <div id="gf_nofield_3_instructions"> <span class="gf_nofield_3_instructions_copy_top gf_tips"><?php _e('Preview your changes up here.', 'gravityforms'); ?> </span> <span class="gf_nofield_3_instructions_copy_mid gf_tips"><?php _e('Edit the field options. Go ahead.. go crazy.', 'gravityforms'); ?> </span> <span class="gf_nofield_3_instructions_copy_bottom gf_tips"><?php _e('If you get stuck, mouseover the tool tips for a little help.', 'gravityforms'); ?> </span> </div> <?php // fourth step ?> <h4 class="gf_nofield_header gf_nofield_4">4. <?php _e('Drag to Arrange Fields', 'gravityforms'); ?> </h4> <p><?php _e('Drag the fields to arrange them the way you prefer', 'gravityforms'); ?> </p> <div id="gf_nofield_4_instructions"> <span class="gf_nofield_4_instructions_copy_top gf_tips"><?php _e('Grab here with your cursor.', 'gravityforms'); ?> </span> <span class="gf_nofield_4_instructions_copy_bottom gf_tips"><?php _e('Drag up or down to arrange your fields.', 'gravityforms'); ?> </span> </div> <?php // fifth step ?> <h4 class="gf_nofield_header gf_nofield_5">5. <?php _e('Save Your Form', 'gravityforms'); ?> </h4> <p><?php _e('Once you're happy with your form, remember to click on the "update form" button to save all your hard work.', 'gravityforms'); ?> </p> <div id="gf_nofield_5_instructions"> <span class="gf_nofield_5_instructions_heading gf_tips"><?php _e('Save Your New Form', 'gravityforms'); ?> </span> <span class="gf_nofield_5_instructions_copy gf_tips"><?php _e('You\'re done. That\'s it.', 'gravityforms'); ?> </span> </div> </li> <?php } ?> <?php if (is_array(rgar($form, 'fields'))) { require_once GFCommon::get_base_path() . '/form_display.php'; foreach ($form['fields'] as $field) { echo GFFormDisplay::get_field($field, '', true, $form); } } ?> </ul> <div id="gform_last_page_settings" class="selectable gform_settings_container" style="display:<?php echo $has_pages ? 'block' : 'none'; ?> ;"> <div class="settings_control_container"> <a href="javascript:void(0);" class="form_edit_icon edit_icon_collapsed" title="<?php _e('Edit Last Page', 'gravityforms'); ?> "><i class='fa fa-caret-down fa-lg'></i></a> </div> <div class="gf-pagebreak-end gf-pagebreak-container"> <div class="gf-pagebreak-text-before"><?php _e('end of last page', 'gravityforms'); ?> </div> <div class="gf-pagebreak-text-main"><span><?php _e('END PAGING', 'gravityforms'); ?> </span></div> <div class="gf-pagebreak-text-after"><?php _e('end of form', 'gravityforms'); ?> </div> </div> <div id="last_page_settings" style="display:none;"> <ul> <li style="width:100px; padding:0px;"> <a href="#gform_last_page_settings_tab_1"><?php _e('Properties', 'gravityforms'); ?> </a></li> </ul> <div id="gform_last_page_settings_tab_1"> <ul class="gforms_form_settings"> <li> <label for="last_page_button_container"> <?php _e('Previous Button', 'gravityforms'); ?> <?php gform_tooltip('form_field_last_page_button'); ?> </label> <div class="last_page_button_options" id="last_page_button_container"> <input type="radio" id="last_page_button_text" name="last_page_button" value="text" onclick="TogglePageButton('last_page');" /> <label for="last_page_button_text" class="inline"> <?php _e('Default', 'gravityforms'); ?> <?php gform_tooltip('previous_button_text'); ?> </label> <input type="radio" id="last_page_button_image" name="last_page_button" value="image" onclick="TogglePageButton('last_page');" /> <label for="last_page_button_image" class="inline"> <?php _e('Image', 'gravityforms'); ?> <?php gform_tooltip('previous_button_image'); ?> </label> <div id="last_page_button_text_container" style="margin-top:5px;"> <label for="last_page_button_text_input" class="inline"> <?php _e('Text:', 'gravityforms'); ?> </label> <input type="text" id="last_page_button_text_input" class="input_size_b" size="40" /> </div> <div id="last_page_button_image_container" style="margin-top:5px;"> <label for="last_page_button_image_url" class="inline"> <?php _e('Image Path:', 'gravityforms'); ?> </label> <input type="text" id="last_page_button_image_url" size="45" /> </div> </div> </li> </ul> </div> </div> </div> <div> <div id="after_insert_dialog" style="display:none;"> <h3><?php _e('You have successfully saved your form!', 'gravityforms'); ?> </h3> <p><?php _e('What would you like to do next?', 'gravityforms'); ?> </p> <div class="new-form-option"> <a title="<?php _e('Preview this form', 'gravityforms'); ?> " id="preview_form_link" href="<?php echo trailingslashit(site_url()); ?> ?gf_page=preview&id={formid}" target="_blank"><?php _e('Preview this Form', 'gravityforms'); ?> </a> </div> <?php if (GFCommon::current_user_can_any('gravityforms_edit_forms')) { ?> <div class="new-form-option"> <a title="<?php _e('Setup email notifications for this form', 'gravityforms'); ?> " id="notification_form_link" href="#"><?php _e('Setup Email Notifications for this Form', 'gravityforms'); ?> </a> </div> <?php } ?> <div class="new-form-option"> <a title="<?php _e('Continue editing this form', 'gravityforms'); ?> " id="edit_form_link" href="#"><?php _e('Continue Editing this Form', 'gravityforms'); ?> </a> </div> <div class="new-form-option"> <a title="<?php _e('I am done. Take me back to form list', 'gravityforms'); ?> " href="?page=gf_edit_forms"><?php _e('Return to Form List', 'gravityforms'); ?> </a> </div> </div> </div> <div id="field_settings" style="display: none;"> <ul> <li style="width:100px; padding:0px;"> <a href="#gform_tab_1"><?php _e('General', 'gravityforms'); ?> </a> </li> <li style="width:100px; padding:0px; "> <a href="#gform_tab_3"><?php _e('Appearance', 'gravityforms'); ?> </a> </li> <li style="width:100px; padding:0px; "> <a href="#gform_tab_2"><?php _e('Advanced', 'gravityforms'); ?> </a> </li> </ul> <div id="gform_tab_1"> <ul> <?php do_action('gform_field_standard_settings', 0, $form_id); ?> <li class="label_setting field_setting"> <label for="field_label"> <?php _e('Field Label', 'gravityforms'); ?> <?php gform_tooltip('form_field_label'); ?> <?php gform_tooltip('form_field_label_html'); ?> </label> <input type="text" id="field_label" class="fieldwidth-3" size="35" /> </li> <?php do_action('gform_field_standard_settings', 10, $form_id); ?> <li class="description_setting field_setting"> <label for="field_description"> <?php _e('Description', 'gravityforms'); ?> <?php gform_tooltip('form_field_description'); ?> </label> <textarea id="field_description" class="fieldwidth-3 fieldheight-2"></textarea> </li> <?php do_action('gform_field_standard_settings', 20, $form_id); ?> <li class="product_field_setting field_setting"> <label for="product_field"> <?php _e('Product Field Mapping', 'gravityforms'); ?> <?php gform_tooltip('form_field_product'); ?> </label> <select id="product_field" onchange="SetFieldProperty('productField', jQuery(this).val());"> <!-- will be populated when field is selected (js.php) --> </select> </li> <?php do_action('gform_field_standard_settings', 25, $form_id); ?> <li class="product_field_type_setting field_setting"> <label for="product_field_type"> <?php _e('Field Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_type'); ?> </label> <select id="product_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeProductType(jQuery('#product_field_type').val());});"> <option value="singleproduct"><?php _e('Single Product', 'gravityforms'); ?> </option> <option value="select"><?php _e('Drop Down', 'gravityforms'); ?> </option> <option value="radio"><?php _e('Radio Buttons', 'gravityforms'); ?> </option> <option value="price"><?php _e('User Defined Price', 'gravityforms'); ?> </option> <option value="hiddenproduct"><?php _e('Hidden', 'gravityforms'); ?> </option> <option value="calculation"><?php _e('Calculation', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 37, $form_id); ?> <li class="shipping_field_type_setting field_setting"> <label for="shipping_field_type"> <?php _e('Field Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_type'); ?> </label> <select id="shipping_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeShippingType(jQuery('#shipping_field_type').val());});"> <option value="singleshipping"><?php _e('Single Method', 'gravityforms'); ?> </option> <option value="select"><?php _e('Drop Down', 'gravityforms'); ?> </option> <option value="radio"><?php _e('Radio Buttons', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 50, $form_id); ?> <li class="base_price_setting field_setting"> <label for="field_base_price"> <?php _e('Price', 'gravityforms'); ?> <?php gform_tooltip('form_field_base_price'); ?> </label> <input type="text" id="field_base_price" onchange="SetBasePrice(this.value)" /> </li> <?php do_action('gform_field_standard_settings', 75, $form_id); ?> <li class="disable_quantity_setting field_setting"> <input type="checkbox" name="field_disable_quantity" id="field_disable_quantity" onclick="SetDisableQuantity(jQuery(this).is(':checked'));" /> <label for="field_disable_quantity" class="inline"> <?php _e('Disable quantity field', 'gravityforms'); ?> <?php gform_tooltip('form_field_disable_quantity'); ?> </label> </li> <?php do_action('gform_field_standard_settings', 100, $form_id); ?> <li class="option_field_type_setting field_setting"> <label for="option_field_type"> <?php _e('Field Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_type'); ?> </label> <select id="option_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#option_field_type').val());});"> <option value="select"><?php _e('Drop Down', 'gravityforms'); ?> </option> <option value="checkbox"><?php _e('Checkboxes', 'gravityforms'); ?> </option> <option value="radio"><?php _e('Radio Buttons', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 125, $form_id); ?> <li class="donation_field_type_setting field_setting"> <label for="donation_field_type"> <?php _e('Field Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_type'); ?> </label> <select id="donation_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeDonationType(jQuery('#donation_field_type').val());});"> <option value="select"><?php _e('Drop Down', 'gravityforms'); ?> </option> <option value="donation"><?php _e('User Defined Price', 'gravityforms'); ?> </option> <option value="radio"><?php _e('Radio Buttons', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 150, $form_id); ?> <li class="quantity_field_type_setting field_setting"> <label for="quantity_field_type"> <?php _e('Field Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_type'); ?> </label> <select id="quantity_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#quantity_field_type').val());});"> <option value="number"><?php _e('Number', 'gravityforms'); ?> </option> <option value="select"><?php _e('Drop Down', 'gravityforms'); ?> </option> <option value="hidden"><?php _e('Hidden', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 200, $form_id); ?> <li class="content_setting field_setting"> <label for="field_content"> <?php _e('Content', 'gravityforms'); ?> <?php gform_tooltip('form_field_content'); ?> </label> <textarea id="field_content" class="fieldwidth-3 fieldheight-1 merge-tag-support mt-position-right mt-prepopulate"></textarea> </li> <?php do_action('gform_field_standard_settings', 225, $form_id); ?> <li class="next_button_setting field_setting"> <label for="next_button_container"> <?php _e('Next Button', 'gravityforms'); ?> </label> <div class="next_button_options" id="next_button_container"> <input type="radio" id="next_button_text" name="next_button" value="text" onclick="TogglePageButton('next'); SetPageButton('next');" /> <label for="next_button_text" class="inline"> <?php _e('Default', 'gravityforms'); ?> <?php gform_tooltip('next_button_text'); ?> </label> <input type="radio" id="next_button_image" name="next_button" value="image" onclick="TogglePageButton('next'); SetPageButton('next');" /> <label for="next_button_image" class="inline"> <?php _e('Image', 'gravityforms'); ?> <?php gform_tooltip('next_button_image'); ?> </label> <div id="next_button_text_container" style="margin-top:5px;"> <label for="next_button_text_input" class="inline"> <?php _e('Text:', 'gravityforms'); ?> </label> <input type="text" id="next_button_text_input" class="input_size_b" size="40" /> </div> <div id="next_button_image_container" style="margin-top:5px;"> <label for="next_button_image_url" class="inline"> <?php _e('Image Path:', 'gravityforms'); ?> </label> <input type="text" id="next_button_image_url" size="45" /> </div> </div> </li> <?php do_action('gform_field_standard_settings', 237, $form_id); ?> <li class="previous_button_setting field_setting"> <label for="previous_button_container"> <?php _e('Previous Button', 'gravityforms'); ?> <?php gform_tooltip('form_field_previous_button'); ?> </label> <div class="previous_button_options" id="previous_button_container"> <input type="radio" id="previous_button_text" name="previous_button" value="text" onclick="TogglePageButton('previous'); SetPageButton('previous');" /> <label for="previous_button_text" class="inline"> <?php _e('Default', 'gravityforms'); ?> <?php gform_tooltip('previous_button_text'); ?> </label> <input type="radio" id="previous_button_image" name="previous_button" value="image" onclick="TogglePageButton('previous'); SetPageButton('previous');" /> <label for="previous_button_image" class="inline"> <?php _e('Image', 'gravityforms'); ?> <?php gform_tooltip('previous_button_image'); ?> </label> <div id="previous_button_text_container" style="margin-top:5px;"> <label for="previous_button_text_input" class="inline"> <?php _e('Text:', 'gravityforms'); ?> </label> <input type="text" id="previous_button_text_input" class="input_size_b" size="40" /> </div> <div id="previous_button_image_container" style="margin-top:5px;"> <label for="previous_button_image_url" class="inline"> <?php _e('Image Path:', 'gravityforms'); ?> </label> <input type="text" id="previous_button_image_url" size="45" /> </div> </div> </li> <?php do_action('gform_field_standard_settings', 250, $form_id); ?> <li class="disable_margins_setting field_setting"> <input type="checkbox" id="field_margins" onclick="SetFieldProperty('disableMargins', this.checked);" /> <label for="field_disable_margins" class="inline"> <?php _e('Disable default margins', 'gravityforms'); ?> <?php gform_tooltip('form_field_disable_margins'); ?> </label><br /> </li> <?php do_action('gform_field_standard_settings', 300, $form_id); ?> <li class="post_custom_field_type_setting field_setting"> <label for="post_custom_field_type"> <?php _e('Field Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_type'); ?> </label> <select id="post_custom_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#post_custom_field_type').val());});"> <optgroup class="option_header" label="<?php _e('Standard Fields', 'gravityforms'); ?> "> <option value="text"><?php _e('Single line text', 'gravityforms'); ?> </option> <option value="textarea"><?php _e('Paragraph Text', 'gravityforms'); ?> </option> <option value="select"><?php _e('Drop Down', 'gravityforms'); ?> </option> <option value="multiselect"><?php _e('Multi Select', 'gravityforms'); ?> </option> <option value="number"><?php _e('Number', 'gravityforms'); ?> </option> <option value="checkbox"><?php _e('Checkboxes', 'gravityforms'); ?> </option> <option value="radio"><?php _e('Radio Buttons', 'gravityforms'); ?> </option> <option value="hidden"><?php _e('Hidden', 'gravityforms'); ?> </option> </optgroup> <optgroup class="option_header" label="<?php _e('Advanced Fields', 'gravityforms'); ?> "> <option value="date"><?php _e('Date', 'gravityforms'); ?> </option> <option value="time"><?php _e('Time', 'gravityforms'); ?> </option> <option value="phone"><?php _e('Phone', 'gravityforms'); ?> </option> <option value="website"><?php _e('Website', 'gravityforms'); ?> </option> <option value="email"><?php _e('Email', 'gravityforms'); ?> </option> <option value="fileupload"><?php _e('File Upload', 'gravityforms'); ?> </option> <option value="list"><?php _e('List', 'gravityforms'); ?> </option> </optgroup> </select> </li> <?php do_action('gform_field_standard_settings', 350, $form_id); ?> <li class="post_tag_type_setting field_setting"> <label for="post_tag_type"> <?php _e('Field Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_type'); ?> </label> <select id="post_tag_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#post_tag_type').val());});"> <option value="text"><?php _e('Single line text', 'gravityforms'); ?> </option> <option value="select"><?php _e('Drop Down', 'gravityforms'); ?> </option> <option value="multiselect"><?php _e('Multi Select', 'gravityforms'); ?> </option> <option value="checkbox"><?php _e('Checkboxes', 'gravityforms'); ?> </option> <option value="radio"><?php _e('Radio Buttons', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 400, $form_id); ?> <?php if (class_exists('ReallySimpleCaptcha')) { ?> <li class="captcha_type_setting field_setting"> <label for="field_captcha_type"> <?php _e('Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_captcha_type'); ?> </label> <select id="field_captcha_type" onchange="StartChangeCaptchaType(jQuery(this).val())"> <option value="captcha"><?php _e('reCAPTCHA', 'gravityforms'); ?> </option> <option value="simple_captcha"><?php _e('Really Simple CAPTCHA', 'gravityforms'); ?> </option> <option value="math"><?php _e('Math Challenge', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 450, $form_id); ?> <li class="captcha_size_setting field_setting"> <label for="field_captcha_size"> <?php _e('Size', 'gravityforms'); ?> </label> <select id="field_captcha_size" onchange="SetCaptchaSize(jQuery(this).val());"> <option value="small"><?php _e('Small', 'gravityforms'); ?> </option> <option value="medium"><?php _e('Medium', 'gravityforms'); ?> </option> <option value="large"><?php _e('Large', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 500, $form_id); ?> <li class="captcha_fg_setting field_setting"> <label for="field_captcha_fg"> <?php _e('Font Color', 'gravityforms'); ?> </label> <?php self::color_picker('field_captcha_fg', 'SetCaptchaFontColor'); ?> </li> <?php do_action('gform_field_standard_settings', 550, $form_id); ?> <li class="captcha_bg_setting field_setting"> <label for="field_captcha_bg"> <?php _e('Background Color', 'gravityforms'); ?> </label> <?php self::color_picker('field_captcha_bg', 'SetCaptchaBackgroundColor'); ?> </li> <?php } do_action('gform_field_standard_settings', 600, $form_id); ?> <li class="captcha_theme_setting field_setting"> <label for="field_captcha_theme"> <?php _e('Theme', 'gravityforms'); ?> <?php gform_tooltip('form_field_recaptcha_theme'); ?> </label> <select id="field_captcha_theme" onchange="SetCaptchaTheme(this.value, '<?php echo GFCommon::get_base_url(); ?> /images/captcha_' + this.value + '.jpg')"> <option value="red"><?php _e('Red', 'gravityforms'); ?> </option> <option value="white"><?php _e('White', 'gravityforms'); ?> </option> <option value="blackglass"><?php _e('Black Glass', 'gravityforms'); ?> </option> <option value="clean"><?php _e('Clean', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 650, $form_id); ?> <li class="post_custom_field_setting field_setting"> <label for="field_custom_field_name"> <?php _e('Custom Field Name', 'gravityforms'); ?> <?php gform_tooltip('form_field_custom_field_name'); ?> </label> <div style="width:100px; float:left;"> <input type="radio" name="field_custom" id="field_custom_existing" size="10" onclick="ToggleCustomField();" /> <label for="field_custom_existing" class="inline"> <?php _e('Existing', 'gravityforms'); ?> </label> </div> <div style="width:100px; float:left;"> <input type="radio" name="field_custom" id="field_custom_new" size="10" onclick="ToggleCustomField();" /> <label for="field_custom_new" class="inline"> <?php _e('New', 'gravityforms'); ?> </label> </div> <div class="clear"> <input type="text" id="field_custom_field_name_text" size="35" /> <select id="field_custom_field_name_select" onchange="SetFieldProperty('postCustomFieldName', jQuery(this).val());"> <option value=""><?php _e('Select an existing custom field', 'gravityforms'); ?> </option> <?php $custom_field_names = RGFormsModel::get_custom_field_names(); foreach ($custom_field_names as $name) { ?> <option value="<?php echo $name; ?> "><?php echo $name; ?> </option> <?php } ?> </select> </div> </li> <?php do_action('gform_field_standard_settings', 700, $form_id); ?> <li class="post_status_setting field_setting"> <label for="field_post_status"> <?php _e('Post Status', 'gravityforms'); ?> <?php gform_tooltip('form_field_post_status'); ?> </label> <select id="field_post_status" name="field_post_status"> <?php $post_stati = apply_filters('gform_post_status_options', array('draft' => 'Draft', 'pending' => 'Pending Review', 'publish' => 'Published')); foreach ($post_stati as $value => $label) { ?> <option value="<?php echo esc_attr($value); ?> "><?php echo esc_html($label); ?> </option> <?php } ?> </select> </li> <?php do_action('gform_field_standard_settings', 750, $form_id); ?> <li class="post_author_setting field_setting"> <label for="field_post_author"> <?php _e('Default Post Author', 'gravityforms'); ?> <?php gform_tooltip('form_field_post_author'); ?> </label> <?php $args = array('name' => 'field_post_author'); $args = apply_filters('gform_author_dropdown_args_' . rgar($form, 'id'), apply_filters('gform_author_dropdown_args', $args)); wp_dropdown_users($args); ?> <div> <input type="checkbox" id="gfield_current_user_as_author" /> <label for="gfield_current_user_as_author" class="inline"><?php _e('Use logged in user as author', 'gravityforms'); ?> <?php gform_tooltip('form_field_current_user_as_author'); ?> </label> </div> </li> <?php do_action('gform_field_standard_settings', 775, $form_id); ?> <?php if (current_theme_supports('post-formats')) { ?> <li class="post_format_setting field_setting"> <label for="field_post_format"> <?php _e('Post Format', 'gravityforms'); ?> <?php gform_tooltip('form_field_post_format'); ?> </label> <?php $post_formats = get_theme_support('post-formats'); $post_formats_dropdown = '<option value="0">Standard</option>'; foreach ($post_formats[0] as $post_format) { $post_format_val = esc_attr($post_format); $post_format_text = esc_html($post_format); $post_formats_dropdown .= "<option value='{$post_format_val}'>" . ucfirst($post_format_text) . '</option>'; } echo '<select name="field_post_format" id="field_post_format">' . $post_formats_dropdown . '</select>'; ?> </li> <?php } // if theme supports post formats ?> <?php do_action('gform_field_standard_settings', 800, $form_id); ?> <li class="post_category_setting field_setting"> <label for="field_post_category"> <?php _e('Post Category', 'gravityforms'); ?> <?php gform_tooltip('form_field_post_category'); ?> </label> <?php wp_dropdown_categories(array('selected' => get_option('default_category'), 'hide_empty' => 0, 'id' => 'field_post_category', 'name' => 'field_post_category', 'orderby' => 'name', 'selected' => 'field_post_category', 'hierarchical' => true)); ?> </li> <?php do_action('gform_field_standard_settings', 825, $form_id); ?> <li class="post_category_field_type_setting field_setting"> <label for="post_category_field_type"> <?php _e('Field Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_type'); ?> </label> <select id="post_category_field_type" onchange="jQuery('#field_settings').slideUp(function(){StartChangeInputType( jQuery('#post_category_field_type').val() );});"> <option value="select"><?php _e('Drop Down', 'gravityforms'); ?> </option> <option value="checkbox"><?php _e('Checkboxes', 'gravityforms'); ?> </option> <option value="radio"><?php _e('Radio Buttons', 'gravityforms'); ?> </option> <option value="multiselect"><?php _e('Multi Select', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 850, $form_id); ?> <li class="post_category_checkbox_setting field_setting"> <label for="field_post_category"> <?php _e('Category', 'gravityforms'); ?> <?php gform_tooltip('form_field_post_category_selection'); ?> </label> <input type="radio" id="gfield_category_all" name="gfield_category" value="all" onclick="ToggleCategory();" /> <label for="gfield_category_all" class="inline"> <?php _e('All Categories', 'gravityforms'); ?> </label> <input type="radio" id="gfield_category_select" name="gfield_category" value="select" onclick="ToggleCategory();" /> <label for="form_button_image" class="inline"> <?php _e('Select Categories', 'gravityforms'); ?> </label> <div id="gfield_settings_category_container"> <table cellpadding="0" cellspacing="5"> <?php $categories = get_categories(array('hide_empty' => 0)); $count = 0; $category_rows = ''; self::_cat_rows($categories, $count, $category_rows); echo $category_rows; ?> </table> </div> </li> <?php do_action('gform_field_standard_settings', 875, $form_id); ?> <li class="post_category_initial_item_setting field_setting"> <input type="checkbox" id="gfield_post_category_initial_item_enabled" onclick="TogglePostCategoryInitialItem(); SetCategoryInitialItem();" /> <label for="gfield_post_category_initial_item_enabled" class="inline"> <?php _e('Display placeholder', 'gravityforms'); ?> <?php gform_tooltip('form_field_post_category_initial_item'); ?> </label> </li> <li id="gfield_post_category_initial_item_container"> <label for="field_post_category_initial_item"> <?php _e('Placeholder Label', 'gravityforms'); ?> </label> <input type="text" id="field_post_category_initial_item" onchange="SetCategoryInitialItem();" class="fieldwidth-3" size="35" /> </li> <?php do_action('gform_field_standard_settings', 900, $form_id); ?> <li class="post_content_template_setting field_setting"> <input type="checkbox" id="gfield_post_content_enabled" onclick="TogglePostContentTemplate();" /> <label for="gfield_post_content_enabled" class="inline"> <?php _e('Create content template', 'gravityforms'); ?> <?php gform_tooltip('form_field_post_content_template_enable'); ?> </label> <div id="gfield_post_content_container"> <div> <?php GFCommon::insert_post_content_variables($form['fields'], 'field_post_content_template', '', 25); ?> </div> <textarea id="field_post_content_template" class="fieldwidth-3 fieldheight-1"></textarea> </div> </li> <?php do_action('gform_field_standard_settings', 950, $form_id); ?> <li class="post_title_template_setting field_setting"> <input type="checkbox" id="gfield_post_title_enabled" onclick="TogglePostTitleTemplate();" /> <label for="gfield_post_title_enabled" class="inline"> <?php _e('Create content template', 'gravityforms'); ?> <?php gform_tooltip('form_field_post_title_template_enable'); ?> </label> <div id="gfield_post_title_container"> <input type="text" id="field_post_title_template" class="fieldwidth-3 merge-tag-support mt-position-right mt-hide_all_fields mt-exclude-post_image-fileupload" /> </div> </li> <?php do_action('gform_field_standard_settings', 975, $form_id); ?> <li class="customfield_content_template_setting field_setting"> <input type="checkbox" id="gfield_customfield_content_enabled" onclick="ToggleCustomFieldTemplate(); SetCustomFieldTemplate();" /> <label for="gfield_customfield_content_enabled" class="inline"> <?php _e('Create content template', 'gravityforms'); ?> <?php gform_tooltip('form_field_customfield_content_template_enable'); ?> </label> <div id="gfield_customfield_content_container"> <div> <?php GFCommon::insert_post_content_variables($form['fields'], 'field_customfield_content_template', 'SetCustomFieldTemplate', 25); ?> </div> <textarea id="field_customfield_content_template" class="fieldwidth-3 fieldheight-1"></textarea> </div> </li> <?php do_action('gform_field_standard_settings', 1000, $form_id); ?> <li class="post_image_setting field_setting"> <label><?php _e('Image Metadata', 'gravityforms'); ?> <?php gform_tooltip('form_field_image_meta'); ?> </label> <input type="checkbox" id="gfield_display_title" onclick="SetPostImageMeta();" /> <label for="gfield_display_title" class="inline"> <?php _e('Title', 'gravityforms'); ?> </label> <br /> <input type="checkbox" id="gfield_display_caption" onclick="SetPostImageMeta();" /> <label for="gfield_display_caption" class="inline"> <?php _e('Caption', 'gravityforms'); ?> </label> <br /> <input type="checkbox" id="gfield_display_description" onclick="SetPostImageMeta();" /> <label for="gfield_display_description" class="inline"> <?php _e('Description', 'gravityforms'); ?> </label> </li> <?php do_action('gform_field_standard_settings', 1025, $form_id); ?> <li class="post_image_featured_image field_setting"> <input type="checkbox" id="gfield_featured_image" onclick="SetFeaturedImage();" /> <label for="gfield_featured_image" class="inline"><?php _e('Set as Featured Image', 'gravityforms'); ?> <?php gform_tooltip('form_field_featured_image'); ?> </label> </li> <?php do_action('gform_field_standard_settings', 1050, $form_id); ?> <li class="address_setting field_setting"> <?php $addressTypes = $gf_address_field->get_address_types(rgar($form, 'id')); ?> <label for="field_address_type"> <?php _e('Address Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_address_type'); ?> </label> <select id="field_address_type" onchange="ChangeAddressType();"> <?php foreach ($addressTypes as $key => $addressType) { ?> <option value="<?php echo esc_attr($key); ?> "><?php echo esc_html($addressType['label']); ?> </option> <?php } ?> </select> <div class="custom_inputs_sub_setting gfield_sub_setting"> <label for="field_address_fields" class="inline"> <?php _e('Address Fields', 'gravityforms'); ?> <?php gform_tooltip('form_field_address_fields'); ?> </label> <div id="field_address_fields_container" style="padding-top:10px;"> <!-- content dynamically created from js.php --> </div> </div> <?php foreach ($addressTypes as $key => $addressType) { $state_label = isset($addressType['state_label']) ? esc_attr($addressType['state_label']) : __('State', 'gravityforms'); ?> <div id="address_type_container_<?php echo esc_attr($key); ?> " class="gfield_sub_setting gfield_address_type_container"> <input type="hidden" id="field_address_country_<?php echo esc_attr($key); ?> " value="<?php echo isset($addressType['country']) ? esc_attr($addressType['country']) : ''; ?> " /> <input type="hidden" id="field_address_zip_label_<?php echo esc_attr($key); ?> " value="<?php echo isset($addressType['zip_label']) ? esc_attr($addressType['zip_label']) : __('Postal Code', 'gravityforms'); ?> " /> <input type="hidden" id="field_address_state_label_<?php echo esc_attr($key); ?> " value="<?php echo $state_label; ?> " /> <input type="hidden" id="field_address_has_states_<?php echo esc_attr($key); ?> " value="<?php echo is_array(rgget('states', $addressType)) ? '1' : ''; ?> " /> <?php if (isset($addressType['states']) && is_array($addressType['states'])) { ?> <label for="field_address_default_state_<?php echo esc_attr($key); ?> "> <?php echo sprintf(__('Default %s', 'gravityforms'), $state_label); ?> <?php gform_tooltip("form_field_address_default_state_{$key}"); ?> </label> <select id="field_address_default_state_<?php echo esc_attr($key); ?> " class="field_address_default_state" onchange="SetAddressProperties();"> <?php echo $gf_address_field->get_state_dropdown($addressType['states']); ?> </select> <?php } ?> <?php if (!isset($addressType['country'])) { ?> <label for="field_address_default_country_<?php echo $key; ?> "> <?php _e('Default Country', 'gravityforms'); ?> <?php gform_tooltip('form_field_address_default_country'); ?> </label> <select id="field_address_default_country_<?php echo $key; ?> " class="field_address_default_country" onchange="SetAddressProperties();"> <?php echo $gf_address_field->get_country_dropdown(); ?> </select> <?php } ?> </div> <?php } ?> </li> <?php do_action('gform_field_standard_settings', 1100, $form_id); ?> <li class="name_format_setting field_setting"> <label for="field_name_format"> <?php _e('Name Format', 'gravityforms'); ?> <?php gform_tooltip('form_field_name_format'); ?> </label> <select id="field_name_format" onchange="StartChangeNameFormat(jQuery(this).val());"> <option value="extended"><?php _e('Extended', 'gravityforms'); ?> </option> <option value="advanced"><?php _e('Advanced', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 1125, $form_id); ?> <li class="name_setting field_setting"> <div class="custom_inputs_setting gfield_sub_setting"> <label for="field_name_fields" class="inline"> <?php _e('Name Fields', 'gravityforms'); ?> <?php gform_tooltip('form_field_name_fields'); ?> </label> <div id="field_name_fields_container" style="padding-top:10px;"> <!-- content dynamically created from js.php --> </div> </div> </li> <?php do_action('gform_field_standard_settings', 1150, $form_id); ?> <li class="date_input_type_setting field_setting"> <label for="field_date_input_type"> <?php _e('Date Input Type', 'gravityforms'); ?> <?php gform_tooltip('form_field_date_input_type'); ?> </label> <select id="field_date_input_type" onchange="SetDateInputType(jQuery(this).val());"> <option value="datefield"><?php _e('Date Field', 'gravityforms'); ?> </option> <option value="datepicker"><?php _e('Date Picker', 'gravityforms'); ?> </option> <option value="datedropdown"><?php _e('Date Drop Down', 'gravityforms'); ?> </option> </select> <div id="date_picker_container"> <input type="radio" id="gsetting_icon_none" name="gsetting_icon" value="none" onclick="SetCalendarIconType(this.value);" /> <label for="gsetting_icon_none" class="inline"> <?php _e('No Icon', 'gravityforms'); ?> </label> <input type="radio" id="gsetting_icon_calendar" name="gsetting_icon" value="calendar" onclick="SetCalendarIconType(this.value);" /> <label for="gsetting_icon_calendar" class="inline"> <?php _e('Calendar Icon', 'gravityforms'); ?> </label> <input type="radio" id="gsetting_icon_custom" name="gsetting_icon" value="custom" onclick="SetCalendarIconType(this.value);" /> <label for="gsetting_icon_custom" class="inline"> <?php _e('Custom Icon', 'gravityforms'); ?> </label> <div id="gfield_icon_url_container"> <label for="gfield_calendar_icon_url" class="inline"> <?php _e('Image Path: ', 'gravityforms'); ?> </label> <input type="text" id="gfield_calendar_icon_url" size="45" /> <div class="instruction"><?php _e('Preview this form to see your custom icon.', 'gravityforms'); ?> </div> </div> </div> </li> <?php do_action('gform_field_standard_settings', 1200, $form_id); ?> <li class="date_format_setting field_setting"> <label for="field_date_format"> <?php _e('Date Format', 'gravityforms'); ?> <?php gform_tooltip('form_field_date_format'); ?> </label> <select id="field_date_format" onchange="SetDateFormat(jQuery(this).val());"> <option value="mdy">mm/dd/yyyy</option> <option value="dmy">dd/mm/yyyy</option> <option value="dmy_dash">dd-mm-yyyy</option> <option value="dmy_dot">dd.mm.yyyy</option> <option value="ymd_slash">yyyy/mm/dd</option> <option value="ymd_dash">yyyy-mm-dd</option> <option value="ymd_dot">yyyy.mm.dd</option> </select> </li> <?php do_action('gform_field_standard_settings', 1225, $form_id); ?> <li class="customize_inputs_setting field_setting"> <label for="field_enable_customize_inputs" class="inline"> <?php _e('Customize Fields', 'gravityforms'); ?> </label> <?php gform_tooltip('form_field_customize_inputs'); ?> <div id="field_customize_inputs_container" style="padding-top:10px;"> <!-- content dynamically created from js.php --> </div> </li> <?php do_action('gform_field_standard_settings', 1250, $form_id); ?> <li class="file_extensions_setting field_setting"> <label for="field_file_extension"> <?php _e('Allowed file extensions', 'gravityforms'); ?> <?php gform_tooltip('form_field_fileupload_allowed_extensions'); ?> </label> <input type="text" id="field_file_extension" size="40" /> <div> <small><?php _e('Separated with commas (i.e. jpg, gif, png, pdf)', 'gravityforms'); ?> </small> </div> </li> <?php do_action('gform_field_standard_settings', 1260, $form_id); ?> <li class="multiple_files_setting field_setting"> <input type="checkbox" id="field_multiple_files" onclick="ToggleMultiFile();" /> <label for="field_multiple_files" class="inline"> <?php _e('Enable Multi-File Upload', 'gravityforms'); ?> <?php gform_tooltip('form_field_multiple_files'); ?> </label> <div id="gform_multiple_files_options"> <br /> <div> <label for="field_max_files"> <?php _e('Maximum Number of Files', 'gravityforms'); ?> <?php gform_tooltip('form_field_max_files'); ?> </label> <input type="text" id="field_max_files" size="10" /> </div> <br /> </div> </li> <?php do_action('gform_field_standard_settings', 1267, $form_id); ?> <li class="file_size_setting field_setting"> <label for="field_max_file_size"> <?php _e('Maximum File Size', 'gravityforms'); ?> <?php gform_tooltip('form_field_max_file_size'); ?> </label> <input type="text" id="field_max_file_size" size="10" placeholder="<?php $max_upload_size = wp_max_upload_size() / 1048576; echo $max_upload_size; ?> MB" /> <div> <small><?php echo __(sprintf('Maximum allowed on this server: %sMB', $max_upload_size), 'gravityforms'); ?> </small> </div> </li> <?php do_action('gform_field_standard_settings', 1275, $form_id); ?> <li class="columns_setting field_setting"> <input type="checkbox" id="field_columns_enabled" onclick="SetFieldProperty('enableColumns', this.checked); ToggleColumns();" /> <label for="field_columns_enabled" class="inline"><?php _e('Enable multiple columns', 'gravityforms'); gform_tooltip('form_field_columns'); ?> </label> <br /> <div id="gfield_settings_columns_container"> <ul id="field_columns"></ul> </div> </li> <?php do_action('gform_field_standard_settings', 1287, $form_id); ?> <li class="maxrows_setting field_setting"> <label for="field_maxrows"> <?php _e('Maximum Rows', 'gravityforms'); ?> <?php gform_tooltip('form_field_maxrows'); ?> </label> <input type="text" id="field_maxrows" /> </li> <?php do_action('gform_field_standard_settings', 1300, $form_id); ?> <li class="time_format_setting field_setting"> <label for="field_time_format"> <?php _e('Time Format', 'gravityforms'); ?> <?php gform_tooltip('form_field_time_format'); ?> </label> <select id="field_time_format" onchange="SetTimeFormat(this.value);"> <option value="12"><?php _e('12 hour', 'gravityforms'); ?> </option> <option value="24"><?php _e('24 hour', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 1325, $form_id); ?> <li class="phone_format_setting field_setting"> <label for="field_phone_format"> <?php _e('Phone Format', 'gravityforms'); ?> <?php gform_tooltip('form_field_phone_format'); ?> </label> <select id="field_phone_format" onchange="SetFieldPhoneFormat(jQuery(this).val());"> <option value="standard">(###) ###-####</option> <option value="international"><?php _e('International', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 1350, $form_id); ?> <li class="choices_setting field_setting"> <div style="float:right;"> <input type="checkbox" id="field_choice_values_enabled" onclick="SetFieldProperty('enableChoiceValue', this.checked); ToggleChoiceValue(); SetFieldChoices();" /> <label for="field_choice_values_enabled" class="inline gfield_value_label"><?php _e('show values', 'gravityforms'); ?> </label> </div> <?php echo apply_filters('gform_choices_setting_title', __('Choices', 'gravityforms')); ?> <?php gform_tooltip('form_field_choices'); ?> <br /> <div id="gfield_settings_choices_container"> <label class="gfield_choice_header_label"><?php _e('Label', 'gravityforms'); ?> </label><label class="gfield_choice_header_value"><?php _e('Value', 'gravityforms'); ?> </label><label class="gfield_choice_header_price"><?php _e('Price', 'gravityforms'); ?> </label> <ul id="field_choices"></ul> </div> <?php $window_title = __('Bulk Add / Predefined Choices', 'gravityforms'); ?> <input type='button' value='<?php echo esc_attr($window_title); ?> ' onclick="tb_show('<?php echo esc_js($window_title); ?> ', '#TB_inline?height=500&width=600&inlineId=gfield_bulk_add', '');" class="button" /> <div id="gfield_bulk_add" style="display:none;"> <div> <?php $predefined_choices = array(__('Countries', 'gravityforms') => $gf_address_field->get_countries(), __('U.S. States', 'gravityforms') => $gf_address_field->get_us_states(), __('Canadian Province/Territory', 'gravityforms') => $gf_address_field->get_canadian_provinces(), __('Continents', 'gravityforms') => array(__('Africa', 'gravityforms'), __('Antarctica', 'gravityforms'), __('Asia', 'gravityforms'), __('Australia', 'gravityforms'), __('Europe', 'gravityforms'), __('North America', 'gravityforms'), __('South America', 'gravityforms')), __('Gender', 'gravityforms') => array(__('Male', 'gravityforms'), __('Female', 'gravityforms'), __('Prefer Not to Answer', 'gravityforms')), __('Age', 'gravityforms') => array(__('Under 18', 'gravityforms'), __('18-24', 'gravityforms'), __('25-34', 'gravityforms'), __('35-44', 'gravityforms'), __('45-54', 'gravityforms'), __('55-64', 'gravityforms'), __('65 or Above', 'gravityforms'), __('Prefer Not to Answer', 'gravityforms')), __('Marital Status', 'gravityforms') => array(__('Single', 'gravityforms'), __('Married', 'gravityforms'), __('Divorced', 'gravityforms'), __('Widowed', 'gravityforms')), __('Employment', 'gravityforms') => array(__('Employed Full-Time', 'gravityforms'), __('Employed Part-Time', 'gravityforms'), __('Self-employed', 'gravityforms'), __('Not employed but looking for work', 'gravityforms'), __('Not employed and not looking for work', 'gravityforms'), __('Homemaker', 'gravityforms'), __('Retired', 'gravityforms'), __('Student', 'gravityforms'), __('Prefer Not to Answer', 'gravityforms')), __('Job Type', 'gravityforms') => array(__('Full-Time', 'gravityforms'), __('Part-Time', 'gravityforms'), __('Per Diem', 'gravityforms'), __('Employee', 'gravityforms'), __('Temporary', 'gravityforms'), __('Contract', 'gravityforms'), __('Intern', 'gravityforms'), __('Seasonal', 'gravityforms')), __('Industry', 'gravityforms') => array(__('Accounting/Finance', 'gravityforms'), __('Advertising/Public Relations', 'gravityforms'), __('Aerospace/Aviation', 'gravityforms'), __('Arts/Entertainment/Publishing', 'gravityforms'), __('Automotive', 'gravityforms'), __('Banking/Mortgage', 'gravityforms'), __('Business Development', 'gravityforms'), __('Business Opportunity', 'gravityforms'), __('Clerical/Administrative', 'gravityforms'), __('Construction/Facilities', 'gravityforms'), __('Consumer Goods', 'gravityforms'), __('Customer Service', 'gravityforms'), __('Education/Training', 'gravityforms'), __('Energy/Utilities', 'gravityforms'), __('Engineering', 'gravityforms'), __('Government/Military', 'gravityforms'), __('Green', 'gravityforms'), __('Healthcare', 'gravityforms'), __('Hospitality/Travel', 'gravityforms'), __('Human Resources', 'gravityforms'), __('Installation/Maintenance', 'gravityforms'), __('Insurance', 'gravityforms'), __('Internet', 'gravityforms'), __('Job Search Aids', 'gravityforms'), __('Law Enforcement/Security', 'gravityforms'), __('Legal', 'gravityforms'), __('Management/Executive', 'gravityforms'), __('Manufacturing/Operations', 'gravityforms'), __('Marketing', 'gravityforms'), __('Non-Profit/Volunteer', 'gravityforms'), __('Pharmaceutical/Biotech', 'gravityforms'), __('Professional Services', 'gravityforms'), __('QA/Quality Control', 'gravityforms'), __('Real Estate', 'gravityforms'), __('Restaurant/Food Service', 'gravityforms'), __('Retail', 'gravityforms'), __('Sales', 'gravityforms'), __('Science/Research', 'gravityforms'), __('Skilled Labor', 'gravityforms'), __('Technology', 'gravityforms'), __('Telecommunications', 'gravityforms'), __('Transportation/Logistics', 'gravityforms'), __('Other', 'gravityforms')), __('Income', 'gravityforms') => array(__('Under $20,000', 'gravityforms'), __('$20,000 - $30,000', 'gravityforms'), __('$30,000 - $40,000', 'gravityforms'), __('$40,000 - $50,000', 'gravityforms'), __('$50,000 - $75,000', 'gravityforms'), __('$75,000 - $100,000', 'gravityforms'), __('$100,000 - $150,000', 'gravityforms'), __('$150,000 or more', 'gravityforms'), __('Prefer Not to Answer', 'gravityforms')), __('Education', 'gravityforms') => array(__('High School', 'gravityforms'), __('Associate Degree', 'gravityforms'), __("Bachelor's Degree", 'gravityforms'), __('Graduate of Professional Degree', 'gravityforms'), __('Some College', 'gravityforms'), __('Other', 'gravityforms'), __('Prefer Not to Answer', 'gravityforms')), __('Days of the Week', 'gravityforms') => array(__('Sunday', 'gravityforms'), __('Monday', 'gravityforms'), __('Tuesday', 'gravityforms'), __('Wednesday', 'gravityforms'), __('Thursday', 'gravityforms'), __('Friday', 'gravityforms'), __('Saturday', 'gravityforms')), __('Months of the Year', 'gravityforms') => array(__('January', 'gravityforms'), __('February', 'gravityforms'), __('March', 'gravityforms'), __('April', 'gravityforms'), __('May', 'gravityforms'), __('June', 'gravityforms'), __('July', 'gravityforms'), __('August', 'gravityforms'), __('September', 'gravityforms'), __('October', 'gravityforms'), __('November', 'gravityforms'), __('December', 'gravityforms')), __('How Often', 'gravityforms') => array(__('Everyday', 'gravityforms'), __('Once a week', 'gravityforms'), __('2 to 3 times a week', 'gravityforms'), __('Once a month', 'gravityforms'), __(' 2 to 3 times a month', 'gravityforms'), __('Less than once a month', 'gravityforms')), __('How Long', 'gravityforms') => array(__('Less than a month', 'gravityforms'), __('1-6 months', 'gravityforms'), __('1-3 years', 'gravityforms'), __('Over 3 Years', 'gravityforms'), __('Never used', 'gravityforms')), __('Satisfaction', 'gravityforms') => array(__('Very Satisfied', 'gravityforms'), __('Satisfied', 'gravityforms'), __('Neutral', 'gravityforms'), __('Unsatisfied', 'gravityforms'), __('Very Unsatisfied', 'gravityforms')), __('Importance', 'gravityforms') => array(__('Very Important', 'gravityforms'), __('Important', 'gravityforms'), __('Somewhat Important', 'gravityforms'), __('Not Important', 'gravityforms')), __('Agreement', 'gravityforms') => array(__('Strongly Agree', 'gravityforms'), __('Agree', 'gravityforms'), __('Disagree', 'gravityforms'), __('Strongly Disagree', 'gravityforms')), __('Comparison', 'gravityforms') => array(__('Much Better', 'gravityforms'), __('Somewhat Better', 'gravityforms'), __('About the Same', 'gravityforms'), __('Somewhat Worse', 'gravityforms'), __('Much Worse', 'gravityforms')), __('Would You', 'gravityforms') => array(__('Definitely', 'gravityforms'), __('Probably', 'gravityforms'), __('Not Sure', 'gravityforms'), __('Probably Not', 'gravityforms'), __('Definitely Not', 'gravityforms')), __('Size', 'gravityforms') => array(__('Extra Small', 'gravityforms'), __('Small', 'gravityforms'), __('Medium', 'gravityforms'), __('Large', 'gravityforms'), __('Extra Large', 'gravityforms'))); $predefined_choices = apply_filters('gform_predefined_choices_' . rgar($form, 'id'), apply_filters('gform_predefined_choices', $predefined_choices)); $custom_choices = RGFormsModel::get_custom_choices(); ?> <div class="panel-instructions"><?php _e('Select a category and customize the predefined choices or paste your own list to bulk add choices.', 'gravityforms'); ?> </div> <div class="bulk-left-panel"> <ul id="bulk_items"> <?php foreach (array_keys($predefined_choices) as $name) { $key = str_replace("'", "\\'", $name); ?> <li> <a href="javascript:void(0);" onclick="SelectPredefinedChoice('<?php echo $key; ?> ');" class="bulk-choice"><?php echo $name; ?> </a> <?php } ?> </ul> </div> <div class="bulk-arrow-mid"></div> <textarea id="gfield_bulk_add_input"></textarea> <br style="clear:both;" /> <div class="panel-buttons" style=""> <input type="button" onclick="InsertBulkChoices(jQuery('#gfield_bulk_add_input').val().split('\n')); tb_remove();" class="button-primary" value="<?php _e('Insert Choices', 'gravityforms'); ?> " /> <input type="button" onclick="tb_remove();" class="button" value="<?php _e('Cancel', 'gravityforms'); ?> " /> </div> <div class="panel-custom" style=""> <a href="javascript:void(0);" onclick="LoadCustomChoicesPanel(true, 'slow');" id="bulk_save_as"><?php _e('Save as new custom choice', 'gravityforms'); ?> </a> <div id="bulk_custom_edit" style="display:none;"> <?php _e('Save as', 'gravityforms'); ?> <input type="text" id="custom_choice_name" value="<?php _e('Enter name', 'gravityforms'); ?> " onfocus="if(this.value == '<?php _e('enter name', 'gravityforms'); ?> ') this.value='';"> <a href="javascript:void(0);" onclick="SaveCustomChoices();" class="button" id="bulk_save_button"><?php _e('Save', 'gravityforms'); ?> </a> <a href="javascript:void(0);" onclick="CloseCustomChoicesPanel('slow');" id="bulk_cancel_link"><?php _e('Cancel', 'gravityforms'); ?> </a> <a href="javascript:void(0);" onclick="DeleteCustomChoice();" id="bulk_delete_link"><?php _e('Delete', 'gravityforms'); ?> </a> </div> <div id="bulk_custom_message" class="alert_yellow" style="display:none; margin-top:8px; padding: 8px;"> <!--Message will be added via javascript--> </div> </div> <script type="text/javascript"> var gform_selected_custom_choice = ''; var gform_custom_choices = <?php echo GFCommon::json_encode($custom_choices); ?> ; var gform_predefined_choices = <?php echo GFCommon::json_encode($predefined_choices); ?> ; </script> </div> </div> </li> <?php do_action('gform_field_standard_settings', 1362, $form_id); ?> <li class="other_choice_setting field_setting"> <input type="checkbox" id="field_other_choice" onclick="var value = jQuery(this).is(':checked'); SetFieldProperty('enableOtherChoice', value); UpdateFieldChoices(GetInputType(field));" /> <label for="field_other_choice" class="inline"> <?php _e('Enable "other" choice', 'gravityforms'); ?> <?php gform_tooltip('form_field_other_choice'); ?> </label> </li> <?php do_action('gform_field_standard_settings', 1368, $form_id); ?> <li class="email_confirm_setting field_setting"> <input type="checkbox" id="gfield_email_confirm_enabled" onclick="SetEmailConfirmation(this.checked);" /> <label for="gfield_email_confirm_enabled" class="inline"> <?php _e('Enable Email Confirmation', 'gravityforms'); ?> <?php gform_tooltip('form_field_email_confirm_enable'); ?> </label> </li> <?php do_action('gform_field_standard_settings', 1375, $form_id); ?> <li class="password_strength_setting field_setting"> <input type="checkbox" id="gfield_password_strength_enabled" onclick="TogglePasswordStrength(); SetPasswordStrength(this.checked);" /> <label for="gfield_password_strength_enabled" class="inline"> <?php _e('Enable Password Strength', 'gravityforms'); ?> <?php gform_tooltip('form_field_password_strength_enable'); ?> </label> </li> <?php do_action('gform_field_standard_settings', 1387, $form_id); ?> <li id="gfield_min_strength_container"> <label for="gfield_min_strength"> <?php _e('Minimum Strength', 'gravityforms'); ?> <?php gform_tooltip('form_field_password_strength_enable'); ?> </label> <select id="gfield_min_strength" onchange="SetFieldProperty('minPasswordStrength', jQuery(this).val());"> <option value=""><?php _e('None', 'gravityforms'); ?> </option> <option value="short"><?php _e('Short', 'gravityforms'); ?> </option> <option value="bad"><?php _e('Bad', 'gravityforms'); ?> </option> <option value="good"><?php _e('Good', 'gravityforms'); ?> </option> <option value="strong"><?php _e('Strong', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 1400, $form_id); ?> <li class="number_format_setting field_setting"> <label for="field_number_format"> <?php _e('Number Format', 'gravityforms'); ?> <?php gform_tooltip('form_field_number_format'); ?> </label> <select id="field_number_format" onchange="SetFieldProperty('numberFormat', this.value);jQuery('.field_calculation_rounding').toggle(this.value != 'currency');"> <option value="decimal_dot">9,999.99</option> <option value="decimal_comma">9.999,99</option> <option value="currency"><?php _e('Currency', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 1415, $form_id); ?> <li class="sub_labels_setting field_setting"> <label for="field_sub_labels"> <?php _e('Sub-Labels', 'gravityforms'); ?> <?php gform_tooltip('form_field_sub_labels'); ?> </label> <div id="field_sub_labels_container"> <!-- content dynamically created from js.php --> </div> </li> <?php do_action('gform_field_standard_settings', 1425, $form_id); ?> <?php do_action('gform_field_standard_settings', 1430, $form_id); ?> <li class="credit_card_setting field_setting"> <label> <?php _e('Supported Credit Cards', 'gravityforms'); ?> <?php gform_tooltip('form_field_credit_cards'); ?> </label> <ul> <?php $cards = GFCommon::get_card_types(); foreach ($cards as $card) { ?> <li> <input type="checkbox" id="field_credit_card_<?php echo esc_attr($card['slug']); ?> " value="<?php echo esc_attr($card['slug']); ?> " onclick="SetCardType(this, this.value);" /> <label for="field_credit_card_<?php echo esc_attr($card['slug']); ?> " class="inline"><?php echo esc_html($card['name']); ?> </label> </li> <?php } ?> </ul> </li> <?php do_action('gform_field_standard_settings', 1435, $form_id); ?> <li class="credit_card_style_setting field_setting"> <label for="credit_card_style"> <?php _e('Card Icon Style', 'gravityforms'); ?> <?php gform_tooltip('form_field_card_style'); ?> </label> <select id="credit_card_style" onchange="SetFieldProperty('creditCardStyle', this.value);"> <option value="style1"><?php _e('Standard', 'gravityforms'); ?> </option> <option value="style2"><?php _e('3D', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_standard_settings', 1440, $form_id); ?> <li class="input_mask_setting field_setting"> <input type="checkbox" id="field_input_mask" onclick="ToggleInputMask();" /> <label for="field_input_mask" class="inline"> <?php _e('Input Mask', 'gravityforms'); ?> <?php gform_tooltip('form_field_mask'); ?> </label><br /> <div id="gform_input_mask"> <br /> <div style="width:100px; float:left;"> <input type="radio" name="field_mask_option" id="field_mask_standard" size="10" onclick="ToggleInputMaskOptions();" /> <label for="field_mask_standard" class="inline"> <?php _e('Standard', 'gravityforms'); ?> </label> </div> <div style="width:100px; float:left;"> <input type="radio" name="field_mask_option" id="field_mask_custom" size="10" onclick="ToggleInputMaskOptions();" /> <label for="field_mask_custom" class="inline"> <?php _e('Custom', 'gravityforms'); ?> </label> </div> <div class="clear"></div> <input type="text" id="field_mask_text" size="35" /> <p class="mask_text_description" style="margin:5px 0 0;"> <?php _e('Enter a custom mask', 'gravityforms'); ?> . <a href="javascript:void(0);" onclick="tb_show('<?php _e('Custom Mask Instructions', 'gravityforms'); ?> ', '#TB_inline?width=350&inlineId=custom_mask_instructions', '');"><?php _e('Help', 'gravityforms'); ?> </a> </p> <div id="custom_mask_instructions" style="display:none;"> <div class="custom_mask_instructions"> <h4><?php _e('Usage', 'gravityforms'); ?> </h4> <ul class="description-list"> <li><?php _e("Use a <em>'9'</em> to indicate a numerical character.", 'gravityforms'); ?> </li> <li><?php _e("Use a lower case <em>'a'</em> to indicate an alphabetical character.", 'gravityforms'); ?> </li> <li><?php _e("Use an asterick <em>'*'</em> to indicate any alphanumeric character.", 'gravityforms'); ?> </li> <li><?php _e("Use a question mark <em>'?'</em> to indicate optional characters. <em>Note:</em> All characters after the question mark will be optional.", 'gravityforms'); ?> </li> <li><?php _e('All other characters are literal values and will be displayed automatically.', 'gravityforms'); ?> </li> </ul> <h4><?php _e('Examples', 'gravityforms'); ?> </h4> <ul class="examples-list"> <li> <h5><?php _e('Date', 'gravityforms'); ?> </h5> <span class="label"><?php _e('Mask', 'gravityforms'); ?> </span> <code>99/99/9999</code><br /> <span class="label"><?php _e('Valid Input', 'gravityforms'); ?> </span> <code>10/21/2011</code> </li> <li> <h5><?php _e('Social Security Number', 'gravityforms'); ?> </h5> <span class="label"><?php _e('Mask', 'gravityforms'); ?> </span> <code>999-99-9999</code><br /> <span class="label"><?php _e('Valid Input', 'gravityforms'); ?> </span> <code>987-65-4329</code> </li> <li> <h5><?php _e('Course Code', 'gravityforms'); ?> </h5> <span class="label"><?php _e('Mask', 'gravityforms'); ?> </span> <code>aaa 999</code><br /> <span class="label"><?php _e('Valid Input', 'gravityforms'); ?> </span> <code>BIO 101</code> </li> <li> <h5><?php _e('License Key', 'gravityforms'); ?> </h5> <span class="label"><?php _e('Mask', 'gravityforms'); ?> </span> <code>***-***-***</code><br /> <span class="label"><?php _e('Valid Input', 'gravityforms'); ?> </span> <code>a9a-f0c-28Q</code> </li> <li> <h5><?php _e('Zip Code w/ Optional Plus Four', 'gravityforms'); ?> </h5> <span class="label"><?php _e('Mask', 'gravityforms'); ?> </span> <code>99999?-9999</code><br /> <span class="label"><?php _e('Valid Input', 'gravityforms'); ?> </span> <code>23462</code> or <code>23462-4062</code> </li> </ul> </div> </div> <select id="field_mask_select" onchange="SetFieldProperty('inputMaskValue', jQuery(this).val());"> <option value=""><?php _e('Select a Mask', 'gravityforms'); ?> </option> <?php $masks = RGFormsModel::get_input_masks(); foreach ($masks as $mask_name => $mask_value) { ?> <option value="<?php echo esc_attr($mask_value); ?> "><?php echo esc_html($mask_name); ?> </option> <?php } ?> </select> </div> </li> <?php do_action('gform_field_standard_settings', 1450, $form_id); ?> <li class="maxlen_setting field_setting"> <label for="field_maxlen"> <?php _e('Maximum Characters', 'gravityforms'); ?> <?php gform_tooltip('form_field_maxlength'); ?> </label> <input type="text" id="field_maxlen" /></input> </li> <?php do_action('gform_field_standard_settings', 1500, $form_id); ?> <li class="range_setting field_setting"> <div style="clear:both;"><?php _e('Range', 'gravityforms'); ?> <?php gform_tooltip('form_field_number_range'); ?> </div> <div style="width:90px; float:left;"> <input type="text" id="field_range_min" size="10" /> <label for="field_range_min"> <?php _e('Min', 'gravityforms'); ?> </label> </div> <div style="width:90px; float:left;"> <input type="text" id="field_range_max" size="10" /> <label for="field_range_max"> <?php _e('Max', 'gravityforms'); ?> </label> </div> <br class="clear" /> </li> <?php do_action('gform_field_standard_settings', 1550, $form_id); ?> <li class="calculation_setting field_setting"> <div class="field_enable_calculation"> <input type="checkbox" id="field_enable_calculation" onclick="ToggleCalculationOptions(this.checked, field);" /> <label for="field_enable_calculation" class="inline"> <?php _e('Enable Calculation', 'gravityforms'); ?> <?php gform_tooltip('form_field_enable_calculation'); ?> </label> </div> <div id="calculation_options" style="display:none;margin-top:10px;"> <label for="field_calculation_formula"> <?php _e('Formula', 'gravityforms'); ?> <?php gform_tooltip('form_field_calculation_formula'); ?> </label> <div> <?php GFCommon::insert_calculation_variables($form['fields'], 'field_calculation_formula', '', 'FormulaContentCallback', 40); ?> <div class="gf_calculation_buttons"> <?php foreach (array('+', '-', '/', '*', '(', ')', '.') as $button) { ?> <input type="button" value="<?php echo in_array($button, array('.')) ? $button : " {$button} "; ?> " onclick="InsertVariable('field_calculation_formula', 'FormulaContentCallback', this.value);" /> <?php } ?> </div> </div> <textarea id="field_calculation_formula" class="fieldwidth-3 fieldheight-2"></textarea> <br /> <a href="javascript:void(0)" onclick="var field = GetSelectedField(); alert(IsValidFormula(field.calculationFormula) ? '<?php _e('The formula appears to be valid.', 'gravityforms'); ?> ' : '<?php _e('There appears to be a problem with the formula.', 'gravityforms'); ?> ');"><?php _e('Validate Formula', 'gravityforms'); ?> </a> <div class="field_calculation_rounding"> <label for="field_calculation_rounding" style="margin-top:10px;"> <?php _e('Rounding', 'gravityforms'); ?> <?php gform_tooltip('form_field_calculation_rounding'); ?> </label> <select id="field_calculation_rounding" onchange="SetFieldProperty('calculationRounding', this.value);"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="norounding">Do not round</option> </select> </div> </div> <br class="clear" /> </li> <?php do_action('gform_field_standard_settings', 1600, $form_id); ?> <li class="rules_setting field_setting"> <?php _e('Rules', 'gravityforms'); ?> <br /> <input type="checkbox" id="field_required" onclick="SetFieldRequired(this.checked);" /> <label for="field_required" class="inline"> <?php _e('Required', 'gravityforms'); ?> <?php gform_tooltip('form_field_required'); ?> </label><br /> <div class="duplicate_setting field_setting"> <input type="checkbox" id="field_no_duplicates" onclick="SetFieldProperty('noDuplicates', this.checked);" /> <label for="field_no_duplicates" class="inline"> <?php _e('No Duplicates', 'gravityforms'); ?> <?php gform_tooltip('form_field_no_duplicate'); ?> </label> </div> </li> <?php do_action('gform_field_standard_settings', -1, $form_id); ?> </ul> </div> <div id="gform_tab_3"> <ul> <?php do_action('gform_field_appearance_settings', 0, $form_id); ?> <li class="placeholder_setting field_setting"> <label for="field_placeholder"> <?php _e('Placeholder', 'gravityforms'); ?> <?php gform_tooltip('form_field_placeholder'); ?> </label> <input type="text" id="field_placeholder" class="field_placeholder fieldwidth-2 merge-tag-support mt-position-right mt-prepopulate" /> </li> <?php do_action('gform_field_appearance_settings', 20, $form_id); ?> <li class="placeholder_textarea_setting field_setting"> <label for="field_placeholder_textarea"> <?php _e('Placeholder', 'gravityforms'); ?> <?php gform_tooltip('form_field_placeholder'); ?> </label> <textarea id="field_placeholder_textarea" class="field_placeholder fieldwidth-3 merge-tag-support mt-position-right mt-prepopulate"></textarea> </li> <?php do_action('gform_field_appearance_settings', 50, $form_id); ?> <li class="input_placeholders_setting field_setting"> <label> <?php _e('Placeholders', 'gravityforms'); ?> <?php gform_tooltip('form_field_input_placeholders'); ?> </label> <div id="field_input_placeholders_container"> <!-- content dynamically created from js.php --> </div> </li> <?php do_action('gform_field_appearance_settings', 100, $form_id); $label_placement_form_setting = rgar($form, 'labelPlacement'); switch ($label_placement_form_setting) { case 'left_label': $label_placement_form_setting_label = __('Left aligned', 'gravityforms'); break; case 'right_label': $label_placement_form_setting_label = __('Right aligned', 'gravityforms'); break; case 'top_label': default: $label_placement_form_setting_label = __('Top aligned', 'gravityforms'); } $enable_label_visiblity_settings = apply_filters('gform_enable_field_label_visibility_settings', false); $description_placement_form_setting = rgar($form, 'descriptionPlacement'); $description_placement_form_setting_label = $description_placement_form_setting == 'above' ? $description_placement_form_setting_label = __('Above inputs', 'gravityforms') : ($description_placement_form_setting_label = __('Below inputs', 'gravityforms')); ?> <li class="label_placement_setting field_setting"> <?php if ($enable_label_visiblity_settings) { ?> <label for="field_label_placement"> <?php _e('Field Label Visibility', 'gravityforms'); ?> <?php gform_tooltip('form_field_label_placement'); ?> </label> <select id="field_label_placement" onchange="SetFieldLabelPlacement(jQuery(this).val());"> <option value=""><?php printf(__('Visible (%s)', 'gravityforms'), esc_html($label_placement_form_setting_label)); ?> </option> <option value="hidden_label"><?php _e('Hidden', 'gravityforms'); ?> </option> </select> <?php } ?> <div id="field_description_placement_container" style="display:none; padding-top:10px;"> <label for="field_description_placement"> <?php _e('Description Placement', 'gravityforms'); ?> <?php gform_tooltip('form_field_description_placement'); ?> </label> <select id="field_description_placement" onchange="SetFieldDescriptionPlacement(jQuery(this).val());"> <option value=""><?php printf(__('Use Form Setting (%s)', 'gravityforms'), esc_html($description_placement_form_setting_label)); ?> </option> <option value="below"><?php _e('Below inputs', 'gravityforms'); ?> </option> <option value="above"><?php _e('Above inputs', 'gravityforms'); ?> </option> </select> </div> </li> <?php do_action('gform_field_appearance_settings', 150, $form_id); $sub_label_placement_form_setting = rgar($form, 'subLabelPlacement'); $sub_label_placement_form_setting_label = $sub_label_placement_form_setting == 'above' ? $sub_label_placement_form_setting_label = __('Above inputs', 'gravityforms') : ($sub_label_placement_form_setting_label = __('Below inputs', 'gravityforms')); ?> <li class="sub_label_placement_setting field_setting"> <label for="field_sub_label_placement"> <?php _e('Sub-Label Placement', 'gravityforms'); ?> <?php gform_tooltip('form_field_sub_label_placement'); ?> </label> <select id="field_sub_label_placement" onchange="SetFieldSubLabelPlacement(jQuery(this).val());"> <option value=""><?php printf(__('Use Form Setting (%s)', 'gravityforms'), esc_html($sub_label_placement_form_setting_label)); ?> </option> <option value="below"><?php _e('Below inputs', 'gravityforms'); ?> </option> <option value="above"><?php _e('Above inputs', 'gravityforms'); ?> </option> <?php if ($enable_label_visiblity_settings) { ?> <option value="hidden_label"><?php _e('Hidden', 'gravityforms'); ?> </option> <?php } ?> </select> </li> <?php do_action('gform_field_appearance_settings', 200, $form_id); ?> <li class="error_message_setting field_setting"> <label for="field_error_message"> <?php _e('Custom Validation Message', 'gravityforms'); ?> <?php gform_tooltip('form_field_validation_message'); ?> </label> <input type="text" id="field_error_message" class="fieldwidth-2" /> </li> <?php do_action('gform_field_appearance_settings', 250, $form_id); ?> <li class="css_class_setting field_setting"> <label for="field_css_class"> <?php _e('Custom CSS Class', 'gravityforms'); ?> <?php gform_tooltip('form_field_css_class'); ?> </label> <input type="text" id="field_css_class" size="30" /> </li> <?php do_action('gform_field_appearance_settings', 300, $form_id); ?> <li class="enable_enhanced_ui_setting field_setting"> <input type="checkbox" id="gfield_enable_enhanced_ui" onclick="SetFieldProperty('enableEnhancedUI', jQuery(this).is(':checked') ? 1 : 0);" /> <label for="gfield_enable_enhanced_ui" class="inline"> <?php _e('Enable enhanced user interface', 'gravityforms'); ?> <?php gform_tooltip('form_field_enable_enhanced_ui'); ?> </label> </li> <?php do_action('gform_field_appearance_settings', 400, $form_id); ?> <li class="size_setting field_setting"> <label for="field_size"> <?php _e('Field Size', 'gravityforms'); ?> <?php gform_tooltip('form_field_size'); ?> </label> <select id="field_size" onchange="SetFieldSize(jQuery(this).val());"> <option value="small"><?php _e('Small', 'gravityforms'); ?> </option> <option value="medium"><?php _e('Medium', 'gravityforms'); ?> </option> <option value="large"><?php _e('Large', 'gravityforms'); ?> </option> </select> </li> </ul> </div> <div id="gform_tab_2"> <ul> <?php do_action('gform_field_advanced_settings', 0, $form_id); ?> <li class="admin_label_setting field_setting"> <label for="field_admin_label"> <?php _e('Admin Field Label', 'gravityforms'); ?> <?php gform_tooltip('form_field_admin_label'); ?> </label> <input type="text" id="field_admin_label" size="35" /> </li> <?php do_action('gform_field_advanced_settings', 25, $form_id); do_action('gform_field_advanced_settings', 35, $form_id); do_action('gform_field_advanced_settings', 50, $form_id); do_action('gform_field_advanced_settings', 100, $form_id); do_action('gform_field_advanced_settings', 125, $form_id); ?> <li class="default_value_setting field_setting"> <label for="field_default_value"> <?php _e('Default Value', 'gravityforms'); ?> <?php gform_tooltip('form_field_default_value'); ?> </label> <input type="text" id="field_default_value" class="field_default_value fieldwidth-2 merge-tag-support mt-position-right mt-prepopulate" /> </li> <?php do_action('gform_field_advanced_settings', 150, $form_id); ?> <li class="default_value_textarea_setting field_setting"> <label for="field_default_value_textarea"> <?php _e('Default Value', 'gravityforms'); ?> <?php gform_tooltip('form_field_default_value'); ?> </label> <textarea id="field_default_value_textarea" class="field_default_value fieldwidth-3 merge-tag-support mt-position-right mt-prepopulate"></textarea> </li> <?php do_action('gform_field_advanced_settings', 155, $form_id); ?> <li class="name_prefix_choices_setting field_setting" style="display:none;"> <?php _e('Prefix Choices', 'gravityforms'); ?> <?php gform_tooltip('form_field_name_prefix_choices'); ?> <br /> <div id="gfield_settings_prefix_input_choices_container" class="gfield_settings_input_choices_container"> <label class="gfield_choice_header_label"><?php _e('Label', 'gravityforms'); ?> </label><label class="gfield_choice_header_value"><?php _e('Value', 'gravityforms'); ?> </label> <ul id="field_prefix_choices" class="field_input_choices"> <!-- content dynamically created from js.php --> </ul> </div> </li> <?php do_action('gform_field_advanced_settings', 175, $form_id); ?> <li class="default_input_values_setting field_setting"> <label> <?php _e('Default Values', 'gravityforms'); ?> <?php gform_tooltip('form_field_default_input_values'); ?> </label> <div id="field_default_input_values_container"> <!-- content dynamically created from js.php --> </div> </li> <?php do_action('gform_field_advanced_settings', 185, $form_id); ?> <li class="copy_values_option field_setting"> <input type="checkbox" id="field_enable_copy_values_option" /> <label for="field_enable_copy_values_option" class="inline"> <?php _e('Display option to use the values submitted in different field', 'gravityforms'); ?> <?php gform_tooltip('form_field_enable_copy_values_option'); ?> </label> <div id="field_copy_values_disabled" style="display:none;padding-top: 10px;"> <span class="instruction" style="margin-left:0"> <?php _e('To activate this option, please add a field to be used as the source.', 'gravityforms'); ?> <?php gform_tooltip('form_field_enable_copy_values_disabled'); ?> </span> </div> <div id="field_copy_values_container" style="display:none;" class="gfield_sub_setting"> <label for="field_copy_values_option_label"> <?php _e('Option Label', 'gravityforms'); ?> <?php gform_tooltip('form_field_copy_values_option_label'); ?> </label> <input id="field_copy_values_option_label" type="text" class="fieldwidth-2" /> <label for="field_copy_values_option_field" style="padding-top: 10px;"> <?php _e('Source Field', 'gravityforms'); ?> <?php gform_tooltip('form_field_copy_values_option_field'); ?> </label> <select id="field_copy_values_option_field"> <!-- content dynamically created --> </select> <div style="padding-top: 10px;"> <input type="checkbox" id="field_copy_values_option_default" /> <label for="field_copy_values_option_default" class="inline"> <?php _e('Activated by default', 'gravityforms'); ?> <?php gform_tooltip('form_field_copy_values_option_default'); ?> </label> </div> </div> </li> <?php do_action('gform_field_advanced_settings', 200, $form_id); do_action('gform_field_advanced_settings', 225, $form_id); ?> <li class="credit_card_icon_style_setting field_setting"> <label> <?php _e('Credit Card Icon Style', 'gravityforms'); ?> <?php gform_tooltip('form_field_credit_card_icon_style'); ?> </label> <ul> <?php $cards = GFCommon::get_card_types(); foreach ($cards as $card) { ?> <li> <input type="checkbox" id="field_credit_card_<?php echo esc_attr($card['slug']); ?> " value="<?php echo esc_attr($card['slug']); ?> " onclick="SetCardType(this, this.value);" /> <label for="field_credit_card_<?php echo esc_attr($card['slug']); ?> " class="inline"><?php echo esc_html($card['name']); ?> </label> </li> <?php } ?> </ul> </li> <?php do_action('gform_field_advanced_settings', 250, $form_id); ?> <li class="captcha_language_setting field_setting"> <label for="field_captcha_language"> <?php _e('Language', 'gravityforms'); ?> <?php gform_tooltip('form_field_recaptcha_language'); ?> </label> <select id="field_captcha_language" onchange="SetFieldProperty('captchaLanguage', this.value);"> <option value="en"><?php _e('English', 'gravityforms'); ?> </option> <option value="nl"><?php _e('Dutch', 'gravityforms'); ?> </option> <option value="fr"><?php _e('French', 'gravityforms'); ?> </option> <option value="de"><?php _e('German', 'gravityforms'); ?> </option> <option value="pt"><?php _e('Portuguese', 'gravityforms'); ?> </option> <option value="ru"><?php _e('Russian', 'gravityforms'); ?> </option> <option value="es"><?php _e('Spanish', 'gravityforms'); ?> </option> <option value="tr"><?php _e('Turkish', 'gravityforms'); ?> </option> </select> </li> <?php do_action('gform_field_advanced_settings', 300, $form_id); do_action('gform_field_advanced_settings', 325, $form_id); ?> <li class="add_icon_url_setting field_setting"> <label for="field_add_icon_url"> <?php _e('Add Icon URL', 'gravityforms'); ?> <?php gform_tooltip('form_field_add_icon_url'); ?> </label> <input type="text" id="field_add_icon_url" class="fieldwidth-2" /> </li> <?php do_action('gform_field_advanced_settings', 337, $form_id); ?> <li class="delete_icon_url_setting field_setting"> <label for="field_delete_icon_url"> <?php _e('Delete Icon URL', 'gravityforms'); ?> <?php gform_tooltip('form_field_delete_icon_url'); ?> </label> <input type="text" id="field_delete_icon_url" class="fieldwidth-2" /> </li> <?php do_action('gform_field_advanced_settings', 350, $form_id); ?> <li class="password_field_setting field_setting"> <input type="checkbox" id="field_password" onclick="SetPasswordProperty(this.checked);" /> <label for="field_password" class="inline"><?php _e('Enable Password Input', 'gravityforms'); gform_tooltip('form_field_password'); ?> </label> </li> <?php do_action('gform_field_advanced_settings', 375, $form_id); ?> <li class="force_ssl_field_setting field_setting"> <input type="checkbox" id="field_force_ssl" onclick="SetFieldProperty('forceSSL', this.checked);" /> <label for="field_force_ssl" class="inline"><?php _e('Force SSL', 'gravityforms'); gform_tooltip('form_field_force_ssl'); ?> </label> </li> <?php do_action('gform_field_advanced_settings', 400, $form_id); ?> <li class="visibility_setting field_setting"> <label><?php _e('Visibility', 'gravityforms'); ?> <?php gform_tooltip('form_field_visibility'); ?> </label> <div> <input type="radio" name="field_visibility" id="field_visibility_everyone" size="10" onclick="SetFieldAdminOnly(!this.checked);" /> <label for="field_visibility_everyone" class="inline"> <?php _e('Everyone', 'gravityforms'); ?> </label> <input type="radio" name="field_visibility" id="field_visibility_admin" size="10" onclick="SetFieldAdminOnly(this.checked);" /> <label for="field_visibility_admin" class="inline"> <?php _e('Admin Only', 'gravityforms'); ?> </label> </div> <br class="clear" /> </li> <?php do_action('gform_field_advanced_settings', 450, $form_id); ?> <li class="prepopulate_field_setting field_setting"> <input type="checkbox" id="field_prepopulate" onclick="SetFieldProperty('allowsPrepopulate', this.checked); ToggleInputName()" /> <label for="field_prepopulate" class="inline"><?php _e('Allow field to be populated dynamically', 'gravityforms'); ?> <?php gform_tooltip('form_field_prepopulate'); ?> </label> <br /> <div id="field_input_name_container" style="display:none; padding-top:10px;"> <!-- content dynamically created from js.php --> </div> </li> <?php do_action('gform_field_advanced_settings', 500, $form_id); ?> <li class="conditional_logic_field_setting field_setting"> <input type="checkbox" id="field_conditional_logic" onclick="SetFieldProperty('conditionalLogic', this.checked ? new ConditionalLogic() : null); ToggleConditionalLogic(false, 'field');" /> <label for="field_conditional_logic" class="inline"><?php _e('Enable Conditional Logic', 'gravityforms'); ?> <?php gform_tooltip('form_field_conditional_logic'); ?> </label> <br /> <div id="field_conditional_logic_container" style="display:none; padding-top:10px;"> <!-- content dynamically created from js.php --> </div> </li> <?php do_action('gform_field_advanced_settings', 525, $form_id); ?> <li class="conditional_logic_page_setting field_setting"> <input type="checkbox" id="page_conditional_logic" onclick="SetFieldProperty('conditionalLogic', this.checked ? new ConditionalLogic() : null); ToggleConditionalLogic(false, 'page');" /> <label for="page_conditional_logic" class="inline"><?php _e('Enable Page Conditional Logic', 'gravityforms'); ?> <?php gform_tooltip('form_page_conditional_logic'); ?> </label> <br /> <div id="page_conditional_logic_container" style="display:none; padding-top:10px;"> <!-- content dynamically created from js.php --> </div> </li> <?php do_action('gform_field_advanced_settings', 550, $form_id); ?> <li class="conditional_logic_nextbutton_setting field_setting"> <input type="checkbox" id="next_button_conditional_logic" onclick="SetNextButtonConditionalLogic(this.checked); ToggleConditionalLogic(false, 'next_button');" /> <label for="next_button_conditional_logic" class="inline"><?php _e('Enable Next Button Conditional Logic', 'gravityforms'); ?> <?php gform_tooltip('form_nextbutton_conditional_logic'); ?> </label> <br /> <div id="next_button_conditional_logic_container" style="display:none; padding-top:10px;"> <!-- content dynamically created from js.php --> </div> </li> <?php do_action('gform_field_advanced_settings', -1, $form_id); ?> </ul> </div> </div> </td> <td valign="top" align="right"> <div id="add_fields"> <div id="floatMenu"> <!-- begin add button boxes --> <ul id="sidebarmenu1" class="menu collapsible expandfirst"> <?php $standard_fields = array(array('class' => 'button', 'data-type' => 'text', 'value' => GFCommon::get_field_type_title('text')), array('class' => 'button', 'data-type' => 'textarea', 'value' => GFCommon::get_field_type_title('textarea')), array('class' => 'button', 'data-type' => 'select', 'value' => GFCommon::get_field_type_title('select')), array('class' => 'button', 'data-type' => 'multiselect', 'value' => GFCommon::get_field_type_title('multiselect')), array('class' => 'button', 'data-type' => 'number', 'value' => GFCommon::get_field_type_title('number')), array('class' => 'button', 'data-type' => 'checkbox', 'value' => GFCommon::get_field_type_title('checkbox')), array('class' => 'button', 'data-type' => 'radio', 'value' => GFCommon::get_field_type_title('radio')), array('class' => 'button', 'data-type' => 'hidden', 'value' => GFCommon::get_field_type_title('hidden')), array('class' => 'button', 'data-type' => 'html', 'value' => GFCommon::get_field_type_title('html')), array('class' => 'button', 'data-type' => 'section', 'value' => GFCommon::get_field_type_title('section')), array('class' => 'button', 'data-type' => 'page', 'value' => GFCommon::get_field_type_title('page'))); $advanced_fields = array(array('class' => 'button', 'data-type' => 'name', 'value' => GFCommon::get_field_type_title('name')), array('class' => 'button', 'data-type' => 'date', 'value' => GFCommon::get_field_type_title('date')), array('class' => 'button', 'data-type' => 'time', 'value' => GFCommon::get_field_type_title('time')), array('class' => 'button', 'data-type' => 'phone', 'value' => GFCommon::get_field_type_title('phone')), array('class' => 'button', 'data-type' => 'address', 'value' => GFCommon::get_field_type_title('address')), array('class' => 'button', 'data-type' => 'website', 'value' => GFCommon::get_field_type_title('website')), array('class' => 'button', 'data-type' => 'email', 'value' => GFCommon::get_field_type_title('email'))); if (apply_filters('gform_enable_password_field', false)) { $advanced_fields[] = array('class' => 'button', 'data-type' => 'password', 'value' => GFCommon::get_field_type_title('password')); } $advanced_fields[] = array('class' => 'button', 'data-type' => 'fileupload', 'value' => GFCommon::get_field_type_title('fileupload')); $advanced_fields[] = array('class' => 'button', 'data-type' => 'captcha', 'value' => GFCommon::get_field_type_title('captcha')); $advanced_fields[] = array('class' => 'button', 'data-type' => 'list', 'value' => GFCommon::get_field_type_title('list')); $post_fields = array(array('class' => 'button', 'data-type' => 'post_title', 'value' => GFCommon::get_field_type_title('post_title')), array('class' => 'button', 'data-type' => 'post_content', 'value' => GFCommon::get_field_type_title('post_content')), array('class' => 'button', 'data-type' => 'post_excerpt', 'value' => GFCommon::get_field_type_title('post_excerpt')), array('class' => 'button', 'data-type' => 'post_tags', 'value' => GFCommon::get_field_type_title('post_tags')), array('class' => 'button', 'data-type' => 'post_category', 'value' => GFCommon::get_field_type_title('post_category')), array('class' => 'button', 'data-type' => 'post_image', 'value' => GFCommon::get_field_type_title('post_image')), array('class' => 'button', 'data-type' => 'post_custom_field', 'value' => GFCommon::get_field_type_title('post_custom_field'))); $pricing_fields = array(array('class' => 'button', 'data-type' => 'product', 'value' => GFCommon::get_field_type_title('product')), array('class' => 'button', 'data-type' => 'quantity', 'value' => GFCommon::get_field_type_title('quantity')), array('class' => 'button', 'data-type' => 'option', 'value' => GFCommon::get_field_type_title('option')), array('class' => 'button', 'data-type' => 'shipping', 'value' => GFCommon::get_field_type_title('shipping')), array('class' => 'button', 'data-type' => 'total', 'value' => GFCommon::get_field_type_title('total'))); if (apply_filters('gform_enable_credit_card_field', false)) { $pricing_fields[] = array('class' => 'button', 'data-type' => 'creditcard', 'value' => GFCommon::get_field_type_title('creditcard')); } $field_groups = array(array('name' => 'standard_fields', 'label' => __('Standard Fields', 'gravityforms'), 'fields' => $standard_fields, 'tooltip_class' => 'tooltip_bottomleft'), array('name' => 'advanced_fields', 'label' => __('Advanced Fields', 'gravityforms'), 'fields' => $advanced_fields), array('name' => 'post_fields', 'label' => __('Post Fields', 'gravityforms'), 'fields' => $post_fields)); $field_groups[] = array('name' => 'pricing_fields', 'label' => __('Pricing Fields', 'gravityforms'), 'fields' => $pricing_fields); foreach (GF_Fields::get_all() as $gf_field) { $field_groups = $gf_field->add_button($field_groups); } $field_groups = apply_filters('gform_add_field_buttons', $field_groups); foreach ($field_groups as $group) { $tooltip_class = empty($group['tooltip_class']) ? 'tooltip_left' : $group['tooltip_class']; ?> <li id="add_<?php echo esc_attr($group['name']); ?> " class="add_field_button_container"> <div class="button-title-link <?php echo $group['name'] == 'standard_fields' ? 'gf_button_title_active' : ''; ?> "> <div class="add-buttons-title"><?php echo esc_html($group['label']); ?> <?php gform_tooltip("form_{$group['name']}", $tooltip_class); ?> </div> </div> <ul> <li class="add-buttons"> <ol class="field_type"> <?php self::display_buttons($group['fields']); ?> </ol> </li> </ul> </li> <?php } ?> </ul> <br style="clear:both;" /> <!--end add button boxes --> <?php if (GFCommon::current_user_can_any('gravityforms_delete_forms')) { $trash_link = '<a class="submitdelete" title="' . __('Move this form to the trash', 'gravityforms') . '" onclick="if(confirm(\'' . __("Would you like to move this form to the trash? \\'Cancel\\' to stop. \\'OK\\' to continue", 'gravityforms') . '\')){ gf_vars.isFormTrash = true; jQuery(\'#form_trash\')[0].submit();} else{return false;}">' . __('Move to Trash', 'gravityforms') . '</a>'; $trash_link = apply_filters('gform_form_delete_link', $trash_link); // deprecated echo apply_filters('gform_form_trash_link', $trash_link); } $button_text = rgar($form, 'id') > 0 ? __('Update Form', 'gravityforms') : __('Save Form', 'gravityforms'); $isNew = rgar($form, 'id') > 0 ? 0 : 1; $save_button = '<input type="button" class="button button-large button-primary update-form" value="' . $button_text . '" onclick="SaveForm(' . $isNew . ');" />'; $save_button = apply_filters('gform_save_form_button', $save_button); echo $save_button; ?> <span id="please_wait_container" style="display:none;"><i class='gficon-gravityforms-spinner-icon gficon-spin'></i></span> <div class="updated_base" id="after_update_dialog" style="display:none;"> <strong><?php _e('Form updated successfully.', 'gravityforms'); ?> <a title="<?php _e('Preview this form', 'gravityforms'); ?> " href="<?php echo trailingslashit(site_url()); ?> ?gf_page=preview&id=<?php echo absint(rgar($form, 'id')); ?> " target="_blank"><?php _e('Preview', 'gravityforms'); ?> </a></strong> </div> <div class="error_base" id="after_update_error_dialog" style="padding:10px 10px 16px 10px; display:none;"> <?php _e('There was an error while saving your form.', 'gravityforms'); ?> <?php printf(__('Please %scontact our support team%s.', 'gravityforms'), '<a href="http://www.gravityhelp.com">', '</a>'); ?> </div> <!-- this field allows us to force onblur events for field setting inputs that are otherwise not triggered when closing the field settings UI --> <input type="text" id="gform_force_focus" style="position:absolute;left:-9999em;" /> <form method="post" id="gform_update"> <?php wp_nonce_field("gforms_update_form_{$form_id}", 'gforms_update_form'); ?> <input type="hidden" id="gform_meta" name="gform_meta" /> </form> </div> </div> </td> </tr> </table> </div> <!-- // including form setting hooks as a temporary fix to prevent issues where users using the "gform_before_update" hook are expecting form settings to be included on the form editor page --> <div style="display:none;"> <!--form settings--> <?php do_action('gform_properties_settings', 100, $form_id); ?> <?php do_action('gform_properties_settings', 200, $form_id); ?> <?php do_action('gform_properties_settings', 300, $form_id); ?> <?php do_action('gform_properties_settings', 400, $form_id); ?> <?php do_action('gform_properties_settings', 500, $form_id); ?> <!--advanced settings--> <?php do_action('gform_advanced_settings', 100, $form_id); ?> <?php do_action('gform_advanced_settings', 200, $form_id); ?> <?php do_action('gform_advanced_settings', 300, $form_id); ?> <?php do_action('gform_advanced_settings', 400, $form_id); ?> <?php do_action('gform_advanced_settings', 500, $form_id); ?> <?php do_action('gform_advanced_settings', 600, $form_id); ?> <?php do_action('gform_advanced_settings', 700, $form_id); ?> <?php do_action('gform_advanced_settings', 800, $form_id); ?> </div> <?php self::inline_scripts($form); require_once GFCommon::get_base_path() . '/js.php'; }