Code Duplication    Length = 13-16 lines in 2 locations

controller/admin_controller.php 2 locations

@@ 197-209 (lines=13) @@
194
		{
195
			$data = $this->get_form_data('phpbb/ads/add');
196
197
			if ($preview)
198
			{
199
				$this->ad_preview($data['ad_code']);
200
			}
201
			else if (empty($this->errors))
202
			{
203
				$ad_id = $this->manager->insert_ad($data);
204
				$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
205
206
				$this->log('ADD', $data['ad_name']);
207
208
				$this->success('ACP_AD_ADD_SUCCESS');
209
			}
210
211
			$this->assign_locations($data);
212
			$this->assign_form_data($data);
@@ 249-264 (lines=16) @@
246
			{
247
				$this->ad_preview($data['ad_code']);
248
			}
249
			else if (empty($this->errors))
250
			{
251
				$success = $this->manager->update_ad($ad_id, $data);
252
253
				if ($success)
254
				{
255
					// Only insert new ad locations to DB when ad exists
256
					$this->manager->delete_ad_locations($ad_id);
257
					$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
258
259
					$this->log('EDIT', $data['ad_name']);
260
261
					$this->success('ACP_AD_EDIT_SUCCESS');
262
				}
263
				$this->error('ACP_AD_DOES_NOT_EXIST');
264
			}
265
		}
266
		else
267
		{