| @@ 866-890 (lines=25) @@ | ||
| 863 | Symphony::ExtensionManager()->notifyMembers('PagePreCreate', '/blueprints/pages/', |
|
| 864 | array('fields' => &$fields)); |
|
| 865 | ||
| 866 | if (!$page_id = PageManager::add($fields)) { |
|
| 867 | $this->pageAlert( |
|
| 868 | __('Unknown errors occurred while attempting to save.') |
|
| 869 | . '<a href="' . SYMPHONY_URL . '/system/log/">' |
|
| 870 | . __('Check your activity log') |
|
| 871 | . '</a>.', |
|
| 872 | Alert::ERROR |
|
| 873 | ); |
|
| 874 | } else { |
|
| 875 | /** |
|
| 876 | * Just after the creation of a new page in `tbl_pages` |
|
| 877 | * |
|
| 878 | * @delegate PagePostCreate |
|
| 879 | * @since Symphony 2.2 |
|
| 880 | * @param string $context |
|
| 881 | * '/blueprints/pages/' |
|
| 882 | * @param integer $page_id |
|
| 883 | * The ID of the newly created Page |
|
| 884 | * @param array $fields |
|
| 885 | * An associative array of data that was just saved for this page |
|
| 886 | */ |
|
| 887 | Symphony::ExtensionManager()->notifyMembers('PagePostCreate', '/blueprints/pages/', |
|
| 888 | array('page_id' => $page_id, 'fields' => &$fields)); |
|
| 889 | ||
| 890 | $redirect = "/blueprints/pages/edit/{$page_id}/created/{$parent_link_suffix}"; |
|
| 891 | } |
|
| 892 | ||
| 893 | // Update existing: |
|
| @@ 912-936 (lines=25) @@ | ||
| 909 | Symphony::ExtensionManager()->notifyMembers('PagePreEdit', '/blueprints/pages/', |
|
| 910 | array('page_id' => $page_id, 'fields' => &$fields)); |
|
| 911 | ||
| 912 | if (!PageManager::edit($page_id, $fields, true)) { |
|
| 913 | return $this->pageAlert( |
|
| 914 | __('Unknown errors occurred while attempting to save.') |
|
| 915 | . '<a href="' . SYMPHONY_URL . '/system/log/">' |
|
| 916 | . __('Check your activity log') |
|
| 917 | . '</a>.', |
|
| 918 | Alert::ERROR |
|
| 919 | ); |
|
| 920 | } else { |
|
| 921 | /** |
|
| 922 | * Just after updating a page in `tbl_pages` |
|
| 923 | * |
|
| 924 | * @delegate PagePostEdit |
|
| 925 | * @since Symphony 2.2 |
|
| 926 | * @param string $context |
|
| 927 | * '/blueprints/pages/' |
|
| 928 | * @param integer $page_id |
|
| 929 | * The ID of the Page that was just updated |
|
| 930 | * @param array $fields |
|
| 931 | * An associative array of data that was just saved for this page |
|
| 932 | */ |
|
| 933 | Symphony::ExtensionManager()->notifyMembers('PagePostEdit', '/blueprints/pages/', |
|
| 934 | array('page_id' => $page_id, 'fields' => $fields)); |
|
| 935 | ||
| 936 | $redirect = "/blueprints/pages/edit/{$page_id}/saved/{$parent_link_suffix}"; |
|
| 937 | } |
|
| 938 | } |
|
| 939 | } |
|