本文整理匯總了PHP中GFCommon::truncate_url方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFCommon::truncate_url方法的具體用法?PHP GFCommon::truncate_url怎麽用?PHP GFCommon::truncate_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GFCommon
的用法示例。
在下文中一共展示了GFCommon::truncate_url方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: leads_page
//.........這裏部分代碼省略.........
<td>
<img id="star_image_<?php
echo esc_attr($lead['id']);
?>
" src="<?php
echo GFCommon::get_base_url();
?>
/images/star<?php
echo intval($lead['is_starred']);
?>
.png" onclick="ToggleStar(this, '<?php
echo esc_js($lead['id']);
?>
','<?php
echo esc_js($filter);
?>
');" />
</td>
<?php
}
$is_first_column = true;
$nowrap_class = 'entry_nowrap';
foreach ($field_ids as $field_id) {
$field = RGFormsModel::get_field($form, $field_id);
$value = rgar($lead, $field_id);
if (!empty($field) && $field->type == 'post_category') {
$value = GFCommon::prepare_post_category_value($value, $field, 'entry_list');
}
//filtering lead value
$value = apply_filters('gform_get_field_value', $value, $lead, $field);
$input_type = !empty($columns[$field_id]['inputType']) ? $columns[$field_id]['inputType'] : $columns[$field_id]['type'];
switch ($input_type) {
case 'source_url':
$value = "<a href='" . esc_attr($lead['source_url']) . "' target='_blank' alt='" . esc_attr($lead['source_url']) . "' title='" . esc_attr($lead['source_url']) . "'>.../" . esc_attr(GFCommon::truncate_url($lead['source_url'])) . '</a>';
break;
case 'date_created':
case 'payment_date':
$value = GFCommon::format_date($value, false);
break;
case 'payment_amount':
$value = GFCommon::to_money($value, $lead['currency']);
break;
case 'created_by':
if (!empty($value)) {
$userdata = get_userdata($value);
if (!empty($userdata)) {
$value = $userdata->user_login;
}
}
break;
default:
if ($field !== null) {
$value = $field->get_value_entry_list($value, $lead, $field_id, $columns, $form);
} else {
$value = esc_html($value);
}
}
$value = apply_filters('gform_entries_field_value', $value, $form_id, $field_id, $lead);
/* ^ maybe move to function */
$query_string = "gf_entries&view=entry&id={$form_id}&lid={$lead['id']}{$search_qs}{$sort_qs}{$dir_qs}{$filter_qs}&paged=" . ($page_index + 1);
if ($is_first_column) {
?>
<td class="column-title">
<a href="admin.php?page=gf_entries&view=entry&id=<?php
echo absint($form_id);
?>
示例2: get_field_input
//.........這裏部分代碼省略.........
return sprintf("<div class='ginput_container'><input name='input_%d' id='%s' type='text' value='%s' class='datepicker %s %s %s' {$tabindex} %s/> </div><input type='hidden' id='gforms_calendar_icon_{$field_id}' class='gform_hidden' value='{$icon_url}'/>", $id, $field_id, esc_attr($value), esc_attr($class), $format, $icon_class, $disabled_text);
}
}
case "time":
if (!empty($post_link)) {
return $post_link;
}
$hour = $minute = $am_selected = $pm_selected = "";
if (!is_array($value) && !empty($value)) {
preg_match('/^(\\d*):(\\d*) ?(.*)$/', $value, $matches);
$hour = esc_attr($matches[1]);
$minute = esc_attr($matches[2]);
$am_selected = rgar($matches, 3) == "am" ? "selected='selected'" : "";
$pm_selected = rgar($matches, 3) == "pm" ? "selected='selected'" : "";
} else {
if (is_array($value)) {
$hour = esc_attr($value[0]);
$minute = esc_attr($value[1]);
$am_selected = rgar($value, 2) == "am" ? "selected='selected'" : "";
$pm_selected = rgar($value, 2) == "pm" ? "selected='selected'" : "";
}
}
$hour_tabindex = self::get_tabindex();
$minute_tabindex = self::get_tabindex();
$ampm_tabindex = self::get_tabindex();
$ampm_field_style = is_admin() && rgar($field, "timeFormat") == "24" ? "style='display:none;'" : "";
$ampm_field = is_admin() || rgar($field, "timeFormat") != "24" ? "<div class='gfield_time_ampm ginput_container' {$ampm_field_style}><select name='input_{$id}[]' id='{$field_id}_3' {$ampm_tabindex} {$disabled_text}><option value='am' {$am_selected}>" . __("AM", "gravityforms") . "</option><option value='pm' {$pm_selected}>" . __("PM", "gravityforms") . "</option></select></div>" : "";
return sprintf("<div class='clear-multi'><div class='gfield_time_hour ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s_1' value='%s' {$hour_tabindex} %s/> : <label for='%s_1'>" . __("HH", "gravityforms") . "</label></div><div class='gfield_time_minute ginput_container'><input type='text' maxlength='2' name='input_%d[]' id='%s_2' value='%s' {$minute_tabindex} %s/><label for='%s_2'>" . __("MM", "gravityforms") . "</label></div>{$ampm_field}</div>", $field_id, $id, $field_id, $hour, $disabled_text, $field_id, $id, $field_id, $minute, $disabled_text, $field_id);
case "fileupload":
$tabindex = self::get_tabindex();
$upload = sprintf("<input name='input_%d' id='%s' type='file' value='%s' size='20' class='%s' {$tabindex} %s/>", $id, $field_id, esc_attr($value), esc_attr($class), $disabled_text);
if (IS_ADMIN && !empty($value)) {
$value = esc_attr($value);
$preview = sprintf("<div id='preview_%d'><a href='%s' target='_blank' alt='%s' title='%s'>%s</a><a href='%s' target='_blank' alt='" . __("Download file", "gravityforms") . "' title='" . __("Download file", "gravityforms") . "'><img src='%s' style='margin-left:10px;'/></a><a href='javascript:void(0);' alt='" . __("Delete file", "gravityforms") . "' title='" . __("Delete file", "gravityforms") . "' onclick='DeleteFile(%d,%d);' ><img src='%s' style='margin-left:10px;'/></a></div>", $id, $value, $value, $value, GFCommon::truncate_url($value), $value, GFCommon::get_base_url() . "/images/download.png", $lead_id, $id, GFCommon::get_base_url() . "/images/delete.png");
return $preview . "<div id='upload_{$id}' style='display:none;'>{$upload}</div>";
} else {
$file_info = RGFormsModel::get_temp_filename($form_id, "input_{$id}");
if ($file_info && !$field["failed_validation"]) {
$preview = "<span class='ginput_preview'><strong>" . esc_html($file_info["uploaded_filename"]) . "</strong> | <a href='javascript:;' onclick='gformDeleteUploadedFile({$form_id}, {$id});'>" . __("delete", "gravityforms") . "</a></span>";
return "<div class='ginput_container'>" . str_replace(" class='", " class='gform_hidden ", $upload) . " {$preview}</div>";
} else {
return "<div class='ginput_container'>{$upload}</div>";
}
}
case "captcha":
switch (rgget("captchaType", $field)) {
case "simple_captcha":
$size = rgempty("simpleCaptchaSize", $field) ? "medium" : $field["simpleCaptchaSize"];
$captcha = self::get_captcha($field);
$tabindex = self::get_tabindex();
$dimensions = IS_ADMIN ? "" : "width='" . rgar($captcha, "width") . "' height='" . rgar($captcha, "height") . "'";
return "<div class='gfield_captcha_container'><img class='gfield_captcha' src='" . rgar($captcha, "url") . "' alt='' {$dimensions} /><div class='gfield_captcha_input_container simple_captcha_{$size}'><input type='text' name='input_{$id}' id='{$field_id}' {$tabindex}/><input type='hidden' name='input_captcha_prefix_{$id}' value='" . rgar($captcha, "prefix") . "' /></div></div>";
break;
case "math":
$size = empty($field["simpleCaptchaSize"]) ? "medium" : $field["simpleCaptchaSize"];
$captcha_1 = self::get_math_captcha($field, 1);
$captcha_2 = self::get_math_captcha($field, 2);
$captcha_3 = self::get_math_captcha($field, 3);
$tabindex = self::get_tabindex();
$dimensions = IS_ADMIN ? "" : "width='{$captcha_1["width"]}' height='{$captcha_1["height"]}'";
return "<div class='gfield_captcha_container'><img class='gfield_captcha' src='{$captcha_1["url"]}' alt='' {$dimensions} /><img class='gfield_captcha' src='{$captcha_2["url"]}' alt='' {$dimensions} /><img class='gfield_captcha' src='{$captcha_3["url"]}' alt='' {$dimensions} /><div class='gfield_captcha_input_container math_{$size}'><input type='text' name='input_{$id}' id='input_{$field_id}' {$tabindex}/><input type='hidden' name='input_captcha_prefix_{$id}' value='{$captcha_1["prefix"]},{$captcha_2["prefix"]},{$captcha_3["prefix"]}' /></div></div>";
break;
default:
if (!function_exists("recaptcha_get_html")) {
require_once GFCommon::get_base_path() . '/recaptchalib.php';
}
示例3: leads_page
//.........這裏部分代碼省略.........
$val = count($ary) > 0 ? $ary[0] : "";
$price = count($ary) > 1 ? $ary[1] : "";
if ($val == $choice["value"]) {
$value = "<img src='" . GFCommon::get_base_url() . "/images/tick.png'/>";
break;
}
}
}
}
}
}
}
}
}
break;
case "post_image":
list($url, $title, $caption, $description) = rgexplode("|:|", $value, 4);
if (!empty($url)) {
//displaying thumbnail (if file is an image) or an icon based on the extension
$thumb = self::get_icon_url($url);
$value = "<a href='" . esc_attr($url) . "' target='_blank' title='" . __("Click to view", "gravityforms") . "'><img src='{$thumb}'/></a>";
}
break;
case "fileupload":
$file_path = $value;
if (!empty($file_path)) {
//displaying thumbnail (if file is an image) or an icon based on the extension
$thumb = self::get_icon_url($file_path);
$file_path = esc_attr($file_path);
$value = "<a href='{$file_path}' target='_blank' title='" . __("Click to view", "gravityforms") . "'><img src='{$thumb}'/></a>";
}
break;
case "source_url":
$value = "<a href='" . esc_attr($lead["source_url"]) . "' target='_blank' alt='" . esc_attr($lead["source_url"]) . "' title='" . esc_attr($lead["source_url"]) . "'>.../" . esc_attr(GFCommon::truncate_url($lead["source_url"])) . "</a>";
break;
case "textarea":
case "post_content":
case "post_excerpt":
$value = esc_html($value);
break;
case "date_created":
case "payment_date":
$value = GFCommon::format_date($value, false);
break;
case "date":
$field = RGFormsModel::get_field($form, $field_id);
$value = GFCommon::date_display($value, rgar($field, "dateFormat"));
break;
case "radio":
case "select":
$field = RGFormsModel::get_field($form, $field_id);
$value = GFCommon::selection_display($value, $field, $lead["currency"]);
break;
case "number":
$field = RGFormsModel::get_field($form, $field_id);
$value = GFCommon::format_number($value, rgar($field, "numberFormat"));
break;
case "total":
case "payment_amount":
$value = GFCommon::to_money($value, $lead["currency"]);
break;
case "created_by":
if (!empty($value)) {
$userdata = get_userdata($value);
$value = $userdata->user_login;
}
示例4: get_field_input
//.........這裏部分代碼省略.........
if ($field["dateType"] == "datefield") {
if ($format == "mdy") {
$tabindex = self::get_tabindex();
$field_str = sprintf("<div class='clear-multi'><div class='gfield_date_month ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.1' value='%s' {$tabindex} %s/><label for='%s.1'>" . __("MM", "gravityforms") . "</label></div>", $field_id, $id, $field_id, $date_info["month"], $disabled_text, $field_id);
$tabindex = self::get_tabindex();
$field_str .= sprintf("<div class='gfield_date_day ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.2' value='%s' {$tabindex} %s/><label for='%s.2'>" . __("DD", "gravityforms") . "</label></div>", $field_id, $id, $field_id, $date_info["day"], $disabled_text, $field_id);
} else {
$tabindex = self::get_tabindex();
$field_str = sprintf("<div class='clear-multi'><div class='gfield_date_day ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.2' value='%s' {$tabindex} %s/><label for='%s.2'>" . __("DD", "gravityforms") . "</label></div>", $field_id, $id, $field_id, $date_info["day"], $disabled_text, $field_id);
$tabindex = self::get_tabindex();
$field_str .= sprintf("<div class='gfield_date_month ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.1' value='%s' {$tabindex} %s/><label for='%s.1'>" . __("MM", "gravityforms") . "</label></div>", $field_id, $id, $field_id, $date_info["month"], $disabled_text, $field_id);
}
$tabindex = self::get_tabindex();
$field_str .= sprintf("<div class='gfield_date_year ginput_container' id='%s'><input type='text' maxlength='4' name='input_%d[]' id='%s.3' value='%s' {$tabindex} %s/><label for='%s.3'>" . __("YYYY", "gravityforms") . "</label></div></div>", $field_id, $id, $field_id, $date_info["year"], $disabled_text, $field_id);
return $field_str;
} else {
$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 = self::get_tabindex();
return sprintf("<div class='ginput_container'><input name='input_%d' id='%s' type='text' value='%s' class='datepicker %s %s %s' {$tabindex} %s/> </div><input type='hidden' id='gforms_calendar_icon_{$field_id}' class='gform_hidden' value='{$icon_url}'/>", $id, $field_id, esc_attr($value), esc_attr($class), $format, $icon_class, $disabled_text);
}
}
case "time":
if (!empty($post_link)) {
return $post_link;
}
if (!is_array($value) && !empty($value)) {
preg_match('/^(\\d*):(\\d*) (.*)$/', $value, $matches);
$hour = esc_attr($matches[1]);
$minute = esc_attr($matches[2]);
$am_selected = $matches[3] == "am" ? "selected='selected'" : "";
$pm_selected = $matches[3] == "pm" ? "selected='selected'" : "";
} else {
$hour = esc_attr($value[0]);
$minute = esc_attr($value[1]);
$am_selected = $value[2] == "am" ? "selected='selected'" : "";
$pm_selected = $value[2] == "pm" ? "selected='selected'" : "";
}
$hour_tabindex = self::get_tabindex();
$minute_tabindex = self::get_tabindex();
$ampm_tabindex = self::get_tabindex();
return sprintf("<div class='clear-multi'><div class='gfield_time_hour ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.1' value='%s' {$hour_tabindex} %s/> : <label for='%s.1'>" . __("HH", "gravityforms") . "</label></div><div class='gfield_time_minute ginput_container'><input type='text' maxlength='2' name='input_%d[]' id='%s.2' value='%s' {$minute_tabindex} %s/><label for='%s.2'>" . __("MM", "gravityforms") . "</label></div><div class='gfield_time_ampm ginput_container'><select name='input_%d[]' id='%s.3' {$ampm_tabindex} %s><option value='am' %s>" . __("AM", "gravityforms") . "</option><option value='pm' %s>" . __("PM", "gravityforms") . "</option></select></div></div>", $field_id, $id, $field_id, $hour, $disabled_text, $field_id, $id, $field_id, $minute, $disabled_text, $field_id, $id, $field_id, $disabled_text, $am_selected, $pm_selected);
case "fileupload":
$tabindex = self::get_tabindex();
$upload = sprintf("<input name='input_%d' id='%s' type='file' value='%s' size='20' class='%s' {$tabindex} %s/>", $id, $field_id, esc_attr($value), esc_attr($class), $disabled_text);
if (IS_ADMIN && !empty($value)) {
$value = esc_attr($value);
$preview = sprintf("<div id='preview_%d'><a href='%s' target='_blank' alt='%s' title='%s'>%s</a><a href='%s' target='_blank' alt='" . __("Download file", "gravityforms") . "' title='" . __("Download file", "gravityforms") . "'><img src='%s' style='margin-left:10px;'/></a><a href='javascript:void(0);' alt='" . __("Delete file", "gravityforms") . "' title='" . __("Delete file", "gravityforms") . "' onclick='DeleteFile(%d,%d);' ><img src='%s' style='margin-left:10px;'/></a></div>", $id, $value, $value, $value, GFCommon::truncate_url($value), $value, GFCommon::get_base_url() . "/images/download.png", $lead_id, $id, GFCommon::get_base_url() . "/images/delete.png");
return $preview . "<div id='upload_{$id}' style='display:none;'>{$upload}</div>";
} else {
$file_info = RGFormsModel::get_temp_filename($form_id, "input_{$id}");
if ($file_info && !$field["failed_validation"]) {
$preview = "<span class='ginput_preview'><strong>{$file_info["uploaded_filename"]}</strong> | <a href='javascript:;' onclick='gformDeleteUploadedFile({$form_id}, {$id});'>" . __("delete", "gravityforms") . "</a></span>";
return "<div class='ginput_container'>" . str_replace(" class='", " class='gform_hidden ", $upload) . " {$preview}</div>";
} else {
return "<div class='ginput_container'>{$upload}</div>";
}
}
case "captcha":
switch ($field["captchaType"]) {
case "simple_captcha":
$size = empty($field["simpleCaptchaSize"]) ? "medium" : $field["simpleCaptchaSize"];
$captcha = self::get_captcha($field);
$tagindex = self::get_tabindex();
$dimensions = IS_ADMIN ? "" : "width='{$captcha["width"]}' height='{$captcha["height"]}'";
return "<div class='gfield_captcha_container'><img class='gfield_captcha' src='{$captcha["url"]}' alt='' {$dimensions} /><div class='gfield_captcha_input_container simple_captcha_{$size}'><input type='text' name='input_{$id}' id='input_{$field_id}' /><input type='hidden' name='input_captcha_prefix_{$id}' value='{$captcha["prefix"]}' /></div></div>";
break;
case "math":
$size = empty($field["simpleCaptchaSize"]) ? "medium" : $field["simpleCaptchaSize"];
$captcha_1 = self::get_math_captcha($field, 1);
$captcha_2 = self::get_math_captcha($field, 2);
$captcha_3 = self::get_math_captcha($field, 3);
$tagindex = self::get_tabindex();
$dimensions = IS_ADMIN ? "" : "width='{$captcha_1["width"]}' height='{$captcha_1["height"]}'";
return "<div class='gfield_captcha_container'><img class='gfield_captcha' src='{$captcha_1["url"]}' alt='' {$dimensions} /><img class='gfield_captcha' src='{$captcha_2["url"]}' alt='' {$dimensions} /><img class='gfield_captcha' src='{$captcha_3["url"]}' alt='' {$dimensions} /><div class='gfield_captcha_input_container math_{$size}'><input type='text' name='input_{$id}' id='input_{$field_id}' /><input type='hidden' name='input_captcha_prefix_{$id}' value='{$captcha_1["prefix"]},{$captcha_2["prefix"]},{$captcha_3["prefix"]}' /></div></div>";
break;
default:
if (!function_exists("recaptcha_get_html")) {
require_once GFCommon::get_base_path() . '/recaptchalib.php';
}
$theme = empty($field["captchaTheme"]) ? "red" : esc_attr($field["captchaTheme"]);
$publickey = get_option("rg_gforms_captcha_public_key");
$privatekey = get_option("rg_gforms_captcha_private_key");
if (IS_ADMIN) {
if (empty($publickey) || empty($privatekey)) {
return "<div class='captcha_message'>" . __("To use the reCaptcha field you must first do the following:", "gravityforms") . "</div><div class='captcha_message'>1 - <a href='https://admin.recaptcha.net/recaptcha/createsite/?app=php' target='_blank'>" . __(sprintf("Sign up%s for a free reCAPTCHA account", "</a>"), "gravityforms") . "</div><div class='captcha_message'>2 - " . __(sprintf("Enter your reCAPTCHA keys in the %ssettings page%s", "<a href='?page=gf_settings'>", "</a>"), "gravityforms") . "</div>";
} else {
return "<div class='ginput_container'><img class='gfield_captcha' src='" . GFCommon::get_base_url() . "/images/captcha_{$theme}.jpg' alt='reCAPTCHA' title='reCAPTCHA'/></div>";
}
} else {
$language = empty($field["captchaLanguage"]) ? "en" : esc_attr($field["captchaLanguage"]);
$options = "<script type='text/javascript'>var RecaptchaOptions = {theme : '{$theme}', lang : '{$language}'}; if(parseInt('" . self::$tab_index . "') > 0) {RecaptchaOptions.tabindex = " . self::$tab_index++ . ";}</script>";
$is_ssl = !empty($_SERVER['HTTPS']);
return $options . "<div class='ginput_container' id='{$field_id}'>" . recaptcha_get_html($publickey, null, $is_ssl) . "</div>";
}
}
break;
}
}
示例5: duplicate_entry_data
/**
* Duplicates the contents of a specified entry id into the specified form
* Adapted from forms_model.php, RGFormsModel::save_lead($Form, $lead) and
* gravity -forms-addons.php for the gravity forms addon plugin
* @param array $form Form object.
* @param array $lead Lead object
* @return void
*/
function duplicate_entry_data($form_change, $current_entry_id)
{
global $wpdb;
$lead_table = GFFormsModel::get_lead_table_name();
$lead_detail_table = GFFormsModel::get_lead_details_table_name();
$lead_meta_table = GFFormsModel::get_lead_meta_table_name();
//pull existing entries information
$current_lead = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$lead_table} WHERE id=%d", $current_entry_id));
$current_fields = $wpdb->get_results($wpdb->prepare("SELECT wp_rg_lead_detail.field_number, wp_rg_lead_detail.value, wp_rg_lead_detail_long.value as long_detail FROM {$lead_detail_table} left outer join wp_rg_lead_detail_long on wp_rg_lead_detail_long.lead_detail_id = wp_rg_lead_detail.id WHERE lead_id=%d", $current_entry_id));
// new lead
$user_id = $current_user && $current_user->ID ? $current_user->ID : 'NULL';
$user_agent = GFCommon::truncate_url($_SERVER["HTTP_USER_AGENT"], 250);
$currency = GFCommon::get_currency();
$source_url = GFCommon::truncate_url(RGFormsModel::get_current_page_url(), 200);
$wpdb->query($wpdb->prepare("INSERT INTO {$lead_table}(form_id, ip, source_url, date_created, user_agent, currency, created_by) VALUES(%d, %s, %s, utc_timestamp(), %s, %s, {$user_id})", $form_change, RGFormsModel::get_ip(), $source_url, $user_agent, $currency));
$lead_id = $wpdb->insert_id;
echo 'Entry ' . $lead_id . ' created in Form ' . $form_change;
//add a note to the new entry
$results = mf_add_note($lead_id, 'Copied Entry ID:' . $current_entry_id . ' into form ' . $form_change . '. New Entry ID =' . $lead_id);
foreach ($current_fields as $row) {
$fieldValue = $row->field_number != 303 ? $row->value : 'Proposed';
$wpdb->query($wpdb->prepare("INSERT INTO {$lead_detail_table}(lead_id, form_id, field_number, value) VALUES(%d, %s, %s, %s)", $lead_id, $form_change, $row->field_number, $fieldValue));
//if detail long is set, add row for new record
if ($row->long_detail != 'NULL') {
$lead_detail_id = $wpdb->insert_id;
$wpdb->query($wpdb->prepare("INSERT INTO wp_rg_lead_detail_long(lead_detail_id, value) VALUES(%d, %s)", $lead_detail_id, $row->long_detail));
}
}
}
示例6: lead_detail_page
//.........這裏部分代碼省略.........
_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 (!empty($lead["payment_status"])) {
echo $lead["transaction_type"] != 2 ? __("Payment Status", "gravityforms") : __("Subscription Status", "gravityforms");
?>
: <span id="gform_payment_status"><?php
echo apply_filters("gform_payment_status", $lead["payment_status"], $form, $lead);
?>
示例7: column_default
/**
* Displays the entry value.
*
* @param object $entry
* @param string $field_id
*/
function column_default($entry, $column_id)
{
$field_id = (string) str_replace('field_id-', '', $column_id);
$form = $this->get_form();
$form_id = $this->get_form_id();
$field = GFFormsModel::get_field($form, $field_id);
$columns = GFFormsModel::get_grid_columns($form_id, true);
$value = rgar($entry, $field_id);
if (!empty($field) && $field->type == 'post_category') {
$value = GFCommon::prepare_post_category_value($value, $field, 'entry_list');
}
// Filtering lead value
$value = apply_filters('gform_get_field_value', $value, $entry, $field);
switch ($field_id) {
case 'source_url':
$value = "<a href='" . esc_attr($entry['source_url']) . "' target='_blank' alt='" . esc_attr($entry['source_url']) . "' title='" . esc_attr($entry['source_url']) . "'>.../" . esc_attr(GFCommon::truncate_url($entry['source_url'])) . '</a>';
break;
case 'date_created':
case 'payment_date':
$value = GFCommon::format_date($value, false);
break;
case 'payment_amount':
$value = GFCommon::to_money($value, $entry['currency']);
break;
case 'created_by':
if (!empty($value)) {
$userdata = get_userdata($value);
if (!empty($userdata)) {
$value = $userdata->user_login;
}
}
break;
default:
if ($field !== null) {
$value = $field->get_value_entry_list($value, $entry, $field_id, $columns, $form);
} else {
$value = esc_html($value);
}
}
$value = apply_filters('gform_entries_field_value', $value, $form_id, $field_id, $entry);
$primary = $this->get_primary_column_name();
if ($column_id == $primary) {
$edit_url = $this->get_detail_url($entry);
$value = '<a title="' . esc_attr__('View this entry', 'gravityforms') . '" href="' . $edit_url . '">' . $value . '</a>';
}
echo $value;
}
示例8: lead_detail_page
//.........這裏部分代碼省略.........
:
<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');
?>
:
示例9: lead_detail_page
//.........這裏部分代碼省略.........
_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 (!empty($lead["payment_status"])) {
echo $lead["transaction_type"] != 2 ? __("Payment Status", "gravityforms") : __("Subscription Status", "gravityforms");
?>
: <?php
echo $lead["payment_status"];
?>
示例10: column_default
/**
* Displays the entry value.
*
* @param object $entry
* @param string $field_id
*/
function column_default($entry, $column_id)
{
$field_id = (string) str_replace('field_id-', '', $column_id);
$form = $this->get_form();
$form_id = $this->get_form_id();
$field = GFFormsModel::get_field($form, $field_id);
$columns = GFFormsModel::get_grid_columns($form_id, true);
$value = rgar($entry, $field_id);
if (!empty($field) && $field->type == 'post_category') {
$value = GFCommon::prepare_post_category_value($value, $field, 'entry_list');
}
// Filtering lead value
$value = apply_filters('gform_get_field_value', $value, $entry, $field);
switch ($field_id) {
case 'source_url':
$value = "<a href='" . esc_attr($entry['source_url']) . "' target='_blank' alt='" . esc_attr($entry['source_url']) . "' title='" . esc_attr($entry['source_url']) . "'>.../" . esc_attr(GFCommon::truncate_url($entry['source_url'])) . '</a>';
break;
case 'date_created':
case 'payment_date':
$value = GFCommon::format_date($value, false);
break;
case 'payment_amount':
$value = GFCommon::to_money($value, $entry['currency']);
break;
case 'created_by':
if (!empty($value)) {
$userdata = get_userdata($value);
if (!empty($userdata)) {
$value = $userdata->user_login;
}
}
break;
default:
if ($field !== null) {
$value = $field->get_value_entry_list($value, $entry, $field_id, $columns, $form);
} else {
$value = esc_html($value);
}
}
$value = apply_filters('gform_entries_field_value', $value, $form_id, $field_id, $entry);
$primary = $this->get_primary_column_name();
$query_string = $this->get_detail_query_string($entry);
if ($column_id == $primary) {
$edit_url = $this->get_detail_url($entry);
echo '<a title="' . esc_attr__('View this entry', 'gravityforms') . '" href="' . $edit_url . '">' . $value . '</a>';
} else {
/**
* Used to inject markup and replace the value of any non-first column in the entry list grid.
*
* @param string $value The value of the field
* @param int $form_id The ID of the current form
* @param int $field_id The ID of the field
* @param array $entry The Entry object
* @param string $query_string The current page's query string
*/
echo apply_filters('gform_entries_column_filter', $value, $form_id, $field_id, $entry, $query_string);
// Maintains gap between value and content from gform_entries_column which existed when using 1.9 and earlier.
echo ' ';
/**
* Fired within the entries column
*
* Used to insert additional entry details
*
* @param int $form_id The ID of the current form
* @param int $field_id The ID of the field
* @param string $value The value of the field
* @param array $entry The Entry object
* @param string $query_string The current page's query string
*/
do_action('gform_entries_column', $form_id, $field_id, $value, $entry, $query_string);
}
}
示例11: make_directory
//.........這裏部分代碼省略.........
$size = false;
$img = "<img src='{$src}' />";
}
} else {
// No thickbox for non-images please
switch (strtolower(trim($postimage))) {
case 'image':
$src = $url;
break;
case 'icon':
default:
$src = $icon;
break;
}
if (!empty($getimagesize)) {
$size = @getimagesize($src);
} else {
$size = false;
}
}
$img = array('src' => $src, 'size' => $size, 'title' => $title, 'caption' => $caption, 'description' => $description, 'url' => esc_attr($url), 'code' => isset($size[3]) ? "<img src='{$src}' {$size[3]} />" : "<img src='{$src}' />");
$img = apply_filters('kws_gf_directory_lead_image', apply_filters('kws_gf_directory_lead_image_' . $postimage, apply_filters('kws_gf_directory_lead_image_' . $lead['id'], $img)));
if (in_array('images', $lightboxsettings) || !empty($lightboxsettings['images'])) {
$lightboxclass .= ' rel="directory_all directory_images"';
}
$value = "<a href='{$url}'{$target}{$lightboxclass}>{$img['code']}</a>";
}
break;
case "source_url":
if (in_array('urls', $lightboxsettings) || !empty($lightboxsettings['urls'])) {
$lightboxclass .= ' rel="directory_all directory_urls"';
}
if ($linkwebsite) {
$value = "<a href='" . esc_attr($lead["source_url"]) . "'{$target}{$lightboxclass} title='" . esc_attr($lead["source_url"]) . "'{$nofollow}>.../" . esc_attr(GFCommon::truncate_url($lead["source_url"])) . "</a>";
} else {
$value = esc_attr(GFCommon::truncate_url($lead["source_url"]));
}
break;
case "textarea":
case "post_content":
case "post_excerpt":
if ($fulltext) {
$long_text = $value = "";
if (isset($lead[$field_id]) && strlen($lead[$field_id]) >= GFORMS_MAX_FIELD_LENGTH) {
$long_text = get_gf_field_value_long($lead["id"], $field_id);
}
if (isset($lead[$field_id])) {
$value = !empty($long_text) ? $long_text : $lead[$field_id];
}
if ($wpautop) {
$value = wpautop($value);
}
} else {
$value = esc_html($value);
}
break;
case "date_created":
$value = GFCommon::format_date($value, false, $datecreatedformat);
break;
case "date":
$field = RGFormsModel::get_field($form, $field_id);
if ($dateformat) {
$value = GFCommon::date_display($value, $dateformat);
} else {
$value = GFCommon::date_display($value, $field["dateFormat"]);
}
示例12: get_field_input
//.........這裏部分代碼省略.........
//address field
$street_address = sprintf("<span class='ginput_full{$class_suffix}' id='" . $field_id . "_1_container'><input type='text' name='input_%d.1' id='%s_1' value='%s' tabindex='%d' %s/><label for='%s_1' id='" . $field_id . "_1_label'>" . apply_filters("gform_address_street", __("Street Address", "gravityforms"), $form_id) . "</label></span>", $id, $field_id, $street_value, self::$tab_index++, $disabled_text, $field_id);
//address line 2 field
$style = IS_ADMIN && $field["hideAddress2"] ? "style='display:none;'" : "";
$street_address2 = IS_ADMIN || !$field["hideAddress2"] ? sprintf("<span class='ginput_full{$class_suffix}' id='" . $field_id . "_2_container' {$style}><input type='text' name='input_%d.2' id='%s_2' value='%s' tabindex='%d' %s/><label for='%s_2' id='" . $field_id . "_2_label'>" . apply_filters("gform_address_street2", __("Address Line 2", "gravityforms"), $form_id) . "</label></span>", $id, $field_id, $street2_value, self::$tab_index++, $disabled_text, $field_id) : "";
//city field
$city = sprintf("<span class='ginput_left{$class_suffix}' id='" . $field_id . "_3_container'><input type='text' name='input_%d.3' id='%s_3' value='%s' tabindex='%d' %s/><label for='%s_3' id='{$field_id}.3_label'>" . apply_filters("gform_address_city", __("City", "gravityforms"), $form_id) . "</label></span>", $id, $field_id, $city_value, self::$tab_index++, $disabled_text, $field_id);
//state field
$state_field = self::get_state_field($field, $id, $field_id, $state_value, $disabled_text);
$state = sprintf("<span class='ginput_right{$class_suffix}' id='" . $field_id . "_4_container'>{$state_field}<label for='%s.4' id='" . $field_id . "_4_label'>" . apply_filters("gform_address_state", $state_label, $form_id) . "</label></span>", $field_id);
$zip = sprintf("<span class='ginput_left{$class_suffix}' id='" . $field_id . "_5_container'><input type='text' name='input_%d.5' id='%s_5' value='%s' tabindex='%d' %s/><label for='%s_5' id='" . $field_id . "_5_label'>" . apply_filters("gform_address_zip", $zip_label, $form_id) . "</label></span>", $id, $field_id, $zip_value, self::$tab_index++, $disabled_text, $field_id);
if (IS_ADMIN || !$hide_country) {
$style = $hide_country ? "style='display:none;'" : "";
$country = sprintf("<span class='ginput_right{$class_suffix}' id='" . $field_id . "_6_container' {$style}><select name='input_%d.6' id='%s_6' tabindex='%d' %s>%s</select><label for='%s_6' id='" . $field_id . "_6_label'>" . apply_filters("gform_address_country", __("Country", "gravityforms"), $form_id) . "</label></span>", $id, $field_id, self::$tab_index++, $disabled_text, $country_list, $field_id);
} else {
$country = sprintf("<input type='hidden' class='gform_hidden' name='input_%d.6' id='%s_6' value='%s'/>", $id, $field_id, $country_value);
}
return "<div class='ginput_complex{$class_suffix} ginput_container' id='{$field_id}'>" . $street_address . $street_address2 . $city . $state . $zip . $country . "</div>";
case "date":
if (!empty($post_link)) {
return $post_link;
}
$format = empty($field["dateFormat"]) ? "mdy" : esc_attr($field["dateFormat"]);
if (IS_ADMIN && RG_CURRENT_VIEW != "entry") {
$datepicker_display = $field["dateType"] == "datefield" ? "none" : "inline";
$dropdown_display = $field["dateType"] == "datefield" ? "inline" : "none";
$icon_display = $field["calendarIconType"] == "calendar" ? "inline" : "none";
$month_field = "<div class='gfield_date_month ginput_date' id='gfield_input_date_month' style='display:{$dropdown_display}'><input name='ginput_month' type='text' disabled='disabled'/><label>" . __("MM", "gravityforms") . "</label></div>";
$day_field = "<div class='gfield_date_day ginput_date' id='gfield_input_date_day' style='display:{$dropdown_display}'><input name='ginput_day' type='text' disabled='disabled'/><label>" . __("DD", "gravityforms") . "</label></div>";
$year_field = "<div class='gfield_date_year ginput_date' id='gfield_input_date_year' style='display:{$dropdown_display}'><input type='text' name='ginput_year' disabled='disabled'/><label>" . __("YYYY", "gravityforms") . "</label></div>";
$field_string = "<div class='ginput_container' id='gfield_input_datepicker' style='display:{$datepicker_display}'><input name='ginput_datepicker' type='text' /><img src='" . GFCommon::get_base_url() . "/images/calendar.png' id='gfield_input_datepicker_icon' style='display:{$icon_display}'/></div>";
$field_string .= $field["dateFormat"] == "dmy" ? $day_field . $month_field . $year_field : $month_field . $day_field . $year_field;
return $field_string;
} else {
$date_info = GFCommon::parse_date($value, $format);
if ($field["dateType"] == "datefield") {
if ($format == "mdy") {
$field_str = sprintf("<div class='clear-multi'><div class='gfield_date_month ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.1' value='%s' tabindex='%d' %s/><label for='%s.1'>" . __("MM", "gravityforms") . "</label></div>", $field_id, $id, $field_id, $date_info["month"], self::$tab_index++, $disabled_text, $field_id);
$field_str .= sprintf("<div class='gfield_date_day ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.2' value='%s' tabindex='%d' %s/><label for='%s.2'>" . __("DD", "gravityforms") . "</label></div>", $field_id, $id, $field_id, $date_info["day"], self::$tab_index++, $disabled_text, $field_id);
} else {
$field_str = sprintf("<div class='clear-multi'><div class='gfield_date_day ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.2' value='%s' tabindex='%d' %s/><label for='%s.2'>" . __("DD", "gravityforms") . "</label></div>", $field_id, $id, $field_id, $date_info["day"], self::$tab_index++, $disabled_text, $field_id);
$field_str .= sprintf("<div class='gfield_date_month ginput_container' id='%s'><input type='text' maxlength='2' name='input_%d[]' id='%s.1' value='%s' tabindex='%d' %s/><label for='%s.1'>" . __("MM", "gravityforms") . "</label></div>", $field_id, $id, $field_id, $date_info["month"], self::$tab_index++, $disabled_text, $field_id);
}
$field_str .= sprintf("<div class='gfield_date_year ginput_container' id='%s'><input type='text' maxlength='4' name='input_%d[]' id='%s.3' value='%s' tabindex='%d' %s/><label for='%s.3'>" . __("YYYY", "gravityforms") . "</label></div></div>", $field_id, $id, $field_id, $date_info["year"], self::$tab_index++, $disabled_text, $field_id);
return $field_str;
} else {
$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"];
return sprintf("<div class='ginput_container'><input name='input_%d' id='%s' type='text' value='%s' class='datepicker %s %s %s' tabindex='%d' %s/>%s</div><input type='hidden' id='gforms_calendar_icon_{$field_id}' class='gform_hidden' value='{$icon_url}'/>", $id, $field_id, esc_attr($value), esc_attr($class), $format, $icon_class, self::$tab_index++, $disabled_text, $datepicker);
}
}
case "time":
if (!empty($post_link)) {
return $post_link;
}
if (!is_array($value) && !empty($value)) {
preg_match('/^(\\d*):(\\d*) (.*)$/', $value, $matches);
$hour = esc_attr($matches[1]);
$minute = esc_attr($matches[2]);
$am_selected = $matches[3] == "am" ? "selected='selected'" : "";
$pm_selected = $matches[3] == "pm" ? "selected='selected'" : "";
} else {
$hour = esc_attr($value[0]);
$minute = esc_attr($value[1]);
$am_selected = $value[2] == "am" ? "selected='selected'" : "";
$pm_selected = $value[2] == "pm" ? "selected='selected'" : "";
}
return sprintf("<div class='clear-multi'><div class='gfield_time_hour ginput_container' id='%s'><input type='text' name='input_%d[]' id='%s.1' value='%s' tabindex='%d' %s/> : <label for='%s.1'>" . __("HH", "gravityforms") . "</label></div><div class='gfield_time_minute'><input type='text' name='input_%d[]' id='%s.2' value='%s' tabindex='%d' %s/><label for='%s.2'>" . __("MM", "gravityforms") . "</label></div><div class='gfield_time_ampm'><select name='input_%d[]' id='%s.3' tabindex='%d' %s><option value='am' %s>" . __("AM", "gravityforms") . "</option><option value='pm' %s>" . __("PM", "gravityforms") . "</option></select></div></div>", $field_id, $id, $field_id, $hour, self::$tab_index++, $disabled_text, $field_id, $id, $field_id, $minute, self::$tab_index++, $disabled_text, $field_id, $id, $field_id, self::$tab_index++, $disabled_text, $am_selected, $pm_selected);
case "fileupload":
$upload = sprintf("<input name='input_%d' id='%s' type='file' value='%s' size='20' class='%s' tabindex='%d' %s/>", $id, $field_id, esc_attr($value), esc_attr($class), self::$tab_index++, $disabled_text);
if (IS_ADMIN && !empty($value)) {
$value = esc_attr($value);
$preview = sprintf("<div id='preview_%d'><a href='%s' target='_blank' alt='%s' title='%s'>%s</a><a href='%s' target='_blank' alt='" . __("Download file", "gravityforms") . "' title='" . __("Download file", "gravityforms") . "'><img src='%s' style='margin-left:10px;'/></a><a href='javascript:void(0);' alt='" . __("Delete file", "gravityforms") . "' title='" . __("Delete file", "gravityforms") . "' onclick='DeleteFile(%d,%d);' ><img src='%s' style='margin-left:10px;'/></a></div>", $id, $value, $value, $value, GFCommon::truncate_url($value), $value, GFCommon::get_base_url() . "/images/download.png", $lead_id, $id, GFCommon::get_base_url() . "/images/delete.png");
return $preview . "<div id='upload_{$id}' style='display:none;'>{$upload}</div>";
} else {
return "<div class='ginput_container'>{$upload}</div>";
}
case "captcha":
if (!function_exists("recaptcha_get_html")) {
require_once GFCommon::get_base_path() . '/recaptchalib.php';
}
$theme = empty($field["captchaTheme"]) ? "red" : esc_attr($field["captchaTheme"]);
$publickey = get_option("rg_gforms_captcha_public_key");
$privatekey = get_option("rg_gforms_captcha_private_key");
if (IS_ADMIN) {
if (empty($publickey) || empty($privatekey)) {
return "<div class='captcha_message'>" . __("To use the reCaptcha field you must first do the following:", "gravityforms") . "</div><div class='captcha_message'>1 - <a href='https://admin.recaptcha.net/recaptcha/createsite/?app=php' target='_blank'>" . __(sprintf("Sign up%s for a free reCAPTCHA account", "</a>"), "gravityforms") . "</div><div class='captcha_message'>2 - " . __(sprintf("Enter your reCAPTCHA keys in the %ssettings page%s", "<a href='?page=gf_settings'>", "</a>"), "gravityforms") . "</div>";
} else {
return "<div><img class='gfield_captcha' src='" . GFCommon::get_base_url() . "/images/captcha_{$theme}.jpg' alt='reCAPTCHA' title='reCAPTCHA'/></div>";
}
} else {
$language = empty($field["captchaLanguage"]) ? "en" : esc_attr($field["captchaLanguage"]);
$options = "<script type='text/javascript'>var RecaptchaOptions = {theme : '{$theme}',tabindex : " . self::$tab_index++ . ", lang : '{$language}'};</script>";
$is_ssl = !empty($_SERVER['HTTPS']);
return $options . "<div class='ginput_container' id='{$field_id}'>" . recaptcha_get_html($publickey, null, $is_ssl) . "</div>";
}
break;
}
}
示例13: explode
break;
case "post_image":
$valueArray = explode("|:|", $value);
@(list($url, $title, $caption, $description) = $valueArray);
if (!empty($url)) {
$value = GFDirectory::render_image_link($url, $lead, $options, $title, $caption, $description);
}
break;
case "source_url":
if (in_array('urls', $lightboxsettings) || !empty($lightboxsettings['urls'])) {
$lightboxclass .= ' rel="directory_all directory_urls"';
}
if ($linkwebsite) {
$value = "<a href='" . esc_attr($lead["source_url"]) . "'{$target}{$lightboxclass} title='" . esc_attr($lead["source_url"]) . "'{$nofollow}>.../" . esc_attr(GFCommon::truncate_url($lead["source_url"])) . "</a>";
} else {
$value = esc_attr(GFCommon::truncate_url($lead["source_url"]));
}
break;
case "post_title":
if (apply_filters('kws_gf_directory_post_title_link', false, $form, $lead) && !empty($lead['post_id'])) {
$value = '<a href="' . esc_url(get_permalink($lead['post_id'])) . '" title="' . esc_attr($value) . '" ' . $nofollow . $target . '>' . esc_html($value) . '</a>';
} else {
$value = esc_html($value);
}
break;
case "textarea":
case "post_content":
case "post_excerpt":
$value = wpautop($value);
break;
case "post_category":
示例14: gfee_field_content
function gfee_field_content($content, $field, $value, $lead_id, $form_id)
{
if ('fileupload' == $field['type']) {
$id = $field['id'];
$multiple_files = $field['multipleFiles'];
$file_list_id = "gform_preview_" . $form_id . "_" . $id;
$file_urls = $multiple_files ? json_decode($value) : array($value);
$preview .= sprintf("<div id='preview_existing_files_%d' data-formid='%d' class='ginput_preview'>", $id, $form_id);
if ($file_urls) {
foreach ($file_urls as $file_index => $file_url) {
// remove url protocol?
$file_url = esc_attr($file_url);
$preview .= sprintf("<div id='preview_file_%d'><input type='hidden' name='delete_file' /><a href='%s' target='_blank' alt='%s' title='%s'>%s</a><a href='%s' target='_blank' alt='" . __("Download file", "gravityforms") . "' title='" . __("Download file", "gravityforms") . "'><img src='%s' style='margin-left:10px;'/></a><a href='javascript:void(0);' alt='" . __("Delete file", "gravityforms") . "' title='" . __("Delete file", "gravityforms") . "' onclick='DeleteFile(%d, this);' ><img src='%s' style='margin-left:10px;'/></a></div>", $file_index, $file_url, $file_url, $file_url, GFCommon::truncate_url($file_url), $file_url, GFCommon::get_base_url() . "/images/download.png", $id, GFCommon::get_base_url() . "/images/delete.png");
}
$preview .= "</div>";
return $content . $preview;
}
}
return $content;
}
示例15: lead_detail_page
//.........這裏部分代碼省略.........
_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);