Plugin Directory

Changeset 2155926


Ignore:
Timestamp:
09/13/2019 05:19:14 AM (7 years ago)
Author:
AmitDeyUS
Message:

Integration with Contact Form 7
Bump version 2.2.8

Location:
marketpowerwp/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • marketpowerwp/trunk/leplugin.php

    r2072362 r2155926  
    44 * Plugin Name: Multisoft MarketPowerPRO Tools
    55 * Description: Integration of MarketPowerPro to Wordpress
    6  * Version: 2.2.7
     6 * Version: 2.2.8
    77 * Author: Rodine Mark Paul L. Villar
    88 * Author URI: mailto:dine@multisoft.com?subject=Multisoft+MarketPowerPRO+Tools
     
    1414}
    1515
    16 if(file_exists('plugin-update-checker/plugin-update-checker.php')) {
     16if (file_exists('plugin-update-checker/plugin-update-checker.php')) {
    1717    require 'plugin-update-checker/plugin-update-checker.php';
    1818    Puc_v4_Factory::buildUpdateChecker(
  • marketpowerwp/trunk/readme.txt

    r2072362 r2155926  
    33Tags: marketpowerpro, multisoft
    44Requires at least: 3.4+
    5 Stable tag: 2.2.7
    6 Version: 2.2.7
     5Stable tag: 2.2.8
     6Version: 2.2.8
    77Tested up to: 5.1
    88License: Commercial
  • marketpowerwp/trunk/src/Multisoft/MPP/Replication/ReplicationController.php

    r2072358 r2155926  
    2828    const OPTION_CHECK_SITE_NAME_PATH_QUERY_FORMAT = 'check_site_name_path_query_format';
    2929    const OPTION_DEFAULT_REPLICATED_SITE_NAME = 'default_replicated_site_name';
     30    const OPTION_REPLICATION_CF7_FORMS = 'replication_cf7_forms';
    3031
    3132    private $replicationGateway;
     
    5051        if (is_plugin_active('all-in-one-seo-pack-pro/all_in_one_seo_pack.php')) {
    5152            $this->add_filter('aioseop_canonical_url', 'replication_seo_canon_compat');
     53        }
     54        if (is_plugin_active('contact-form-7/wp-contact-form-7.php')) {
     55            $this->add_action('wpcf7_before_send_mail', 'replication_cf7');
    5256        }
    5357        if (file_exists(ABSPATH . "logs")) {
     
    195199            self::OPTION_CHECK_SITE_NAME_PATH_QUERY_FORMAT
    196200        );
     201
     202        $settingsGateway->addSettingsSection(
     203            $settingsGateway::INTEGRATIONS_TAB,
     204            self::SECTION_MPP_REPLICATION,
     205            'Replication Integration Settings',
     206            [$this, "mpp_replication_integration_settings"]
     207        );
     208        $settingsGateway->registerSetting(
     209            $settingsGateway::INTEGRATIONS_TAB,
     210            self::SECTION_MPP_REPLICATION,
     211            self::OPTION_REPLICATION_CF7_FORMS
     212        );
    197213    }
    198214
     
    202218        $sample_content = "[mppe]Hello my name is MPPE_FIRSTNAME, " .
    203219            "I live in MPPE_ADDRESS1 MPPE_ADDRESS2 MPPE_CITY, MPPE_COUNTRYNAME MPPE_POSTALCODE. " .
    204             "My MPP Distributor ID is MPPE_DISTRIBUTORID and my common id is MPPE_COMMONID[/mppe]!";
     220            "My MPP Distributor ID is MPPE_DISTRIBUTORID, my e-mail address is MPPE_EMAIL and my common id is MPPE_COMMONID[/mppe]!";
    205221        $parsed = do_shortcode($sample_content);
    206222        $view->assign('sample', $sample_content);
     
    404420    }
    405421
    406 
     422    public function mpp_replication_integration_settings()
     423    {
     424        $settingsGateway = SettingsGateway::getInstance();
     425        $replicationView = new View($this, 'mpp/replication/integration_settings_section.php');
     426        $replicationView->assign('active_integrations', [
     427            "cf7" => is_plugin_active('contact-form-7/wp-contact-form-7.php')
     428        ]);
     429        $cf7Forms = get_posts(['post_type' => 'wpcf7_contact_form', 'posts_per_page' => -1]);
     430        $replicationView->assign('all_cf7_forms', $cf7Forms);
     431        $replicationView->assign('replication_cf7_forms',
     432            $settingsGateway->get(self::OPTION_REPLICATION_CF7_FORMS, ''));
     433        $replicationView->display();
     434    }
     435
     436    public function replication_cf7($cf7)
     437    {
     438        /**
     439         * @var $cf7 \WPCF7_ContactForm
     440         */
     441        $replicationGateway = ReplicationGateway::getInstance();
     442        $siteName = $replicationGateway->get_replication_site_name(true);
     443        if ($siteName) {
     444            $replicationInfo = $replicationGateway->get_replication_info(MPP_DEBUG);
     445            if (!empty($replicationInfo['EMAIL'])) {
     446                $submission = \WPCF7_Submission::get_instance();
     447                $cf7Mail = $cf7->get_properties('mail');
     448                $cf7Mail['mail']['recipient'] = $replicationInfo['EMAIL'];
     449                $cf7->set_properties(['mail' => $cf7Mail['mail']]);
     450            }
     451        }
     452        return $cf7;
     453    }
    407454}
  • marketpowerwp/trunk/src/Multisoft/MPP/Settings/SettingsController.php

    r1431993 r2155926  
    6161            foreach ($settings as $setting) {
    6262                $value = Input::post($setting->id, "");
    63                 if (trim($value) == "" && $setting->isPassword) {
     63                if (!is_array($value) && trim($value) == "" && $setting->isPassword) {
    6464                    continue;
    6565                }
  • marketpowerwp/trunk/src/Multisoft/MPP/Settings/SettingsGateway.php

    r1445352 r2155926  
    1818    const PREFIX = "multisoft_mpp_";
    1919    const GENERAL_TAB = "general";
     20    const INTEGRATIONS_TAB = "integrations";
    2021    const ADVANCED_TAB = "advanced";
    2122
     
    3637    {
    3738        $this->addSettingsTab(self::GENERAL_TAB, "General");
     39        $this->addSettingsTab(self::INTEGRATIONS_TAB, "Integrations");
    3840        $this->addSettingsTab(self::ADVANCED_TAB, "Advanced");
    3941    }
Note: See TracChangeset for help on using the changeset viewer.