/** * Display warning message on plugin settings page when SOAP extension is not loaded. * * @access public * @return void */ public function plugin_settings_page() { if (extension_loaded('soap')) { return parent::plugin_settings_page(); } $icon = $this->plugin_settings_icon(); if (empty($icon)) { $icon = '<i class="fa fa-cogs"></i>'; } echo '<h3><span>' . $icon . ' ' . $this->plugin_settings_title() . '</span></h3>'; echo '<p>' . __('Gravity Forms CleverReach Add-On requires the PHP Soap extension to be able to communicate with CleverReach.', 'gravityformscleverreach') . '</p>'; echo '<p>' . __('To continue using this Add-On, please enable the Soap extension.', 'gravityformscleverreach') . '</p>'; }
/** * Register needed plugin hooks and PayPal delayed payment support. * * @access public * @return void */ public function init() { parent::init(); if ($this->is_gravityforms_supported('2.0-beta-3')) { add_filter('gform_entry_detail_meta_boxes', array($this, 'register_meta_box'), 10, 3); } else { add_action('gform_entry_detail_sidebar_middle', array($this, 'add_entry_detail_panel'), 10, 2); } add_action('admin_init', array($this, 'maybe_create_conversation')); add_filter('gform_addnote_button', array($this, 'add_note_checkbox')); add_action('gform_post_note_added', array($this, 'add_note_to_conversation'), 10, 6); add_filter('gform_entries_column_filter', array($this, 'add_entry_conversation_column_link'), 10, 5); $this->add_delayed_payment_support(array('option_label' => esc_html__('Create conversation in Help Scout only when payment is received.', 'gravityformshelpscout'))); }
/** * Public facing init * * @since 1.5.0 */ public function init_frontend() { parent::init_frontend(); // Move this hook so everything else is all done and dusted first! remove_filter('gform_entry_post_save', array($this, 'maybe_process_feed')); if ($this->load_ua_settings()) { $this->load_measurement_client(); add_filter('gform_after_submission', array($this, 'maybe_process_feed'), 10, 2); // IPN hook for paypal standard! if (class_exists('GFPayPal')) { add_action('gform_paypal_post_ipn', array($this, 'paypal_track_form_post_ipn'), 10, 2); } } }
public function feed_edit_page($form, $feed_id) { // ensures valid credentials were entered in the settings page if ($this->login_api_fd() == false) { ?> <div><?php echo sprintf(__('We are unable to login to FacturaDirecta with the provided API key or URL is incorrect (it must finish with slash / ). Please make sure you have entered a valid API key in the %sSettings Page%s', 'gravityformsfd'), '<a href="' . $this->get_plugin_settings_url() . '">', '</a>'); ?> </div> <?php return; } echo '<script type="text/javascript">var form = ' . GFCommon::json_encode($form) . ';</script>'; parent::feed_edit_page($form, $feed_id); }
/** * Plugin starting point. Handles hooks, loading of language files and PayPal delayed payment support. */ public function init() { parent::init(); $this->add_delayed_payment_support(array('option_label' => esc_html__('Subscribe member to Emma only when payment is received.', 'gravityformsemma'))); }
public function feed_edit_page($form, $feed_id) { // getting MailChimp API $api = $this->get_api(); // ensures valid credentials were entered in the settings page if (!$api) { ?> <div><?php echo sprintf(__('We are unable to login to MailChimp with the provided credentials. Please make sure they are valid in the %sSettings Page%s', 'gravityformsmailchimp'), "<a href='" . $this->get_plugin_settings_url() . "'>", '</a>'); ?> </div> <?php return; } echo '<script type="text/javascript">var form = ' . GFCommon::json_encode($form) . ';</script>'; parent::feed_edit_page($form, $feed_id); }
/** * Register needed styles. * * @access public * @return array $styles */ public function styles() { $styles = array(array('handle' => 'gform_agilecrm_form_settings_css', 'src' => $this->get_base_url() . '/css/form_settings.css', 'version' => $this->_version, 'enqueue' => array(array('admin_page' => array('form_settings'))))); return array_merge(parent::styles(), $styles); }
/** * Initialize the AJAX hooks. */ public function init_ajax() { parent::init_ajax(); add_action('wp_ajax_gf_dismiss_mailchimp_menu', array($this, 'ajax_dismiss_menu')); }
/** * We need to override the default get_save_success_message method for cases when they are disconnecting or switching auth methods. * Be sure to call parent::get_save_success_message() at the end. */ public function get_save_success_message($sections) { if ($this->is_switch()) { return __('Switched authentication method.', 'gfeloqua'); } if ($this->is_disconnect()) { return __('Your connection settings have been removed.', 'gfeloqua'); } return parent::get_save_success_message($sections); }
public function upgrade($previous_version) { if (empty($previous_version)) { $previous_version = get_option('gf_freshbooks_version'); } $previous_is_pre_addon_framework = !empty($previous_version) && version_compare($previous_version, '2.0.dev1', '<'); if ($previous_is_pre_addon_framework) { $old_feeds = $this->get_old_feeds(); if (!$old_feeds) { return; } $counter = 1; foreach ($old_feeds as $old_feed) { $feed_name = 'Feed ' . $counter; $form_id = $old_feed['form_id']; $is_active = $old_feed['is_active']; $line_items = ''; switch (rgar($old_feed['meta'], 'is_fixed_cost')) { case "1": $line_items = 'fixed'; case "2": $line_items = 'pricing'; case "0": $line_items = 'dynamic'; } $new_meta = array('feedName' => $feed_name, 'email' => rgar($old_feed['meta'], 'email'), 'firstName' => rgar($old_feed['meta'], 'first_name'), 'lastName' => rgar($old_feed['meta'], 'last_name'), 'organization' => rgar($old_feed['meta'], 'organization'), 'address' => rgar($old_feed['meta'], 'address'), 'phone' => rgar($old_feed['meta'], 'phone'), 'fax' => rgar($old_feed['meta'], 'fax'), 'notes' => rgar($old_feed['meta'], 'notes'), 'alsoCreate' => rgar($old_feed['meta'], 'alsocreate'), 'poNumber' => rgar($old_feed['meta'], 'ponumber'), 'discount' => rgar($old_feed['meta'], 'discount'), 'notes2' => rgar($old_feed['meta'], 'notes2'), 'terms' => rgar($old_feed['meta'], 'terms'), 'updateClient' => rgar($old_feed['meta'], 'update_client'), 'lineItems' => $line_items); $i = 0; foreach ($old_feed['meta']['items'] as $item) { $new_meta['item'][] = $item['item_id']; $new_meta['description'][] = $item['description']; $new_meta['cost'][] = $item['cost']; $new_meta['quantity'][] = $item['quantity']; } $optin_enabled = rgar($old_feed['meta'], 'optin_enabled'); if ($optin_enabled) { $new_meta['feed_condition_conditional_logic'] = 1; $new_meta['feed_condition_conditional_logic_object'] = array('conditionalLogic' => array('actionType' => 'show', 'logicType' => 'all', 'rules' => array(array('fieldId' => $old_feed['meta']['optin_field_id'], 'operator' => $old_feed['meta']['optin_operator'], 'value' => $old_feed['meta']['optin_value'])))); } else { $new_meta['feed_condition_conditional_logic'] = 0; } $this->insert_feed($form_id, $is_active, $new_meta); $counter++; } $new_settings = array('siteName' => get_option('gf_freshbooks_site_name'), 'authToken' => get_option('gf_freshbooks_auth_token')); parent::update_plugin_settings($new_settings); } }
/** * Plugin starting point. Adds PayPal delayed payment support. * * @access public * @return void */ public function init() { parent::init(); $this->add_delayed_payment_support(array('option_label' => esc_html__('Send message to HipChat only when payment is received.', 'gravityformshipchat'))); }
/** * Checks if a previous version was installed and if the feeds need migrating to the framework structure. * * @param string $previous_version The version number of the previously installed version. */ public function upgrade($previous_version) { if (empty($previous_version)) { $previous_version = get_option('gf_campaignmonitor_version'); } $previous_is_pre_addon_framework = !empty($previous_version) && version_compare($previous_version, '3.0.dev1', '<'); if ($previous_is_pre_addon_framework) { $this->copy_feeds(); $old_settings = get_option('gf_campaignmonitor_settings'); $new_settings = array('apiKey' => $old_settings['api_key'], 'apiClientId' => $old_settings['client_id']); parent::update_plugin_settings($new_settings); //set paypal delay setting $this->update_paypal_delay_settings('delay_campaignmonitor_subscription'); } }
public function styles() { $styles = array(array("handle" => "my_styles_css", "src" => $this->get_base_url() . "/css/my_styles.css", "version" => $this->_version, "enqueue" => array(array("field_types" => array("poll"))))); return array_merge(parent::styles(), $styles); }
/** * Enqueue admin scripts. * * @access public * @return array $scripts */ public function scripts() { $scripts = array(array('handle' => 'trello_client', 'deps' => array('jquery'), 'src' => '//api.trello.com/1/client.js?key=' . $this->trello_app_key), array('handle' => 'gform_trello_admin', 'deps' => array('jquery', 'trello_client'), 'src' => $this->get_base_url() . '/js/admin.js', 'version' => $this->_version, 'enqueue' => array(array('admin_page' => array('plugin_settings'))))); return array_merge(parent::scripts(), $scripts); }
/** * Retrieves the settings from the $_POST and reformat the couponAmount and couponCode before they are saved. * * @return array The post data containing the updated coupon feed settings. */ public function get_posted_settings() { $post_data = parent::get_posted_settings(); if (!empty($post_data)) { if (isset($post_data['couponAmount'])) { $post_data['couponAmount'] = GFCommon::to_number($post_data['couponAmount']); } if (isset($post_data['couponCode'])) { $post_data['couponCode'] = strtoupper($post_data['couponCode']); } } return $post_data; }
public function init_frontend() { parent::init_frontend(); add_filter('gform_disable_registration', array($this, 'disable_registration'), 10, 4); add_action('gform_after_submission', array($this, 'after_submission'), 9, 2); }
public function get_setting($setting_name, $default_value = '', $settings = false) { return parent::get_setting($setting_name, $default_value, $settings); }
/** * Register needed plugin hooks and PayPal delayed payment support. * * @access public * @return void */ public function init() { parent::init(); $this->add_delayed_payment_support(array('option_label' => esc_html__('Subscribe contact to Mad Mimi only when payment is received.', 'gravityformsmadmimi'))); }
private function payment_method_is_overridden($method_name, $base_class = 'GFPaymentAddOn') { return parent::method_is_overridden($method_name, $base_class); }
/** * Return the stylesheets which should be enqueued. * * @return array */ public function styles() { $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min'; $styles = array(array('handle' => 'gform_activecampaign_form_settings_css', 'src' => $this->get_base_url() . "/css/form_settings{$min}.css", 'version' => $this->_version, 'enqueue' => array(array('admin_page' => array('form_settings'))))); return array_merge(parent::styles(), $styles); }
/** * @access public * @return void */ public function init() { parent::init(); }
public function get_app_settings() { return parent::get_app_settings(); }
/** * Override how multiple choices in multiselect and checkbox type field values are separated and enable use of the gform_zohocrm_field_value hook. * * @param string $field_value The field value. * @param array $form The form object currently being processed. * @param array $entry The entry object currently being processed. * @param string $field_id The ID of the field being processed. * * @return string */ public function maybe_override_field_value($field_value, $form, $entry, $field_id) { $field = GFFormsModel::get_field($form, $field_id); if (is_object($field)) { $is_integer = $field_id == intval($field_id); $input_type = $field->get_input_type(); if ($input_type == 'multiselect' || $is_integer && $input_type == 'checkbox') { $field_value = str_replace(', ', ';', $field_value); } } return parent::maybe_override_field_value($field_value, $form, $entry, $field_id); }
protected function settings_password($field, $echo = true) { // Once Rocketgenius implements this, this wont be necessary. if (method_exists('GFAddOn', 'settings_password') && is_callable(array('GFAddOn', 'settings_password'))) { $output = parent::settings_password($field, false); } else { $output = parent::settings_text($field, false); $output = str_replace('type="text"', 'type="password" autocomplete="off"', $output); } if ($echo) { echo $output; } return $output; }