|
@@ 215-226 (lines=12) @@
|
| 212 |
|
{ |
| 213 |
|
$this->ad_preview($data['ad_code']); |
| 214 |
|
} |
| 215 |
|
else if (empty($this->errors)) |
| 216 |
|
{ |
| 217 |
|
$ad_id = $this->manager->insert_ad($data); |
| 218 |
|
$this->manager->insert_ad_locations($ad_id, $data['ad_locations']); |
| 219 |
|
|
| 220 |
|
// Add u_phpbb_ads_owner permission |
| 221 |
|
$this->auth_admin->acl_set('user', 0, $data['ad_owner'], array('u_phpbb_ads_owner' => 1)); |
| 222 |
|
|
| 223 |
|
$this->log('ADD', $data['ad_name']); |
| 224 |
|
|
| 225 |
|
$this->success('ACP_AD_ADD_SUCCESS'); |
| 226 |
|
} |
| 227 |
|
|
| 228 |
|
$this->assign_locations($data); |
| 229 |
|
$this->assign_form_data($data); |
|
@@ 282-294 (lines=13) @@
|
| 279 |
|
|
| 280 |
|
$success = $this->manager->update_ad($ad_id, $data); |
| 281 |
|
|
| 282 |
|
if ($success) |
| 283 |
|
{ |
| 284 |
|
// Only insert new ad locations to DB when ad exists |
| 285 |
|
$this->manager->delete_ad_locations($ad_id); |
| 286 |
|
$this->manager->insert_ad_locations($ad_id, $data['ad_locations']); |
| 287 |
|
|
| 288 |
|
// Add u_phpbb_ads_owner permission to new owner |
| 289 |
|
$this->auth_admin->acl_set('user', 0, $data['ad_owner'], array('u_phpbb_ads_owner' => 1)); |
| 290 |
|
|
| 291 |
|
$this->log('EDIT', $data['ad_name']); |
| 292 |
|
|
| 293 |
|
$this->success('ACP_AD_EDIT_SUCCESS'); |
| 294 |
|
} |
| 295 |
|
|
| 296 |
|
$this->error('ACP_AD_DOES_NOT_EXIST'); |
| 297 |
|
} |