Code Duplication    Length = 5-5 lines in 3 locations

admin_pages/messages/Messages_Admin_Page.core.php 1 location

@@ 2609-2613 (lines=5) @@
2606
			//any default settings for the messenger?
2607
			$msgr_settings = $this->_active_messengers[$messenger]['obj']->get_admin_settings_fields();
2608
2609
			if ( !empty( $msgr_settings ) ) {
2610
				foreach ( $msgr_settings as $field => $value ) {
2611
					$this->_active_messengers[$messenger]['settings'][$field] = $value;
2612
				}
2613
			}
2614
2615
			//update settings in database
2616
			EEH_MSG_Template::update_active_messengers_in_db( $this->_active_messengers );

core/helpers/EEH_Activation.helper.php 1 location

@@ 1392-1396 (lines=5) @@
1389
				//setup any initial settings for the messenger
1390
				$msgr_settings = $installed_messengers[$messenger]->get_admin_settings_fields();
1391
1392
				if ( !empty( $msgr_settings ) ) {
1393
					foreach ( $msgr_settings as $field => $value ) {
1394
						$active_messengers[$messenger]['settings'][$field] = $value;
1395
					}
1396
				}
1397
1398
				//now let's save the settings for this messenger! Must do now because the validator checks the db for active messengers to validate.
1399
				EEH_MSG_Template::update_active_messengers_in_db( $active_messengers );

core/libraries/messages/EE_messages.lib.php 1 location

@@ 171-175 (lines=5) @@
168
			//setup any initial settings for the messenger
169
			$msgr_settings = $messenger->get_admin_settings_fields();
170
171
			if ( !empty( $msgr_settings ) ) {
172
				foreach ( $msgr_settings as $field => $value ) {
173
					$active_messengers[ $messenger->name ][ 'settings' ][ $field ] = $value;
174
				}
175
			}
176
177
			EEH_MSG_Template::update_active_messengers_in_db( $active_messengers );
178
			update_option( 'ee_has_activated_messenger', $has_activated );