1 | <?php |
||
20 | abstract class AdminPageFramework_NetworkAdmin extends AdminPageFramework { |
||
21 | |||
22 | /** |
||
23 | * Defines the class object structure type. |
||
24 | * |
||
25 | * @since 3.7.12 |
||
26 | * @internal |
||
27 | */ |
||
28 | protected $_sStructureType = 'network_admin_page'; |
||
29 | |||
30 | /** |
||
31 | * Used to refer the built-in root menu slugs. |
||
32 | * |
||
33 | * @since 3.1.0 |
||
34 | * @remark Not for the user. |
||
35 | * @var array Holds the built-in root menu slugs. |
||
36 | * @internal |
||
37 | */ |
||
38 | protected $_aBuiltInRootMenuSlugs = array( |
||
39 | // All keys must be lower case to support case insensitive look-ups. |
||
40 | 'dashboard' => 'index.php', |
||
41 | 'sites' => 'sites.php', // not work |
||
42 | 'themes' => 'themes.php', // not work |
||
43 | 'plugins' => 'plugins.php', |
||
44 | 'users' => 'users.php', |
||
45 | 'settings' => 'settings.php', |
||
46 | 'updates' => 'update-core.php', // does not work |
||
47 | ); |
||
48 | |||
49 | /** |
||
50 | * Registers necessary callbacks ans sets up internal components including properties. |
||
51 | * |
||
52 | * <h4>Example</h4> |
||
53 | * <code>if ( is_admin() ) |
||
54 | * new MyAdminPageClass( 'my_custom_option_key', __FILE__ );</code> |
||
55 | * |
||
56 | * @access public |
||
57 | * @since 3.1.0 |
||
58 | * @see http://codex.wordpress.org/Roles_and_Capabilities |
||
59 | * @see http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains |
||
60 | * @param string $sOptionKey (optional) specifies the option key name to store in the options table. If this is not set, the instantiated class name will be used. |
||
61 | * @param string $sCallerPath (optional) used to retrieve the plugin/theme details to auto-insert the information into the page footer. |
||
62 | * @param string $sCapability (optional) sets the overall access level to the admin pages created by the framework. The used capabilities are listed <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. The capability can be set per page, tab, setting section, setting field. Default: `manage_options.` |
||
63 | * @param string $sTextDomain (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: `admin-page-framework`. |
||
64 | * @return void returns nothing. |
||
|
|||
65 | */ |
||
66 | public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ){ |
||
95 | |||
96 | /** |
||
97 | * Instantiates a link object based on the type. |
||
98 | * |
||
99 | * @since 3.7.10 |
||
100 | * @internal |
||
101 | * @return null|object |
||
102 | */ |
||
103 | protected function _getLinkObject() { |
||
107 | |||
108 | /** |
||
109 | * Instantiates a link object based on the type. |
||
110 | * |
||
111 | * @since 3.7.10 |
||
112 | * @internal |
||
113 | * @return null|object |
||
114 | */ |
||
115 | protected function _getPageLoadObject() { |
||
119 | |||
120 | /** |
||
121 | * Checks whether the class should be instantiated. |
||
122 | * |
||
123 | * @since 3.1.0 |
||
124 | * @internal |
||
125 | */ |
||
126 | protected function _isInstantiatable() { |
||
140 | |||
141 | |||
142 | /** |
||
143 | * Retrieves the saved option value from the given option key and the dimensional array key representation. |
||
144 | * |
||
145 | * <h4>Example</h4> |
||
146 | * <code> |
||
147 | * $aData = AdminPageFramework::getOption( 'APF' ); |
||
148 | * $aSection = AdminPageFramework::getOption( 'APF', 'my_section' ); |
||
149 | * $sText = AdminPageFramework::getOption( 'APF', array( 'my_section', 'my_text_field' ), 'foo' ); |
||
150 | * $sColor = AdminPageFramework::getOption( 'APF', 'my_color_field', '#FFF' ); |
||
151 | * </code> |
||
152 | * |
||
153 | * @since 3.1.0 |
||
154 | * @param string $sOptionKey the option key of the options table. |
||
155 | * @param string $asKey the representation of dimensional array keys. If the returning option structure is like the following, |
||
156 | * <code> |
||
157 | * array( |
||
158 | * 'a' => array( |
||
159 | * 'b' => array( |
||
160 | * 'c' => 'ccc', |
||
161 | * ), |
||
162 | * ), |
||
163 | * ) |
||
164 | * </code> |
||
165 | * then the value 'ccc' can be retrieved with the key representation array of |
||
166 | * <code> |
||
167 | * array( 'a', 'b', 'c' ) |
||
168 | * </code> |
||
169 | * @param mixed $vDefault the default value that will be returned if nothing is stored. |
||
170 | * @return mixed If the field ID is not specified. |
||
171 | */ |
||
172 | static public function getOption( $sOptionKey, $asKey=null , $vDefault=null ) { |
||
175 | |||
176 | } |
||
177 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.