本文整理匯總了PHP中GFCommon::get_email_fields方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFCommon::get_email_fields方法的具體用法?PHP GFCommon::get_email_fields怎麽用?PHP GFCommon::get_email_fields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GFCommon
的用法示例。
在下文中一共展示了GFCommon::get_email_fields方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: lead_detail_page
//.........這裏部分代碼省略.........
<!-- / end notifications -->
<?php
}
?>
<!-- begin print button -->
<div class="detail-view-print">
<a href="javascript:;" onclick="var notes_qs = jQuery('#gform_print_notes').is(':checked') ? '¬es=1' : ''; var url='<?php
echo trailingslashit(site_url());
?>
?gf_page=print-entry&fid=<?php
echo absint($form['id']);
?>
&lid=<?php
echo absint($lead['id']);
?>
' + notes_qs; window.open (url,'printwindow');" class="button"><?php
esc_html_e('Print', 'gravityforms');
?>
</a>
<?php
if (GFCommon::current_user_can_any('gravityforms_view_entry_notes')) {
?>
<input type="checkbox" name="print_notes" value="print_notes" checked="checked" id="gform_print_notes" />
<label for="print_notes"><?php
esc_html_e('include notes', 'gravityforms');
?>
</label>
<?php
}
?>
</div>
<!-- end print button -->
<?php
do_action('gform_entry_detail_sidebar_after', $form, $lead);
?>
</div>
<div id="post-body" class="has-sidebar">
<div id="post-body-content" class="has-sidebar-content">
<?php
do_action('gform_entry_detail_content_before', $form, $lead);
if ($mode == 'view') {
self::lead_detail_grid($form, $lead, true);
} else {
self::lead_detail_edit($form, $lead);
}
do_action('gform_entry_detail', $form, $lead);
if (GFCommon::current_user_can_any('gravityforms_view_entry_notes')) {
?>
<div class="postbox">
<h3>
<label for="name"><?php
esc_html_e('Notes', 'gravityforms');
?>
</label>
</h3>
<form method="post">
<?php
wp_nonce_field('gforms_update_note', 'gforms_update_note');
?>
<div class="inside">
<?php
$notes = RGFormsModel::get_lead_notes($lead['id']);
//getting email values
$email_fields = GFCommon::get_email_fields($form);
$emails = array();
foreach ($email_fields as $email_field) {
if (!empty($lead[$email_field->id])) {
$emails[] = $lead[$email_field->id];
}
}
//displaying notes grid
$subject = '';
self::notes_grid($notes, true, $emails, $subject);
?>
</div>
</form>
</div>
<?php
}
do_action('gform_entry_detail_content_after', $form, $lead);
?>
</div>
</div>
</div>
</div>
</form>
<?php
if (rgpost('action') == 'update') {
?>
<div class="updated fade" style="padding:6px;">
<?php
esc_html_e('Entry Updated.', 'gravityforms');
?>
</div>
<?php
}
}
示例2: lead_detail_page
//.........這裏部分代碼省略.........
<!-- / end notifications -->
<?php
}
?>
<!-- begin print button -->
<div class="detail-view-print">
<a href="javascript:;" onclick="var notes_qs = jQuery('#gform_print_notes').is(':checked') ? '¬es=1' : ''; var url='<?php
echo trailingslashit(site_url());
?>
?gf_page=print-entry&fid=<?php
echo $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
}
}
示例3: get_notification_ui_settings
//.........這裏部分代碼省略.........
_e("Send to Email", "gravityforms");
?>
</th>
<td>
<?php
$to_email = rgget("toType", $notification) == "email" ? rgget("to", $notification) : "";
?>
<input type="text" name="gform_notification_to_email" id="gform_notification_to_email" value="<?php
echo esc_attr($to_email);
?>
" class="fieldwidth-1" />
<?php
if (rgpost("gform_notification_to_type") == "email" && $is_invalid_email_to) {
?>
<span class="validation_message"><?php
_e("Please enter a valid email address", "gravityforms");
?>
</span>
<?php
}
?>
</td>
<?php
echo $subsetting_close;
?>
</tr> <!-- / to email -->
<?php
$ui_settings['notification_to_email'] = ob_get_contents();
ob_clean();
?>
<?php
$email_fields = apply_filters("gform_email_fields_notification_admin_{$form["id"]}", apply_filters("gform_email_fields_notification_admin", GFCommon::get_email_fields($form), $form), $form);
?>
<tr id="gform_notification_to_field_container" class="notification_to_container <?php
echo $send_to_class;
?>
" <?php
echo $notification_to_type != "field" ? "style='display:none';" : "";
?>
>
<?php
echo $subsetting_open;
?>
<th scope="row"><?php
_e("Send to Field", "gravityforms");
?>
</th>
<td>
<?php
if (!empty($email_fields)) {
?>
<select name="gform_notification_to_field" id="gform_notification_to_field">
<option value=""><?php
_e("Select an email field", "gravityforms");
?>
</option>
<?php
$to_field = rgget("toType", $notification) == "field" ? rgget("to", $notification) : "";
foreach ($email_fields as $field) {
?>
<option value="<?php
echo $field["id"];
?>
" <?php
示例4: add_sidebar_text_before
//.........這裏部分代碼省略.........
(Your Rating)<br/>
<span id="updateMSG" style="font-size:smaller">Average Rating: <?php
echo $ratingAvg;
?>
Stars from <?php
echo $ratingNum;
?>
users.</span>
<?php
if ($ratingResults != '') {
echo '<table cellspacing="0" style="padding:10px 0">' . ' <tr>' . ' <td class="entry-view-field-name">Rating</td>' . ' <td class="entry-view-field-name">User</td>' . ' <td class="entry-view-field-name">Date Rated</td>' . '</tr>' . $ratingResults . '</table>';
}
?>
</div>
</div>
<?php
/* Notes Sidebar Area */
?>
<div class="postbox" style="float:none;padding: 10px;">
<h3>
<label for="name"><?php
_e('Notes', 'gravityforms');
?>
</label>
</h3>
<?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 = '';
notes_sidebar_grid($notes, true, $emails, $subject);
?>
</div>
</div>
<?php
/* Entry Management Sidebar Area */
if ($mode == 'view') {
?>
<div class='postbox' style="float:none;padding: 10px;">
<?php
// Load Entry Sidebar details
mf_sidebar_entry_info($form['id'], $lead);
?>
<?php
// Create Update button for sidebar entry management
$entry_sidebar_button = '<input type="submit" name="update_management" value="Update Management" class="button"
style="width:auto;padding-bottom:2px;"
onclick="jQuery(\'#action\').val(\'update_entry_management\');"/>';
echo $entry_sidebar_button;
?>
</div>
<?php
}
示例5: get_notification_ui_settings
//.........這裏部分代碼省略.........
esc_html_e('Send to Email', 'gravityforms');
?>
</th>
<td>
<?php
$to_email = rgget('toType', $notification) == 'email' ? rgget('to', $notification) : '';
?>
<input type="text" name="gform_notification_to_email" id="gform_notification_to_email" value="<?php
echo esc_attr($to_email);
?>
" class="fieldwidth-1" />
<?php
if (rgpost('gform_notification_to_type') == 'email' && $is_invalid_email_to) {
?>
<span class="validation_message"><?php
esc_html_e('Please enter a valid email address', 'gravityforms');
?>
.</span>
<?php
}
?>
</td>
<?php
echo $subsetting_close;
?>
</tr> <!-- / to email -->
<?php
$ui_settings['notification_to_email'] = ob_get_contents();
ob_clean();
?>
<?php
$email_fields = apply_filters("gform_email_fields_notification_admin_{$form['id']}", apply_filters('gform_email_fields_notification_admin', GFCommon::get_email_fields($form), $form), $form);
?>
<tr id="gform_notification_to_field_container" class="notification_to_container <?php
echo esc_attr($send_to_class);
?>
" <?php
echo $notification_to_type != 'field' ? "style='display:none';" : '';
?>
>
<?php
echo $subsetting_open;
?>
<th scope="row"><?php
esc_html_e('Send to Field', 'gravityforms');
?>
</th>
<td>
<?php
if (!empty($email_fields)) {
?>
<select name="gform_notification_to_field" id="gform_notification_to_field">
<option value=""><?php
esc_html_e('Select an email field', 'gravityforms');
?>
</option>
<?php
$to_field = rgget('toType', $notification) == 'field' ? rgget('to', $notification) : '';
foreach ($email_fields as $field) {
?>
<option value="<?php
echo esc_attr($field->id);
?>
" <?php
示例6: get_note_emails_array
/**
* Get array of emails addresses from the stored entry
*
* @since 1.17
*
* @return array Array of email addresses connected to the entry
*/
private static function get_note_emails_array()
{
$gravityview_view = GravityView_View::getInstance();
//getting email values
$email_fields = GFCommon::get_email_fields($gravityview_view->getForm());
$entry = $gravityview_view->getCurrentEntry();
$note_emails = array();
foreach ($email_fields as $email_field) {
if (!empty($entry["{$email_field->id}"]) && is_email($entry["{$email_field->id}"])) {
$note_emails[] = $entry["{$email_field->id}"];
}
}
/**
* @filter `gravityview/field/notes/emails` Modify the dropdown values displayed in the "Also email note to" dropdown
* @since 1.17
* @param array $note_emails Array of email addresses connected to the entry
* @param array $entry Current entry
*/
$note_emails = apply_filters('gravityview/field/notes/emails', $note_emails, $entry);
return (array) $note_emails;
}
示例7: lead_detail_page
//.........這裏部分代碼省略.........
</div>
</div>
</div>
<!-- / end notifications -->
<?php
}
?>
<!-- begin print button -->
<div class="detail-view-print">
<a href="javascript:;" onclick="var notes_qs = jQuery('#gform_print_notes').is(':checked') ? '¬es=1' : ''; var url='<?php
echo 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 -->
</div>
<div id="post-body" class="has-sidebar">
<div id="post-body-content" class="has-sidebar-content">
<?php
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 id="namediv" class="stuffbox">
<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
}
?>
</div>
</div>
</div>
</div>
</form>
<?php
if (rgpost("action") == "update") {
?>
<div class="updated fade" style="padding:6px;">
<?php
_e("Entry Updated.", "gravityforms");
?>
</div>
<?php
}
}
示例8: meta_box_notes
public static function meta_box_notes($args, $metabox)
{
$entry = $args['entry'];
$form = $args['form'];
?>
<form method="post">
<?php
wp_nonce_field('gforms_update_note', 'gforms_update_note');
?>
<div class="inside">
<?php
$notes = RGFormsModel::get_lead_notes($entry['id']);
//getting email values
$email_fields = GFCommon::get_email_fields($form);
$emails = array();
foreach ($email_fields as $email_field) {
if (!empty($entry[$email_field->id])) {
$emails[] = $entry[$email_field->id];
}
}
//displaying notes grid
$subject = '';
self::notes_grid($notes, true, $emails, $subject);
?>
</div>
</form>
<?php
}
示例9: notification_page
public static function notification_page($form_id)
{
$form = RGFormsModel::get_form_meta($form_id);
if ($_POST["save"]) {
check_admin_referer('gforms_save_notification', 'gforms_save_notification');
$form["notification"]["to"] = stripslashes($_POST["form_notification_to"]);
$form["notification"]["bcc"] = stripslashes($_POST["form_notification_bcc"]);
$form["notification"]["subject"] = stripslashes($_POST["form_notification_subject"]);
$form["notification"]["message"] = stripslashes($_POST["form_notification_message"]);
$form["notification"]["from"] = empty($_POST["form_notification_from_field"]) ? stripslashes($_POST["form_notification_from"]) : "";
$form["notification"]["fromField"] = stripslashes($_POST["form_notification_from_field"]);
$form["notification"]["fromName"] = empty($_POST["form_notification_from_name_field"]) ? stripslashes($_POST["form_notification_from_name"]) : "";
$form["notification"]["fromNameField"] = stripslashes($_POST["form_notification_from_name_field"]);
$form["notification"]["replyTo"] = empty($_POST["form_notification_reply_to_field"]) ? stripslashes($_POST["form_notification_reply_to"]) : "";
$form["notification"]["replyToField"] = stripslashes($_POST["form_notification_reply_to_field"]);
$form["notification"]["routing"] = !empty($_POST["gform_routing_meta"]) ? GFCommon::json_decode(stripslashes($_POST["gform_routing_meta"]), true) : null;
$form["notification"]["disableAutoformat"] = $_POST["form_notification_disable_autoformat"];
$form["autoResponder"]["toField"] = stripslashes($_POST["form_autoresponder_to"]);
$form["autoResponder"]["bcc"] = stripslashes($_POST["form_autoresponder_bcc"]);
$form["autoResponder"]["fromName"] = stripslashes($_POST["form_autoresponder_from_name"]);
$form["autoResponder"]["from"] = stripslashes($_POST["form_autoresponder_from"]);
$form["autoResponder"]["replyTo"] = stripslashes($_POST["form_autoresponder_reply_to"]);
$form["autoResponder"]["subject"] = stripslashes($_POST["form_autoresponder_subject"]);
$form["autoResponder"]["message"] = stripslashes($_POST["form_autoresponder_message"]);
$form["autoResponder"]["disableAutoformat"] = $_POST["form_autoresponder_disable_autoformat"];
//validating input...
$invalid_tab = self::validate_notification();
if ($invalid_tab == 0) {
//input valid, updating...
//emptying notification email if it is supposed to be disabled
if (empty($_POST["form_notification_enable_admin"]) || $_POST["notification_to"] == "routing") {
$form["notification"]["to"] = "";
}
//emptying notification routing if it is supposed to be disabled
if (empty($_POST["form_notification_enable_admin"]) || $_POST["notification_to"] == "email") {
$form["notification"]["routing"] = null;
}
//emptying autoResponder settings if it is supposed to be disabled
if (empty($_POST["form_notification_enable_user"])) {
$form["autoResponder"]["toField"] = "";
}
RGFormsModel::update_form_meta($form_id, $form);
}
}
$wp_email = get_bloginfo("admin_email");
$email_fields = GFCommon::get_email_fields($form);
$name_fields = GFCommon::get_fields_by_type($form, array("name"));
$has_admin_notification_fields = (!empty($form["notification"]["to"]) || !empty($form["notification"]["routing"])) && (!empty($form["notification"]["subject"]) || !empty($form["notification"]["message"]));
$has_user_notification_fields = !empty($form["autoResponder"]["toField"]) && (!empty($form["autoResponder"]["subject"]) || !empty($form["autoResponder"]["message"]));
$is_admin_notification_enabled = $has_admin_notification_fields && empty($_POST["save"]) || !empty($_POST["form_notification_enable_admin"]);
$is_user_notification_enabled = $has_user_notification_fields && empty($_POST["save"]) || !empty($_POST["form_notification_enable_user"]);
$is_routing_enabled = !empty($form["notification"]["routing"]) && $_POST["notification_to"] != "email";
?>
<link rel="stylesheet" href="<?php
echo GFCommon::get_base_url();
?>
/css/admin.css?ver=<?php
echo GFCommon::$version;
?>
" />
<script type="text/javascript" src="<?php
echo GFCommon::get_base_url();
?>
/js/forms.js?ver=<?php
echo GFCommon::$version;
?>
"></script>
<script src="<?php
echo GFCommon::get_base_url();
?>
/js/jquery.json-1.3.js?ver=<?php
echo GFCommon::$version;
?>
"></script>
<script type="text/javascript">
var gform_has_unsaved_changes = false;
jQuery(document).ready(function(){
jQuery("#entry_form input, #entry_form textarea, #entry_form select").change(function(){
gform_has_unsaved_changes = true;
});
window.onbeforeunload = function(){
if (gform_has_unsaved_changes){
return "You have unsaved changes.";
}
}
});
<?php
if (empty($form["notification"])) {
$form["notification"] = array();
}
?>
var form = <?php
echo GFCommon::json_encode($form);
?>
;
//.........這裏部分代碼省略.........
示例10: lead_detail_page
//.........這裏部分代碼省略.........
_e("Add Note", "gravityforms");
?>
" class="button" style="width:60px;" onclick="jQuery('#action').val('add_quick_note');"/>
</span>
</div>
</div>
</div>
</div>
<!-- end side notes -->
<?php
}
?>
<!-- begin print button -->
<div class="detail-view-print">
<a href="javascript:;" onclick="var notes_qs = jQuery('#gform_print_notes').is(':checked') ? '¬es=1' : ''; var url='<?php
echo GFCommon::get_base_url();
?>
/print-entry.php?fid=<?php
echo $form['id'];
?>
&lid=<?php
echo $lead['id'];
?>
' + notes_qs; window.open (url,'printwindow');" class="button">Print</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">include notes</label>
<?php
}
?>
</div>
<!-- end print button -->
</div>
<div id="post-body" class="has-sidebar">
<div id="post-body-content" class="has-sidebar-content">
<?php
if ($mode == "view") {
self::lead_detail_grid($form, $lead, true);
} else {
self::lead_detail_edit($form, $lead);
}
?>
<?php
if (GFCommon::current_user_can_any("gravityforms_view_entry_notes")) {
?>
<div id="namediv" class="stuffbox">
<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
}
?>
</div>
</div>
</div>
</div>
</form>
<?php
if (rgpost("action") == "update") {
?>
<div class="updated fade" style="padding:6px;">
<?php
_e("Entry Updated.", "gravityforms");
?>
</div>
<?php
}
}
示例11: notification_page
public static function notification_page($form_id)
{
add_action('media_buttons', array('GFNotification', 'media_buttons'), 40);
$form = RGFormsModel::get_form_meta($form_id);
$invalid_tab = "";
if (rgpost("save")) {
check_admin_referer('gforms_save_notification', 'gforms_save_notification');
$form["notification"]["to"] = rgpost("form_notification_to");
$form["notification"]["bcc"] = rgpost("form_notification_bcc");
$form["notification"]["subject"] = rgpost("form_notification_subject");
$form["notification"]["message"] = rgpost("form_notification_message");
$form["notification"]["from"] = rgempty("form_notification_from_field") ? rgpost("form_notification_from") : "";
$form["notification"]["fromField"] = rgpost("form_notification_from_field");
$form["notification"]["fromName"] = rgempty("form_notification_from_name_field") ? rgpost("form_notification_from_name") : "";
$form["notification"]["fromNameField"] = rgpost("form_notification_from_name_field");
$form["notification"]["replyTo"] = rgempty("form_notification_reply_to_field") ? rgpost("form_notification_reply_to") : "";
$form["notification"]["replyToField"] = rgpost("form_notification_reply_to_field");
$form["notification"]["routing"] = !rgempty("gform_routing_meta") ? GFCommon::json_decode(rgpost("gform_routing_meta"), true) : null;
$form["notification"]["disableAutoformat"] = rgpost("form_notification_disable_autoformat");
$form["autoResponder"]["toField"] = rgpost("form_autoresponder_to");
$form["autoResponder"]["bcc"] = rgpost("form_autoresponder_bcc");
$form["autoResponder"]["fromName"] = rgpost("form_autoresponder_from_name");
$form["autoResponder"]["from"] = rgpost("form_autoresponder_from");
$form["autoResponder"]["replyTo"] = rgpost("form_autoresponder_reply_to");
$form["autoResponder"]["subject"] = rgpost("form_autoresponder_subject");
$form["autoResponder"]["message"] = rgpost("form_autoresponder_message");
$form["autoResponder"]["disableAutoformat"] = rgpost("form_autoresponder_disable_autoformat");
//validating input...
$invalid_tab = self::validate_notification();
if ($invalid_tab == 0) {
//input valid, updating...
//emptying notification email if it is supposed to be disabled
if (empty($_POST["form_notification_enable_admin"]) || $_POST["notification_to"] == "routing") {
$form["notification"]["to"] = "";
}
//emptying notification routing if it is supposed to be disabled
if (empty($_POST["form_notification_enable_admin"]) || $_POST["notification_to"] == "email") {
$form["notification"]["routing"] = null;
}
//emptying autoResponder settings if it is supposed to be disabled
if (empty($_POST["form_notification_enable_user"])) {
$form["autoResponder"]["toField"] = "";
}
RGFormsModel::update_form_meta($form_id, $form);
}
}
$wp_email = "{admin_email}";
$email_fields = GFCommon::get_email_fields($form);
$name_fields = GFCommon::get_fields_by_type($form, array("name"));
$has_admin_notification_fields = GFCommon::has_admin_notification($form);
$has_user_notification_fields = GFCommon::has_user_notification($form);
$is_admin_notification_enabled = $has_admin_notification_fields && empty($_POST["save"]) || !empty($_POST["form_notification_enable_admin"]);
$is_user_notification_enabled = $has_user_notification_fields && empty($_POST["save"]) || !empty($_POST["form_notification_enable_user"]);
$is_routing_enabled = !empty($form["notification"]["routing"]) && rgpost("notification_to") != "email";
?>
<link rel="stylesheet" href="<?php
echo GFCommon::get_base_url();
?>
/css/admin.css?ver=<?php
echo GFCommon::$version;
?>
" />
<script type="text/javascript" src="<?php
echo GFCommon::get_base_url();
?>
/js/forms.js?ver=<?php
echo GFCommon::$version;
?>
"></script>
<script src="<?php
echo GFCommon::get_base_url();
?>
/js/jquery.json-1.3.js?ver=<?php
echo GFCommon::$version;
?>
"></script>
<script type="text/javascript">
var gform_has_unsaved_changes = false;
jQuery(document).ready(function(){
jQuery("#entry_form input, #entry_form textarea, #entry_form select").change(function(){
gform_has_unsaved_changes = true;
});
window.onbeforeunload = function(){
if (gform_has_unsaved_changes){
return "You have unsaved changes.";
}
}
if(jQuery(document).on){
jQuery(document).on('change', '.gfield_routing_value_dropdown', function(){
SetRoutingValueDropDown(jQuery(this));
});
}
else{
jQuery('.gfield_routing_value_dropdown').live('change', function(){
SetRoutingValueDropDown(jQuery(this));
//.........這裏部分代碼省略.........
示例12: timeline
public static function timeline($entry, $form)
{
$notes = self::get_timeline_notes($entry);
//getting email values
$email_fields = GFCommon::get_email_fields($form);
$emails = array();
foreach ($email_fields as $email_field) {
if (!empty($entry[$email_field->id])) {
$emails[] = $entry[$email_field->id];
}
}
//displaying notes grid
$subject = '';
self::notes_grid($notes, true, $emails, $subject);
}