Exemple #1
0
function print_tooltip_scripts()
{
    wp_enqueue_style('gform_tooltip', GFCommon::get_base_url() . '/css/tooltip.css', null, GFCommon::$version);
    wp_enqueue_style('gform_font_awesome', GFCommon::get_base_url() . '/css/font-awesome.css', null, GFCommon::$version);
    wp_print_scripts('gform_tooltip_init');
    wp_print_styles('gform_tooltip', 'gform_font_awesome');
}
 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'));
 }
Exemple #3
0
function print_tooltip_scripts()
{
    wp_register_script('qtip-lib', GFCommon::get_base_url() . "/js/jquery.qtip-1.0.0-rc2.min.js", null, GFCommon::$version);
    wp_enqueue_script('qtip-init', GFCommon::get_base_url() . "/js/qtip_init.js", array('qtip-lib'), GFCommon::$version);
    wp_enqueue_style("gf_tooltip", GFCommon::get_base_url() . "/css/tooltip.css", null, GFCommon::$version);
    wp_print_scripts();
    wp_print_styles();
}
Exemple #4
0
function print_tooltip_scripts()
{
    $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
    wp_enqueue_style('gform_tooltip', GFCommon::get_base_url() . "/css/tooltip{$min}.css", null, GFCommon::$version);
    wp_enqueue_style('gform_font_awesome', GFCommon::get_base_url() . "/css/font-awesome{$min}.css", null, GFCommon::$version);
    wp_print_scripts('gform_tooltip_init');
    wp_print_styles('gform_tooltip', 'gform_font_awesome');
}
 function column_is_active($item)
 {
     $is_active = intval(rgar($item, "is_active"));
     $src = GFCommon::get_base_url() . "/images/active{$is_active}.png";
     $title = $is_active ? __("Active", "gravityforms") : __("Inactive", "gravityforms");
     $img = sprintf("<img src=\"{$src}\" class=\"toggle_active\" title=\"{$title}\" data-feed-id=\"%s\" style=\"cursor:pointer\";/>", $item['id']);
     return $img;
 }
function wps_gform_enqueue_scripts($form, $ajax)
{
    // cycle through fields to see if tos is being used
    foreach ($form['fields'] as $field) {
        if ($field['type'] === 'dateinline') {
            $url = plugins_url('gform_dateinline.js', __FILE__);
            wp_enqueue_script("gform_dateinline_script", $url, array("jquery", "jquery-ui-datepicker"), '1.0');
            // Note WPS_JS is a constant I’ve set for all my child theme’s custom JS.
            wp_register_style('datepicker', GFCommon::get_base_url() . '/css/datepicker.min.css', null, GFCommon::$version);
            wp_enqueue_style('datepicker');
            break;
        }
    }
}
 public function get_field_input($form, $value = '', $entry = null)
 {
     $lead_id = absint(rgar($entry, 'id'));
     $form_id = absint($form['id']);
     $is_entry_detail = $this->is_entry_detail();
     $is_form_editor = $this->is_form_editor();
     $id = absint($this->id);
     $field_id = $is_entry_detail || $is_form_editor || $form_id == 0 ? "input_{$id}" : 'input_' . $form_id . "_{$id}";
     $size = $this->size;
     $class_suffix = $is_entry_detail ? '_admin' : '';
     $class = $size . $class_suffix;
     $disabled_text = $is_form_editor ? 'disabled="disabled"' : '';
     $tabindex = $this->get_tabindex();
     $multiple_files = $this->multipleFiles;
     $file_list_id = 'gform_preview_' . $form_id . '_' . $id;
     $is_entry_detail = $this->is_entry_detail();
     $is_form_editor = $this->is_form_editor();
     $is_admin = $is_entry_detail || $is_form_editor;
     $max_upload_size = !$is_admin && $this->maxFileSize > 0 ? $this->maxFileSize * 1048576 : wp_max_upload_size();
     $allowed_extensions = !empty($this->allowedExtensions) ? join(',', GFCommon::clean_extensions(explode(',', strtolower($this->allowedExtensions)))) : array();
     if (!empty($allowed_extensions)) {
         $extensions_message = esc_attr(sprintf(__('Accepted file types: %s.', 'gravityforms'), str_replace(',', ', ', $allowed_extensions)));
     } else {
         $extensions_message = '';
     }
     if ($multiple_files) {
         $upload_action_url = trailingslashit(site_url()) . '?gf_page=' . GFCommon::get_upload_page_slug();
         $max_files = $this->maxFiles > 0 ? $this->maxFiles : 0;
         $browse_button_id = 'gform_browse_button_' . $form_id . '_' . $id;
         $container_id = 'gform_multifile_upload_' . $form_id . '_' . $id;
         $drag_drop_id = 'gform_drag_drop_area_' . $form_id . '_' . $id;
         $messages_id = "gform_multifile_messages_{$form_id}_{$id}";
         if (empty($allowed_extensions)) {
             $allowed_extensions = '*';
         }
         $disallowed_extensions = GFCommon::get_disallowed_file_extensions();
         if (defined('DOING_AJAX') && DOING_AJAX && 'rg_change_input_type' === rgpost('action')) {
             $plupload_init = array();
         } else {
             $plupload_init = array('runtimes' => 'html5,flash,html4', 'browse_button' => $browse_button_id, 'container' => $container_id, 'drop_element' => $drag_drop_id, 'filelist' => $file_list_id, 'unique_names' => true, 'file_data_name' => 'file', 'url' => $upload_action_url, 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array('mime_types' => array(array('title' => __('Allowed Files', 'gravityforms'), 'extensions' => $allowed_extensions)), 'max_file_size' => $max_upload_size . 'b'), 'multipart' => true, 'urlstream_upload' => false, 'multipart_params' => array('form_id' => $form_id, 'field_id' => $id), 'gf_vars' => array('max_files' => $max_files, 'message_id' => $messages_id, 'disallowed_extensions' => $disallowed_extensions));
             if (rgar($form, 'requireLogin')) {
                 $plupload_init['multipart_params']['_gform_file_upload_nonce_' . $form_id] = wp_create_nonce('gform_file_upload_' . $form_id, '_gform_file_upload_nonce_' . $form_id);
             }
             // plupload 2 was introduced in WordPress 3.9. Plupload 1 accepts a slightly different init array.
             if (version_compare(get_bloginfo('version'), '3.9-RC1', '<')) {
                 $plupload_init['max_file_size'] = $max_upload_size . 'b';
                 $plupload_init['filters'] = array(array('title' => __('Allowed Files', 'gravityforms'), 'extensions' => $allowed_extensions));
             }
         }
         $plupload_init = gf_apply_filters('gform_plupload_settings', $form_id, $plupload_init, $form_id, $this);
         $drop_files_here_text = esc_html__('Drop files here or', 'gravityforms');
         $select_files_text = esc_attr__('Select files', 'gravityforms');
         $plupload_init_json = htmlspecialchars(json_encode($plupload_init), ENT_QUOTES, 'UTF-8');
         $upload = "<div id='{$container_id}' data-settings='{$plupload_init_json}' class='gform_fileupload_multifile'>\n\t\t\t\t\t\t\t\t\t\t<div id='{$drag_drop_id}' class='gform_drop_area'>\n\t\t\t\t\t\t\t\t\t\t\t<span class='gform_drop_instructions'>{$drop_files_here_text} </span>\n\t\t\t\t\t\t\t\t\t\t\t<input id='{$browse_button_id}' type='button' value='{$select_files_text}' class='button gform_button_select_files' aria-describedby='extensions_message' {$tabindex} />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>";
         if (!$is_admin) {
             $upload .= "<span id='extensions_message' class='screen-reader-text'>{$extensions_message}</span>";
             $upload .= "<div class='validation_message'>\n\t\t\t\t\t\t\t\t<ul id='{$messages_id}'>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>";
         }
         if ($is_entry_detail) {
             $upload .= sprintf('<input type="hidden" name="input_%d" value=\'%s\' />', $id, esc_attr($value));
         }
     } else {
         $upload = '';
         if ($max_upload_size <= 2047 * 1048576) {
             //  MAX_FILE_SIZE > 2048MB fails. The file size is checked anyway once uploaded, so it's not necessary.
             $upload = sprintf("<input type='hidden' name='MAX_FILE_SIZE' value='%d' />", $max_upload_size);
         }
         $upload .= sprintf("<input name='input_%d' id='%s' type='file' class='%s' aria-describedby='extensions_message' {$tabindex} %s/>", $id, $field_id, esc_attr($class), $disabled_text);
         if (!$is_admin) {
             $upload .= "<span id='extensions_message' class='screen-reader-text'>{$extensions_message}</span>";
         }
     }
     if ($is_entry_detail && !empty($value)) {
         // edit entry
         $file_urls = $multiple_files ? json_decode($value) : array($value);
         $upload_display = $multiple_files ? '' : "style='display:none'";
         $preview = "<div id='upload_{$id}' {$upload_display}>{$upload}</div>";
         $preview .= sprintf("<div id='%s'></div>", $file_list_id);
         $preview .= sprintf("<div id='preview_existing_files_%d'>", $id);
         foreach ($file_urls as $file_index => $file_url) {
             if (GFCommon::is_ssl() && strpos($file_url, 'http:') !== false) {
                 $file_url = str_replace('http:', 'https:', $file_url);
             }
             $download_file_text = esc_attr__('Download file', 'gravityforms');
             $delete_file_text = esc_attr__('Delete file', 'gravityforms');
             $file_index = intval($file_index);
             $file_url = esc_attr($file_url);
             $display_file_url = GFCommon::truncate_url($file_url);
             $download_button_url = GFCommon::get_base_url() . '/images/download.png';
             $delete_button_url = GFCommon::get_base_url() . '/images/delete.png';
             $preview .= "<div id='preview_file_{$file_index}' class='ginput_preview'>\n\t\t\t\t\t\t\t\t<a href='{$file_url}' target='_blank' alt='{$file_url}' title='{$file_url}'>{$display_file_url}</a>\n\t\t\t\t\t\t\t\t<a href='{$file_url}' target='_blank' alt='{$download_file_text}' title='{$download_file_text}'>\n\t\t\t\t\t\t\t\t<img src='{$download_button_url}' style='margin-left:10px;'/></a><a href='javascript:void(0);' alt='{$delete_file_text}' title='{$delete_file_text}' onclick='DeleteFile({$lead_id},{$id},this);' ><img src='{$delete_button_url}' style='margin-left:10px;'/></a>\n\t\t\t\t\t\t\t</div>";
         }
         $preview .= '</div>';
         return $preview;
     } else {
         $input_name = "input_{$id}";
         $uploaded_files = isset(GFFormsModel::$uploaded_files[$form_id][$input_name]) ? GFFormsModel::$uploaded_files[$form_id][$input_name] : array();
         $file_infos = $multiple_files ? $uploaded_files : RGFormsModel::get_temp_filename($form_id, $input_name);
         if (!empty($file_infos)) {
             $preview = sprintf("<div id='%s'>", $file_list_id);
             $file_infos = $multiple_files ? $uploaded_files : array($file_infos);
             foreach ($file_infos as $file_info) {
                 $file_upload_markup = apply_filters('gform_file_upload_markup', "<img alt='" . esc_attr__('Delete file', 'gravityforms') . "' title='" . esc_attr__('Delete file', 'gravityforms') . "' class='gform_delete' src='" . GFCommon::get_base_url() . "/images/delete.png' onclick='gformDeleteUploadedFile({$form_id}, {$id}, this);' /> <strong>" . esc_html($file_info['uploaded_filename']) . '</strong>', $file_info, $form_id, $id);
                 $preview .= "<div class='ginput_preview'>{$file_upload_markup}</div>";
             }
             $preview .= '</div>';
             if (!$multiple_files) {
                 $upload = str_replace(" class='", " class='gform_hidden ", $upload);
             }
             return "<div class='ginput_container ginput_container_fileupload'>" . $upload . " {$preview}</div>";
         } else {
             $preview = $multiple_files ? sprintf("<div id='%s'></div>", $file_list_id) : '';
             return "<div class='ginput_container ginput_container_fileupload'>{$upload}</div>" . $preview;
         }
     }
 }
    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 '&nbsp;&nbsp;<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') ? '&notes=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 
        }
    }
Exemple #9
0
				field_str += "<tr class='input_placeholder_row' data-input_id='" + id + "' id='input_placeholder_row_" + inputId + "'><td><label for='field_placeholder_" + id + "' class='inline'>" + field["inputs"][i]["label"] + "</label></td>";
				placeholder = typeof field["inputs"][i]["placeholder"] != 'undefined' ? field["inputs"][i]["placeholder"] : '';
				placeholder = placeholder.replace(/'/g, "&#039;");
				field_str += "<td><input class='input_placeholder' type='text' value='" + placeholder + "' id='field_placeholder_" + id + "' /></td></tr>";
			}
		}

		jQuery("#field_input_placeholders_container").html(field_str);
	}

	function GetCustomizeInputsUI(field, showInputSwitches) {
		if (typeof showInputSwitches == 'undefined') {
			showInputSwitches = true;
		}
		var imagesUrl = '<?php 
echo GFCommon::get_base_url() . '/images/';
?>
';
		var html, customLabel, isHidden, title, img, input, inputId, id, inputName, defaultLabel, placeholder;

		if (!field['inputs']) {
			html = "<label for='field_single_input' class='inline'><?php 
_e('Sub-Label:', 'gravityforms');
?>
&nbsp;</label>";
			customLabel = typeof field["customInputLabel"] != 'undefined' ? field["customInputLabel"] : '';
			html += "<input type='text' value='" + customLabel + "' id='field_single_custom_label' />";
		} else {
			html = "<table class='field_custom_inputs_ui'><tr>";
			if (showInputSwitches) {
				html += "<td></td>";
 public static function get_field_content($field, $value = "", $force_frontend_label = false, $form_id = 0)
 {
     $id = $field["id"];
     $size = rgar($field, "size");
     $validation_message = rgget("failed_validation", $field) && !empty($field["validation_message"]) ? sprintf("<div class='gfield_description validation_message'>%s</div>", $field["validation_message"]) : "";
     $duplicate_disabled = array('captcha', 'post_title', 'post_content', 'post_excerpt', 'total', 'shipping', 'creditcard');
     $duplicate_field_link = !in_array($field['type'], $duplicate_disabled) ? "<a class='field_duplicate_icon' id='gfield_duplicate_{$id}' title='" . __("click to duplicate this field", "gravityforms") . "' href='#' onclick='StartDuplicateField(this); return false;'>" . __("Duplicate", "gravityforms") . "</a>" : "";
     $duplicate_field_link = apply_filters("gform_duplicate_field_link", $duplicate_field_link);
     $delete_field_link = "<a class='field_delete_icon' id='gfield_delete_{$id}' title='" . __("click to delete this field", "gravityforms") . "' href='#' onclick='StartDeleteField(this); return false;'>" . __("Delete", "gravityforms") . "</a>";
     $delete_field_link = apply_filters("gform_delete_field_link", $delete_field_link);
     $field_type_title = GFCommon::get_field_type_title($field["type"]);
     $admin_buttons = IS_ADMIN ? "<div class='gfield_admin_icons'><div class='gfield_admin_header_title'>{$field_type_title} : " . __("Field ID", "gravityforms") . " {$field["id"]}</div>" . $delete_field_link . $duplicate_field_link . "<a class='field_edit_icon edit_icon_collapsed' title='" . __("click to edit this field", "gravityforms") . "'>" . __("Edit", "gravityforms") . "</a></div>" : "";
     $field_label = $force_frontend_label ? $field["label"] : GFCommon::get_label($field);
     if (rgar($field, "inputType") == "singleproduct" && !rgempty($field["id"] . ".1", $value)) {
         $field_label = rgar($value, $field["id"] . ".1");
     }
     $field_id = IS_ADMIN || $form_id == 0 ? "input_{$id}" : "input_" . $form_id . "_{$id}";
     $required_div = IS_ADMIN || rgar($field, "isRequired") ? sprintf("<span class='gfield_required'>%s</span>", $field["isRequired"] ? "*" : "") : "";
     $target_input_id = "";
     $is_description_above = rgar($field, "descriptionPlacement") == "above";
     switch (RGFormsModel::get_input_type($field)) {
         case "section":
             $description = self::get_description(rgget("description", $field), "gsection_description");
             $field_content = sprintf("%s<h2 class='gsection_title'>%s</h2>%s", $admin_buttons, esc_html($field_label), $description);
             break;
         case "page":
             //only executed on the form editor in the admin
             $page_label = __("Page Break", "gravityforms");
             $src = GFCommon::get_base_url() . "/images/gf_pagebreak_inline.png";
             $field_content = "{$admin_buttons} <label class='gfield_label'>&nbsp;</label><img src='{$src}' alt='{$page_label}' title='{$page_label}' />";
             break;
         case "adminonly_hidden":
         case "hidden":
         case "html":
             $field_content = !IS_ADMIN ? "{FIELD}" : ($field_content = sprintf("%s<label class='gfield_label' for='%s'>%s</label>{FIELD}", $admin_buttons, $field_id, esc_html($field_label)));
             break;
         case "checkbox":
         case "radio":
             $description = self::get_description(rgget("description", $field), "gfield_description");
             if ($is_description_above) {
                 $field_content = sprintf("%s<label class='gfield_label'>%s%s</label>%s{FIELD}%s", $admin_buttons, esc_html($field_label), $required_div, $description, $validation_message);
             } else {
                 $field_content = sprintf("%s<label class='gfield_label'>%s%s</label>{FIELD}%s%s", $admin_buttons, esc_html($field_label), $required_div, $description, $validation_message);
             }
             break;
         case "name":
             switch (rgar($field, "nameFormat")) {
                 case "simple":
                     $target_input_id = $field_id;
                     break;
                 case "extended":
                     $target_input_id = $field_id . "_2";
                     break;
                 default:
                     $target_input_id = $field_id . "_3";
             }
         case "address":
             if (empty($target_input_id)) {
                 $target_input_id = $field_id . "_1";
             }
         default:
             if (empty($target_input_id)) {
                 $target_input_id = $field_id;
             }
             $description = self::get_description(rgget("description", $field), "gfield_description");
             if ($is_description_above) {
                 $field_content = sprintf("%s<label class='gfield_label' for='%s'>%s%s</label>%s{FIELD}%s", $admin_buttons, $target_input_id, esc_html($field_label), $required_div, $description, $validation_message);
             } else {
                 $field_content = sprintf("%s<label class='gfield_label' for='%s'>%s%s</label>{FIELD}%s%s", $admin_buttons, $target_input_id, esc_html($field_label), $required_div, $description, $validation_message);
             }
             break;
     }
     if (RGFormsModel::get_input_type($field) == "creditcard" && !GFCommon::is_ssl() && !IS_ADMIN) {
         $field_content = "<div class='gfield_creditcard_warning_message'>" . __("This page is unsecured. Do not enter a real credit card number. Use this field only for testing purposes. ", "gravityforms") . "</div>" . $field_content;
     }
     $value = self::default_if_empty($field, $value);
     $field_content = str_replace("{FIELD}", GFCommon::get_field_input($field, $value, 0, $form_id), $field_content);
     $field_content = apply_filters("gform_field_content", $field_content, $field, $value, 0, $form_id);
     return $field_content;
 }
Exemple #11
0
    public static function page_header($title = '')
    {
        $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
        // register admin styles
        wp_register_style('gform_admin', GFCommon::get_base_url() . "/css/admin{$min}.css");
        wp_print_styles(array('jquery-ui-styles', 'gform_admin'));
        $current_tab = rgempty('view', $_GET) ? 'export_entry' : rgget('view');
        $setting_tabs = self::get_tabs();
        // kind of boring having to pass the title, optionally get it from the settings tab
        if (!$title) {
            foreach ($setting_tabs as $tab) {
                if ($tab['name'] == $current_tab) {
                    $title = $tab['name'];
                }
            }
        }
        ?>


		<div class="wrap <?php 
        echo sanitize_html_class($current_tab);
        ?>
">

		<h2><?php 
        echo esc_html($title);
        ?>
</h2>

		<?php 
        GFCommon::display_admin_message();
        ?>

		<div id="gform_tab_group" class="gform_tab_group vertical_tabs">
		<ul id="gform_tabs" class="gform_tabs">
			<?php 
        foreach ($setting_tabs as $tab) {
            $query = array('view' => $tab['name']);
            if (isset($tab['query'])) {
                $query = array_merge($query, $tab['query']);
            }
            $url = add_query_arg($query);
            ?>
				<li <?php 
            echo $current_tab == $tab['name'] ? "class='active'" : '';
            ?>
>
					<a href="<?php 
            echo esc_url($url);
            ?>
"><?php 
            echo esc_html($tab['label']);
            ?>
</a>
				</li>
			<?php 
        }
        ?>
		</ul>

		<div id="gform_tab_container" class="gform_tab_container">
		<div class="gform_tab_content" id="tab_<?php 
        echo esc_attr($current_tab);
        ?>
">

	<?php 
    }
Exemple #12
0
    public static function export_lead_page()
    {
        ?>
        <script type='text/javascript' src='<?php 
        echo GFCommon::get_base_url();
        ?>
/js/jquery-ui/ui.datepicker.js?ver=<?php 
        echo GFCommon::$version;
        ?>
'></script>
        <script type="text/javascript">
            function SelectExportForm(formId){
                if(!formId)
                    return;

                var mysack = new sack("<?php 
        echo admin_url("admin-ajax.php");
        ?>
" );
                mysack.execute = 1;
                mysack.method = 'POST';
                mysack.setVar( "action", "rg_select_export_form" );
                mysack.setVar( "rg_select_export_form", "<?php 
        echo wp_create_nonce("rg_select_export_form");
        ?>
" );
                mysack.setVar( "form_id", formId);
                mysack.encVar( "cookie", document.cookie, false );
                mysack.onError = function() { alert('<?php 
        echo esc_js(__("Ajax error while selecting a form", "gravityforms"));
        ?>
' )};
                mysack.runAJAX();

                return true;
            }

            function EndSelectExportForm(aryFields){
                if(aryFields.length == 0)
                {
                    jQuery("#export_field_container, #export_date_container, #export_submit_container").hide()
                    return;
                }

                var fieldList = "<li><input type='checkbox' onclick=\"jQuery('.gform_export_field').attr('checked', this.checked); jQuery('#gform_export_check_all').html(this.checked ? '<strong><?php 
        _e("Deselect All", "gravityforms");
        ?>
</strong>' : '<strong><?php 
        _e("Select All", "gravityforms");
        ?>
</strong>'); \"> <label id='gform_export_check_all'><strong><?php 
        _e("Select All", "gravityforms");
        ?>
</strong></label></li>";
                for(var i=0; i<aryFields.length; i++){
                    fieldList += "<li><input type='checkbox' id='export_field_" + i + "' name='export_field[]' value='" + aryFields[i][0] + "' class='gform_export_field'> <label for='export_field_" + i + "'>" + aryFields[i][1] + "</label></li>";
                }
                jQuery("#export_field_list").html(fieldList);
                jQuery("#export_date_start, #export_date_end").datepicker({dateFormat: 'yy-mm-dd'});

                jQuery("#export_field_container, #export_date_container, #export_submit_container").hide().show();
            }
        </script>
        <link rel="stylesheet" href="<?php 
        echo GFCommon::get_base_url();
        ?>
/css/admin.css"/>

        <div class="wrap">
            <img alt="<?php 
        _e("Gravity Forms", "gravityforms");
        ?>
" style="margin: 15px 7px 0pt 0pt; float: left;" src="<?php 
        echo GFCommon::get_base_url();
        ?>
/images/gravity-export-icon-32.png"/>
            <h2><?php 
        _e("Export Form Entries", "gravityforms");
        ?>
</h2>
            <?php 
        self::export_links();
        ?>

            <p class="textleft"><?php 
        _e("Select a form below to export entries. Once you have selected a form you may select the fields you would like to export and an optional date range. When you click the download button below, Gravity Forms will create a CSV file for you to save to your computer.", "gravityforms");
        ?>
</p>
            <div class="hr-divider"></div>
            <form method="post" style="margin-top:10px;">
                <?php 
        echo wp_nonce_field("rg_start_export", "rg_start_export_nonce");
        ?>
                <table class="form-table">
                  <tr valign="top">

                       <th scope="row"><label for="export_form"><?php 
        _e("Select A Form", "gravityforms");
        ?>
</label> <?php 
        gform_tooltip("export_select_form");
        ?>
</th>
                        <td>

                          <select id="export_form" name="export_form" onchange="SelectExportForm(jQuery(this).val());">
                            <option value=""><?php 
        _e("Select a form", "gravityforms");
        ?>
</option>
                            <?php 
        $forms = RGFormsModel::get_forms(null, "title");
        foreach ($forms as $form) {
            ?>
                                <option value="<?php 
            echo absint($form->id);
            ?>
"><?php 
            echo esc_html($form->title);
            ?>
</option>
                                <?php 
        }
        ?>
                        </select>

                        </td>
                    </tr>
                  <tr id="export_field_container" valign="top" style="display: none;">
                       <th scope="row"><label for="export_fields"><?php 
        _e("Select Fields", "gravityforms");
        ?>
</label> <?php 
        gform_tooltip("export_select_fields");
        ?>
</th>
                        <td>
                            <ul id="export_field_list">
                            <ul>
                        </td>
                   </tr>
                  <tr id="export_date_container" valign="top" style="display: none;">
                       <th scope="row"><label for="export_date"><?php 
        _e("Select Date Range", "gravityforms");
        ?>
</label> <?php 
        gform_tooltip("export_date_range");
        ?>
</th>
                        <td>
                            <div>
                                <span style="width:150px; float:left; ">
                                    <input type="text" id="export_date_start" name="export_date_start" style="width:90%"/>
                                    <strong><label for="export_date_start" style="display:block;"><?php 
        _e("Start", "gravityforms");
        ?>
</label></strong>
                                </span>

                                <span style="width:150px; float:left;">
                                    <input type="text" id="export_date_end" name="export_date_end" style="width:90%"/>
                                    <strong><label for="export_date_end" style="display:block;"><?php 
        _e("End", "gravityforms");
        ?>
</label></strong>
                                </span>
                                <div style="clear: both;"></div>
                                <?php 
        _e("Date Range is optional, if no date range is selected all entries will be exported.", "gravityforms");
        ?>
                            </div>
                        </td>
                   </tr>
                </table>
                <ul>
                    <li id="export_submit_container" style="display:none; clear:both;">
                        <br/><br/>
                        <input type="submit" name="export_lead" value="<?php 
        _e("Download Export File", "gravityforms");
        ?>
" class="button-primary"/>
                        <span id="please_wait_container" style="display:none; margin-left:15px;">
                            <img src="<?php 
        echo GFCommon::get_base_url();
        ?>
/images/loading.gif"> <?php 
        _e("Exporting entries. Please wait...", "gravityforms");
        ?>
                        </span>

                        <iframe id="export_frame" width="1" height="1" src="about:blank"></iframe>
                    </li>
                </ul>
            </form>
        </div>
        <?php 
    }
Exemple #13
0
    public static function lead_detail_page()
    {
        global $wpdb;
        global $current_user;
        if (!GFCommon::ensure_wp_version()) {
            return;
        }
        echo GFCommon::get_remote_message();
        $form = RGFormsModel::get_form_meta($_GET["id"]);
        $form_id = $form["id"];
        $form = apply_filters("gform_admin_pre_render_" . $form["id"], apply_filters("gform_admin_pre_render", $form));
        $lead_id = 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;
            }
            $type = rgget("type");
            if (empty($type)) {
                $type = rgget("field_id") == "0" ? "global" : "field";
            }
            $search_criteria["field_filters"][] = array("key" => $key, "type" => $type, "operator" => rgempty("operator", $_GET) ? "is" : rgget("operator"), "value" => $val);
        }
        $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) {
            _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")) {
                    $email_to = $_POST["gentry_email_notes_to"];
                    $email_from = $current_user->user_email;
                    $email_subject = stripslashes($_POST["gentry_email_subject"]);
                    $headers = "From: \"{$email_from}\" <{$email_from}> \r\n";
                    $result = wp_mail($email_to, $email_subject, stripslashes($_POST["new_note"]), $headers);
                }
                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") {
                    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(__("You don't have adequate permissions 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"];
        ?>
        <link rel="stylesheet" href="<?php 
        echo GFCommon::get_base_url();
        ?>
/css/admin.css" />
         <script type="text/javascript">

            jQuery(document).ready(function(){
                toggleNotificationOverride(true);
            });

            function DeleteFile(leadId, fieldId, deleteButton){
                if(confirm(<?php 
        _e("'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 esc_js(__("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 
        _e("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 $lead['id'];
        ?>
',
                        formId : '<?php 
        echo $form['id'];
        ?>
'
                    },
                    function(response) {
                        if(response) {
                            displayMessage(response, "error", "#notifications_container");
                        } else {
                            displayMessage("<?php 
        _e("Notifications were resent successfully.", "gravityforms");
        ?>
", "updated", "#notifications_container");

                            // reset UI
                            jQuery(".gform_notifications").attr('checked', false);
                            jQuery('#notification_override_email').val('');
                        }

                        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 __("Entry #", "gravityforms") . absint($lead["id"]);
        ?>
</span><span class="gf_admin_page_subtitle"><span class="gf_admin_page_formid">ID: <?php 
        echo $form['id'];
        ?>
</span><?php 
        echo $form['title'];
        $gf_entry_locking = new GFEntryLocking();
        $gf_entry_locking->lock_info($lead_id);
        ?>
</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>
                            <span class="hndle"><?php 
        _e("Entry", "gravityforms");
        ?>
</span>
                        </h3>
                        <div class="inside">
                            <div id="submitcomment" class="submitbox">
                                <div id="minor-publishing" style="padding:10px;">
                                    <br/>
                                    <?php 
        _e("Entry Id", "gravityforms");
        ?>
: <?php 
        echo absint($lead["id"]);
        ?>
<br/><br/>
                                    <?php 
        _e("Submitted on", "gravityforms");
        ?>
: <?php 
        echo esc_html(GFCommon::format_date($lead["date_created"], false, "Y/m/d"));
        ?>
                                    <br/><br/>
                                    <?php 
        _e("User IP", "gravityforms");
        ?>
: <?php 
        echo $lead["ip"];
        ?>
                                    <br/><br/>
                                    <?php 
        if (!empty($lead["created_by"]) && ($usermeta = get_userdata($lead["created_by"]))) {
            ?>
                                        <?php 
            _e("User", "gravityforms");
            ?>
: <a href="user-edit.php?user_id=<?php 
            echo absint($lead["created_by"]);
            ?>
" alt="<?php 
            _e("View user profile", "gravityforms");
            ?>
" title="<?php 
            _e("View user profile", "gravityforms");
            ?>
"><?php 
            echo esc_html($usermeta->user_login);
            ?>
</a>
                                        <br/><br/>
                                        <?php 
        }
        ?>

                                    <?php 
        _e("Embed Url", "gravityforms");
        ?>
: <a href="<?php 
        echo esc_url($lead["source_url"]);
        ?>
" target="_blank" alt="<?php 
        echo esc_url($lead["source_url"]);
        ?>
" title="<?php 
        echo esc_url($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 
            _e("Edit Post", "gravityforms");
            ?>
: <a href="post.php?action=edit&post=<?php 
            echo absint($post->ID);
            ?>
" alt="<?php 
            _e("Click to edit post", "gravityforms");
            ?>
" title="<?php 
            _e("Click to edit post", "gravityforms");
            ?>
"><?php 
            echo esc_html($post->post_title);
            ?>
</a>
                                        <br/><br/>
                                        <?php 
        }
        if (apply_filters("gform_enable_entry_info_payment_details", true, $lead)) {
            if (!empty($lead["payment_status"])) {
                echo $lead["transaction_type"] == 2 ? __("Subscription Status", "gravityforms") : __("Payment 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 ? __("Start Date", "gravityforms") : __("Payment 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 ? __("Subscriber Id", "gravityforms") : __("Transaction Id", "gravityforms");
                    ?>
: <?php 
                    echo $lead["transaction_id"];
                    ?>
                                                <br/><br/>
                                                <?php 
                }
                if (!rgblank($lead["payment_amount"])) {
                    echo $lead["transaction_type"] == 2 ? __("Subscription Amount", "gravityforms") : __("Payment 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::akismet_enabled($form['id'])) {
                    ?>
                                                    <a onclick="jQuery('#action').val('unspam'); jQuery('#entry_form').submit()" href="#"><?php 
                    _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 
                    _e("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 
                    _e("Delete Permanently", "gravityforms");
                    ?>
</a>
                                                    <?php 
                }
                break;
            case "trash":
                ?>
                                                <a onclick="jQuery('#action').val('restore'); jQuery('#entry_form').submit()" href="#"><?php 
                _e("Restore", "gravityforms");
                ?>
</a>
                                                <?php 
                if (GFCommon::current_user_can_any("gravityforms_delete_entries")) {
                    ?>
                                                    |
                                                    <a class="submitdelete deletion" onclick="if ( confirm('<?php 
                    _e("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 
                    _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 
                    _e("Move to Trash", "gravityforms");
                    ?>
</a>
                                                    <?php 
                    echo GFCommon::akismet_enabled($form['id']) ? "|" : "";
                }
                if (GFCommon::akismet_enabled($form['id'])) {
                    ?>
                                                    <a class="submitdelete deletion" onclick="jQuery('#action').val('spam'); jQuery('#entry_form').submit()" href="#"><?php 
                    _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");
            $button_click = $mode == "view" ? "jQuery('#screen_mode').val('edit');" : "jQuery('#action').val('update'); jQuery('#screen_mode').val('view');";
            $update_button = '<input class="button button-large button-primary" type="submit" tabindex="4" value="' . $button_text . '" name="save" onclick="' . $button_click . '"/>';
            echo apply_filters("gform_entrydetail_update_button", $update_button);
            if ($mode == "edit") {
                echo '&nbsp;&nbsp;<input class="button button-large" type="submit" tabindex="5" value="' . __("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 style="cursor:default;"><span><?php 
            _e("Notifications", "gravityforms");
            ?>
</span></h3>
                            <div class="inside">
                                <div class="message" style="display:none; padding:10px; margin:10px 0px;"></div>
                                <div>
                                    <?php 
            if (!is_array($form["notifications"]) || count($form["notifications"]) <= 0) {
                ?>
                                        <p class="description"><?php 
                _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 
                _e("Configure Notifications", "gravityforms");
                ?>
</a>
                                    <?php 
            } else {
                foreach ($form["notifications"] as $notification) {
                    ?>
                                            <input type="checkbox" class="gform_notifications" value="<?php 
                    echo $notification["id"];
                    ?>
" id="notification_<?php 
                    echo $notification["id"];
                    ?>
" onclick="toggleNotificationOverride();" />
                                            <label for="notification_<?php 
                    echo $notification["id"];
                    ?>
"><?php 
                    echo $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 
                _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 
                _e("Resend Notifications", "gravityforms");
                ?>
" class="button" style="" onclick="ResendNotifications();"/>
                                        <span id="please_wait_container" style="display:none; margin-left: 5px;">
                                            <img src="<?php 
                echo GFCommon::get_base_url();
                ?>
/images/loading.gif"> <?php 
                _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') ? '&notes=1' : ''; var url='<?php 
        echo trailingslashit(site_url());
        ?>
?gf_page=print-entry&fid=<?php 
        echo $form['id'];
        ?>
&lid=<?php 
        echo $lead['id'];
        ?>
' + notes_qs; window.open (url,'printwindow');" class="button"><?php 
        _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 
            _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 
            _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 = !empty($form["autoResponder"]["subject"]) ? "RE: " . GFCommon::replace_variables($form["autoResponder"]["subject"], $form, $lead) : "";
            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 
            _e("Entry Updated.", "gravityforms");
            ?>
            </div>
            <?php 
        }
    }
 function column_is_active($item)
 {
     $is_active = intval(rgar($item, 'is_active'));
     $src = GFCommon::get_base_url() . "/images/active{$is_active}.png";
     $title = $is_active ? __('Active', 'gravityforms') : __('Inactive', 'gravityforms');
     $img = "<img src='{$src}' title='{$title}' onclick='gaddon.toggleFeedActive(this, \"{$this->_slug}\", {$item['id']});' style='cursor:pointer';/>";
     return $img;
 }
Exemple #15
0
    public static function entry_activation_button($form_id, $lead)
    {
        if (!self::is_lead_pending_activation($lead)) {
            return;
        }
        require_once self::get_base_path() . '/includes/signups.php';
        $lead_id = rgar($lead, 'id');
        $activation_key = GFUserSignups::get_lead_activation_key($lead_id);
        ?>

        <div id="gf_user_pending_activation">
            <?php 
        _e('Pending Activation:', 'gravityformsuserregistration');
        ?>
            <a onclick="activateUser('<?php 
        echo $activation_key;
        ?>
');" id="gf_user_pending_activate_link" style="cursor:pointer;">Activate User</a>
        </div>

        <script type="text/javascript">

        function activateUser(activationKey) {

            if(!confirm('<?php 
        _e('Are you sure you want to activate this user?', 'gravityformsuserregistration');
        ?>
'))
                return;

            var spinner = new ajaxSpinner('#gf_user_pending_activate_link', 'margin-left:10px');

            jQuery.post(ajaxurl, {
                key: activationKey,
                action: 'gf_user_activate'
            }, function(response) {

                // if there is an error message, alert it
                if(response) {

                    alert(response);
                    jQuery('#gf_user_pending_activation').fadeOut(function(){
                        spinner.destroy();
                    });

                } else {

                    jQuery('#gf_user_pending_activation').html('<div class="updated"><p><?php 
        _e('User Activated Successfully', 'gravityformsuserregistration');
        ?>
</p></div>');
                    setTimeout('jQuery("#gf_user_pending_activation").slideUp();', 5000);
                    spinner.destroy();

                }

            });

        }

        function ajaxSpinner(elem, style) {

            this.elem = elem;
            this.image = '<img src="<?php 
        echo GFCommon::get_base_url();
        ?>
/images/loading.gif" style="' + style + '" />';

            this.init = function() {
                this.spinner = jQuery(this.image);
                jQuery(this.elem).after(this.spinner);
                return this;
            }

            this.destroy = function() {
                jQuery(this.spinner).remove();
            }

            return this.init();
        }

        </script>

        <?php 
    }
        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 = apply_filters("gform_form_pre_results_{$form_id}", apply_filters("gform_form_pre_results", $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();
            ?>
">

                <div class="icon32" id="gravity-entry-icon"><br></div>

                <h2><?php 
            echo empty($form_id) ? $page_title : $page_title . " : " . esc_html($form["title"]);
            ?>
</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" => __("Filters", "gravityforms"), "tooltip" => "gresults_filters", "markup" => '<div id="gresults-results-field-filters-container">
                                                                                <!-- placeholder populated by js -->
                                                                             </div>'), "date_range" => array("label" => __("Date Range", "gravityforms"), "tooltip" => "gresults_date_range", "markup" => '<div style="width:90px; float:left; ">

                                                                                    <label
                                                                                        for="gresults-results-filter-date-start">' . __("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">' . __("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"];
                    ?>
                                                &nbsp;<?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 
                _e('Apply filters', 'gravityforms');
                ?>
">
                                            <input type="button" id="gresults-results-filter-clear-button"
                                                   class="button button-secondary button-large" value="<?php 
                _e('Clear', 'gravityforms');
                ?>
"
                                                   onclick="gresults.clearFilterForm();">

                                            <div class="gresults-filter-loading"
                                                 style="display:none; float:right; margin-top:5px;">
                                                <img
                                                    src="<?php 
                echo GFCommon::get_base_url();
                ?>
/images/spinner.gif"
                                                    alt="loading..."/>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="gresults-filter-loading" style="display:none;margin:0 5px 10px 0;">
                        <img style="vertical-align:middle;"
                             src="<?php 
                echo GFCommon::get_base_url();
                ?>
/images/spinner.gif"
                             alt="loading..."/>&nbsp;
                        <a href="javascript:void(0);" onclick="javascript:gresultsAjaxRequest.abort()">Cancel</a>
                    </div>

                    <div id="gresults-results-wrapper">
                        <div id="gresults-results">&nbsp;
                        </div>
                    </div>

                <?php 
            } else {
                _e("This form does not have any fields that can be used for results", "gravityforms");
            }
            ?>
            </div>


        <?php 
        }
    return;
}
global $gfpdf;
$config_data = $gfpdf->get_default_config_data($form_id);
/**
 * Load the form data to pass to our PDF generating function 
 */
$form = RGFormsModel::get_form_meta($form_id);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <link rel="stylesheet" href="<?php 
echo GFCommon::get_base_url();
?>
/css/print.css" type="text/css" />
    <link rel='stylesheet' href='<?php 
echo PDF_PLUGIN_URL . 'initialisation/template.css';
?>
' type='text/css' />
    <title>Gravity PDF</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
    <body>
        <div class="no-style">
            <?php 
/*
 * Loop through the entries
 * There is usually only one but you can pass more IDs through the lid URL parameter
Exemple #18
0
 public static function get_icon_url($path)
 {
     $info = pathinfo($path);
     switch (strtolower(rgar($info, 'extension'))) {
         case 'css':
             $file_name = 'icon_css.gif';
             break;
         case 'doc':
             $file_name = 'icon_doc.gif';
             break;
         case 'fla':
             $file_name = 'icon_fla.gif';
             break;
         case 'html':
         case 'htm':
         case 'shtml':
             $file_name = 'icon_html.gif';
             break;
         case 'js':
             $file_name = 'icon_js.gif';
             break;
         case 'log':
             $file_name = 'icon_log.gif';
             break;
         case 'mov':
             $file_name = 'icon_mov.gif';
             break;
         case 'pdf':
             $file_name = 'icon_pdf.gif';
             break;
         case 'php':
             $file_name = 'icon_php.gif';
             break;
         case 'ppt':
             $file_name = 'icon_ppt.gif';
             break;
         case 'psd':
             $file_name = 'icon_psd.gif';
             break;
         case 'sql':
             $file_name = 'icon_sql.gif';
             break;
         case 'swf':
             $file_name = 'icon_swf.gif';
             break;
         case 'txt':
             $file_name = 'icon_txt.gif';
             break;
         case 'xls':
             $file_name = 'icon_xls.gif';
             break;
         case 'xml':
             $file_name = 'icon_xml.gif';
             break;
         case 'zip':
             $file_name = 'icon_zip.gif';
             break;
         case 'gif':
         case 'jpg':
         case 'jpeg':
         case 'png':
         case 'bmp':
         case 'tif':
         case 'eps':
             $file_name = 'icon_image.gif';
             break;
         case 'mp3':
         case 'wav':
         case 'wma':
             $file_name = 'icon_audio.gif';
             break;
         case 'mp4':
         case 'avi':
         case 'wmv':
         case 'flv':
             $file_name = 'icon_video.gif';
             break;
         default:
             $file_name = 'icon_generic.gif';
             break;
     }
     return GFCommon::get_base_url() . "/images/doctypes/{$file_name}";
 }
Exemple #19
0
 public static function print_form_scripts($form, $ajax)
 {
     if (!get_option('rg_gforms_disable_css')) {
         if (!wp_style_is('gforms_css')) {
             $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
             wp_enqueue_style('gforms_reset_css', GFCommon::get_base_url() . "/css/formreset{$min}.css", null, GFCommon::$version);
             wp_print_styles(array('gforms_reset_css'));
             wp_enqueue_style('gforms_formsmain_css', GFCommon::get_base_url() . "/css/formsmain{$min}.css", null, GFCommon::$version);
             wp_print_styles(array('gforms_formsmain_css'));
             wp_enqueue_style('gforms_ready_class_css', GFCommon::get_base_url() . "/css/readyclass{$min}.css", null, GFCommon::$version);
             wp_print_styles(array('gforms_ready_class_css'));
             wp_enqueue_style('gforms_browsers_css', GFCommon::get_base_url() . "/css/browsers{$min}.css", null, GFCommon::$version);
             wp_print_styles(array('gforms_browsers_css'));
             if (self::has_datepicker_field($form)) {
                 wp_enqueue_style('gforms_datepicker_css', GFCommon::get_base_url() . "/css/datepicker{$min}.css", null, GFCommon::$version);
                 wp_print_styles(array('gforms_datepicker_css'));
             }
             if (is_rtl()) {
                 wp_enqueue_style('gforms_rtl_css', GFCommon::get_base_url() . "/css/rtl{$min}.css", null, GFCommon::$version);
                 wp_print_styles(array('gforms_rtl_css'));
             }
         }
     }
     $scripts = array();
     if (($ajax || self::has_enhanced_dropdown($form) || self::has_price_field($form) || self::has_password_strength($form) || self::has_pages($form) || self::has_password_strength($form) || GFCommon::has_list_field($form) || GFCommon::has_credit_card_field($form) || self::has_calculation_field($form)) && !wp_script_is('gform_gravityforms')) {
         $scripts[] = 'gform_gravityforms';
     }
     if (self::has_conditional_logic($form) && !wp_script_is('gform_conditional_logic')) {
         $scripts[] = 'gform_conditional_logic';
     }
     if (self::has_datepicker_field($form) && !wp_script_is('gform_datepicker_init')) {
         $scripts[] = 'gform_datepicker_init';
     }
     if (self::has_pages($form) && !wp_script_is('gform_json')) {
         $scripts[] = 'gform_json';
     }
     if (self::has_character_counter($form) && !wp_script_is('gform_textarea_counter')) {
         $scripts[] = 'gform_textarea_counter';
     }
     if (self::has_input_mask($form) && !wp_script_is('gform_masked_input')) {
         $scripts[] = 'gform_masked_input';
     }
     if (self::has_enhanced_dropdown($form) && !wp_script_is('gform_chosen') && !wp_script_is('chosen')) {
         if (wp_script_is('chosen', 'registered')) {
             $scripts[] = 'chosen';
         } else {
             $scripts[] = 'gform_chosen';
         }
     }
     if (!wp_script_is('jquery')) {
         $scripts[] = 'jquery';
     }
     foreach ($scripts as $script) {
         wp_enqueue_script($script);
     }
     wp_print_scripts($scripts);
     if (wp_script_is('gform_gravityforms')) {
         echo '<script type="text/javascript"> ' . GFCommon::gf_global(false) . ' </script>';
     }
 }
Exemple #20
0
    public static function help_page()
    {
        if (!GFCommon::ensure_wp_version()) {
            return;
        }
        echo GFCommon::get_remote_message();
        $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" />
		<div class="wrap <?php 
        echo GFCommon::get_browser_class();
        ?>
">
			<h2><?php 
        esc_html_e('Gravity Forms Help', 'gravityforms');
        ?>
</h2>

			<div style="margin-top:10px;">

				<div
					class="gforms_help_alert alert_yellow"><?php 
        printf(esc_html__('%sIMPORTANT NOTICE:%s We do not provide support via e-mail. Please %sopen a support ticket%s.', 'gravityforms'), '<strong>', '</strong>', '<a href="https://www.gravityhelp.com/support/" target="_blank">', '</a>');
        ?>
</div>

				<div><?php 
        printf(esc_html__("Please review the plugin documentation and %sfrequently asked questions (FAQ)%s first. If you still can't find the answer %sopen a support ticket%s and we will be happy to answer your questions and assist you with any problems. %sPlease note:%s If you have not %spurchased a license%s from us, you won't have access to these help resources.", 'gravityforms'), '<a href="https://www.gravityhelp.com/frequently-asked-questions/">', '</a>', '<a href="https://www.gravityhelp.com/support/" target="_blank">', '</a>', '<strong>', '</strong>', '<a href="http://www.gravityforms.com/purchase-gravity-forms/">', '</a>');
        ?>
</div>


				<div class="hr-divider"></div>

				<h3><?php 
        esc_html_e('Gravity Forms Documentation', 'gravityforms');
        ?>
</h3>

				<ul style="margin-top:15px;">
					<li>
						<div class="gforms_helpbox">
							<form name="jump">
								<select name="menu">
									<!-- begin documentation listing -->
									<option selected>
										<?php 
        esc_html_e('Documentation (please select a topic)', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/documentation/article/getting-started/">
										<?php 
        esc_html_e('Getting Started', 'gravityforms');
        ?>
									</option>
									<option	value="https://www.gravityhelp.com/documentation/article/design-and-layout/">
										<?php 
        esc_html_e('Design and Layout', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/documentation/category/extending-gravity-forms/">
										<?php 
        esc_html_e('Developer Docs', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/documentation/category/add-ons-gravity-forms/">
										<?php 
        esc_html_e('Add-Ons', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/documentation/category/how-to/">
										<?php 
        esc_html_e('How To', 'gravityforms');
        ?>
									</option>
									<!-- end documentation listing -->
								</select>
								<input type="button" class="button"
									   onClick="window.open(document.jump.menu.options[document.jump.menu.selectedIndex].value);"
									   value="<?php 
        esc_attr_e('GO', 'gravityforms');
        ?>
">
							</form>
						</div>

					</li>
				</ul>

				<div class="hr-divider"></div>

				<h3><?php 
        esc_html_e('Gravity Forms FAQ', 'gravityforms');
        ?>
</h3>
				<ul style="margin-top:15px;">
					<li>
						<div class="gforms_helpbox">
							<form name="jump1">
								<select name="menu1">

									<!-- begin faq listing -->
									<option selected>
										<?php 
        esc_html_e('FAQ (please select a topic)', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/frequently-asked-questions/faq-installation/">
										<?php 
        esc_html_e('Installation Questions', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/frequently-asked-questions/faq-styling-formatting/">
										<?php 
        esc_html_e('Formatting/Styling Questions', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/frequently-asked-questions/faq-notifications/">
										<?php 
        esc_html_e('Notification Questions', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/frequently-asked-questions/faq-general-questions/">
										<?php 
        esc_html_e('General Questions', 'gravityforms');
        ?>
									</option>

									<!-- end faq listing -->
								</select>
								<input type="button" class="button"
									   onClick="window.open(document.jump1.menu1.options[document.jump1.menu1.selectedIndex].value);"
									   value="<?php 
        esc_attr_e('GO', 'gravityforms');
        ?>
">
							</form>
						</div>

					</li>

				</ul>

				<div class="hr-divider"></div>

				<h3><?php 
        esc_html_e('Gravity Forms Downloads', 'gravityforms');
        ?>
</h3>
				<?php 
        printf(esc_html__('%sPlease Note:%s Only licensed Gravity Forms customers are granted access to the downloads section.', 'gravityforms'), '<strong>', '</strong>');
        ?>
				<ul style="margin-top:15px;">
					<li>
						<div class="gforms_helpbox">
							<form name="jump3">
								<select name="menu3">

									<!-- begin downloads listing -->
									<option selected>
										<?php 
        esc_html_e('Downloads (please select a product)', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/downloads/">
										<?php 
        esc_html_e('Gravity Forms', 'gravityforms');
        ?>
									</option>
									<option value="https://www.gravityhelp.com/downloads/add-ons/">
										<?php 
        esc_html_e('Gravity Forms Add-Ons', 'gravityforms');
        ?>
									</option>

									<!-- end downloads listing -->
								</select>
								<input type="button" class="button"
									   onClick="window.open(document.jump3.menu3.options[document.jump3.menu3.selectedIndex].value);"
									   value="<?php 
        esc_attr_e('GO', 'gravityforms');
        ?>
">
							</form>
						</div>
					</li>
				</ul>

				<div class="hr-divider"></div>

				<h3><?php 
        esc_html_e('Gravity Forms Tutorials & Resources', 'gravityforms');
        ?>
</h3>
				<?php 
        printf(esc_html__('%sPlease note:%s The Gravity Forms support team does not provide support for third party scripts, widgets, etc.', 'gravityforms'), '<strong>', '</strong>');
        ?>

				<div class="gforms_helpbox" style="margin:15px 0;">
					<ul class="resource_list">
						<li>
							<a href="http://www.gravityhelp.com/"><?php 
        esc_html_e('Gravity Forms Blog', 'gravityforms');
        ?>
</a>
						</li>
						<li>
							<a target="_blank" href="https://www.gravityhelp.com/gravity-forms-css-visual-guide/">
								<?php 
        esc_html_e('Gravity Forms Visual CSS Guide', 'gravityforms');
        ?>
							</a>
						</li>
						<li>
							<a target="_blank" href="http://www.rocketgenius.com/gravity-forms-css-targeting-specific-elements/">
								<?php 
        esc_html_e('Gravity Forms CSS: Targeting Specific Elements', 'gravityforms');
        ?>
							</a>
						</li>
						<li>
							<a target="_blank" href="https://www.gravityhelp.com/creating-a-modal-form-with-gravity-forms-and-fancybox/">
								<?php 
        esc_html_e('Creating a Modal Form with Gravity Forms and FancyBox', 'gravityforms');
        ?>
							</a>
						</li>
						<li>
							<a target="_blank" href="http://yoast.com/gravity-forms-widget-update/">
								<?php 
        esc_html_e('Gravity Forms Widget (Third Party Release)', 'gravityforms');
        ?>
							</a>
						</li>
						<li>
							<a target="_blank" href="http://wordpress.org/extend/plugins/wp-mail-smtp/">
								<?php 
        esc_html_e('WP Mail SMTP Plugin', 'gravityforms');
        ?>
							</a>
						</li>
						<li>
							<a target="_blank" href="http://wordpress.org/extend/plugins/members/">
								<?php 
        esc_html_e('Members Plugin (Role Management - Integrates with Gravity Forms)', 'gravityforms');
        ?>
							</a>
						</li>
						<li>
							<a target="_blank" href="http://wordpress.org/extend/plugins/really-simple-captcha/">
								<?php 
        esc_html_e('Really Simple Captcha Plugin (Integrates with Gravity Forms)', 'gravityforms');
        ?>
							</a>
						</li>
					</ul>

				</div>

			</div>
		</div>


	<?php 
    }
    public static function color_picker($field_name, $callback)
    {
        ?>
		<table cellpadding="0" cellspacing="0">
			<tr>
				<td>
					<input type='text' class="iColorPicker" size="7" name='<?php 
        echo esc_attr($field_name);
        ?>
' onchange='SetColorPickerColor(this.name, this.value, "<?php 
        echo $callback;
        ?>
");' id='<?php 
        echo esc_attr($field_name);
        ?>
' />
				</td>
				<td style="padding-right:5px; padding-left:5px;">
					<img style="top:3px; cursor:pointer; border:1px solid #dfdfdf;" id="chip_<?php 
        echo esc_attr($field_name);
        ?>
" valign="bottom" height="22" width="22" src="<?php 
        echo GFCommon::get_base_url();
        ?>
/images/blankspace.png" />
				</td>
				<td>
					<img style="cursor:pointer;" valign="bottom" id="chooser_<?php 
        echo esc_attr($field_name);
        ?>
" src="<?php 
        echo GFCommon::get_base_url();
        ?>
/images/color.png" />
				</td>
			</tr>
		</table>
		<script type="text/javascript">
			jQuery("#chooser_<?php 
        echo esc_js($field_name);
        ?>
").click(function (e) {
				iColorShow(e.pageX, e.pageY, '<?php 
        echo esc_js($field_name);
        ?>
', "<?php 
        echo esc_js($callback);
        ?>
");
			});
			jQuery("#chip_<?php 
        echo esc_js($field_name);
        ?>
").click(function (e) {
				iColorShow(e.pageX, e.pageY, '<?php 
        echo esc_js($field_name);
        ?>
', "<?php 
        echo esc_js($callback);
        ?>
");
			});
		</script>
	<?php 
    }
 public function get_field_input($form, $value = '', $entry = null)
 {
     $picker_value = '';
     if (is_array($value)) {
         // GFCommon::parse_date() takes a numeric array.
         $value = array_values($value);
     } else {
         $picker_value = $value;
     }
     $format = empty($this->dateFormat) ? 'mdy' : esc_attr($this->dateFormat);
     $date_info = GFCommon::parse_date($value, $format);
     $day_value = esc_attr(rgget('day', $date_info));
     $month_value = esc_attr(rgget('month', $date_info));
     $year_value = esc_attr(rgget('year', $date_info));
     $is_entry_detail = $this->is_entry_detail();
     $is_form_editor = $this->is_form_editor();
     $form_id = $form['id'];
     $id = intval($this->id);
     $field_id = $is_entry_detail || $is_form_editor || $form_id == 0 ? "input_{$id}" : 'input_' . $form_id . "_{$id}";
     $size = $this->size;
     $disabled_text = $is_form_editor ? "disabled='disabled'" : '';
     $class_suffix = $is_entry_detail ? '_admin' : '';
     $class = $size . $class_suffix;
     $form_sub_label_placement = rgar($form, 'subLabelPlacement');
     $field_sub_label_placement = rgar($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 screen-reader-text'" : '';
     $month_input = GFFormsModel::get_input($this, $this->id . '.1');
     $day_input = GFFormsModel::get_input($this, $this->id . '.2');
     $year_input = GFFormsModel::get_input($this, $this->id . '.3');
     $month_sub_label = rgar($month_input, 'customLabel') != '' ? $month_input['customLabel'] : esc_html(_x('MM', 'Abbreviation: Month', 'gravityforms'));
     $day_sub_label = rgar($day_input, 'customLabel') != '' ? $day_input['customLabel'] : esc_html__('DD', 'gravityforms');
     $year_sub_label = rgar($year_input, 'customLabel') != '' ? $year_input['customLabel'] : esc_html__('YYYY', 'gravityforms');
     $month_placeholder_attribute = GFCommon::get_input_placeholder_attribute($month_input);
     $day_placeholder_attribute = GFCommon::get_input_placeholder_attribute($day_input);
     $year_placeholder_attribute = GFCommon::get_input_placeholder_attribute($year_input);
     $month_placeholder_value = GFCommon::get_input_placeholder_value($month_input);
     $day_placeholder_value = GFCommon::get_input_placeholder_value($day_input);
     $year_placeholder_value = GFCommon::get_input_placeholder_value($year_input);
     $date_picker_placeholder = $this->get_field_placeholder_attribute();
     $is_html5 = RGFormsModel::is_html5_enabled();
     $date_input_type = $is_html5 ? 'number' : 'text';
     $month_html5_attributes = $is_html5 ? "min='1' max='12' step='1'" : '';
     $day_html5_attributes = $is_html5 ? "min='1' max='31' step='1'" : '';
     $year_min = apply_filters('gform_date_min_year', '1920', $form, $this);
     $year_max = apply_filters('gform_date_max_year', date('Y') + 1, $form, $this);
     $year_min_attribute = $is_html5 && is_numeric($year_min) ? "min='{$year_min}'" : '';
     $year_max_attribute = $is_html5 && is_numeric($year_max) ? "max='{$year_max}'" : '';
     $year_step_attribute = $is_html5 ? "step='1'" : '';
     $field_position = substr($format, 0, 3);
     if ($is_form_editor) {
         $datepicker_display = in_array($this->dateType, array('datefield', 'datedropdown')) ? 'none' : 'inline';
         $datefield_display = $this->dateType == 'datefield' ? 'inline' : 'none';
         $dropdown_display = $this->dateType == 'datedropdown' ? 'inline' : 'none';
         $icon_display = $this->calendarIconType == 'calendar' ? 'inline' : 'none';
         if ($is_sub_label_above) {
             $month_field = "<div class='gfield_date_month ginput_date' id='gfield_input_date_month' style='display:{$datefield_display}'>\n                                    <label for='{$field_id}_1' {$sub_label_class_attribute}>{$month_sub_label}</label>\n                                    <input id='{$field_id}_1' name='ginput_month' type='text' {$month_placeholder_attribute} {$disabled_text} value='{$month_value}'/>\n                                </div>";
             $day_field = "<div class='gfield_date_day ginput_date' id='gfield_input_date_day' style='display:{$datefield_display}'>\n                                    <label for='{$field_id}_2' {$sub_label_class_attribute}>{$day_sub_label}</label>\n                                    <input id='{$field_id}_2' name='ginput_day' type='text' {$day_placeholder_attribute} {$disabled_text} value='{$day_value}'/>\n                               </div>";
             $year_field = "<div class='gfield_date_year ginput_date' id='gfield_input_date_year' style='display:{$datefield_display}'>\n                                    <label {$sub_label_class_attribute}>{$year_sub_label}</label>\n                                    <input id='{$field_id}_3' type='text' name='text' {$year_placeholder_attribute} {$disabled_text} value='{$year_value}'/>\n                               </div>";
         } else {
             $month_field = "<div class='gfield_date_month ginput_date' id='gfield_input_date_month' style='display:{$datefield_display}'>\n                                    <input id='{$field_id}_1' name='ginput_month' type='text' {$month_placeholder_attribute} {$disabled_text} value='{$month_value}'/>\n                                    <label for='{$field_id}_1' {$sub_label_class_attribute}>{$month_sub_label}</label>\n                                </div>";
             $day_field = "<div class='gfield_date_day ginput_date' id='gfield_input_date_day' style='display:{$datefield_display}'>\n                                    <input id='{$field_id}_2' name='ginput_day' type='text' {$day_placeholder_attribute} {$disabled_text} value='{$day_value}'/>\n                                    <label for='{$field_id}_2' {$sub_label_class_attribute}>{$day_sub_label}</label>\n                              </div>";
             $year_field = "<div class='gfield_date_year ginput_date' id='gfield_input_date_year' style='display:{$datefield_display}'>\n                                    <input type='text' id='{$field_id}_3' name='ginput_year' {$year_placeholder_attribute} {$disabled_text} value='{$year_value}'/>\n                                    <label for='{$field_id}_3' {$sub_label_class_attribute}>{$year_sub_label}</label>\n                               </div>";
         }
         $month_dropdown = "<div class='gfield_date_dropdown_month ginput_date_dropdown' id='gfield_dropdown_date_month' style='display:{$dropdown_display}'>" . $this->get_month_dropdown('', "{$field_id}_1", rgar($date_info, 'month'), '', $disabled_text, $month_placeholder_value) . '</div>';
         $day_dropdown = "<div class='gfield_date_dropdown_day ginput_date_dropdown' id='gfield_dropdown_date_day' style='display:{$dropdown_display}'>" . $this->get_day_dropdown('', "{$field_id}_2", rgar($date_info, 'day'), '', $disabled_text, $day_placeholder_value) . '</div>';
         $year_dropdown = "<div class='gfield_date_dropdown_year ginput_date_dropdown' id='gfield_dropdown_date_year' style='display:{$dropdown_display}'>" . $this->get_year_dropdown('', "{$field_id}_3", rgar($date_info, 'year'), '', $disabled_text, $year_placeholder_value, $form) . '</div>';
         $field_string = "<div class='ginput_container ginput_container_date' id='gfield_input_datepicker' style='display:{$datepicker_display}'><input name='ginput_datepicker' type='text' {$date_picker_placeholder} {$disabled_text} value = '{$picker_value}'/><img src='" . GFCommon::get_base_url() . "/images/calendar.png' id='gfield_input_datepicker_icon' style='display:{$icon_display}'/></div>";
         switch ($field_position) {
             case 'dmy':
                 $date_inputs = $day_field . $month_field . $year_field . $day_dropdown . $month_dropdown . $year_dropdown;
                 break;
             case 'ymd':
                 $date_inputs = $year_field . $month_field . $day_field . $year_dropdown . $month_dropdown . $day_dropdown;
                 break;
             default:
                 $date_inputs = $month_field . $day_field . $year_field . $month_dropdown . $day_dropdown . $year_dropdown;
                 break;
         }
         $field_string .= "<div id='{$field_id}' class='ginput_container ginput_container_date'>{$date_inputs}</div>";
         return $field_string;
     } else {
         $date_type = $this->dateType;
         if (in_array($date_type, array('datefield', 'datedropdown'))) {
             switch ($field_position) {
                 case 'dmy':
                     $tabindex = $this->get_tabindex();
                     if ($date_type == 'datedropdown') {
                         $field_str = "<div class='clear-multi'><div class='gfield_date_dropdown_day ginput_container ginput_container_date' id='{$field_id}_2_container'>" . $this->get_day_dropdown("input_{$id}[]", "{$field_id}_2", rgar($date_info, 'day'), $tabindex, $disabled_text, $day_placeholder_value) . '</div>';
                         $tabindex = $this->get_tabindex();
                         $field_str .= "<div class='gfield_date_dropdown_month ginput_container ginput_container_date' id='{$field_id}_1_container'>" . $this->get_month_dropdown("input_{$id}[]", "{$field_id}_1", rgar($date_info, 'month'), $tabindex, $disabled_text, $month_placeholder_value) . '</div>';
                         $tabindex = $this->get_tabindex();
                         $field_str .= "<div class='gfield_date_dropdown_year ginput_container ginput_container_date' id='{$field_id}_3_container'>" . $this->get_year_dropdown("input_{$id}[]", "{$field_id}_3", rgar($date_info, 'year'), $tabindex, $disabled_text, $year_placeholder_value, $form) . '</div></div>';
                     } else {
                         $field_str = $is_sub_label_above ? "<div class='clear-multi'>\n                                        <div class='gfield_date_day ginput_container ginput_container_date' id='{$field_id}_2_container'>\n                                            <label for='{$field_id}_2' {$sub_label_class_attribute}>{$day_sub_label}</label>\n                                            <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_2' value='{$day_value}' {$tabindex} {$disabled_text} {$day_placeholder_attribute} {$day_html5_attributes}/>\n                                        </div>" : "<div class='clear-multi'>\n                                        <div class='gfield_date_day ginput_container ginput_container_date' id='{$field_id}_2_container'>\n                                            <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_2' value='{$day_value}' {$tabindex} {$disabled_text} {$day_placeholder_attribute} {$day_html5_attributes}/>\n                                            <label for='{$field_id}_2' {$sub_label_class_attribute}>{$day_sub_label}</label>\n                                        </div>";
                         $tabindex = $this->get_tabindex();
                         $field_str .= $is_sub_label_above ? "<div class='gfield_date_month ginput_container ginput_container_date' id='{$field_id}_1_container'>\n                                        <label for='{$field_id}_1' {$sub_label_class_attribute}>{$month_sub_label}</label>\n                                        <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_1' value='{$month_value}' {$tabindex} {$disabled_text} {$month_placeholder_attribute} {$month_html5_attributes}/>\n                                   </div>" : "<div class='gfield_date_month ginput_container ginput_container_date' id='{$field_id}_1_container'>\n                                        <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_1' value='{$month_value}' {$tabindex} {$disabled_text} {$month_placeholder_attribute} {$month_html5_attributes}/>\n                                        <label for='{$field_id}_1' {$sub_label_class_attribute}>{$month_sub_label}</label>\n                                   </div>";
                         $tabindex = $this->get_tabindex();
                         $field_str .= $is_sub_label_above ? "<div class='gfield_date_year ginput_container ginput_container_date' id='{$field_id}_3_container'>\n                                            <label for='{$field_id}_3' {$sub_label_class_attribute}>{$year_sub_label}</label>\n                                            <input type='{$date_input_type}' maxlength='4' name='input_{$id}[]' id='{$field_id}_3' value='{$year_value}' {$tabindex} {$disabled_text} {$year_placeholder_attribute} {$year_min_attribute} {$year_max_attribute} {$year_step_attribute}/>\n                                       </div>\n                                    </div>" : "<div class='gfield_date_year ginput_container ginput_container_date' id='{$field_id}_3_container'>\n                                        <input type='{$date_input_type}' maxlength='4' name='input_{$id}[]' id='{$field_id}_3' value='{$year_value}' {$tabindex} {$disabled_text} {$year_placeholder_attribute} {$year_min_attribute} {$year_max_attribute} {$year_step_attribute}/>\n                                        <label for='{$field_id}_3' {$sub_label_class_attribute}>{$year_sub_label}</label>\n                                   </div>\n                                </div>";
                     }
                     break;
                 case 'ymd':
                     $tabindex = $this->get_tabindex();
                     if ($date_type == 'datedropdown') {
                         $field_str = "<div class='clear-multi'><div class='gfield_date_dropdown_year ginput_container ginput_container_date' id='{$field_id}_3_container'>" . $this->get_year_dropdown("input_{$id}[]", "{$field_id}_3", rgar($date_info, 'year'), $tabindex, $disabled_text, $year_placeholder_value, $form) . '</div>';
                         $tabindex = $this->get_tabindex();
                         $field_str .= "<div class='gfield_date_dropdown_month ginput_container ginput_container_date' id='{$field_id}_1_container'>" . $this->get_month_dropdown("input_{$id}[]", "{$field_id}_1", rgar($date_info, 'month'), $tabindex, $disabled_text, $month_placeholder_value) . '</div>';
                         $tabindex = $this->get_tabindex();
                         $field_str .= "<div class='gfield_date_dropdown_day ginput_container ginput_container_date' id='{$field_id}_2_container'>" . $this->get_day_dropdown("input_{$id}[]", "{$field_id}_2", rgar($date_info, 'day'), $tabindex, $disabled_text, $day_placeholder_value) . '</div></div>';
                     } else {
                         $field_str = $is_sub_label_above ? "<div class='clear-multi'>\n                                            <div class='gfield_date_year ginput_container ginput_container_date' id='{$field_id}_3_container'>\n                                                <label for='{$field_id}_3' {$sub_label_class_attribute}>{$year_sub_label}</label>\n                                                <input type='{$date_input_type}' maxlength='4' name='input_{$id}[]' id='{$field_id}_3' value='{$year_value}' {$tabindex} {$disabled_text} {$year_placeholder_attribute} {$year_min_attribute} {$year_max_attribute} {$year_step_attribute}/>\n                                            </div>" : "<div class='clear-multi'>\n                                            <div class='gfield_date_year ginput_container ginput_container_date' id='{$field_id}_3_container'>\n                                                <input type='{$date_input_type}' maxlength='4' name='input_{$id}[]' id='{$field_id}_3' value='{$year_value}' {$tabindex} {$disabled_text} {$year_placeholder_attribute} {$year_min_attribute} {$year_max_attribute} {$year_step_attribute}/>\n                                                <label for='{$field_id}_3' {$sub_label_class_attribute}>{$year_sub_label}</label>\n                                            </div>";
                         $tabindex = $this->get_tabindex();
                         $field_str .= $is_sub_label_above ? "<div class='gfield_date_month ginput_container ginput_container_date' id='{$field_id}_1_container'>\n                                                <label for='{$field_id}_1' {$sub_label_class_attribute}>{$month_sub_label}</label>\n                                                <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_1' value='{$month_value}' {$tabindex} {$disabled_text} {$month_placeholder_attribute} {$month_html5_attributes}/>\n                                            </div>" : "<div class='gfield_date_month ginput_container ginput_container_date' id='{$field_id}_1_container'>\n                                                <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_1' value='{$month_value}' {$tabindex} {$disabled_text} {$month_placeholder_attribute} {$month_html5_attributes}/>\n                                                <label for='{$field_id}_1' {$sub_label_class_attribute}>{$month_sub_label}</label>\n                                            </div>";
                         $tabindex = $this->get_tabindex();
                         $field_str .= $is_sub_label_above ? "<div class='gfield_date_day ginput_container ginput_container_date' id='{$field_id}_2_container'>\n                                                <label for='{$field_id}_2' {$sub_label_class_attribute}>{$day_sub_label}</label>\n                                                <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_2' value='{$day_value}' {$tabindex} {$disabled_text} {$day_placeholder_attribute} {$day_html5_attributes}/>\n                                           </div>\n                                        </div>" : "<div class='gfield_date_day ginput_container ginput_container_date' id='{$field_id}_2_container'>\n                                                <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_2' value='{$day_value}' {$tabindex} {$disabled_text} {$day_placeholder_attribute} {$day_html5_attributes}/>\n                                                <label for='{$field_id}_2' {$sub_label_class_attribute}>{$day_sub_label}</label>\n                                           </div>\n                                        </div>";
                     }
                     break;
                 default:
                     $tabindex = $this->get_tabindex();
                     if ($date_type == 'datedropdown') {
                         $field_str = "<div class='clear-multi'><div class='gfield_date_dropdown_month ginput_container ginput_container_date' id='{$field_id}_1_container'>" . $this->get_month_dropdown("input_{$id}[]", "{$field_id}_1", rgar($date_info, 'month'), $tabindex, $disabled_text, $month_placeholder_value) . '</div>';
                         $tabindex = $this->get_tabindex();
                         $field_str .= "<div class='gfield_date_dropdown_day ginput_container ginput_container_date' id='{$field_id}_2_container'>" . $this->get_day_dropdown("input_{$id}[]", "{$field_id}_2", rgar($date_info, 'day'), $tabindex, $disabled_text, $day_placeholder_value) . '</div>';
                         $tabindex = $this->get_tabindex();
                         $field_str .= "<div class='gfield_date_dropdown_year ginput_container ginput_container_date' id='{$field_id}_3_container'>" . $this->get_year_dropdown("input_{$id}[]", "{$field_id}_3", rgar($date_info, 'year'), $tabindex, $disabled_text, $year_placeholder_value, $form) . '</div></div>';
                     } else {
                         $field_str = $is_sub_label_above ? "<div class='clear-multi'><div class='gfield_date_month ginput_container ginput_container_date' id='{$field_id}_1_container'>\n                                            <label for='{$field_id}_1' {$sub_label_class_attribute}>{$month_sub_label}</label>\n                                            <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_1' value='{$month_value}' {$tabindex} {$disabled_text} {$month_placeholder_attribute} {$month_html5_attributes}/>\n                                        </div>" : "<div class='clear-multi'><div class='gfield_date_month ginput_container ginput_container_date' id='{$field_id}_1_container'>\n                                            <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_1' value='{$month_value}' {$tabindex} {$disabled_text} {$month_placeholder_attribute} {$month_html5_attributes}/>\n                                            <label for='{$field_id}_1' {$sub_label_class_attribute}>{$month_sub_label}</label>\n                                        </div>";
                         $tabindex = $this->get_tabindex();
                         $field_str .= $is_sub_label_above ? "<div class='gfield_date_day ginput_container ginput_container_date' id='{$field_id}_2_container'>\n                                            <label for='{$field_id}_2' {$sub_label_class_attribute}>{$day_sub_label}</label>\n                                            <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_2' value='{$day_value}' {$tabindex} {$disabled_text} {$day_placeholder_attribute} {$day_html5_attributes}/>\n                                        </div>" : "<div class='gfield_date_day ginput_container ginput_container_date' id='{$field_id}_2_container'>\n                                            <input type='{$date_input_type}' maxlength='2' name='input_{$id}[]' id='{$field_id}_2' value='{$day_value}' {$tabindex} {$disabled_text} {$day_placeholder_attribute} {$day_html5_attributes}/>\n                                            <label for='{$field_id}_2' {$sub_label_class_attribute}>{$day_sub_label}</label>\n                                        </div>";
                         $tabindex = $this->get_tabindex();
                         $field_str .= $is_sub_label_above ? "<div class='gfield_date_year ginput_container ginput_container_date' id='{$field_id}_3_container'>\n                                            <label for='{$field_id}_3' {$sub_label_class_attribute}>{$year_sub_label}</label>\n                                            <input type='{$date_input_type}' maxlength='4' name='input_{$id}[]' id='{$field_id}_3' value='{$year_value}' {$tabindex} {$disabled_text} {$year_placeholder_attribute} {$year_min_attribute} {$year_max_attribute} {$year_step_attribute}/>\n                                       </div>\n                                   </div>" : "<div class='gfield_date_year ginput_container ginput_container_date' id='{$field_id}_3_container'>\n                                            <input type='{$date_input_type}' maxlength='4' name='input_{$id}[]' id='{$field_id}_3' value='{$year_value}' {$tabindex} {$disabled_text} {$year_placeholder_attribute} {$year_min_attribute} {$year_max_attribute} {$year_step_attribute}/>\n                                            <label for='{$field_id}_3' {$sub_label_class_attribute}>{$year_sub_label}</label>\n                                       </div>\n                                   </div>";
                     }
                     break;
             }
             return "<div id='{$field_id}' class='ginput_container ginput_container_date'>{$field_str}</div>";
         } else {
             $picker_value = esc_attr(GFCommon::date_display($picker_value, $format));
             $icon_class = $this->calendarIconType == 'none' ? 'datepicker_no_icon' : 'datepicker_with_icon';
             $icon_url = empty($this->calendarIconUrl) ? GFCommon::get_base_url() . '/images/calendar.png' : $this->calendarIconUrl;
             $icon_url = esc_url($icon_url);
             $tabindex = $this->get_tabindex();
             $class = esc_attr($class);
             return "<div class='ginput_container ginput_container_date'>\n                            <input name='input_{$id}' id='{$field_id}' type='text' value='{$picker_value}' class='datepicker {$class} {$format} {$icon_class}' {$tabindex} {$disabled_text} {$date_picker_placeholder}/>\n                        </div>\n                        <input type='hidden' id='gforms_calendar_icon_{$field_id}' class='gform_hidden' value='{$icon_url}'/>";
         }
     }
 }
 /**
  * get HTML for input and label for date field (as date picker)
  * @param array $field
  * @param string $value
  * @param integer $lead_id
  * @param integer $form_id
  * @return string
  */
 protected function fieldDate($field, $value = "", $lead_id = 0, $form_id = 0)
 {
     $id = $field['id'];
     $sub_id = $field['sub_id'];
     $field_id = IS_ADMIN || $form_id == 0 ? "gfeway_{$id}_{$sub_id}" : "gfeway_{$form_id}_{$id}_{$sub_id}";
     $form_id = IS_ADMIN && empty($form_id) ? rgget('id') : $form_id;
     $format = empty($field['dateFormat']) ? 'dmy' : esc_attr($field['dateFormat']);
     $size = rgar($field, 'size');
     $disabled_text = IS_ADMIN && RG_CURRENT_VIEW != 'entry' ? 'disabled="disabled"' : '';
     $class_suffix = RG_CURRENT_VIEW == 'entry' ? '_admin' : '';
     $value = GFCommon::date_display($value, $format);
     $icon_class = $field['calendarIconType'] == 'none' ? 'datepicker_no_icon' : 'datepicker_with_icon';
     $icon_url = empty($field['calendarIconUrl']) ? GFCommon::get_base_url() . '/images/calendar.png' : $field['calendarIconUrl'];
     $tabindex = GFCommon::get_tabindex();
     $inputClass = array($size . $class_suffix, $format, $icon_class);
     $spanClass = array('gfeway_recurring_left', 'gfeway_recurring_date');
     if (empty($field['hidden'])) {
         $inputClass[] = 'datepicker';
     } else {
         $spanClass[] = 'gf_hidden';
     }
     $dataMin = '';
     if (!empty($field['dateMin'])) {
         $dataMin = sprintf('data-gfeway-minDate="%s"', esc_attr($field['dateMin']));
     }
     $dataMax = '';
     if (!empty($field['dateMax'])) {
         $dataMax = sprintf('data-gfeway-maxDate="%s"', esc_attr($field['dateMax']));
     }
     $value = esc_attr($value);
     $spanClass = esc_attr(implode(' ', $spanClass));
     $inputClass = esc_attr(implode(' ', $inputClass));
     $inputName = sprintf('gfeway_%s[%s]', $id, $sub_id);
     $label = esc_html($field['label']);
     ob_start();
     require GFEWAY_PLUGIN_ROOT . 'views/recurring-field-input-date.php';
     $input = ob_get_clean();
     return $input;
 }
    function column_cb($item)
    {
        $is_active = isset($item["isActive"]) ? $item["isActive"] : true;
        ?>
        <img src="<?php 
        echo GFCommon::get_base_url();
        ?>
/images/active<?php 
        echo intval($is_active);
        ?>
.png" style="cursor: pointer;margin:-5px 0 0 8px;" alt="<?php 
        $is_active ? __("Active", "gravityforms") : __("Inactive", "gravityforms");
        ?>
" title="<?php 
        echo $is_active ? __("Active", "gravityforms") : __("Inactive", "gravityforms");
        ?>
" onclick="ToggleActive(this, '<?php 
        echo $item["id"];
        ?>
'); " />
        <?php 
    }
Exemple #25
0
    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&amp;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>', "&nbsp;<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 
    }
Exemple #26
0
        public function settings_qrcode()
        {
            ?>
            <button class="button-secondary"
                    id="gfwebapi-qrbutton"><?php 
            _e("Show/hide QR Code", "gravityforms");
            ?>
</button>
            <div id="gfwebapi-qrcode-container" style="display:none;">
                <img id="gfwebapi-qrcode" src="<?php 
            echo GFCommon::get_base_url();
            ?>
/images/spinner.gif"/>
            </div>

        <?php 
        }
Exemple #27
0
 public static function modify_tiny_mce_4($init)
 {
     // Hack to fix compatibility issue with ACF PRO
     if (!isset($init['content_css'])) {
         return $init;
     }
     $base_url = GFCommon::get_base_url();
     $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
     $editor_styles = $base_url . "/css/shortcode-ui-editor-styles{$min}.css,";
     $form_styles = $base_url . "/css/formsmain{$min}.css";
     if (isset($init['content_css'])) {
         if (empty($init['content_css'])) {
             $init['content_css'] = '';
         } elseif (is_array($init['content_css'])) {
             $init['content_css'][] = $editor_styles;
             $init['content_css'][] = $form_styles;
             return $init;
         } else {
             $init['content_css'] = $init['content_css'] . ',';
         }
     }
     // Note: Using .= here can trigger a fatal error
     $init['content_css'] = $init['content_css'] . $editor_styles . $form_styles;
     return $init;
 }
 /**
  * Returns the URL of the Add-On Framework root folder
  *
  * @return string
  */
 private static function _get_base_url()
 {
     $folder = basename(dirname(__FILE__));
     return GFCommon::get_base_url() . "/includes/" . $folder;
 }
Exemple #29
0
        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'];
                    ?>
												&nbsp;<?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>&nbsp;
						<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">&nbsp;
						</div>
					</div>

				<?php 
            } else {
                _e('This form does not have any fields that can be used for results', 'gravityforms');
            }
            ?>
			</div>


		<?php 
        }
Exemple #30
0
    public static function help_page()
    {
        if (!GFCommon::ensure_wp_version()) {
            return;
        }
        echo GFCommon::get_remote_message();
        ?>
        <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 Help", "gravityforms");
        ?>
</h2>

            <div style="margin-top:10px;">

                <div
                    class="gforms_help_alert alert_yellow"><?php 
        _e("<strong>IMPORTANT NOTICE:</strong> We do not provide support via e-mail. Please <a href='http://www.gravityhelp.com/support/' target='_blank'>open a support ticket</a>.", "gravityforms");
        ?>
</div>

                <div><?php 
        _e("Please review the plugin documentation and <a href='http://www.gravityhelp.com/frequently-asked-questions/'>frequently asked questions (FAQ)</a> first. If you still can't find the answer <a href='http://www.gravityhelp.com/support/' target='_blank'>open a support ticket</a> and we will be happy to answer your questions and assist you with any problems. <strong>Please note:</strong> If you have not <a href='http://www.gravityforms.com/purchase-gravity-forms/'>purchased a license</a> from us, you won't have access to these help resources.", "gravityforms");
        ?>
</div>


                <div class="hr-divider"></div>

                <h3><?php 
        _e("Gravity Forms Documentation", "gravityforms");
        ?>
</h3>

                <ul style="margin-top:15px;">
                    <li>
                        <div class="gforms_helpbox">
                            <form name="jump">
                                <select name="menu">
                                    <!-- begin documentation listing -->
                                    <option
                                        selected><?php 
        _e("Documentation (please select a topic)", "gravityforms");
        ?>
</option>
                                    <option
                                        value="http://gravityhelp.com/documentation/page/Getting_Started"><?php 
        _e("Getting Started", "gravityforms");
        ?>
</option>
                                    <option
                                        value="http://gravityhelp.com/documentation/page/Using_Gravity_Forms"><?php 
        _e("Using Gravity Forms", "gravityforms");
        ?>
</option>
                                    <option
                                        value="http://gravityhelp.com/documentation/page/Design_and_Layout"><?php 
        _e("Design and Layout", "gravityforms");
        ?>
</option>
                                    <option
                                        value="http://gravityhelp.com/documentation/page/Developer_Docs"><?php 
        _e("Developer Docs", "gravityforms");
        ?>
</option>
                                    <option
                                        value="http://gravityhelp.com/documentation/page/Add-ons"><?php 
        _e("Add-Ons", "gravityforms");
        ?>
</option>
                                    <option
                                        value="http://gravityhelp.com/documentation/page/How_To"><?php 
        _e("How To", "gravityforms");
        ?>
</option>
                                    <!-- end documentation listing -->
                                </select>
                                <input type="button" class="button"
                                       onClick="window.open(document.jump.menu.options[document.jump.menu.selectedIndex].value);"
                                       value="<?php 
        _e("GO", "gravityforms");
        ?>
">
                            </form>
                        </div>

                    </li>
                </ul>

                <div class="hr-divider"></div>

                <h3><?php 
        _e("Gravity Forms FAQ", "gravityforms");
        ?>
</h3>
                <ul style="margin-top:15px;">
                    <li>
                        <div class="gforms_helpbox">
                            <form name="jump1">
                                <select name="menu1">

                                    <!-- begin faq listing -->
                                    <option selected><?php 
        _e("FAQ (please select a topic)", "gravityforms");
        ?>
</option>
                                    <option value="http://www.gravityhelp.com/frequently-asked-questions/#faq_installation"><?php 
        _e("Installation Questions", "gravityforms");
        ?>
</option>
                                    <option value="http://www.gravityhelp.com/frequently-asked-questions/#faq_styling"><?php 
        _e("Formatting/Styling Questions", "gravityforms");
        ?>
</option>
                                    <option value="http://www.gravityhelp.com/frequently-asked-questions/#faq_notifications"><?php 
        _e("Notification Questions", "gravityforms");
        ?>
</option>
                                    <option value="http://www.gravityhelp.com/frequently-asked-questions/#faq_general"><?php 
        _e("General Questions", "gravityforms");
        ?>
</option>

                                    <!-- end faq listing -->
                                </select>
                                <input type="button" class="button"
                                       onClick="window.open(document.jump1.menu1.options[document.jump1.menu1.selectedIndex].value);"
                                       value="<?php 
        _e("GO", "gravityforms");
        ?>
">
                            </form>
                        </div>

                    </li>

                </ul>

                <div class="hr-divider"></div>

                <h3><?php 
        _e("Gravity Forms Downloads", "gravityforms");
        ?>
</h3>
                <?php 
        _e("<strong>Please Note:</strong> Only licensed Gravity Forms customers are granted access to the downloads section.", "gravityforms");
        ?>
                <ul style="margin-top:15px;">
                    <li>
                        <div class="gforms_helpbox">
                            <form name="jump3">
                                <select name="menu3">

                                    <!-- begin downloads listing -->
                                    <option selected><?php 
        _e("Downloads (please select a product)", "gravityforms");
        ?>
</option>
                                    <option value="http://www.gravityhelp.com/downloads/"><?php 
        _e("Gravity Forms", "gravityforms");
        ?>
</option>
                                    <option value="http://www.gravityhelp.com/downloads/add-ons/"><?php 
        _e("Gravity Forms Add-Ons", "gravityforms");
        ?>
</option>

                                    <!-- end downloads listing -->
                                </select>
                                <input type="button" class="button"
                                       onClick="window.open(document.jump3.menu3.options[document.jump3.menu3.selectedIndex].value);"
                                       value="<?php 
        _e("GO", "gravityforms");
        ?>
">
                            </form>
                        </div>

                    </li>

                </ul>


                <div class="hr-divider"></div>

                <h3><?php 
        _e("Gravity Forms Tutorials &amp; Resources", "gravityforms");
        ?>
</h3>
                <?php 
        _e("<strong>Please note:</strong> The Gravity Forms support team does not provide support for third party scripts, widgets, etc.", "gravityforms");
        ?>

                <div class="gforms_helpbox" style="margin:15px 0;">
                    <ul class="resource_list">
                        <li><a href="http://www.gravityhelp.com/">Gravity Forms Blog</a></li>
                        <li><a target="_blank" href="http://www.gravityhelp.com/gravity-forms-css-visual-guide/">Gravity
                                Forms Visual CSS Guide</a></li>
                        <li><a target="_blank"
                               href="http://www.rocketgenius.com/gravity-forms-css-targeting-specific-elements/">Gravity
                                Forms CSS: Targeting Specific Elements</a></li>
                        <li><a target="_blank"
                               href="http://www.gravityhelp.com/creating-a-modal-form-with-gravity-forms-and-fancybox/">Creating
                                a Modal Form with Gravity Forms and FancyBox</a></li>
                        <li><a target="_blank" href="http://yoast.com/gravity-forms-widget-update/">Gravity Forms Widget
                                (Third Party Release)</a></li>
                        <li><a target="_blank" href="http://wordpress.org/extend/plugins/wp-mail-smtp/">WP Mail SMTP
                                Plugin</a></li>
                        <li><a target="_blank" href="http://wordpress.org/extend/plugins/members/">Members Plugin (Role
                                Management - Integrates with Gravity Forms)</a></li>
                        <li><a target="_blank" href="http://wordpress.org/extend/plugins/really-simple-captcha/">Really
                                Simple Captcha Plugin (Integrates with Gravity Forms)</a></li>
                    </ul>

                </div>

            </div>
        </div>


    <?php 
    }