Code Duplication    Length = 13-16 lines in 2 locations

controller/admin_controller.php 2 locations

@@ 180-192 (lines=13) @@
177
		{
178
			$data = $this->get_form_data('phpbb/admanagement/add');
179
180
			if ($preview)
181
			{
182
				$this->ad_preview($data['ad_code']);
183
			}
184
			else if (empty($this->errors))
185
			{
186
				$ad_id = $this->manager->insert_ad($data);
187
				$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
188
189
				$this->log('ADD', $data['ad_name']);
190
191
				$this->success('ACP_AD_ADD_SUCCESS');
192
			}
193
194
			$this->assign_locations($data);
195
			$this->assign_form_data($data);
@@ 230-245 (lines=16) @@
227
			{
228
				$this->ad_preview($data['ad_code']);
229
			}
230
			else if (empty($this->errors))
231
			{
232
				$success = $this->manager->update_ad($ad_id, $data);
233
234
				if ($success)
235
				{
236
					// Only insert new ad locations to DB when ad exists
237
					$this->manager->delete_ad_locations($ad_id);
238
					$this->manager->insert_ad_locations($ad_id, $data['ad_locations']);
239
240
					$this->log('EDIT', $data['ad_name']);
241
242
					$this->success('ACP_AD_EDIT_SUCCESS');
243
				}
244
				$this->error('ACP_AD_DOES_NOT_EXIST');
245
			}
246
		}
247
		else
248
		{