public function app_settings_tab() { require_once GFCommon::get_base_path() . '/tooltips.php'; $icon = $this->app_settings_icon(); if (empty($icon)) { $icon = '<i class="fa fa-cogs"></i>'; } ?> <h3><span><?php echo $icon; ?> <?php echo $this->app_settings_title(); ?> </span></h3> <?php if ($this->maybe_uninstall()) { ?> <div class="push-alert-gold" style="border-left: 1px solid #E6DB55; border-right: 1px solid #E6DB55;"> <?php printf(esc_html_x('%s has been successfully uninstalled. It can be re-activated from the %splugins page%s.', 'Displayed on the settings page after uninstalling a Gravity Flow extension.', 'gravityforms'), esc_html($this->_title), "<a href='plugins.php'>", '</a>'); ?> </div> <?php } else { //saves settings page if save button was pressed $this->maybe_save_app_settings(); //reads main addon settings $settings = $this->get_app_settings(); $this->set_settings($settings); //reading addon fields $sections = $this->app_settings_fields(); GFCommon::display_admin_message(); //rendering settings based on fields and current settings $this->render_settings($sections); $this->render_uninstall(); } }
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 }
protected function app_settings_tab() { require_once GFCommon::get_base_path() . "/tooltips.php"; $icon = $this->app_settings_icon(); if (empty($icon)) { $icon = '<i class="fa fa-cogs"></i>'; } ?> <h3><span><?php echo $icon; ?> <?php echo $this->app_settings_title(); ?> </span></h3> <?php if ($this->method_is_overridden('app_settings')) { //enables plugins to override settings page by implementing a plugin_settings() function $this->app_settings(); } else { if ($this->maybe_uninstall()) { ?> <div class="push-alert-gold" style="border-left: 1px solid #E6DB55; border-right: 1px solid #E6DB55;"> <?php _e(sprintf("%s has been successfully uninstalled. It can be re-activated from the %splugins page%s.", $this->_title, "<a href='plugins.php'>", "</a>"), "gravityforms"); ?> </div> <?php } else { //saves settings page if save button was pressed $this->maybe_save_app_settings(); //reads main addon settings $settings = $this->get_app_settings(); $this->set_settings($settings); //reading addon fields $sections = $this->app_settings_fields(); GFCommon::display_admin_message(); //rendering settings based on fields and current settings $this->render_settings($sections, $settings); } } }
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)); }
public static function page_header($title = '') { // register admin styles wp_register_style('gform_admin', GFCommon::get_base_url() . '/css/admin.css'); wp_print_styles(array('jquery-ui-styles', 'gform_admin', 'wp-pointer')); $form = GFFormsModel::get_form_meta(rgget('id')); $current_tab = rgempty('subview', $_GET) ? 'settings' : rgget('subview'); $setting_tabs = GFFormSettings::get_tabs($form['id']); // 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['label']; } } } ?> <div class="wrap gforms_edit_form <?php echo GFCommon::get_browser_class(); ?> "> <h2 class="gf_admin_page_title"> <span><?php echo $title; ?> </span><span class="gf_admin_page_subtitle"><span class="gf_admin_page_formid">ID: <?php echo $form['id']; ?> </span><span class="gf_admin_page_formname"><?php _e('Form Name', 'gravityforms'); ?> : <?php echo $form['title']; ?> </span></span> </h2> <?php GFCommon::display_admin_message(); ?> <?php RGForms::top_toolbar(); ?> <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('subview' => $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><span></span> </li> <?php } ?> </ul> <div id="gform_tab_container_1" class="gform_tab_container"> <div class="gform_tab_content" id="tab_<?php echo $current_tab; ?> "> <?php }
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)); }
/** * Plugin settings page */ public function plugin_settings_page() { ?> <h3><span><?php echo $this->plugin_settings_title(); ?> </span></h3> <?php if ($this->method_is_overridden('plugin_settings')) { //enables plugins to override settings page by implementing a plugin_settings() function $this->plugin_settings(); } else { if ($this->maybe_uninstall()) { ?> <div class="push-alert-gold" style="border-left: 1px solid #E6DB55; border-right: 1px solid #E6DB55;"> <?php _e(sprintf("%s has been successfully uninstalled. It can be re-activated from the %splugins page%s.", $this->_title, "<a href='plugins.php'>", "</a>"), "gravityforms"); ?> </div> <?php } else { //saves settings page if save button was pressed $this->maybe_save_plugin_settings(); //reads main addon settings $settings = $this->get_plugin_settings(); $this->set_settings($settings); //reading addon fields $sections = $this->plugin_settings_fields(); GFCommon::display_admin_message(); //rendering settings based on fields and current settings $this->render_settings($sections, $settings); //renders uninstall section $this->render_uninstall(); } } }
protected function feed_edit_page($form, $feed_id) { // Save feed if appropriate $feed_id = $this->maybe_save_feed_settings($feed_id, $form['id']); ?> <input type="hidden" name="gf_feed_id" value="<?php echo $feed_id; ?> "/> <?php $feed = $this->get_feed($feed_id); $this->set_settings($feed['meta']); GFCommon::display_admin_message(); $this->render_settings($this->get_feed_settings_fields()); }
public static function page_header($title = '') { // register admin styles wp_register_style('gform_admin', GFCommon::get_base_url() . '/css/admin.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']; } } } ?> <style type="text/css"> /* temporary styles */ #form_settings { margin-top: 0; } .gform_tab_group { background-color: #f1f1f1; border: 1px solid #ccc; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); margin-top: 10px; } .gform_tabs { width: 150px; float: left; } .gform_tab_container { margin-left: 150px; background-color: #fff; padding: 20px; border-left: 1px solid #ccc; } .gform_tabs { margin-top: 10px; } .gform_tabs a { border: 1px solid #f1f1f1; padding: 6px 10px; text-decoration: none; display: block; } .gform_tabs li.active a { background-color: #fff; border: 1px solid #ccc; border-right-color: #fff; line-height: 18px; margin: 0 -1px 0 -4px; } .gform_tab_content { overflow: hidden; } .gform_tab_content h3 { font-size: 1.6em; margin-top: 2px; } </style> <div class="wrap <?php echo $current_tab; ?> "> <div class="icon32" style="background: url(<?php echo GFCommon::get_base_url(); ?> /images/gravity-export-icon-32.png) no-repeat;"></div> <h2><?php echo $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"]); } ?> <li <?php echo $current_tab == $tab["name"] ? "class='active'" : ""; ?> > <a href="<?php echo add_query_arg($query); ?> "><?php echo $tab["label"]; ?> </a> </li> <?php } ?> </ul> <div id="gform_tab_container" class="gform_tab_container"> <div class="gform_tab_content" id="tab_<?php echo $current_tab; ?> "> <?php }
public static function page_header($title = '') { // register admin styles wp_register_style('gform_admin', GFCommon::get_base_url() . '/css/admin.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 $current_tab; ?> "> <h2><?php echo $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"]); } ?> <li <?php echo $current_tab == $tab["name"] ? "class='active'" : ""; ?> > <a href="<?php echo add_query_arg($query); ?> "><?php echo $tab["label"]; ?> </a> </li> <?php } ?> </ul> <div id="gform_tab_container" class="gform_tab_container"> <div class="gform_tab_content" id="tab_<?php echo $current_tab; ?> "> <?php }
public static function page_header($title = '') { // register admin styles $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min'; wp_register_style('gform_admin', GFCommon::get_base_url() . "/css/admin{$min}.css"); wp_print_styles(array('jquery-ui-styles', 'gform_admin', 'wp-pointer')); $form = GFFormsModel::get_form_meta(rgget('id')); $current_tab = rgempty('subview', $_GET) ? 'settings' : rgget('subview'); $setting_tabs = GFFormSettings::get_tabs($form['id']); // 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['label']; } } } ?> <div class="wrap gforms_edit_form gforms_form_settings_wrap <?php echo GFCommon::get_browser_class(); ?> "> <?php GFCommon::form_page_title($form); ?> <?php GFCommon::display_dismissible_message(); ?> <?php GFCommon::display_admin_message(); ?> <?php RGForms::top_toolbar(); ?> <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('subview' => $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><span></span> </li> <?php } ?> </ul> <div id="gform_tab_container_1" class="gform_tab_container"> <div class="gform_tab_content" id="tab_<?php echo esc_attr($current_tab); ?> "> <?php }
public function page_header($title = '') { // register admin styles wp_register_style('gform_admin', GFCommon::get_base_url() . '/css/admin.css'); wp_print_styles(array('jquery-ui-styles', 'gform_admin', 'wp-pointer')); // get view details $subviews = $this->get_subviews(); ?> <div class="wrap <?php echo GFCommon::get_browser_class(); ?> "> <?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 ($subviews as $view) { $query = array('subview' => $view['name']); if (isset($view['query'])) { $query = array_merge($query, $view['query']); } ?> <li <?php echo $this->get_current_subview() == $view['name'] ? 'class="active"' : ''; ?> > <a href="<?php echo add_query_arg($query); ?> "><?php echo $view['label']; ?> </a> </li> <?php } ?> </ul> <div id="gform_tab_container" class="gform_tab_container"> <div class="gform_tab_content" id="tab_<?php echo $this->get_current_subview(); ?> "> <?php }
/** * Handle rendering/saving the settings on the feed (coupon) edit page. * * @param integer $feed_id The current feed ID. * @param integer $form_id The form ID the coupon applies to or Zero for all forms. */ public function coupon_edit_page($feed_id, $form_id) { $messages = ''; // Save feed if appropriate $feed_fields = $this->get_feed_settings_fields(); $feed_id = $this->maybe_save_feed_settings($feed_id, ''); $this->_coupon_feed_id = $feed_id; //update the form_id on the feed $feed = $this->get_feed($feed_id); if (is_array($feed)) { $this->update_feed_form_id($feed_id, rgar($feed['meta'], 'gravityForm')); } ?> <h3><span><?php echo $this->feed_settings_title(); ?> </span></h3> <input type="hidden" name="gf_feed_id" value="<?php echo $feed_id; ?> "/> <?php $this->set_settings($feed['meta']); GFCommon::display_admin_message('', $messages); $this->render_settings($feed_fields); }
protected function feed_edit_page($form, $feed_id) { // Save feed if appropriate $feed_id = $this->maybe_save_feed_settings($feed_id, $form['id']); $this->settings_hidden(array('name' => 'fid', 'value' => $feed_id)); $this->settings_hidden(array('name' => 'form_id', 'value' => $form['id'])); GFCommon::display_admin_message(); $this->render_settings($this->get_feed_settings_fields()); }