@@ -48,6 +48,8 @@ discard block |
||
48 | 48 | * <li>a base64-encoded SVG using a data URI, which will be colored to match the color scheme. This should begin with 'data:image/svg+xml;base64,'.</li> |
49 | 49 | * </ul> |
50 | 50 | * @param string (optional) the position number that is passed to the <var>$position</var> parameter of the <a href="http://codex.wordpress.org/Function_Reference/add_menu_page">add_menu_page()</a> function. |
51 | + * @param string $sIcon16x16 |
|
52 | + * @param integer $iMenuPosition |
|
51 | 53 | * @return void |
52 | 54 | */ |
53 | 55 | public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16=null, $iMenuPosition=null ) { |
@@ -70,6 +72,7 @@ discard block |
||
70 | 72 | * |
71 | 73 | * @since 2.0.0 |
72 | 74 | * @internal |
75 | + * @param string $sMenuLabel |
|
73 | 76 | * @return void|string Returns the associated slug string, if true. |
74 | 77 | */ |
75 | 78 | private function _isBuiltInMenuItem( $sMenuLabel ) { |
@@ -104,39 +104,39 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | - * Adds sub-menu items on the left sidebar menu of the administration panel. |
|
108 | - * |
|
109 | - * It supports pages and links. Each of them has the specific array structure. |
|
110 | - * |
|
111 | - * <h4>Example</h4> |
|
112 | - * <code>$this->addSubMenuItems( |
|
113 | - * array( |
|
114 | - * 'title' => 'Various Form Fields', |
|
115 | - * 'page_slug' => 'first_page', |
|
116 | - * 'screen_icon' => 'options-general', |
|
117 | - * ), |
|
118 | - * array( |
|
119 | - * 'title' => 'Manage Options', |
|
120 | - * 'page_slug' => 'second_page', |
|
121 | - * 'screen_icon' => 'link-manager', |
|
122 | - * ), |
|
123 | - * array( |
|
124 | - * 'title' => 'Google', |
|
125 | - * 'href' => 'http://www.google.com', |
|
126 | - * 'show_page_heading_tab' => false, // this removes the title from the page heading tabs. |
|
127 | - * ) |
|
128 | - * );</code> |
|
129 | - * |
|
130 | - * @since 2.0.0 |
|
131 | - * @since 3.0.0 Changed the scope to public. |
|
132 | - * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
|
133 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
134 | - * @param array $aSubMenuItem1 a first sub-menu array. A sub-menu array can be a link or a page. For the specifications of the array structures and its arguments, refer to the parameter section of the `addSubMenuItem()` method. |
|
135 | - * @param array $aSubMenuItem2 (optional) a second sub-menu array. |
|
136 | - * @param array $_and_more (optional) a third and add items as many as necessary with next parameters. |
|
137 | - * @access public |
|
138 | - * @return void |
|
139 | - */ |
|
107 | + * Adds sub-menu items on the left sidebar menu of the administration panel. |
|
108 | + * |
|
109 | + * It supports pages and links. Each of them has the specific array structure. |
|
110 | + * |
|
111 | + * <h4>Example</h4> |
|
112 | + * <code>$this->addSubMenuItems( |
|
113 | + * array( |
|
114 | + * 'title' => 'Various Form Fields', |
|
115 | + * 'page_slug' => 'first_page', |
|
116 | + * 'screen_icon' => 'options-general', |
|
117 | + * ), |
|
118 | + * array( |
|
119 | + * 'title' => 'Manage Options', |
|
120 | + * 'page_slug' => 'second_page', |
|
121 | + * 'screen_icon' => 'link-manager', |
|
122 | + * ), |
|
123 | + * array( |
|
124 | + * 'title' => 'Google', |
|
125 | + * 'href' => 'http://www.google.com', |
|
126 | + * 'show_page_heading_tab' => false, // this removes the title from the page heading tabs. |
|
127 | + * ) |
|
128 | + * );</code> |
|
129 | + * |
|
130 | + * @since 2.0.0 |
|
131 | + * @since 3.0.0 Changed the scope to public. |
|
132 | + * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
|
133 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
134 | + * @param array $aSubMenuItem1 a first sub-menu array. A sub-menu array can be a link or a page. For the specifications of the array structures and its arguments, refer to the parameter section of the `addSubMenuItem()` method. |
|
135 | + * @param array $aSubMenuItem2 (optional) a second sub-menu array. |
|
136 | + * @param array $_and_more (optional) a third and add items as many as necessary with next parameters. |
|
137 | + * @access public |
|
138 | + * @return void |
|
139 | + */ |
|
140 | 140 | public function addSubMenuItems( $aSubMenuItem1, $aSubMenuItem2=null, $_and_more=null ) { |
141 | 141 | foreach ( func_get_args() as $_aSubMenuItem ) { |
142 | 142 | $this->addSubMenuItem( $_aSubMenuItem ); |
@@ -144,50 +144,50 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * Adds the given sub-menu item on the left sidebar menu of the administration panel. |
|
148 | - * |
|
149 | - * It supports pages and links. Each of them has the specific array structure. |
|
150 | - * |
|
151 | - * <h4>Example</h4> |
|
152 | - * <code>$this->addSubMenuItem( |
|
153 | - * array( |
|
154 | - * 'title' => 'Read Me', |
|
155 | - * 'menu_title' => 'About' |
|
156 | - * 'page_slug' => 'my_plugin_readme', |
|
157 | - * ) |
|
158 | - * );</code> |
|
159 | - * |
|
160 | - * @since 2.0.0 |
|
161 | - * @since 3.0.0 Changed the scope to public. |
|
162 | - * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
|
163 | - * @param array a sub-menu array. It can be a page or a link. The array structures are as follows: |
|
164 | - * <h4>Sub-menu Page Array</h4> |
|
165 | - * <ul> |
|
166 | - * <li>**title** - (string) the page title of the page.</li> |
|
167 | - * <li>**page_slug** - (string) the page slug of the page. Non-alphabetical characters should not be used including dots(.) and hyphens(-).</li> |
|
168 | - * <li>**screen_icon** - (optional, string) either the ID selector name from the following list or the icon URL. The size of the icon should be 32 by 32 in pixel. This is for WordPress 3.7.x or below. |
|
169 | - * <pre>edit, post, index, media, upload, link-manager, link, link-category, edit-pages, page, edit-comments, themes, plugins, users, profile, user-edit, tools, admin, options-general, ms-admin, generic</pre> |
|
170 | - * <p>( Notes: the `generic` icon is available WordPress version 3.5 or above.)</p> |
|
171 | - * </li> |
|
172 | - * <li>**capability** - (optional, string) the access level to the created admin pages defined <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. If not set, the overall capability assigned in the class constructor, which is `manage_options` by default, will be used.</li> |
|
173 | - * <li>**order** - (optional, integer) the order number of the page. The lager the number is, the lower the position it is placed in the menu.</li> |
|
174 | - * <li>**show_page_heading_tab** - (optional, boolean) if this is set to false, the page title won't be displayed in the page heading tab. Default: `true`.</li> |
|
175 | - * <li>**show_in_menu** - (optional) If this is set to false, the page title won't be displayed in the sidebar menu while the page is still accessible. Default: true.</li> |
|
176 | - * <li>**page_title** - (optional) [3.3.0+] When the page title differs from the menu title, use this argument.</li> |
|
177 | - * <li>**menu_title** - (optional) [3.3.0+] When the menu title differs from the menu title, use this argument.</li> |
|
178 | - * </ul> |
|
179 | - * <h4>Sub-menu Link Array</h4> |
|
180 | - * <ul> |
|
181 | - * <li>**title** - (string) the link title.</li> |
|
182 | - * <li>**href** - (string) the URL of the target link.</li> |
|
183 | - * <li>**capability** - (optional, string) the access level to show the item, defined <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. If not set, the overall capability assigned in the class constructor, which is `manage_options` by default, will be used.</li> |
|
184 | - * <li>**order** - (optional, integer) the order number of the page. The lager the number is, the lower the position it is placed in the menu.</li> |
|
185 | - * <li>**show_page_heading_tab** - (optional, boolean) if this is set to false, the page title won't be displayed in the page heading tab. Default: `true`.</li> |
|
186 | - * <li>**show_in_menu** - (optional) If this is set to false, the page title won't be displayed in the sidebar menu while the page is still accessible. Default: true.</li> |
|
187 | - * </ul> |
|
188 | - * @access public |
|
189 | - * @return void |
|
190 | - */ |
|
147 | + * Adds the given sub-menu item on the left sidebar menu of the administration panel. |
|
148 | + * |
|
149 | + * It supports pages and links. Each of them has the specific array structure. |
|
150 | + * |
|
151 | + * <h4>Example</h4> |
|
152 | + * <code>$this->addSubMenuItem( |
|
153 | + * array( |
|
154 | + * 'title' => 'Read Me', |
|
155 | + * 'menu_title' => 'About' |
|
156 | + * 'page_slug' => 'my_plugin_readme', |
|
157 | + * ) |
|
158 | + * );</code> |
|
159 | + * |
|
160 | + * @since 2.0.0 |
|
161 | + * @since 3.0.0 Changed the scope to public. |
|
162 | + * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
|
163 | + * @param array a sub-menu array. It can be a page or a link. The array structures are as follows: |
|
164 | + * <h4>Sub-menu Page Array</h4> |
|
165 | + * <ul> |
|
166 | + * <li>**title** - (string) the page title of the page.</li> |
|
167 | + * <li>**page_slug** - (string) the page slug of the page. Non-alphabetical characters should not be used including dots(.) and hyphens(-).</li> |
|
168 | + * <li>**screen_icon** - (optional, string) either the ID selector name from the following list or the icon URL. The size of the icon should be 32 by 32 in pixel. This is for WordPress 3.7.x or below. |
|
169 | + * <pre>edit, post, index, media, upload, link-manager, link, link-category, edit-pages, page, edit-comments, themes, plugins, users, profile, user-edit, tools, admin, options-general, ms-admin, generic</pre> |
|
170 | + * <p>( Notes: the `generic` icon is available WordPress version 3.5 or above.)</p> |
|
171 | + * </li> |
|
172 | + * <li>**capability** - (optional, string) the access level to the created admin pages defined <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. If not set, the overall capability assigned in the class constructor, which is `manage_options` by default, will be used.</li> |
|
173 | + * <li>**order** - (optional, integer) the order number of the page. The lager the number is, the lower the position it is placed in the menu.</li> |
|
174 | + * <li>**show_page_heading_tab** - (optional, boolean) if this is set to false, the page title won't be displayed in the page heading tab. Default: `true`.</li> |
|
175 | + * <li>**show_in_menu** - (optional) If this is set to false, the page title won't be displayed in the sidebar menu while the page is still accessible. Default: true.</li> |
|
176 | + * <li>**page_title** - (optional) [3.3.0+] When the page title differs from the menu title, use this argument.</li> |
|
177 | + * <li>**menu_title** - (optional) [3.3.0+] When the menu title differs from the menu title, use this argument.</li> |
|
178 | + * </ul> |
|
179 | + * <h4>Sub-menu Link Array</h4> |
|
180 | + * <ul> |
|
181 | + * <li>**title** - (string) the link title.</li> |
|
182 | + * <li>**href** - (string) the URL of the target link.</li> |
|
183 | + * <li>**capability** - (optional, string) the access level to show the item, defined <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. If not set, the overall capability assigned in the class constructor, which is `manage_options` by default, will be used.</li> |
|
184 | + * <li>**order** - (optional, integer) the order number of the page. The lager the number is, the lower the position it is placed in the menu.</li> |
|
185 | + * <li>**show_page_heading_tab** - (optional, boolean) if this is set to false, the page title won't be displayed in the page heading tab. Default: `true`.</li> |
|
186 | + * <li>**show_in_menu** - (optional) If this is set to false, the page title won't be displayed in the sidebar menu while the page is still accessible. Default: true.</li> |
|
187 | + * </ul> |
|
188 | + * @access public |
|
189 | + * @return void |
|
190 | + */ |
|
191 | 191 | public function addSubMenuItem( array $aSubMenuItem ) { |
192 | 192 | if ( isset( $aSubMenuItem[ 'href' ] ) ) { |
193 | 193 | $this->addSubMenuLink( $aSubMenuItem ); |
@@ -197,20 +197,20 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | /** |
200 | - * Adds the given link into the menu on the left sidebar of the administration panel. |
|
201 | - * |
|
202 | - * @since 2.0.0 |
|
203 | - * @since 3.0.0 Changed the scope to public from protected. |
|
204 | - * @since 3.5.0 Changed the scope to public as it was still protected. |
|
205 | - * @param string the menu title. |
|
206 | - * @param string the URL linked to the menu. |
|
207 | - * @param string (optional) the <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">access level</a>. |
|
208 | - * @param string (optional) the order number. The larger it is, the lower the position it gets. |
|
209 | - * @param string (optional) if set to false, the menu title will not be listed in the tab navigation menu at the top of the page. |
|
210 | - * @access public |
|
211 | - * @return void |
|
212 | - * @internal |
|
213 | - */ |
|
200 | + * Adds the given link into the menu on the left sidebar of the administration panel. |
|
201 | + * |
|
202 | + * @since 2.0.0 |
|
203 | + * @since 3.0.0 Changed the scope to public from protected. |
|
204 | + * @since 3.5.0 Changed the scope to public as it was still protected. |
|
205 | + * @param string the menu title. |
|
206 | + * @param string the URL linked to the menu. |
|
207 | + * @param string (optional) the <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">access level</a>. |
|
208 | + * @param string (optional) the order number. The larger it is, the lower the position it gets. |
|
209 | + * @param string (optional) if set to false, the menu title will not be listed in the tab navigation menu at the top of the page. |
|
210 | + * @access public |
|
211 | + * @return void |
|
212 | + * @internal |
|
213 | + */ |
|
214 | 214 | public function addSubMenuLink( array $aSubMenuLink ) { |
215 | 215 | |
216 | 216 | // If required keys are not set, return. |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param string (optional) the position number that is passed to the <var>$position</var> parameter of the <a href="http://codex.wordpress.org/Function_Reference/add_menu_page">add_menu_page()</a> function. |
51 | 51 | * @return void |
52 | 52 | */ |
53 | - public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16=null, $iMenuPosition=null ) { |
|
53 | + public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16 = null, $iMenuPosition = null ) { |
|
54 | 54 | |
55 | 55 | $sRootMenuLabel = trim( $sRootMenuLabel ); |
56 | 56 | $_sSlug = $this->_isBuiltInMenuItem( $sRootMenuLabel ); // if true, this method returns the slug |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function setRootMenuPageBySlug( $sRootMenuSlug ) { |
100 | 100 | |
101 | - $this->oProp->aRootMenu['sPageSlug'] = $sRootMenuSlug; // do not sanitize the slug here because post types includes a question mark. |
|
102 | - $this->oProp->aRootMenu['fCreateRoot'] = false; // indicates to use an existing menu item. |
|
101 | + $this->oProp->aRootMenu[ 'sPageSlug' ] = $sRootMenuSlug; // do not sanitize the slug here because post types includes a question mark. |
|
102 | + $this->oProp->aRootMenu[ 'fCreateRoot' ] = false; // indicates to use an existing menu item. |
|
103 | 103 | |
104 | 104 | } |
105 | 105 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @access public |
138 | 138 | * @return void |
139 | 139 | */ |
140 | - public function addSubMenuItems( $aSubMenuItem1, $aSubMenuItem2=null, $_and_more=null ) { |
|
140 | + public function addSubMenuItems( $aSubMenuItem1, $aSubMenuItem2 = null, $_and_more = null ) { |
|
141 | 141 | foreach ( func_get_args() as $_aSubMenuItem ) { |
142 | 142 | $this->addSubMenuItem( $_aSubMenuItem ); |
143 | 143 | } |
@@ -214,16 +214,16 @@ discard block |
||
214 | 214 | public function addSubMenuLink( array $aSubMenuLink ) { |
215 | 215 | |
216 | 216 | // If required keys are not set, return. |
217 | - if ( ! isset( $aSubMenuLink['href'], $aSubMenuLink['title'] ) ) { |
|
217 | + if ( !isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
218 | 218 | return; |
219 | 219 | } |
220 | 220 | |
221 | 221 | // If the set URL is not valid, return. |
222 | - if ( ! filter_var( $aSubMenuLink['href'], FILTER_VALIDATE_URL ) ) { |
|
222 | + if ( !filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
223 | 223 | return; |
224 | 224 | } |
225 | 225 | |
226 | - $_oFormatter = new AdminPageFramework_Format_SubMenuLink( |
|
226 | + $_oFormatter = new AdminPageFramework_Format_SubMenuLink( |
|
227 | 227 | $aSubMenuLink, |
228 | 228 | $this |
229 | 229 | ); |
@@ -312,11 +312,11 @@ discard block |
||
312 | 312 | */ |
313 | 313 | public function addSubMenuPage( array $aSubMenuPage ) { |
314 | 314 | |
315 | - if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
315 | + if ( !isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
316 | 316 | return; |
317 | 317 | } |
318 | 318 | |
319 | - $_oFormatter = new AdminPageFramework_Format_SubMenuPage( |
|
319 | + $_oFormatter = new AdminPageFramework_Format_SubMenuPage( |
|
320 | 320 | $aSubMenuPage, |
321 | 321 | $this |
322 | 322 | ); |
@@ -215,12 +215,12 @@ discard block |
||
215 | 215 | public function addSubMenuLink( array $aSubMenuLink ) { |
216 | 216 | |
217 | 217 | // If required keys are not set, return. |
218 | - if ( ! isset( $aSubMenuLink['href'], $aSubMenuLink['title'] ) ) { |
|
218 | + if ( ! isset( $aSubMenuLink['href'], $aSubMenuLink['title'] ) ) { |
|
219 | 219 | return; |
220 | 220 | } |
221 | 221 | |
222 | 222 | // If the set URL is not valid, return. |
223 | - if ( ! filter_var( $aSubMenuLink['href'], FILTER_VALIDATE_URL ) ) { |
|
223 | + if ( ! filter_var( $aSubMenuLink['href'], FILTER_VALIDATE_URL ) ) { |
|
224 | 224 | return; |
225 | 225 | } |
226 | 226 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function addSubMenuPage( array $aSubMenuPage ) { |
315 | 315 | |
316 | - if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
316 | + if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
317 | 317 | return; |
318 | 318 | } |
319 | 319 |
@@ -52,42 +52,6 @@ discard block |
||
52 | 52 | * @since 2.0.0 |
53 | 53 | * @since 3.0.0 Changed the scope to public. Added page slug target support. |
54 | 54 | * @since 3.3.1 Moved from `AdminPageFramework_Page`. |
55 | - * @param array $aTab1 The in-page tab array. |
|
56 | - * <h4>In-Page Tab Array</h4> |
|
57 | - * <ul> |
|
58 | - * <li>**page_slug** - (string) the page slug that the tab belongs to.</li> |
|
59 | - * <li>**tab_slug** - (string) the tab slug. Non-alphabetical characters should not be used including dots(.) and hyphens(-).</li> |
|
60 | - * <li>**title** - (string) the title of the tab.</li> |
|
61 | - * <li>**order** - (optional, integer) the order number of the tab. The lager the number is, the lower the position it is placed in the menu.</li> |
|
62 | - * <li>**show_in_page_tab** - (optional, boolean) default: `true`. If this is set to `false`, the tab title will not be displayed in the tab navigation menu; however, it is still accessible from the direct URL.</li> |
|
63 | - * <li>**parent_tab_slug** - (optional, string) this needs to be set if the above `show_in_page_tab` argument is `false` so that the parent tab will be emphasized as active when the hidden page is accessed.</li> |
|
64 | - * <li>**url** - [3.5.0+] (optional, string) If this is set, the link url of the navigation tab will be this url. Use this to create link only tab.</li> |
|
65 | - * <li>**capability** - [3.6.0+] (optional, string) The capability level.</li> |
|
66 | - * <li>**if** - [3.6.0+] (optional, boolean) Whether the tab should be displayed or not.</li> |
|
67 | - * <li>style - [3.6.3+] (optional) (string|array) The path or url of a stylesheet which gets loaded in the head tag. Or inline CSS rules. |
|
68 | - * When custom arguments need to be set such as whether it should be inserted in the footer, set an array holding the following arguments. |
|
69 | - * <ul> |
|
70 | - * <li>src - (required, string) the source url or path.</li> |
|
71 | - * <li>handle_id - (optional, string) The handle ID of the stylesheet.</li> |
|
72 | - * <li>dependencies - (optional, array) The dependency array.</li> |
|
73 | - * <li>version - (optional, string) The stylesheet version number.</li> |
|
74 | - * <li>media - (optional, string) the description of the field which is inserted into the after the input field tag.</li> |
|
75 | - * </ul> |
|
76 | - * </li> |
|
77 | - * <li>script - [3.6.3+] (optional) (string|array) The path or url of a JavaScript script which gets loaded in the head tag. Or an inline JavaScript script. |
|
78 | - * When custom arguments need to be set such as whether it should be inserted in the footer, set an array holding the following arguments. |
|
79 | - * <ul> |
|
80 | - * <li>src - (required, string) the source url or path.</li> |
|
81 | - * <li>handle_id - (optional, string) The handle ID of the stylesheet.</li> |
|
82 | - * <li>dependencies - (optional, array) The dependency array.</li> |
|
83 | - * <li>version - (optional, string) The stylesheet version number.</li> |
|
84 | - * <li>translation - (optional, array) an array holding translation key-value pairs.</li> |
|
85 | - * </ul> |
|
86 | - * </li> |
|
87 | - * </ul> |
|
88 | - * @param array $aTab2 Another in-page tab array. |
|
89 | - * @param array $_and_more (optional) Add in-page tab arrays as many as necessary to the next parameters. |
|
90 | - * @param string $sPageSlug (optional) If the passed parameter item is a string, it will be stored as the target page slug so that it will be applied to the next passed tab arrays as the page_slug element. |
|
91 | 55 | * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
92 | 56 | * @remark In-page tabs are different from page-heading tabs which is automatically added with page titles. |
93 | 57 | * @return void |
@@ -277,6 +241,10 @@ discard block |
||
277 | 241 | /** |
278 | 242 | * Sets a page property. |
279 | 243 | * @since 3.6.0 |
244 | + * @param string $sPropertyName |
|
245 | + * @param string $sPropertyKey |
|
246 | + * @param boolean|string $mValue |
|
247 | + * @param string $sPageSlug |
|
280 | 248 | * @return void |
281 | 249 | */ |
282 | 250 | private function _setPageProperty( $sPropertyName, $sPropertyKey, $mValue, $sPageSlug ) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @return void |
94 | 94 | */ |
95 | 95 | public function addInPageTabs( /* $aTab1, $aTab2=null, $_and_more=null */ ) { |
96 | - foreach( func_get_args() as $asTab ) { |
|
96 | + foreach ( func_get_args() as $asTab ) { |
|
97 | 97 | $this->addInPageTab( $asTab ); |
98 | 98 | } |
99 | 99 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // Target page slug - will be applied when no page slug is specified. |
117 | 117 | static $__sTargetPageSlug; |
118 | - if ( ! is_array( $asInPageTab ) ) { |
|
118 | + if ( !is_array( $asInPageTab ) ) { |
|
119 | 119 | $__sTargetPageSlug = is_string( $asInPageTab ) |
120 | 120 | ? $asInPageTab |
121 | 121 | : $__sTargetPageSlug; // set the target page slug |
@@ -130,23 +130,23 @@ discard block |
||
130 | 130 | ); |
131 | 131 | |
132 | 132 | // Set the target page slug for next calls |
133 | - $__sTargetPageSlug = $aInPageTab[ 'page_slug' ]; |
|
133 | + $__sTargetPageSlug = $aInPageTab[ 'page_slug' ]; |
|
134 | 134 | |
135 | 135 | // Required keys |
136 | - if ( ! isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
136 | + if ( !isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
140 | 140 | // Count - the number of added in-page tabs. |
141 | - $_aElements = $this->oUtil->getElement( |
|
141 | + $_aElements = $this->oUtil->getElement( |
|
142 | 142 | $this->oProp->aInPageTabs, |
143 | 143 | $aInPageTab[ 'page_slug' ], |
144 | 144 | array() |
145 | 145 | ); |
146 | - $_iCountElement = count( $_aElements ); |
|
146 | + $_iCountElement = count( $_aElements ); |
|
147 | 147 | |
148 | 148 | // Pre-format |
149 | - $aInPageTab = array( |
|
149 | + $aInPageTab = array( |
|
150 | 150 | 'page_slug' => $this->oUtil->sanitizeSlug( $aInPageTab[ 'page_slug' ] ), |
151 | 151 | 'tab_slug' => $this->oUtil->sanitizeSlug( $aInPageTab[ 'tab_slug' ] ), |
152 | 152 | 'order' => $this->oUtil->getAOrB( |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @param boolean $bShow If false, the page title will not be displayed. |
175 | 175 | * @return void |
176 | 176 | */ |
177 | - public function setPageTitleVisibility( $bShow=true, $sPageSlug='' ) { |
|
177 | + public function setPageTitleVisibility( $bShow = true, $sPageSlug = '' ) { |
|
178 | 178 | $this->_setPageProperty( |
179 | 179 | 'bShowPageTitle', |
180 | 180 | 'show_page_title', |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @remark Page-heading tabs and in-page tabs are different. The former displays page titles and the latter displays tab titles. |
199 | 199 | * @remark If the second parameter is omitted, it sets the default value. |
200 | 200 | */ |
201 | - public function setPageHeadingTabsVisibility( $bShow=true, $sPageSlug='' ) { |
|
201 | + public function setPageHeadingTabsVisibility( $bShow = true, $sPageSlug = '' ) { |
|
202 | 202 | $this->_setPageProperty( |
203 | 203 | 'bShowPageHeadingTabs', |
204 | 204 | 'show_page_heading_tabs', |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @param string $sPageSlug The page to apply the visibility setting. If not set, it applies to all the pages. |
220 | 220 | * @remark If the second parameter is omitted, it sets the default value. |
221 | 221 | */ |
222 | - public function setInPageTabsVisibility( $bShow=true, $sPageSlug='' ) { |
|
222 | + public function setInPageTabsVisibility( $bShow = true, $sPageSlug = '' ) { |
|
223 | 223 | $this->_setPageProperty( |
224 | 224 | 'bShowInPageTabs', |
225 | 225 | 'show_in_page_tabs', |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @param string $sPageSlug The page slug that applies the setting. |
243 | 243 | * @remark If the second parameter is omitted, it sets the default value. |
244 | 244 | */ |
245 | - public function setInPageTabTag( $sTag='h3', $sPageSlug='' ) { |
|
245 | + public function setInPageTabTag( $sTag = 'h3', $sPageSlug = '' ) { |
|
246 | 246 | $this->_setPageProperty( |
247 | 247 | 'sInPageTabTag', |
248 | 248 | 'in_page_tab_tag', |
@@ -265,9 +265,9 @@ discard block |
||
265 | 265 | * @param string $sPageSlug The page slug that applies the setting. |
266 | 266 | * @remark If the second parameter is omitted, it sets the default value. |
267 | 267 | */ |
268 | - public function setPageHeadingTabTag( $sTag='h2', $sPageSlug='' ) { |
|
268 | + public function setPageHeadingTabTag( $sTag = 'h2', $sPageSlug = '' ) { |
|
269 | 269 | $this->_setPageProperty( |
270 | - 'sPageHeadingTabTag', // property name |
|
270 | + 'sPageHeadingTabTag', // property name |
|
271 | 271 | 'page_heading_tab_tag', // property key |
272 | 272 | $sTag, // value |
273 | 273 | $sPageSlug // page slug |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | $this->oProp->{$sPropertyName} = $mValue; |
291 | 291 | |
292 | - foreach( $this->oProp->aPages as &$_aPage ) { |
|
292 | + foreach ( $this->oProp->aPages as &$_aPage ) { |
|
293 | 293 | $_aPage[ $sPropertyKey ] = $mValue; |
294 | 294 | |
295 | 295 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @return void |
94 | 94 | */ |
95 | 95 | public function addInPageTabs( /* $aTab1, $aTab2=null, $_and_more=null */ ) { |
96 | - foreach( func_get_args() as $asTab ) { |
|
96 | + foreach( func_get_args() as $asTab ) { |
|
97 | 97 | $this->addInPageTab( $asTab ); |
98 | 98 | } |
99 | 99 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @remark In-page tabs are different from page-heading tabs which are automatically added with page titles. |
112 | 112 | * @return void |
113 | 113 | */ |
114 | - public function addInPageTab( $asInPageTab ) { |
|
114 | + public function addInPageTab( $asInPageTab ) { |
|
115 | 115 | |
116 | 116 | // Target page slug - will be applied when no page slug is specified. |
117 | 117 | static $__sTargetPageSlug; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $__sTargetPageSlug = $aInPageTab[ 'page_slug' ]; |
134 | 134 | |
135 | 135 | // Required keys |
136 | - if ( ! isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
136 | + if ( ! isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @param string $sPageSlug The page slug that applies the setting. |
243 | 243 | * @remark If the second parameter is omitted, it sets the default value. |
244 | 244 | */ |
245 | - public function setInPageTabTag( $sTag='h3', $sPageSlug='' ) { |
|
245 | + public function setInPageTabTag( $sTag='h3', $sPageSlug='' ) { |
|
246 | 246 | $this->_setPageProperty( |
247 | 247 | 'sInPageTabTag', |
248 | 248 | 'in_page_tab_tag', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods to handle importing options. |
@@ -24,6 +24,7 @@ |
||
24 | 24 | * Registers necessary callbacks and sets up properties. |
25 | 25 | * |
26 | 26 | * @internal |
27 | + * @param string $sCallerPath |
|
27 | 28 | */ |
28 | 29 | public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
29 | 30 |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | foreach ( $this->oProp->aPages as $_aPage ) { |
128 | 128 | |
129 | - if ( ! isset( $_aPage[ 'page_slug' ] ) ) { |
|
129 | + if ( ! isset( $_aPage[ 'page_slug' ] ) ) { |
|
130 | 130 | continue; |
131 | 131 | } |
132 | 132 | $this->oProp->sDefaultPageSlug = $_aPage[ 'page_slug' ]; |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | * @since 3.1.1 Moved from `AdminPageFramework_Menu`. |
264 | 264 | * @return void |
265 | 265 | */ |
266 | - private function _removePageSubmenuItem( $sMenuSlug, $sMenuTitle, $sPageTitle, $sPageSlug ){ |
|
266 | + private function _removePageSubmenuItem( $sMenuSlug, $sMenuTitle, $sPageTitle, $sPageSlug ) { |
|
267 | 267 | |
268 | 268 | foreach( ( array ) $GLOBALS['submenu'][ $sMenuSlug ] as $_iIndex => $_aSubMenu ) { |
269 | 269 | |
270 | - if ( ! isset( $_aSubMenu[ 3 ] ) ) { |
|
270 | + if ( ! isset( $_aSubMenu[ 3 ] ) ) { |
|
271 | 271 | continue; |
272 | 272 | } |
273 | 273 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $sPageTitle, |
283 | 283 | $sPageSlug, |
284 | 284 | ); |
285 | - if ( $_aA !== $_aB ) { |
|
285 | + if ( $_aA !== $_aB ) { |
|
286 | 286 | continue; |
287 | 287 | } |
288 | 288 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @internal |
27 | 27 | */ |
28 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
28 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
29 | 29 | |
30 | 30 | parent::__construct( $sOptionKey, $sCallerPath, $sCapability, $sTextDomain ); |
31 | 31 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | foreach ( $this->oProp->aPages as $_aPage ) { |
128 | 128 | |
129 | - if ( ! isset( $_aPage[ 'page_slug' ] ) ) { |
|
129 | + if ( !isset( $_aPage[ 'page_slug' ] ) ) { |
|
130 | 130 | continue; |
131 | 131 | } |
132 | 132 | $this->oProp->sDefaultPageSlug = $_aPage[ 'page_slug' ]; |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | */ |
145 | 145 | private function _registerRootMenuPage() { |
146 | 146 | $this->oProp->aRootMenu[ '_page_hook' ] = add_menu_page( |
147 | - $this->oProp->sClassName, // Page title - will be invisible anyway |
|
148 | - $this->oProp->aRootMenu[ 'sTitle' ], // Menu title - should be the root page title. |
|
149 | - $this->oProp->sCapability, // Capability - access right |
|
150 | - $this->oProp->aRootMenu[ 'sPageSlug' ], // Menu ID |
|
151 | - '', // Page content displaying function - the root page will be removed so no need to register a function. |
|
152 | - $this->oProp->aRootMenu[ 'sIcon16x16' ], // icon path |
|
147 | + $this->oProp->sClassName, // Page title - will be invisible anyway |
|
148 | + $this->oProp->aRootMenu[ 'sTitle' ], // Menu title - should be the root page title. |
|
149 | + $this->oProp->sCapability, // Capability - access right |
|
150 | + $this->oProp->aRootMenu[ 'sPageSlug' ], // Menu ID |
|
151 | + '', // Page content displaying function - the root page will be removed so no need to register a function. |
|
152 | + $this->oProp->aRootMenu[ 'sIcon16x16' ], // icon path |
|
153 | 153 | $this->oUtil->getElement( |
154 | 154 | $this->oProp->aRootMenu, |
155 | 155 | 'iPosition', |
@@ -173,32 +173,32 @@ discard block |
||
173 | 173 | */ |
174 | 174 | private function _registerSubMenuItem( array $aArgs ) { |
175 | 175 | |
176 | - if ( ! current_user_can( $aArgs['capability'] ) ) { |
|
176 | + if ( !current_user_can( $aArgs[ 'capability' ] ) ) { |
|
177 | 177 | return ''; |
178 | 178 | } |
179 | 179 | |
180 | - $_sRootPageSlug = $this->oProp->aRootMenu['sPageSlug']; |
|
180 | + $_sRootPageSlug = $this->oProp->aRootMenu[ 'sPageSlug' ]; |
|
181 | 181 | $_sMenuSlug = plugin_basename( $_sRootPageSlug ); // to be compatible with add_submenu_page() |
182 | 182 | |
183 | - switch( $aArgs['type'] ) { |
|
183 | + switch ( $aArgs[ 'type' ] ) { |
|
184 | 184 | case 'page': |
185 | 185 | // it's possible that the page_slug key is not set if the user uses a method like setPageHeadingTabsVisibility() prior to addSubMenuItam(). |
186 | 186 | return $this->_addPageSubmenuItem( |
187 | 187 | $_sRootPageSlug, |
188 | 188 | $_sMenuSlug, |
189 | - $aArgs['page_slug'], |
|
190 | - $this->oUtil->getElement( $aArgs, 'page_title', $aArgs['title'] ), |
|
191 | - $this->oUtil->getElement( $aArgs, 'menu_title', $aArgs['title'] ), |
|
192 | - $aArgs['capability'], |
|
193 | - $aArgs['show_in_menu'] |
|
189 | + $aArgs[ 'page_slug' ], |
|
190 | + $this->oUtil->getElement( $aArgs, 'page_title', $aArgs[ 'title' ] ), |
|
191 | + $this->oUtil->getElement( $aArgs, 'menu_title', $aArgs[ 'title' ] ), |
|
192 | + $aArgs[ 'capability' ], |
|
193 | + $aArgs[ 'show_in_menu' ] |
|
194 | 194 | ); |
195 | 195 | case 'link': |
196 | 196 | return $this->_addLinkSubmenuItem( |
197 | 197 | $_sMenuSlug, |
198 | - $aArgs['title'], |
|
199 | - $aArgs['capability'], |
|
200 | - $aArgs['href'], |
|
201 | - $aArgs['show_in_menu'] |
|
198 | + $aArgs[ 'title' ], |
|
199 | + $aArgs[ 'capability' ], |
|
200 | + $aArgs[ 'href' ], |
|
201 | + $aArgs[ 'show_in_menu' ] |
|
202 | 202 | ); |
203 | 203 | default: |
204 | 204 | return ''; |
@@ -214,43 +214,43 @@ discard block |
||
214 | 214 | */ |
215 | 215 | private function _addPageSubmenuItem( $sRootPageSlug, $sMenuSlug, $sPageSlug, $sPageTitle, $sMenuTitle, $sCapability, $bShowInMenu ) { |
216 | 216 | |
217 | - if ( ! $sPageSlug ) { |
|
217 | + if ( !$sPageSlug ) { |
|
218 | 218 | return ''; |
219 | 219 | } |
220 | 220 | $_sPageHook = add_submenu_page( |
221 | - $sRootPageSlug, // the root (parent) page slug |
|
222 | - $sPageTitle, // page title |
|
223 | - $sMenuTitle, // menu title |
|
224 | - $sCapability, // capability |
|
225 | - $sPageSlug, // menu slug |
|
221 | + $sRootPageSlug, // the root (parent) page slug |
|
222 | + $sPageTitle, // page title |
|
223 | + $sMenuTitle, // menu title |
|
224 | + $sCapability, // capability |
|
225 | + $sPageSlug, // menu slug |
|
226 | 226 | // In admin.php ( line 149 of WordPress v3.6.1 ), do_action($page_hook) ( where $page_hook is $_sPageHook ) |
227 | 227 | // will be executed and it triggers the __call() magic method with the method name of "md5 class hash + _page_ + this page slug". |
228 | - array( $this, $this->oProp->sClassHash . '_page_' . $sPageSlug ) |
|
228 | + array( $this, $this->oProp->sClassHash.'_page_'.$sPageSlug ) |
|
229 | 229 | ); |
230 | 230 | |
231 | 231 | // Ensure only it is added one time per page slug. |
232 | - if ( ! isset( $this->oProp->aPageHooks[ $_sPageHook ] ) ) { |
|
232 | + if ( !isset( $this->oProp->aPageHooks[ $_sPageHook ] ) ) { |
|
233 | 233 | // 3.4.1+ Give a lower priority as the page meta box class also hooks the current_screen to register form elements. |
234 | 234 | // When the validation callback is triggered, their form registration should be done already. So this hook should be loaded later than them. |
235 | - add_action( 'current_screen' , array( $this, "load_pre_" . $sPageSlug ), 20 ); |
|
235 | + add_action( 'current_screen', array( $this, "load_pre_".$sPageSlug ), 20 ); |
|
236 | 236 | |
237 | 237 | // 3.6.3+ |
238 | 238 | // It is possible that an in-page tab is added during the above hooks and the current page is the default tab without the tab GET query key in the url. |
239 | 239 | // Set a low priority because the user may add in-page tabs in their callback method of this action hook. |
240 | - add_action( "load_" . $sPageSlug, array( $this, '_replyToFinalizeInPageTabs' ), 9999 ); |
|
240 | + add_action( "load_".$sPageSlug, array( $this, '_replyToFinalizeInPageTabs' ), 9999 ); |
|
241 | 241 | |
242 | 242 | // 3.6.3+ |
243 | - add_action( "load_after_" . $sPageSlug, array( $this, '_replyToEnqueuePageAssets' ) ); |
|
243 | + add_action( "load_after_".$sPageSlug, array( $this, '_replyToEnqueuePageAssets' ) ); |
|
244 | 244 | |
245 | 245 | } |
246 | 246 | $this->oProp->aPageHooks[ $sPageSlug ] = $this->oUtil->getAOrB( |
247 | 247 | is_network_admin(), |
248 | - $_sPageHook . '-network', |
|
248 | + $_sPageHook.'-network', |
|
249 | 249 | $_sPageHook |
250 | 250 | ); |
251 | 251 | |
252 | 252 | // If the visibility option is false, remove the one just added from the sub-menu array |
253 | - if ( ! $bShowInMenu ) { |
|
253 | + if ( !$bShowInMenu ) { |
|
254 | 254 | $this->_removePageSubmenuItem( $sMenuSlug, $sMenuTitle, $sPageTitle, $sPageSlug ); |
255 | 255 | } |
256 | 256 | return $_sPageHook; |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | * @since 3.1.1 Moved from `AdminPageFramework_Menu`. |
264 | 264 | * @return void |
265 | 265 | */ |
266 | - private function _removePageSubmenuItem( $sMenuSlug, $sMenuTitle, $sPageTitle, $sPageSlug ){ |
|
266 | + private function _removePageSubmenuItem( $sMenuSlug, $sMenuTitle, $sPageTitle, $sPageSlug ) { |
|
267 | 267 | |
268 | - foreach( ( array ) $GLOBALS['submenu'][ $sMenuSlug ] as $_iIndex => $_aSubMenu ) { |
|
268 | + foreach ( ( array ) $GLOBALS[ 'submenu' ][ $sMenuSlug ] as $_iIndex => $_aSubMenu ) { |
|
269 | 269 | |
270 | - if ( ! isset( $_aSubMenu[ 3 ] ) ) { |
|
270 | + if ( !isset( $_aSubMenu[ 3 ] ) ) { |
|
271 | 271 | continue; |
272 | 272 | } |
273 | 273 | |
@@ -318,15 +318,15 @@ discard block |
||
318 | 318 | |
319 | 319 | // If it is in the network admin area, do not remove the menu; otherwise, it gets not accessible. |
320 | 320 | if ( is_network_admin() ) { |
321 | - unset( $GLOBALS['submenu'][ $sMenuSlug ][ $_iIndex ] ); |
|
321 | + unset( $GLOBALS[ 'submenu' ][ $sMenuSlug ][ $_iIndex ] ); |
|
322 | 322 | return; |
323 | 323 | } |
324 | 324 | |
325 | 325 | if ( |
326 | - ! isset( $_GET['page'] ) |
|
327 | - || isset( $_GET['page'] ) && $sPageSlug != $_GET['page'] |
|
326 | + !isset( $_GET[ 'page' ] ) |
|
327 | + || isset( $_GET[ 'page' ] ) && $sPageSlug != $_GET[ 'page' ] |
|
328 | 328 | ) { |
329 | - unset( $GLOBALS['submenu'][ $sMenuSlug ][ $_iIndex ] ); |
|
329 | + unset( $GLOBALS[ 'submenu' ][ $sMenuSlug ][ $_iIndex ] ); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | } |
@@ -339,13 +339,13 @@ discard block |
||
339 | 339 | * @return void |
340 | 340 | */ |
341 | 341 | private function _addLinkSubmenuItem( $sMenuSlug, $sTitle, $sCapability, $sHref, $bShowInMenu ) { |
342 | - if ( ! $bShowInMenu ) { |
|
342 | + if ( !$bShowInMenu ) { |
|
343 | 343 | return; |
344 | 344 | } |
345 | - if ( ! isset( $GLOBALS['submenu'][ $sMenuSlug ] ) ) { |
|
346 | - $GLOBALS['submenu'][ $sMenuSlug ] = array(); |
|
345 | + if ( !isset( $GLOBALS[ 'submenu' ][ $sMenuSlug ] ) ) { |
|
346 | + $GLOBALS[ 'submenu' ][ $sMenuSlug ] = array(); |
|
347 | 347 | } |
348 | - $GLOBALS['submenu'][ $sMenuSlug ][] = array ( |
|
348 | + $GLOBALS[ 'submenu' ][ $sMenuSlug ][ ] = array( |
|
349 | 349 | $sTitle, |
350 | 350 | $sCapability, |
351 | 351 | $sHref, |
@@ -360,8 +360,8 @@ discard block |
||
360 | 360 | * @internal |
361 | 361 | */ |
362 | 362 | public function _replyToFixPageTitleForHiddenPages( $sAdminTitle, $sPageTitle ) { |
363 | - if ( isset( $_GET['page'], $this->oProp->aHiddenPages[ $_GET['page'] ] ) ) { |
|
364 | - return $this->oProp->aHiddenPages[ $_GET['page'] ] . $sAdminTitle; |
|
363 | + if ( isset( $_GET[ 'page' ], $this->oProp->aHiddenPages[ $_GET[ 'page' ] ] ) ) { |
|
364 | + return $this->oProp->aHiddenPages[ $_GET[ 'page' ] ].$sAdminTitle; |
|
365 | 365 | } |
366 | 366 | return $sAdminTitle; |
367 | 367 | } |
@@ -455,6 +455,7 @@ |
||
455 | 455 | * @internal |
456 | 456 | * @since 3.5.3 |
457 | 457 | * @since DEVVER Moved from `AdminPageFramework_FormDefinition_Page`. |
458 | + * @param string $sTabSlug |
|
458 | 459 | * @return boolean |
459 | 460 | */ |
460 | 461 | private function _isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) { |
@@ -52,16 +52,16 @@ discard block |
||
52 | 52 | public function getPageOnlyOptions( $aOptions, $sPageSlug ) { |
53 | 53 | |
54 | 54 | $_aStoredOptionsOfThePage = array(); |
55 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
55 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
56 | 56 | |
57 | 57 | // Check the section |
58 | - if ( ! $this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
58 | + if ( !$this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
59 | 59 | continue; |
60 | 60 | } |
61 | 61 | |
62 | 62 | // At this point, the element belongs the given page slug as the section is of the given page slug's. |
63 | 63 | $this->_setPageOnlyOptions( |
64 | - $_aStoredOptionsOfThePage, // by reference - gets updated in the method. |
|
64 | + $_aStoredOptionsOfThePage, // by reference - gets updated in the method. |
|
65 | 65 | $aOptions, |
66 | 66 | $_aSubSectionsOrFields, |
67 | 67 | $sPageSlug, |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @internal |
82 | 82 | */ |
83 | 83 | private function _setPageOnlyOptions( array &$_aStoredOptionsOfThePage, array $aOptions, array $_aSubSectionsOrFields, $sPageSlug, $_sSectionID ) { |
84 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
84 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
85 | 85 | |
86 | 86 | // If it's a sub-section array, |
87 | 87 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | public function getOtherPageOptions( $aOptions, $sPageSlug ) { |
154 | 154 | |
155 | 155 | $_aStoredOptionsNotOfThePage = array(); |
156 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
156 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
157 | 157 | |
158 | 158 | // Check the section |
159 | 159 | if ( $this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @internal |
183 | 183 | */ |
184 | 184 | private function _setOtherPageOptions( array &$_aStoredOptionsNotOfThePage, array $aOptions, array $_aSubSectionsOrFields, $sPageSlug ) { |
185 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
185 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
186 | 186 | |
187 | 187 | // It's a sub-section array. |
188 | 188 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | public function getOtherTabOptions( $aOptions, $sPageSlug, $sTabSlug ) { |
246 | 246 | |
247 | 247 | $_aStoredOptionsNotOfTheTab = array(); |
248 | - foreach( $this->aFieldsets as $_sSectionPath => $_aSubSectionsOrFields ) { |
|
248 | + foreach ( $this->aFieldsets as $_sSectionPath => $_aSubSectionsOrFields ) { |
|
249 | 249 | |
250 | 250 | // If the section is of the given page and the given tab, skip. |
251 | 251 | if ( $this->_isThisSectionSetToThisTab( $_sSectionPath, $sPageSlug, $sTabSlug ) ) { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | private function _setOtherTabOptions( array &$_aStoredOptionsNotOfTheTab, array $aOptions, array $_aSubSectionsOrFields, $sSectionPath ) { |
277 | 277 | |
278 | 278 | // At this point, the passed element belongs to the other tabs since the section of the given tab is skipped. |
279 | - foreach ( $_aSubSectionsOrFields as $_isSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
279 | + foreach ( $_aSubSectionsOrFields as $_isSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
280 | 280 | |
281 | 281 | // If it's a sub section |
282 | 282 | if ( $this->isNumericInteger( $_isSubSectionIndexOrFieldID ) ) { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @since DEVVER Moved from `AdminPageFramework_FormDefinition_Page`. |
334 | 334 | * @return array |
335 | 335 | */ |
336 | - public function getTabOptions( $aOptions, $sPageSlug, $sTabSlug='' ) { |
|
336 | + public function getTabOptions( $aOptions, $sPageSlug, $sTabSlug = '' ) { |
|
337 | 337 | $_aOtherTabOptions = $this->getOtherTabOptions( $aOptions, $sPageSlug, $sTabSlug ); |
338 | 338 | return $this->invertCastArrayContents( $aOptions, $_aOtherTabOptions ); |
339 | 339 | } |
@@ -348,17 +348,17 @@ discard block |
||
348 | 348 | * @since DEVVER Moved from `AdminPageFramework_FormDefinition_Page`. |
349 | 349 | * @return array |
350 | 350 | */ |
351 | - public function getTabOnlyOptions( array $aOptions, $sPageSlug, $sTabSlug='' ) { |
|
351 | + public function getTabOnlyOptions( array $aOptions, $sPageSlug, $sTabSlug = '' ) { |
|
352 | 352 | |
353 | 353 | $_aStoredOptionsOfTheTab = array(); |
354 | - if ( ! $sTabSlug ) { |
|
354 | + if ( !$sTabSlug ) { |
|
355 | 355 | return $_aStoredOptionsOfTheTab; |
356 | 356 | } |
357 | 357 | |
358 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
358 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
359 | 359 | |
360 | 360 | // Check the section |
361 | - if ( ! $this->_isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) ) { |
|
361 | + if ( !$this->_isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) ) { |
|
362 | 362 | continue; |
363 | 363 | } |
364 | 364 | |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | */ |
385 | 385 | private function _setTabOnlyOptions( array &$_aStoredOptionsOfTheTab, array $aOptions, array $_aSubSectionsOrFields, $_sSectionID ) { |
386 | 386 | |
387 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
387 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
388 | 388 | |
389 | 389 | // if it's a sub-section array. |
390 | 390 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | */ |
442 | 442 | private function _isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) { |
443 | 443 | |
444 | - if ( ! isset( $this->aSectionsets[ $_sSectionID ][ 'page_slug' ] ) ) { |
|
444 | + if ( !isset( $this->aSectionsets[ $_sSectionID ][ 'page_slug' ] ) ) { |
|
445 | 445 | return false; |
446 | 446 | } |
447 | 447 | return ( |
@@ -459,10 +459,10 @@ discard block |
||
459 | 459 | */ |
460 | 460 | private function _isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) { |
461 | 461 | |
462 | - if ( ! $this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
462 | + if ( !$this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
463 | 463 | return false; |
464 | 464 | } |
465 | - if ( ! isset( $this->aSectionsets[ $_sSectionID ][ 'tab_slug' ] ) ) { |
|
465 | + if ( !isset( $this->aSectionsets[ $_sSectionID ][ 'tab_slug' ] ) ) { |
|
466 | 466 | return false; |
467 | 467 | } |
468 | 468 | return ( |
@@ -479,9 +479,9 @@ discard block |
||
479 | 479 | */ |
480 | 480 | private function _setOptionValue( &$aSubject, $asDimensionalPath, $aOptions ) { |
481 | 481 | $_aDimensionalPath = $this->getAsArray( $asDimensionalPath ); |
482 | - $_mValue = $this->getElement( |
|
482 | + $_mValue = $this->getElement( |
|
483 | 483 | $aOptions, |
484 | - $_aDimensionalPath, // as of DEVVER, it can be an array or string |
|
484 | + $_aDimensionalPath, // as of DEVVER, it can be an array or string |
|
485 | 485 | null |
486 | 486 | ); |
487 | 487 | if ( isset( $_mValue ) ) { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | ); |
108 | 108 | // @todo Examine whether this check can be removed |
109 | 109 | // as the section that hods this field is already checked above outside this loop. |
110 | - if ( $sPageSlug !== $_aFieldset[ 'page_slug' ] ) { |
|
110 | + if ( $sPageSlug !== $_aFieldset[ 'page_slug' ] ) { |
|
111 | 111 | continue; |
112 | 112 | } |
113 | 113 | |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @since DEVVER Moved from `AdminPageFramework_FormDefinition_Page`. |
334 | 334 | * @return array |
335 | 335 | */ |
336 | - public function getTabOptions( $aOptions, $sPageSlug, $sTabSlug='' ) { |
|
336 | + public function getTabOptions( $aOptions, $sPageSlug, $sTabSlug='' ) { |
|
337 | 337 | $_aOtherTabOptions = $this->getOtherTabOptions( $aOptions, $sPageSlug, $sTabSlug ); |
338 | 338 | return $this->invertCastArrayContents( $aOptions, $_aOtherTabOptions ); |
339 | 339 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | public function getTabOnlyOptions( array $aOptions, $sPageSlug, $sTabSlug='' ) { |
352 | 352 | |
353 | 353 | $_aStoredOptionsOfTheTab = array(); |
354 | - if ( ! $sTabSlug ) { |
|
354 | + if ( ! $sTabSlug ) { |
|
355 | 355 | return $_aStoredOptionsOfTheTab; |
356 | 356 | } |
357 | 357 |
@@ -43,6 +43,7 @@ |
||
43 | 43 | * @since 2.1.0 |
44 | 44 | * @remark This method just adds the given text into the class property. The actual registration will be performed with the <em>replyToRegisterHelpTabTextForMetaBox()</em> method. |
45 | 45 | * @internal |
46 | + * @param string $sHTMLContent |
|
46 | 47 | */ |
47 | 48 | public function _addHelpText( $sHTMLContent, $sHTMLSidebarContent="" ) { |
48 | 49 |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | * @remark This method just adds the given text into the class property. The actual registration will be performed with the <em>replyToRegisterHelpTabTextForMetaBox()</em> method. |
45 | 45 | * @internal |
46 | 46 | */ |
47 | - public function _addHelpText( $sHTMLContent, $sHTMLSidebarContent="" ) { |
|
47 | + public function _addHelpText( $sHTMLContent, $sHTMLSidebarContent = "" ) { |
|
48 | 48 | |
49 | - $this->oProp->aHelpTabText[] = "<div class='contextual-help-description'>" . $sHTMLContent . "</div>"; |
|
50 | - $this->oProp->aHelpTabTextSide[] = "<div class='contextual-help-description'>" . $sHTMLSidebarContent . "</div>"; |
|
49 | + $this->oProp->aHelpTabText[ ] = "<div class='contextual-help-description'>".$sHTMLContent."</div>"; |
|
50 | + $this->oProp->aHelpTabTextSide[ ] = "<div class='contextual-help-description'>".$sHTMLSidebarContent."</div>"; |
|
51 | 51 | |
52 | 52 | } |
53 | 53 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | * @remark This method just adds the given text into the class property. The actual registration will be performed with the `replyToRegisterHelpTabTextForMetaBox()` method. |
63 | 63 | * @internal |
64 | 64 | */ |
65 | - public function _addHelpTextForFormFields( $sFieldTitle, $sHelpText, $sHelpTextSidebar="" ) { |
|
65 | + public function _addHelpTextForFormFields( $sFieldTitle, $sHelpText, $sHelpTextSidebar = "" ) { |
|
66 | 66 | $this->_addHelpText( |
67 | - "<span class='contextual-help-tab-title'>" . $sFieldTitle . "</span> - " . PHP_EOL |
|
67 | + "<span class='contextual-help-tab-title'>".$sFieldTitle."</span> - ".PHP_EOL |
|
68 | 68 | . $sHelpText, |
69 | 69 | $sHelpTextSidebar |
70 | 70 | ); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function _replyToRegisterHelpTabTextForMetaBox() { |
82 | 82 | |
83 | 83 | // Check if the currently loaded page is of meta box page. |
84 | - if ( ! $this->_isInThePage() ) { return false; } |
|
84 | + if ( !$this->_isInThePage() ) { return false; } |
|
85 | 85 | |
86 | 86 | $this->_setHelpTab( // defined in the base class. |
87 | 87 | $this->oProp->sMetaBoxID, |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | */ |
101 | 101 | protected function _isInThePage() { |
102 | 102 | |
103 | - if ( ! $this->oProp->bIsAdmin ) { return false; } |
|
104 | - if ( ! in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
103 | + if ( !$this->oProp->bIsAdmin ) { return false; } |
|
104 | + if ( !in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
105 | 105 | return false; |
106 | 106 | } |
107 | - if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
107 | + if ( !in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
108 | 108 | return false; |
109 | 109 | } |
110 | 110 | return true; |
@@ -53,6 +53,10 @@ |
||
53 | 53 | */ |
54 | 54 | public $_sFormRegistrationHook = 'admin_enqueue_scripts'; |
55 | 55 | |
56 | + /** |
|
57 | + * @param AdminPageFramework_PageMetaBox_Model $oCaller |
|
58 | + * @param string $sClassName |
|
59 | + */ |
|
56 | 60 | function __construct( $oCaller, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='page_meta_box' ) { |
57 | 61 | |
58 | 62 | // this must be done after the menu class finishes building the menu with the _replyToBuildMenu() method. |
@@ -170,7 +170,7 @@ |
||
170 | 170 | * @since 3.5.3 |
171 | 171 | * @return string The found page slug. An empty string if not found. |
172 | 172 | * @remark Do not return `null` when not found as some framework methods check the retuened value with `isset()` and if null is given, `isset()` yields `false` while it does `true` for an emtpy string (''). |
173 | - */ |
|
173 | + */ |
|
174 | 174 | public function getCurrentPageSlug() { |
175 | 175 | return isset( $_GET[ 'page' ] ) |
176 | 176 | ? $_GET[ 'page' ] |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public $_sFormRegistrationHook = 'admin_enqueue_scripts'; |
55 | 55 | |
56 | - function __construct( $oCaller, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='page_meta_box' ) { |
|
56 | + function __construct( $oCaller, $sClassName, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework', $sStructureType = 'page_meta_box' ) { |
|
57 | 57 | |
58 | 58 | // this must be done after the menu class finishes building the menu with the _replyToBuildMenu() method. |
59 | 59 | add_action( 'admin_menu', array( $this, '_replyToSetUpProperties' ), 100 ); |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function _replyToSetUpProperties() { |
93 | 93 | |
94 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
94 | + if ( !isset( $_GET[ 'page' ] ) ) { |
|
95 | 95 | return; |
96 | 96 | } |
97 | 97 | |
98 | 98 | $this->oAdminPage = $this->_getOwnerObjectOfPage( $_GET[ 'page' ] ); |
99 | - if ( ! $this->oAdminPage ) { |
|
99 | + if ( !$this->oAdminPage ) { |
|
100 | 100 | return; |
101 | 101 | } |
102 | 102 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function _getScreenIDOfPage( $sPageSlug ) { |
129 | 129 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
130 | - ? $_oAdminPage->oProp->aPages[ $sPageSlug ][ '_page_hook' ] . ( is_network_admin() ? '-network' : '' ) |
|
130 | + ? $_oAdminPage->oProp->aPages[ $sPageSlug ][ '_page_hook' ].( is_network_admin() ? '-network' : '' ) |
|
131 | 131 | : ''; |
132 | 132 | } |
133 | 133 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @since 3.0.0 |
138 | 138 | * @return boolean Returns true if it is of framework's added page; otherwise, false. |
139 | 139 | */ |
140 | - public function isPageAdded( $sPageSlug='' ) { |
|
140 | + public function isPageAdded( $sPageSlug = '' ) { |
|
141 | 141 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
142 | 142 | ? $_oAdminPage->oProp->isPageAdded( $sPageSlug ) |
143 | 143 | : false; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | public function isCurrentTab( $sTabSlug ) { |
154 | 154 | |
155 | 155 | $_sCurrentPageSlug = $this->getElement( $_GET, 'page' ); |
156 | - if ( ! $_sCurrentPageSlug ) { |
|
156 | + if ( !$_sCurrentPageSlug ) { |
|
157 | 157 | return false; |
158 | 158 | } |
159 | 159 | $_sCurrentTabSlug = $this->getElement( |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function getDefaultInPageTab( $sPageSlug ) { |
205 | 205 | |
206 | - if ( ! $sPageSlug ) { |
|
206 | + if ( !$sPageSlug ) { |
|
207 | 207 | return ''; |
208 | 208 | } |
209 | 209 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function getOptionKey( $sPageSlug ) { |
220 | 220 | |
221 | - if ( ! $sPageSlug ) { |
|
221 | + if ( !$sPageSlug ) { |
|
222 | 222 | return ''; |
223 | 223 | } |
224 | 224 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $GLOBALS, |
245 | 245 | array( 'aAdminPageFramework', 'aPageClasses' ) |
246 | 246 | ); |
247 | - foreach( $_aPageClasses as $_oAdminPage ) { |
|
247 | + foreach ( $_aPageClasses as $_oAdminPage ) { |
|
248 | 248 | if ( $_oAdminPage->oProp->isPageAdded( $sPageSlug ) ) { |
249 | 249 | return $_oAdminPage; |
250 | 250 | } |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public $_sFormRegistrationHook = 'admin_enqueue_scripts'; |
55 | 55 | |
56 | - function __construct( $oCaller, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='page_meta_box' ) { |
|
56 | + function __construct( $oCaller, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='page_meta_box' ) { |
|
57 | 57 | |
58 | 58 | // this must be done after the menu class finishes building the menu with the _replyToBuildMenu() method. |
59 | 59 | add_action( 'admin_menu', array( $this, '_replyToSetUpProperties' ), 100 ); |
60 | - if ( is_network_admin() ) { |
|
60 | + if ( is_network_admin() ) { |
|
61 | 61 | add_action( 'network_admin_menu', array( $this, '_replyToSetUpProperties' ), 100 ); |
62 | 62 | } |
63 | 63 | |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function _replyToSetUpProperties() { |
93 | 93 | |
94 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
94 | + if ( ! isset( $_GET[ 'page' ] ) ) { |
|
95 | 95 | return; |
96 | 96 | } |
97 | 97 | |
98 | 98 | $this->oAdminPage = $this->_getOwnerObjectOfPage( $_GET[ 'page' ] ); |
99 | - if ( ! $this->oAdminPage ) { |
|
99 | + if ( ! $this->oAdminPage ) { |
|
100 | 100 | return; |
101 | 101 | } |
102 | 102 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @since 3.0.0 |
138 | 138 | * @return boolean Returns true if it is of framework's added page; otherwise, false. |
139 | 139 | */ |
140 | - public function isPageAdded( $sPageSlug='' ) { |
|
140 | + public function isPageAdded( $sPageSlug='' ) { |
|
141 | 141 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
142 | 142 | ? $_oAdminPage->oProp->isPageAdded( $sPageSlug ) |
143 | 143 | : false; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | public function isCurrentTab( $sTabSlug ) { |
154 | 154 | |
155 | 155 | $_sCurrentPageSlug = $this->getElement( $_GET, 'page' ); |
156 | - if ( ! $_sCurrentPageSlug ) { |
|
156 | + if ( ! $_sCurrentPageSlug ) { |
|
157 | 157 | return false; |
158 | 158 | } |
159 | 159 | $_sCurrentTabSlug = $this->getElement( |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function getDefaultInPageTab( $sPageSlug ) { |
205 | 205 | |
206 | - if ( ! $sPageSlug ) { |
|
206 | + if ( ! $sPageSlug ) { |
|
207 | 207 | return ''; |
208 | 208 | } |
209 | 209 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function getOptionKey( $sPageSlug ) { |
220 | 220 | |
221 | - if ( ! $sPageSlug ) { |
|
221 | + if ( ! $sPageSlug ) { |
|
222 | 222 | return ''; |
223 | 223 | } |
224 | 224 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
@@ -32,6 +32,8 @@ |
||
32 | 32 | * Sets up properties and hooks. |
33 | 33 | * |
34 | 34 | * @since 3.0.4 |
35 | + * @param string $sMetaBoxID |
|
36 | + * @param string $sTitle |
|
35 | 37 | */ |
36 | 38 | public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
37 | 39 |
@@ -277,7 +277,7 @@ |
||
277 | 277 | ); |
278 | 278 | } |
279 | 279 | |
280 | - /** |
|
280 | + /** |
|
281 | 281 | * Extracts meta box form fields options array from the given options array of an admin page. |
282 | 282 | * |
283 | 283 | * @since 3.5.6 |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @since 3.0.4 |
35 | 35 | */ |
36 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
36 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
37 | 37 | |
38 | 38 | // The property object needs to be done first before the parent constructor. |
39 | - $this->oProp = new AdminPageFramework_Property_MetaBox_Page( |
|
39 | + $this->oProp = new AdminPageFramework_Property_MetaBox_Page( |
|
40 | 40 | $this, |
41 | 41 | get_class( $this ), |
42 | 42 | $sCapability, |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | protected function _setUpValidationHooks( $oScreen ) { |
82 | 82 | |
83 | 83 | // Validation hooks |
84 | - foreach( $this->oProp->aPageSlugs as $_sIndexOrPageSlug => $_asTabArrayOrPageSlug ) { |
|
84 | + foreach ( $this->oProp->aPageSlugs as $_sIndexOrPageSlug => $_asTabArrayOrPageSlug ) { |
|
85 | 85 | |
86 | 86 | if ( is_string( $_asTabArrayOrPageSlug ) ) { |
87 | 87 | $_sPageSlug = $_asTabArrayOrPageSlug; |
88 | - add_filter( "validation_saved_options_without_dynamic_elements_{$_sPageSlug}", array( $this, '_replyToFilterPageOptionsWODynamicElements' ), 10, 2 ); // 3.4.1+ |
|
88 | + add_filter( "validation_saved_options_without_dynamic_elements_{$_sPageSlug}", array( $this, '_replyToFilterPageOptionsWODynamicElements' ), 10, 2 ); // 3.4.1+ |
|
89 | 89 | add_filter( "validation_{$_sPageSlug}", array( $this, '_replyToValidateOptions' ), 10, 4 ); |
90 | 90 | add_filter( "options_update_status_{$_sPageSlug}", array( $this, '_replyToModifyOptionsUpdateStatus' ) ); |
91 | 91 | continue; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | // At this point, the array key is the page slug. It means the user specified the tab(s). |
95 | 95 | $_sPageSlug = $_sIndexOrPageSlug; |
96 | 96 | $_aTabs = $_asTabArrayOrPageSlug; |
97 | - foreach( $_aTabs as $_sTabSlug ) { |
|
97 | + foreach ( $_aTabs as $_sTabSlug ) { |
|
98 | 98 | add_filter( "validation_{$_sPageSlug}_{$_sTabSlug}", array( $this, '_replyToValidateOptions' ), 10, 4 ); |
99 | 99 | add_filter( "validation_saved_options_without_dynamic_elements_{$_sPageSlug}_{$_sTabSlug}", array( $this, '_replyToFilterPageOptionsWODynamicElements' ), 10, 2 ); // 3.4.1+ |
100 | 100 | add_filter( "options_update_status_{$_sPageSlug}_{$_sTabSlug}", array( $this, '_replyToModifyOptionsUpdateStatus' ) ); |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | * @return void |
114 | 114 | * @callback action add_meta_boxes |
115 | 115 | */ |
116 | - public function _replyToAddMetaBox( $sPageHook='' ) { |
|
117 | - foreach( $this->oProp->aPageSlugs as $sKey => $_asPage ) { |
|
118 | - if ( is_string( $_asPage ) ) { |
|
116 | + public function _replyToAddMetaBox( $sPageHook = '' ) { |
|
117 | + foreach ( $this->oProp->aPageSlugs as $sKey => $_asPage ) { |
|
118 | + if ( is_string( $_asPage ) ) { |
|
119 | 119 | $this->_addMetaBox( $_asPage ); |
120 | 120 | continue; |
121 | 121 | } |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | * @return void |
131 | 131 | */ |
132 | 132 | private function _addMetaBoxes( $sPageSlug, $asPage ) { |
133 | - foreach( $this->oUtil->getAsArray( $asPage ) as $_sTabSlug ) { |
|
134 | - if ( ! $this->oProp->isCurrentTab( $_sTabSlug ) ) { |
|
133 | + foreach ( $this->oUtil->getAsArray( $asPage ) as $_sTabSlug ) { |
|
134 | + if ( !$this->oProp->isCurrentTab( $_sTabSlug ) ) { |
|
135 | 135 | continue; |
136 | 136 | } |
137 | 137 | $this->_addMetaBox( $sPageSlug ); |
@@ -147,12 +147,12 @@ discard block |
||
147 | 147 | */ |
148 | 148 | private function _addMetaBox( $sPageSlug ) { |
149 | 149 | add_meta_box( |
150 | - $this->oProp->sMetaBoxID, // id |
|
151 | - $this->oProp->sTitle, // title |
|
150 | + $this->oProp->sMetaBoxID, // id |
|
151 | + $this->oProp->sTitle, // title |
|
152 | 152 | array( $this, '_replyToPrintMetaBoxContents' ), // callback |
153 | 153 | $this->oProp->_getScreenIDOfPage( $sPageSlug ), // screen ID |
154 | - $this->oProp->sContext, // context |
|
155 | - $this->oProp->sPriority, // priority |
|
154 | + $this->oProp->sContext, // context |
|
155 | + $this->oProp->sPriority, // priority |
|
156 | 156 | null // argument (deprecated) |
157 | 157 | ); |
158 | 158 | } |
@@ -200,17 +200,17 @@ discard block |
||
200 | 200 | |
201 | 201 | $_aNewMetaBoxInputs = $this->oForm->getSubmittedData( $_POST ); |
202 | 202 | $_aOldMetaBoxInputs = $this->oUtil->castArrayContents( |
203 | - $this->oForm->getDataStructureFromAddedFieldsets(), // model |
|
203 | + $this->oForm->getDataStructureFromAddedFieldsets(), // model |
|
204 | 204 | $aOldPageOptions // data source |
205 | 205 | ); |
206 | 206 | |
207 | 207 | // Apply filters - third party scripts will have access to the input. |
208 | 208 | $_aNewMetaBoxInputsRaw = $_aNewMetaBoxInputs; // copy one for validation errors. |
209 | 209 | $_aNewMetaBoxInputs = call_user_func_array( |
210 | - array( $this, 'validate' ), // triggers __call() |
|
210 | + array( $this, 'validate' ), // triggers __call() |
|
211 | 211 | array( $_aNewMetaBoxInputs, $_aOldMetaBoxInputs, $this, $aSubmitInfo ) |
212 | 212 | ); // 3.5.3+ |
213 | - $_aNewMetaBoxInputs = $this->oUtil->addAndApplyFilters( |
|
213 | + $_aNewMetaBoxInputs = $this->oUtil->addAndApplyFilters( |
|
214 | 214 | $this, |
215 | 215 | "validation_{$this->oProp->sClassName}", |
216 | 216 | $_aNewMetaBoxInputs, |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | public function _replyToModifyOptionsUpdateStatus( $aStatus ) { |
247 | 247 | |
248 | - if ( ! $this->hasFieldError() ) { |
|
248 | + if ( !$this->hasFieldError() ) { |
|
249 | 249 | return $aStatus; |
250 | 250 | } |
251 | 251 | return array( |
@@ -268,11 +268,11 @@ discard block |
||
268 | 268 | public function _replyToGetSavedFormData() { |
269 | 269 | $_aPageOptions = $this->oUtil->addAndApplyFilter( |
270 | 270 | $this, // the caller factory object |
271 | - 'options_' . $this->oProp->sClassName, |
|
271 | + 'options_'.$this->oProp->sClassName, |
|
272 | 272 | $this->oProp->oAdminPage->oProp->aOptions |
273 | 273 | ); |
274 | 274 | return $this->oUtil->castArrayContents( |
275 | - $this->oForm->getDataStructureFromAddedFieldsets(), // model |
|
275 | + $this->oForm->getDataStructureFromAddedFieldsets(), // model |
|
276 | 276 | $_aPageOptions // data source |
277 | 277 | ); |
278 | 278 | } |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | private function _getPageMetaBoxOptionsFromPageOptions( array $aPageOptions, array $aFieldsets ) { |
289 | 289 | |
290 | 290 | $_aOptions = array(); |
291 | - foreach( $aFieldsets as $_sSectionID => $_aFieldsets ) { |
|
292 | - if ( '_default' === $_sSectionID ) { |
|
293 | - foreach( $_aFieldsets as $_aField ) { |
|
291 | + foreach ( $aFieldsets as $_sSectionID => $_aFieldsets ) { |
|
292 | + if ( '_default' === $_sSectionID ) { |
|
293 | + foreach ( $_aFieldsets as $_aField ) { |
|
294 | 294 | if ( array_key_exists( $_aField[ 'field_id' ], $aPageOptions ) ) { |
295 | 295 | $_aOptions[ $_aField[ 'field_id' ] ] = $aPageOptions[ $_aField[ 'field_id' ] ]; |
296 | 296 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @since 3.0.4 |
35 | 35 | */ |
36 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
36 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
37 | 37 | |
38 | 38 | // The property object needs to be done first before the parent constructor. |
39 | 39 | $this->oProp = new AdminPageFramework_Property_MetaBox_Page( |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | // Validation hooks |
84 | 84 | foreach( $this->oProp->aPageSlugs as $_sIndexOrPageSlug => $_asTabArrayOrPageSlug ) { |
85 | 85 | |
86 | - if ( is_string( $_asTabArrayOrPageSlug ) ) { |
|
86 | + if ( is_string( $_asTabArrayOrPageSlug ) ) { |
|
87 | 87 | $_sPageSlug = $_asTabArrayOrPageSlug; |
88 | 88 | add_filter( "validation_saved_options_without_dynamic_elements_{$_sPageSlug}", array( $this, '_replyToFilterPageOptionsWODynamicElements' ), 10, 2 ); // 3.4.1+ |
89 | 89 | add_filter( "validation_{$_sPageSlug}", array( $this, '_replyToValidateOptions' ), 10, 4 ); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function _replyToAddMetaBox( $sPageHook='' ) { |
117 | 117 | foreach( $this->oProp->aPageSlugs as $sKey => $_asPage ) { |
118 | - if ( is_string( $_asPage ) ) { |
|
118 | + if ( is_string( $_asPage ) ) { |
|
119 | 119 | $this->_addMetaBox( $_asPage ); |
120 | 120 | continue; |
121 | 121 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | private function _addMetaBoxes( $sPageSlug, $asPage ) { |
133 | 133 | foreach( $this->oUtil->getAsArray( $asPage ) as $_sTabSlug ) { |
134 | - if ( ! $this->oProp->isCurrentTab( $_sTabSlug ) ) { |
|
134 | + if ( ! $this->oProp->isCurrentTab( $_sTabSlug ) ) { |
|
135 | 135 | continue; |
136 | 136 | } |
137 | 137 | $this->_addMetaBox( $sPageSlug ); |
@@ -112,6 +112,7 @@ |
||
112 | 112 | * |
113 | 113 | * @internal |
114 | 114 | * @since 3.5.10 |
115 | + * @param string $sMenuKey |
|
115 | 116 | * @return void |
116 | 117 | */ |
117 | 118 | private function _removeAddNewSidebarSubMenu( $sMenuKey, $sPostTypeSlug ) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $this->_removeAddNewSidebarSubMenu( |
77 | 77 | is_string( $_bsShowInMenu ) |
78 | 78 | ? $_bsShowInMenu |
79 | - : 'edit.php?post_type=' . $this->oProp->sPostType, |
|
79 | + : 'edit.php?post_type='.$this->oProp->sPostType, |
|
80 | 80 | $this->oProp->sPostType |
81 | 81 | ); |
82 | 82 | |
@@ -117,20 +117,20 @@ discard block |
||
117 | 117 | private function _removeAddNewSidebarSubMenu( $sMenuKey, $sPostTypeSlug ) { |
118 | 118 | |
119 | 119 | // Remove the default post type menu item. |
120 | - if ( ! isset( $GLOBALS['submenu'][ $sMenuKey ] ) ) { |
|
120 | + if ( !isset( $GLOBALS[ 'submenu' ][ $sMenuKey ] ) ) { |
|
121 | 121 | // logged-in users of an insufficient access level don't have the menu to be registered. |
122 | 122 | return; |
123 | 123 | } |
124 | 124 | |
125 | - foreach ( $GLOBALS['submenu'][ $sMenuKey ] as $_iIndex => $_aSubMenu ) { |
|
125 | + foreach ( $GLOBALS[ 'submenu' ][ $sMenuKey ] as $_iIndex => $_aSubMenu ) { |
|
126 | 126 | |
127 | - if ( ! isset( $_aSubMenu[ 2 ] ) ) { |
|
127 | + if ( !isset( $_aSubMenu[ 2 ] ) ) { |
|
128 | 128 | continue; |
129 | 129 | } |
130 | 130 | |
131 | 131 | // Remove the default Add New entry. |
132 | - if ( 'post-new.php?post_type=' . $sPostTypeSlug === $_aSubMenu[ 2 ] ) { |
|
133 | - unset( $GLOBALS['submenu'][ $sMenuKey ][ $_iIndex ] ); |
|
132 | + if ( 'post-new.php?post_type='.$sPostTypeSlug === $_aSubMenu[ 2 ] ) { |
|
133 | + unset( $GLOBALS[ 'submenu' ][ $sMenuKey ][ $_iIndex ] ); |
|
134 | 134 | continue; |
135 | 135 | } |
136 | 136 | |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function _replyToAddAuthorTableFilter() { |
147 | 147 | |
148 | - if ( ! $this->oProp->bEnableAuthorTableFileter ) { |
|
148 | + if ( !$this->oProp->bEnableAuthorTableFileter ) { |
|
149 | 149 | return; |
150 | 150 | } |
151 | 151 | |
152 | 152 | if ( |
153 | - ! ( isset( $_GET['post_type'] ) && post_type_exists( $_GET['post_type'] ) |
|
154 | - && in_array( strtolower( $_GET['post_type'] ), array( $this->oProp->sPostType ) ) ) |
|
153 | + !( isset( $_GET[ 'post_type' ] ) && post_type_exists( $_GET[ 'post_type' ] ) |
|
154 | + && in_array( strtolower( $_GET[ 'post_type' ] ), array( $this->oProp->sPostType ) ) ) |
|
155 | 155 | ) { |
156 | 156 | return; |
157 | 157 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | 'show_option_all' => $this->oMsg->get( 'show_all_authors' ), |
162 | 162 | 'show_option_none' => false, |
163 | 163 | 'name' => 'author', |
164 | - 'selected' => ! empty( $_GET[ 'author' ] ) |
|
164 | + 'selected' => !empty( $_GET[ 'author' ] ) |
|
165 | 165 | ? $_GET[ 'author' ] |
166 | 166 | : 0, |
167 | 167 | 'include_selected' => false, |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | return; |
188 | 188 | } |
189 | 189 | |
190 | - foreach ( get_object_taxonomies( $GLOBALS['typenow'] ) as $_sTaxonomySulg ) { |
|
190 | + foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $_sTaxonomySulg ) { |
|
191 | 191 | |
192 | - if ( ! in_array( $_sTaxonomySulg, $this->oProp->aTaxonomyTableFilters ) ) { |
|
192 | + if ( !in_array( $_sTaxonomySulg, $this->oProp->aTaxonomyTableFilters ) ) { |
|
193 | 193 | continue; |
194 | 194 | } |
195 | 195 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | // Echo the drop down list based on the passed array argument. |
204 | 204 | wp_dropdown_categories( |
205 | 205 | array( |
206 | - 'show_option_all' => $this->oMsg->get( 'show_all' ) . ' ' . $_oTaxonomy->label, |
|
206 | + 'show_option_all' => $this->oMsg->get( 'show_all' ).' '.$_oTaxonomy->label, |
|
207 | 207 | 'taxonomy' => $_sTaxonomySulg, |
208 | 208 | 'name' => $_oTaxonomy->name, |
209 | 209 | 'orderby' => 'name', |
@@ -223,24 +223,24 @@ discard block |
||
223 | 223 | * |
224 | 224 | * @internal |
225 | 225 | */ |
226 | - public function _replyToGetTableFilterQueryForTaxonomies( $oQuery=null ) { |
|
226 | + public function _replyToGetTableFilterQueryForTaxonomies( $oQuery = null ) { |
|
227 | 227 | |
228 | 228 | if ( 'edit.php' != $this->oProp->sPageNow ) { |
229 | 229 | return $oQuery; |
230 | 230 | } |
231 | 231 | |
232 | - if ( ! isset( $GLOBALS['typenow'] ) ) { |
|
232 | + if ( !isset( $GLOBALS[ 'typenow' ] ) ) { |
|
233 | 233 | return $oQuery; |
234 | 234 | } |
235 | 235 | |
236 | - foreach ( get_object_taxonomies( $GLOBALS['typenow'] ) as $sTaxonomySlug ) { |
|
236 | + foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $sTaxonomySlug ) { |
|
237 | 237 | |
238 | - if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
238 | + if ( !in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | |
242 | 242 | $sVar = &$oQuery->query_vars[ $sTaxonomySlug ]; |
243 | - if ( ! isset( $sVar ) ) { |
|
243 | + if ( !isset( $sVar ) ) { |
|
244 | 244 | continue; |
245 | 245 | } |
246 | 246 | |
@@ -268,14 +268,14 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | // If the screen icon url is specified |
271 | - if ( isset( $this->oProp->aPostTypeArgs['screen_icon'] ) && $this->oProp->aPostTypeArgs['screen_icon'] ) { |
|
272 | - $this->oProp->sStyle .= $this->_getStylesForPostTypeScreenIcon( $this->oProp->aPostTypeArgs['screen_icon'] ); |
|
271 | + if ( isset( $this->oProp->aPostTypeArgs[ 'screen_icon' ] ) && $this->oProp->aPostTypeArgs[ 'screen_icon' ] ) { |
|
272 | + $this->oProp->sStyle .= $this->_getStylesForPostTypeScreenIcon( $this->oProp->aPostTypeArgs[ 'screen_icon' ] ); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | $this->oProp->sStyle = $this->oUtil->addAndApplyFilters( $this, "style_{$this->oProp->sClassName}", $this->oProp->sStyle ); |
276 | 276 | |
277 | 277 | // Print out the filtered styles. |
278 | - if ( ! empty( $this->oProp->sStyle ) ) { |
|
278 | + if ( !empty( $this->oProp->sStyle ) ) { |
|
279 | 279 | echo "<style type='text/css' id='admin-page-framework-style-post-type'>" |
280 | 280 | . $this->oProp->sStyle |
281 | 281 | . "</style>"; |
@@ -326,10 +326,10 @@ discard block |
||
326 | 326 | */ |
327 | 327 | public function _replyToFilterPostTypeContent( $sContent ) { |
328 | 328 | |
329 | - if ( ! is_singular() ) { |
|
329 | + if ( !is_singular() ) { |
|
330 | 330 | return $sContent; |
331 | 331 | } |
332 | - if ( ! is_main_query() ) { |
|
332 | + if ( !is_main_query() ) { |
|
333 | 333 | return $sContent; |
334 | 334 | } |
335 | 335 | global $post; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @package AdminPageFramework |
18 | 18 | * @subpackage PostType |
19 | 19 | */ |
20 | -abstract class AdminPageFramework_PostType_View extends AdminPageFramework_PostType_Model { |
|
20 | +abstract class AdminPageFramework_PostType_View extends AdminPageFramework_PostType_Model { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Sets up hooks. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | parent::__construct( $oProp ); |
31 | 31 | |
32 | - if ( $this->_isInThePage() ) { |
|
32 | + if ( $this->_isInThePage() ) { |
|
33 | 33 | |
34 | 34 | // Table filters |
35 | 35 | add_action( 'restrict_manage_posts', array( $this, '_replyToAddAuthorTableFilter' ) ); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | foreach ( $GLOBALS['submenu'][ $sMenuKey ] as $_iIndex => $_aSubMenu ) { |
126 | 126 | |
127 | - if ( ! isset( $_aSubMenu[ 2 ] ) ) { |
|
127 | + if ( ! isset( $_aSubMenu[ 2 ] ) ) { |
|
128 | 128 | continue; |
129 | 129 | } |
130 | 130 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function _replyToAddAuthorTableFilter() { |
147 | 147 | |
148 | - if ( ! $this->oProp->bEnableAuthorTableFileter ) { |
|
148 | + if ( ! $this->oProp->bEnableAuthorTableFileter ) { |
|
149 | 149 | return; |
150 | 150 | } |
151 | 151 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function _replyToAddTaxonomyTableFilter() { |
179 | 179 | |
180 | - if ( $GLOBALS[ 'typenow' ] != $this->oProp->sPostType ) { |
|
180 | + if ( $GLOBALS[ 'typenow' ] != $this->oProp->sPostType ) { |
|
181 | 181 | return; |
182 | 182 | } |
183 | 183 | |
@@ -225,22 +225,22 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function _replyToGetTableFilterQueryForTaxonomies( $oQuery=null ) { |
227 | 227 | |
228 | - if ( 'edit.php' != $this->oProp->sPageNow ) { |
|
228 | + if ( 'edit.php' != $this->oProp->sPageNow ) { |
|
229 | 229 | return $oQuery; |
230 | 230 | } |
231 | 231 | |
232 | - if ( ! isset( $GLOBALS['typenow'] ) ) { |
|
232 | + if ( ! isset( $GLOBALS['typenow'] ) ) { |
|
233 | 233 | return $oQuery; |
234 | 234 | } |
235 | 235 | |
236 | 236 | foreach ( get_object_taxonomies( $GLOBALS['typenow'] ) as $sTaxonomySlug ) { |
237 | 237 | |
238 | - if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
238 | + if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | |
242 | 242 | $sVar = &$oQuery->query_vars[ $sTaxonomySlug ]; |
243 | - if ( ! isset( $sVar ) ) { |
|
243 | + if ( ! isset( $sVar ) ) { |
|
244 | 244 | continue; |
245 | 245 | } |
246 | 246 |
@@ -107,6 +107,7 @@ |
||
107 | 107 | * |
108 | 108 | * @since 3.0.0 |
109 | 109 | * @internal |
110 | + * @param boolean $bRenderTableRow |
|
110 | 111 | * @return string |
111 | 112 | */ |
112 | 113 | private function _getFieldsOutput( $iTermID, $bRenderTableRow ) { |
@@ -69,7 +69,7 @@ |
||
69 | 69 | return "{$_aField['field_id']}{$_sKey}"; |
70 | 70 | } |
71 | 71 | |
72 | - /** |
|
72 | + /** |
|
73 | 73 | * Adds input fields |
74 | 74 | * |
75 | 75 | * @internal |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | '', |
49 | 49 | "[{$_sKey}]" |
50 | 50 | ); |
51 | - return $_aField['field_id'] . $_sKey; |
|
51 | + return $_aField[ 'field_id' ].$_sKey; |
|
52 | 52 | |
53 | 53 | } |
54 | 54 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | '', |
67 | 67 | "|{$_sKey}" |
68 | 68 | ); |
69 | - return "{$_aField['field_id']}{$_sKey}"; |
|
69 | + return "{$_aField[ 'field_id' ]}{$_sKey}"; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $_aOutput = array(); |
115 | 115 | |
116 | 116 | // Set nonce. |
117 | - $_aOutput[] = wp_nonce_field( |
|
117 | + $_aOutput[ ] = wp_nonce_field( |
|
118 | 118 | $this->oProp->sClassHash, |
119 | 119 | $this->oProp->sClassHash, |
120 | 120 | true, |
@@ -125,17 +125,17 @@ discard block |
||
125 | 125 | $this->_setOptionArray( $iTermID, $this->oProp->sOptionKey ); |
126 | 126 | |
127 | 127 | // Get the field outputs |
128 | - $_aOutput[] = $this->oForm->get(); |
|
128 | + $_aOutput[ ] = $this->oForm->get(); |
|
129 | 129 | |
130 | 130 | // Filter the output |
131 | 131 | $_sOutput = $this->oUtil->addAndApplyFilters( |
132 | 132 | $this, |
133 | - 'content_' . $this->oProp->sClassName, |
|
133 | + 'content_'.$this->oProp->sClassName, |
|
134 | 134 | $this->content( implode( PHP_EOL, $_aOutput ) ) |
135 | 135 | ); |
136 | 136 | |
137 | 137 | // Do action |
138 | - $this->oUtil->addAndDoActions( $this, 'do_' . $this->oProp->sClassName, $this ); |
|
138 | + $this->oUtil->addAndDoActions( $this, 'do_'.$this->oProp->sClassName, $this ); |
|
139 | 139 | |
140 | 140 | return $_sOutput; |
141 | 141 | |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | public function _replyToPrintColumnCell( $vValue, $sColumnSlug, $sTermID ) { |
155 | 155 | |
156 | 156 | $_sCellHTML = ''; |
157 | - if ( isset( $_GET['taxonomy'] ) && $_GET['taxonomy'] ) { |
|
158 | - $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$_GET['taxonomy']}", $vValue, $sColumnSlug, $sTermID ); |
|
157 | + if ( isset( $_GET[ 'taxonomy' ] ) && $_GET[ 'taxonomy' ] ) { |
|
158 | + $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$_GET[ 'taxonomy' ]}", $vValue, $sColumnSlug, $sTermID ); |
|
159 | 159 | } |
160 | 160 | $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$this->oProp->sClassName}", $_sCellHTML, $sColumnSlug, $sTermID ); |
161 | 161 | $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$this->oProp->sClassName}_{$sColumnSlug}", $_sCellHTML, $sTermID ); // 3.0.2+ |