當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GFFormSettings::output_field_scripts方法代碼示例

本文整理匯總了PHP中GFFormSettings::output_field_scripts方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFFormSettings::output_field_scripts方法的具體用法?PHP GFFormSettings::output_field_scripts怎麽用?PHP GFFormSettings::output_field_scripts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GFFormSettings的用法示例。


在下文中一共展示了GFFormSettings::output_field_scripts方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: notification_edit_page


//.........這裏部分代碼省略.........
					str += "<option value='" + selectedValue.replace(/'/g, "&#039;") + "' selected='selected'>" + selectedValue + "</option>";
				}
				str += "</select>";
			}
			else {
				selectedValue = selectedValue ? selectedValue.replace(/'/g, "&#039;") : "";
				//create a text field for fields that don't have choices (i.e text, textarea, number, email, etc...)
				str = "<input type='text' placeholder='" + <?php 
        echo json_encode(esc_html__('Enter value', 'gravityforms'));
        ?>
 +"' class='gfield_routing_select' id='routing_value_" + index + "' value='" + selectedValue.replace(/'/g, "&#039;") + "' onchange='SetRouting(" + index + ");' onkeyup='SetRouting(" + index + ");'>";
			}
			return str;
		}

		function GetFieldById(fieldId) {
			for (var i = 0; i < form.fields.length; i++) {
				if (form.fields[i].id == fieldId)
					return form.fields[i];
			}
			return null;
		}
		//---------------------------------------------------------------------------------

		function InsertRouting(index) {
			var routings = current_notification.routing;
			routings.splice(index, 0, new ConditionalRule());

			CreateRouting(routings);
			SetRouting(index);
		}

		function SetRouting(ruleIndex) {
			if (!current_notification.routing && ruleIndex == 0)
				current_notification.routing = [new ConditionalRule()];

			current_notification.routing[ruleIndex]["email"] = jQuery("#routing_email_" + ruleIndex).val();
			current_notification.routing[ruleIndex]["fieldId"] = jQuery("#routing_field_id_" + ruleIndex).val();
			current_notification.routing[ruleIndex]["operator"] = jQuery("#routing_operator_" + ruleIndex).val();
			current_notification.routing[ruleIndex]["value"] = jQuery("#routing_value_" + ruleIndex).val();

			var json = jQuery.toJSON(current_notification.routing);
			jQuery('#gform_routing_meta').val(json);
		}

		function DeleteRouting(ruleIndex) {
			current_notification.routing.splice(ruleIndex, 1);
			CreateRouting(current_notification.routing);
		}

		function SetConditionalLogic(isChecked) {
			current_notification.conditionalLogic = isChecked ? new ConditionalLogic() : null;
		}

		function SaveJSMeta() {
			jQuery('#gform_routing_meta').val(jQuery.toJSON(current_notification.routing));
			jQuery('#gform_conditional_logic_meta').val(jQuery.toJSON(current_notification.conditionalLogic));
		}

		<?php 
        GFFormSettings::output_field_scripts();
        ?>

		</script>

		<form method="post" id="gform_notification_form" onsubmit="gform_has_unsaved_changes = false; SaveJSMeta();">

			<?php 
        wp_nonce_field('gforms_save_notification', 'gforms_save_notification');
        ?>
			<?php 
        if (rgar($notification, 'isDefault')) {
            echo '<input type="hidden" id="gform_is_default" name="gform_is_default" value="1"/>';
        }
        ?>
			<input type="hidden" id="gform_routing_meta" name="gform_routing_meta" />
			<input type="hidden" id="gform_conditional_logic_meta" name="gform_conditional_logic_meta" />
			<input type="hidden" id="gform_notification_id" name="gform_notification_id" value="<?php 
        echo esc_attr($notification_id);
        ?>
" />

			<table class="form-table gform_nofification_edit">
				<?php 
        array_map(array('GFFormSettings', 'output'), $notification_ui_settings);
        ?>
			</table>

			<p class="submit">
				<?php 
        $button_label = $is_new_notification ? __('Save Notification', 'gravityforms') : __('Update Notification', 'gravityforms');
        $notification_button = '<input class="button-primary" type="submit" value="' . esc_attr($button_label) . '" name="save"/>';
        echo apply_filters('gform_save_notification_button', $notification_button);
        ?>
			</p>
		</form>

		<?php 
        GFFormSettings::page_footer();
    }
開發者ID:jamesaveryw,項目名稱:mississippi-staging,代碼行數:101,代碼來源:notification.php

示例2: feed_edit_page

    protected function feed_edit_page($form, $feed_id)
    {
        // Save feed if appropriate
        $feed_id = $this->maybe_save_feed_settings($feed_id, $form['id']);
        $this->_current_feed_id = $feed_id;
        //So that current feed functions work when creating a new feed
        ?>
		<script type="text/javascript">
			<?php 
        GFFormSettings::output_field_scripts();
        ?>
		</script>

		<h3><span><?php 
        echo $this->feed_settings_title();
        ?>
</span></h3>

		<?php 
        $feed = $this->get_feed($feed_id);
        $this->set_settings($feed['meta']);
        GFCommon::display_admin_message();
        $this->render_settings($this->get_feed_settings_fields($form));
    }
開發者ID:sbayer55,項目名稱:The-Road-Gallery,代碼行數:24,代碼來源:class-gf-feed-addon.php

示例3: feed_edit_page

    public function feed_edit_page($form, $feed_id)
    {
        $title = '<h3><span>' . $this->feed_settings_title() . '</span></h3>';
        if (!$this->can_create_feed()) {
            echo $title . '<div>' . $this->configure_addon_message() . '</div>';
            return;
        }
        // Save feed if appropriate
        $feed_id = $this->maybe_save_feed_settings($feed_id, $form['id']);
        $this->_current_feed_id = $feed_id;
        // So that current feed functions work when creating a new feed
        ?>
		<script type="text/javascript">
			<?php 
        GFFormSettings::output_field_scripts();
        ?>
		</script>
		<?php 
        echo $title;
        $feed = $this->get_feed($feed_id);
        $this->set_settings($feed['meta']);
        GFCommon::display_admin_message();
        $this->render_settings($this->get_feed_settings_fields($form));
    }
開發者ID:fjbeteiligung,項目名稱:development,代碼行數:24,代碼來源:class-gf-feed-addon.php


注:本文中的GFFormSettings::output_field_scripts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。