Changeset 2155926
- Timestamp:
- 09/13/2019 05:19:14 AM (7 years ago)
- Location:
- marketpowerwp/trunk
- Files:
-
- 1 added
- 5 edited
-
leplugin.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
src/Multisoft/MPP/Replication/ReplicationController.php (modified) (5 diffs)
-
src/Multisoft/MPP/Settings/SettingsController.php (modified) (1 diff)
-
src/Multisoft/MPP/Settings/SettingsGateway.php (modified) (2 diffs)
-
views/mpp/replication/integration_settings_section.php (added)
Legend:
- Unmodified
- Added
- Removed
-
marketpowerwp/trunk/leplugin.php
r2072362 r2155926 4 4 * Plugin Name: Multisoft MarketPowerPRO Tools 5 5 * Description: Integration of MarketPowerPro to Wordpress 6 * Version: 2.2. 76 * Version: 2.2.8 7 7 * Author: Rodine Mark Paul L. Villar 8 8 * Author URI: mailto:dine@multisoft.com?subject=Multisoft+MarketPowerPRO+Tools … … 14 14 } 15 15 16 if (file_exists('plugin-update-checker/plugin-update-checker.php')) {16 if (file_exists('plugin-update-checker/plugin-update-checker.php')) { 17 17 require 'plugin-update-checker/plugin-update-checker.php'; 18 18 Puc_v4_Factory::buildUpdateChecker( -
marketpowerwp/trunk/readme.txt
r2072362 r2155926 3 3 Tags: marketpowerpro, multisoft 4 4 Requires at least: 3.4+ 5 Stable tag: 2.2. 76 Version: 2.2. 75 Stable tag: 2.2.8 6 Version: 2.2.8 7 7 Tested up to: 5.1 8 8 License: Commercial -
marketpowerwp/trunk/src/Multisoft/MPP/Replication/ReplicationController.php
r2072358 r2155926 28 28 const OPTION_CHECK_SITE_NAME_PATH_QUERY_FORMAT = 'check_site_name_path_query_format'; 29 29 const OPTION_DEFAULT_REPLICATED_SITE_NAME = 'default_replicated_site_name'; 30 const OPTION_REPLICATION_CF7_FORMS = 'replication_cf7_forms'; 30 31 31 32 private $replicationGateway; … … 50 51 if (is_plugin_active('all-in-one-seo-pack-pro/all_in_one_seo_pack.php')) { 51 52 $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'); 52 56 } 53 57 if (file_exists(ABSPATH . "logs")) { … … 195 199 self::OPTION_CHECK_SITE_NAME_PATH_QUERY_FORMAT 196 200 ); 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 ); 197 213 } 198 214 … … 202 218 $sample_content = "[mppe]Hello my name is MPPE_FIRSTNAME, " . 203 219 "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]!"; 205 221 $parsed = do_shortcode($sample_content); 206 222 $view->assign('sample', $sample_content); … … 404 420 } 405 421 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 } 407 454 } -
marketpowerwp/trunk/src/Multisoft/MPP/Settings/SettingsController.php
r1431993 r2155926 61 61 foreach ($settings as $setting) { 62 62 $value = Input::post($setting->id, ""); 63 if ( trim($value) == "" && $setting->isPassword) {63 if (!is_array($value) && trim($value) == "" && $setting->isPassword) { 64 64 continue; 65 65 } -
marketpowerwp/trunk/src/Multisoft/MPP/Settings/SettingsGateway.php
r1445352 r2155926 18 18 const PREFIX = "multisoft_mpp_"; 19 19 const GENERAL_TAB = "general"; 20 const INTEGRATIONS_TAB = "integrations"; 20 21 const ADVANCED_TAB = "advanced"; 21 22 … … 36 37 { 37 38 $this->addSettingsTab(self::GENERAL_TAB, "General"); 39 $this->addSettingsTab(self::INTEGRATIONS_TAB, "Integrations"); 38 40 $this->addSettingsTab(self::ADVANCED_TAB, "Advanced"); 39 41 }
Note: See TracChangeset
for help on using the changeset viewer.