当前位置: 首页>>代码示例>>PHP>>正文


PHP GFCommon::get_base_url方法代码示例

本文整理汇总了PHP中GFCommon::get_base_url方法的典型用法代码示例。如果您正苦于以下问题:PHP GFCommon::get_base_url方法的具体用法?PHP GFCommon::get_base_url怎么用?PHP GFCommon::get_base_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GFCommon的用法示例。


在下文中一共展示了GFCommon::get_base_url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: print_tooltip_scripts

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');
}
开发者ID:sashadt,项目名称:wp-deploy-test,代码行数:7,代码来源:tooltips.php

示例2: init

 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'));
 }
开发者ID:emilysnothere,项目名称:Gravity-Forms-Marketo-Add-on,代码行数:60,代码来源:marketo.php

示例3: print_tooltip_scripts

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();
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:8,代码来源:tooltips.php

示例4: print_tooltip_scripts

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');
}
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:8,代码来源:tooltips.php

示例5: column_is_active

 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;
 }
开发者ID:sbayer55,项目名称:The-Road-Gallery,代码行数:8,代码来源:class.plugify-gfaddonfeedstable.php

示例6: wps_gform_enqueue_scripts

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;
        }
    }
}
开发者ID:patrickporto,项目名称:gravityforms-datepickerinline,代码行数:14,代码来源:gravityforms-datepicker.php

示例7: get_field_input

 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);
//.........这里部分代码省略.........
开发者ID:wesleykepke,项目名称:ARIA,代码行数:101,代码来源:class-gf-field-fileupload.php

示例8: lead_detail_page


//.........这里部分代码省略.........
                $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);
开发者ID:christopherhodges,项目名称:wp-api,代码行数:67,代码来源:entry_detail.php

示例9: GetCustomizeInputsUI

				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>";
开发者ID:healthcommcore,项目名称:osnap,代码行数:31,代码来源:js.php

示例10: get_field_content

 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;
 }
开发者ID:pwillems,项目名称:mimosa-contents,代码行数:80,代码来源:form_display.php

示例11: page_header

    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 
    }
开发者ID:renztoygwapo,项目名称:lincoln,代码行数:68,代码来源:export.php

示例12: export_lead_page

    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 
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:export.php

示例13: lead_detail_page


//.........这里部分代码省略.........
                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"));
        ?>
' )};
开发者ID:JSpier,项目名称:smacamp,代码行数:67,代码来源:entry_detail.php

示例14: column_is_active

 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;
 }
开发者ID:sbayer55,项目名称:The-Road-Gallery,代码行数:8,代码来源:class-gf-feed-addon.php

示例15: entry_activation_button

    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 
    }
开发者ID:Inteleck,项目名称:hwc,代码行数:85,代码来源:userregistration.php


注:本文中的GFCommon::get_base_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。