1 | <?php |
||
18 | abstract class AdminPageFramework_PageMetaBox_Model extends AdminPageFramework_PageMetaBox_Router { |
||
19 | |||
20 | /** |
||
21 | * A validation callback method. |
||
22 | * |
||
23 | * The user may just override this method instead of defining a `validation_{...}` callback method. |
||
24 | * |
||
25 | * @since 3.4.1 |
||
26 | * @since 3.5.3 Moved from `AdminPageFramework_Factory_Model`. |
||
27 | * @todo Examine if the forth parameter of submit info can be added or not. |
||
28 | * @param array $aInput The submit form data. |
||
29 | * @param array $aOldInput The previously submit form data stored in the database. |
||
30 | * @param object $oFactory The page meta box factory object. |
||
31 | * @param array $aSubmitInfo [3.5.3+] An array holding submit information such as which submit field is pressed. |
||
32 | * @remark Not defining this method for backward compatibility to avoid strict standard warnings of PHP. |
||
33 | */ |
||
34 | // public function validate( $aInput, $aOldInput, $oFactory, $aSubmitInfo ) { |
||
35 | // return $aInput; |
||
36 | // } |
||
37 | |||
38 | /** |
||
39 | * Sets up validation hooks. |
||
40 | * |
||
41 | * @since 3.3.0 |
||
42 | * @since 3.7.9 Renamed from `_setUpValidationHooks`. Changed the scope to public from protected. |
||
43 | * @callback action set_up_{instantiated class name} |
||
44 | * @internal |
||
45 | */ |
||
46 | public function _replyToSetUpValidationHooks( $oScreen ) { |
||
71 | |||
72 | /** |
||
73 | * Adds the defined meta box. |
||
74 | * |
||
75 | * @internal |
||
76 | * @since 3.0.0 |
||
77 | * @since 3.7.10 Changed the name from `_replyToAddMetaBox()`. |
||
78 | * @remark Before this method is called, the pages and in-page tabs need to be registered already. |
||
79 | * @return void |
||
80 | * @callback action add_meta_boxes |
||
81 | */ |
||
82 | public function _replyToRegisterMetaBoxes( $sPageHook='' ) { |
||
91 | /** |
||
92 | * Adds meta boxes. |
||
93 | * |
||
94 | * @since 3.7.0 |
||
95 | * @since 3.7.10 Changed the name from `_addMetaBoxes()`. |
||
96 | * @internal |
||
97 | * @return void |
||
98 | */ |
||
99 | private function _registerMetaBoxes( $sPageSlug, $asPage ) { |
||
107 | /** |
||
108 | * Adds meta box with the given page slug. |
||
109 | * |
||
110 | * @since 3.0.0 |
||
111 | * @since 3.7.10 Changed the name from `_addMetaBox()`. |
||
112 | * @internal |
||
113 | * @uses add_meta_box() |
||
114 | * @return void |
||
115 | */ |
||
116 | private function _registerMetaBox( $sPageSlug ) { |
||
127 | |||
128 | /** |
||
129 | * Filters the page option array. |
||
130 | * |
||
131 | * This is triggered from the system validation method of the main Admin Page Framework factory class with the `validation_saved_options_{page slug}` filter hook. |
||
132 | * |
||
133 | * @since 3.0.0 |
||
134 | * @param array $aPageOptions |
||
135 | * @deprecated 3.4.1 |
||
136 | * @internal |
||
137 | */ |
||
138 | public function _replyToFilterPageOptions( $aPageOptions ) { |
||
141 | /** |
||
142 | * Filters the array of the options without dynamic elements. |
||
143 | * |
||
144 | * @since 3.4.1 Deprecated `_replyToFilterPageOptions()`. |
||
145 | * @callback filter validation_saved_options_without_dynamic_elements_{$_sPageSlug} |
||
146 | * @callback filter validation_saved_options_without_dynamic_elements_{page slug}_{tab slug} |
||
147 | * @internal |
||
148 | */ |
||
149 | public function _replyToFilterPageOptionsWODynamicElements( $aOptionsWODynamicElements, $oFactory ) { |
||
152 | |||
153 | /** |
||
154 | * Validates the submitted option values. |
||
155 | * |
||
156 | * This method is triggered with the `validation_{page slug}` or `validation_{page slug}_{tab slug}` method of the main Admin Page Framework factory class. |
||
157 | * |
||
158 | * @internal |
||
159 | * @callback filter validation_{page slug}, validation_{page slug}_{tab slug} |
||
160 | * @sicne 3.0.0 |
||
161 | * @param array $aNewPageOptions The array holing the field values of the page sent from the framework page class (the main class). |
||
162 | * @param array $aOldPageOptions The array holing the saved options of the page. Note that this will be empty if non of generic page fields are created. |
||
163 | * @param object $oAdminPage The admin page factory class object. |
||
164 | * @param array $aSubmitInfo An array containing submit information such as a pressed submit field ID. |
||
165 | * @return array The validated form input data. |
||
166 | */ |
||
167 | public function _replyToValidateOptions( $aNewPageOptions, $aOldPageOptions, $oAdminPage, $aSubmitInfo ) { |
||
202 | |||
203 | /** |
||
204 | * Modifies the options update status array. |
||
205 | * |
||
206 | * This is to insert the 'field_errors' key into the options update status array when there is a field error. |
||
207 | * |
||
208 | * @internal |
||
209 | * @since 3.4.1 |
||
210 | * @callback filter options_update_status_{page slug} |
||
211 | * @callback filter options_update_status_{page slug}_{tab slug} |
||
212 | * @return array |
||
213 | */ |
||
214 | public function _replyToModifyOptionsUpdateStatus( $aStatus ) { |
||
225 | |||
226 | /** |
||
227 | * Called when the form object tries to set the form data from the database. |
||
228 | * |
||
229 | * @callback form `saved_data` |
||
230 | * @remark The `oOptions` property will be automatically set with the overload method. |
||
231 | * @remark Redefine (override) this method completely because the parent meta box factory class |
||
232 | * has this method and its own way to retrieve form data. |
||
233 | * @return array The saved form data. |
||
234 | * @since 3.7.0 |
||
235 | */ |
||
236 | public function _replyToGetSavedFormData() { |
||
247 | |||
248 | /** |
||
249 | * Extracts meta box form fields options array from the given options array of an admin page. |
||
250 | * |
||
251 | * @since 3.5.6 |
||
252 | * @return array The extracted options array. |
||
253 | * @internal |
||
254 | * @deprecated 3.7.0 |
||
255 | */ |
||
256 | private function _getPageMetaBoxOptionsFromPageOptions( array $aPageOptions, array $aFieldsets ) { |
||
274 | |||
275 | } |
||
276 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.