| @@ 355-388 (lines=34) @@ | ||
| 352 | } |
|
| 353 | } |
|
| 354 | ||
| 355 | public function __actionEdit() |
|
| 356 | { |
|
| 357 | if (array_key_exists('save', $_POST['action'])) { |
|
| 358 | return $this->__formAction(); |
|
| 359 | } elseif (array_key_exists('delete', $_POST['action'])) { |
|
| 360 | /** |
|
| 361 | * Prior to deleting the Event file. Target file path is provided. |
|
| 362 | * |
|
| 363 | * @delegate EventPreDelete |
|
| 364 | * @since Symphony 2.2 |
|
| 365 | * @param string $context |
|
| 366 | * '/blueprints/events/' |
|
| 367 | * @param string $file |
|
| 368 | * The path to the Event file |
|
| 369 | */ |
|
| 370 | Symphony::ExtensionManager()->notifyMembers('EventPreDelete', '/blueprints/events/', array('file' => EVENTS . "/event." . $this->_context['handle'] . ".php")); |
|
| 371 | ||
| 372 | if (!General::deleteFile(EVENTS . '/event.' . $this->_context['handle'] . '.php')) { |
|
| 373 | $this->pageAlert( |
|
| 374 | __('Failed to delete %s.', array('<code>' . $this->_context['handle'] . '</code>')) |
|
| 375 | . ' ' . __('Please check permissions on %s.', array('<code>/workspace/events</code>')), |
|
| 376 | Alert::ERROR |
|
| 377 | ); |
|
| 378 | } else { |
|
| 379 | $pages = ResourceManager::getAttachedPages(ResourceManager::RESOURCE_TYPE_EVENT, $this->_context['handle']); |
|
| 380 | ||
| 381 | foreach ($pages as $page) { |
|
| 382 | ResourceManager::detach(ResourceManager::RESOURCE_TYPE_EVENT, $this->_context['handle'], $page['id']); |
|
| 383 | } |
|
| 384 | ||
| 385 | redirect(SYMPHONY_URL . '/blueprints/events/'); |
|
| 386 | } |
|
| 387 | } |
|
| 388 | } |
|
| 389 | ||
| 390 | public function __actionIndex($resource_type) |
|
| 391 | { |
|
| @@ 1077-1110 (lines=34) @@ | ||
| 1074 | return parent::__actionIndex(ResourceManager::RESOURCE_TYPE_DS); |
|
| 1075 | } |
|
| 1076 | ||
| 1077 | public function __actionEdit() |
|
| 1078 | { |
|
| 1079 | if (array_key_exists('save', $_POST['action'])) { |
|
| 1080 | return $this->__formAction(); |
|
| 1081 | } elseif (array_key_exists('delete', $_POST['action'])) { |
|
| 1082 | /** |
|
| 1083 | * Prior to deleting the Datasource file. Target file path is provided. |
|
| 1084 | * |
|
| 1085 | * @delegate DatasourcePreDelete |
|
| 1086 | * @since Symphony 2.2 |
|
| 1087 | * @param string $context |
|
| 1088 | * '/blueprints/datasources/' |
|
| 1089 | * @param string $file |
|
| 1090 | * The path to the Datasource file |
|
| 1091 | */ |
|
| 1092 | Symphony::ExtensionManager()->notifyMembers('DatasourcePreDelete', '/blueprints/datasources/', array('file' => DATASOURCES . "/data." . $this->_context['handle'] . ".php")); |
|
| 1093 | ||
| 1094 | if (!General::deleteFile(DATASOURCES . '/data.' . $this->_context['handle'] . '.php')) { |
|
| 1095 | $this->pageAlert( |
|
| 1096 | __('Failed to delete %s.', array('<code>' . $this->_context['handle'] . '</code>')) |
|
| 1097 | . ' ' . __('Please check permissions on %s.', array('<code>/workspace/data-sources</code>')), |
|
| 1098 | Alert::ERROR |
|
| 1099 | ); |
|
| 1100 | } else { |
|
| 1101 | $pages = ResourceManager::getAttachedPages(ResourceManager::RESOURCE_TYPE_DS, $this->_context['handle']); |
|
| 1102 | ||
| 1103 | foreach ($pages as $page) { |
|
| 1104 | ResourceManager::detach(ResourceManager::RESOURCE_TYPE_DS, $this->_context['handle'], $page['id']); |
|
| 1105 | } |
|
| 1106 | ||
| 1107 | redirect(SYMPHONY_URL . '/blueprints/datasources/'); |
|
| 1108 | } |
|
| 1109 | } |
|
| 1110 | } |
|
| 1111 | ||
| 1112 | public function __actionNew() |
|
| 1113 | { |
|