Code Duplication    Length = 13-16 lines in 2 locations

controller/admin_controller.php 2 locations

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