404Redirect.php
8 years ago
Capability.php
8 years ago
LoginRedirect.php
8 years ago
LogoutRedirect.php
8 years ago
Menu.php
8 years ago
Metabox.php
8 years ago
Post.php
8 years ago
Redirect.php
8 years ago
Route.php
8 years ago
404Redirect.php
67 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * ====================================================================== |
| 5 | * LICENSE: This file is subject to the terms and conditions defined in * |
| 6 | * file 'license.txt', which is part of this source code package. * |
| 7 | * ====================================================================== |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Backend 404 redirect manager |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @author Vasyl Martyniuk <vasyl@vasyltech.com> |
| 15 | */ |
| 16 | class AAM_Backend_Feature_Main_404Redirect extends AAM_Backend_Feature_Abstract { |
| 17 | |
| 18 | /** |
| 19 | * @inheritdoc |
| 20 | */ |
| 21 | public static function getTemplate() { |
| 22 | return 'main/404redirect.phtml'; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Save AAM utility options |
| 27 | * |
| 28 | * @return string |
| 29 | * |
| 30 | * @access public |
| 31 | */ |
| 32 | public function save() { |
| 33 | $param = AAM_Core_Request::post('param'); |
| 34 | $value = stripslashes(AAM_Core_Request::post('value')); |
| 35 | |
| 36 | AAM_Core_Config::set($param, $value); |
| 37 | |
| 38 | return json_encode(array('status' => 'success')); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Register 404 redirect feature |
| 43 | * |
| 44 | * @return void |
| 45 | * |
| 46 | * @access public |
| 47 | */ |
| 48 | public static function register() { |
| 49 | if (is_main_site()) { |
| 50 | AAM_Backend_Feature::registerFeature((object) array( |
| 51 | 'uid' => '404redirect', |
| 52 | 'position' => 50, |
| 53 | 'title' => __('404 Redirect', AAM_KEY), |
| 54 | 'capability' => 'aam_manage_404_redirect', |
| 55 | 'type' => 'main', |
| 56 | 'subjects' => array( |
| 57 | AAM_Core_Subject_Default::UID, |
| 58 | AAM_Core_Subject_Role::UID, |
| 59 | AAM_Core_Subject_User::UID, |
| 60 | AAM_Core_Subject_Visitor::UID |
| 61 | ), |
| 62 | 'view' => __CLASS__ |
| 63 | )); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | } |