当前位置: 首页>>代码示例>>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;未经允许,请勿转载。