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