Abstract.php
87 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 | * Abstract class for each backend UI feature |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @version 7.0.0 |
| 15 | */ |
| 16 | abstract class AAM_Backend_Feature_Abstract |
| 17 | { |
| 18 | |
| 19 | /** |
| 20 | * Default access capability to the service |
| 21 | * |
| 22 | * @version 7.0.0 |
| 23 | */ |
| 24 | const ACCESS_CAPABILITY = 'aam_manager'; |
| 25 | |
| 26 | /** |
| 27 | * HTML template to render |
| 28 | * |
| 29 | * @version 7.0.0 |
| 30 | */ |
| 31 | const TEMPLATE = null; |
| 32 | |
| 33 | /** |
| 34 | * Get content |
| 35 | * |
| 36 | * @return string |
| 37 | * @access public |
| 38 | * |
| 39 | * @version 7.0.0 |
| 40 | */ |
| 41 | public function __invoke() |
| 42 | { |
| 43 | return $this->get_content(); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Get HTML content |
| 48 | * |
| 49 | * @return string |
| 50 | * @access public |
| 51 | * |
| 52 | * @version 7.0.0 |
| 53 | */ |
| 54 | public function get_content() |
| 55 | { |
| 56 | ob_start(); |
| 57 | require_once(dirname(__DIR__) . '/tmpl/' . static::TEMPLATE); |
| 58 | $content = ob_get_contents(); |
| 59 | ob_end_clean(); |
| 60 | |
| 61 | return $content; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Get currently managed access level |
| 66 | * |
| 67 | * @return AAM_Backend_AccessLevel |
| 68 | * @access public |
| 69 | * |
| 70 | * @version 7.0.0 |
| 71 | */ |
| 72 | public function get_access_level() |
| 73 | { |
| 74 | return AAM_Backend_AccessLevel::get_instance(); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Register feature |
| 79 | * |
| 80 | * @return void |
| 81 | * @access public |
| 82 | * |
| 83 | * @version 7.0.0 |
| 84 | */ |
| 85 | public static function register() {} |
| 86 | |
| 87 | } |