Code Duplication    Length = 5-5 lines in 3 locations

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

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

admin_pages/messages/Messages_Admin_Page.core.php 1 location

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

core/helpers/EEH_Activation.helper.php 1 location

@@ 1341-1345 (lines=5) @@
1338
				//setup any initial settings for the messenger
1339
				$msgr_settings = $installed_messengers[$messenger]->get_admin_settings_fields();
1340
1341
				if ( !empty( $msgr_settings ) ) {
1342
					foreach ( $msgr_settings as $field => $value ) {
1343
						$active_messengers[$messenger]['settings'][$field] = $value;
1344
					}
1345
				}
1346
1347
				//now let's save the settings for this messenger! Must do now because the validator checks the db for active messengers to validate.
1348
				EEH_MSG_Template::update_active_messengers_in_db( $active_messengers );