@@ -74,6 +74,8 @@ discard block |
||
74 | 74 | * <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> |
75 | 75 | * </ul> |
76 | 76 | * @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. |
77 | + * @param string $sIcon16x16 |
|
78 | + * @param integer $iMenuPosition |
|
77 | 79 | * @return void |
78 | 80 | */ |
79 | 81 | public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16=null, $iMenuPosition=null ) { |
@@ -96,6 +98,7 @@ discard block |
||
96 | 98 | * |
97 | 99 | * @since 2.0.0 |
98 | 100 | * @internal |
101 | + * @param string $sMenuLabel |
|
99 | 102 | * @return void|string Returns the associated slug string, if true. |
100 | 103 | */ |
101 | 104 | private function _isBuiltInMenuItem( $sMenuLabel ) { |
@@ -160,9 +163,6 @@ discard block |
||
160 | 163 | * @since 3.0.0 Changed the scope to public. |
161 | 164 | * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
162 | 165 | * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
163 | - * @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. |
|
164 | - * @param array $aSubMenuItem2 (optional) a second sub-menu array. |
|
165 | - * @param array $_and_more (optional) a third and add items as many as necessary with next parameters. |
|
166 | 166 | * @access public |
167 | 167 | * @return void |
168 | 168 | */ |
@@ -250,20 +250,20 @@ |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
253 | - * Adds the given link into the menu on the left sidebar of the administration panel. |
|
254 | - * |
|
255 | - * @since 2.0.0 |
|
256 | - * @since 3.0.0 Changed the scope to public from protected. |
|
257 | - * @since 3.5.0 Changed the scope to public as it was still protected. |
|
258 | - * @param string the menu title. |
|
259 | - * @param string the URL linked to the menu. |
|
260 | - * @param string (optional) the <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">access level</a>. |
|
261 | - * @param string (optional) the order number. The larger it is, the lower the position it gets. |
|
262 | - * @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. |
|
263 | - * @access public |
|
264 | - * @return void |
|
265 | - * @internal |
|
266 | - */ |
|
253 | + * Adds the given link into the menu on the left sidebar of the administration panel. |
|
254 | + * |
|
255 | + * @since 2.0.0 |
|
256 | + * @since 3.0.0 Changed the scope to public from protected. |
|
257 | + * @since 3.5.0 Changed the scope to public as it was still protected. |
|
258 | + * @param string the menu title. |
|
259 | + * @param string the URL linked to the menu. |
|
260 | + * @param string (optional) the <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">access level</a>. |
|
261 | + * @param string (optional) the order number. The larger it is, the lower the position it gets. |
|
262 | + * @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. |
|
263 | + * @access public |
|
264 | + * @return void |
|
265 | + * @internal |
|
266 | + */ |
|
267 | 267 | public function addSubMenuLink( array $aSubMenuLink ) { |
268 | 268 | |
269 | 269 | // If required keys are not set, return. |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @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. |
77 | 77 | * @return void |
78 | 78 | */ |
79 | - public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16=null, $iMenuPosition=null ) { |
|
79 | + public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16 = null, $iMenuPosition = null ) { |
|
80 | 80 | |
81 | 81 | $sRootMenuLabel = trim( $sRootMenuLabel ); |
82 | 82 | $_sSlug = $this->_isBuiltInMenuItem( $sRootMenuLabel ); // if true, this method returns the slug |
@@ -267,16 +267,16 @@ discard block |
||
267 | 267 | public function addSubMenuLink( array $aSubMenuLink ) { |
268 | 268 | |
269 | 269 | // If required keys are not set, return. |
270 | - if ( ! isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
270 | + if ( !isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 | |
274 | 274 | // If the set URL is not valid, return. |
275 | - if ( ! filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
275 | + if ( !filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
276 | 276 | return; |
277 | 277 | } |
278 | 278 | |
279 | - $_oFormatter = new AdminPageFramework_Format_SubMenuLink( |
|
279 | + $_oFormatter = new AdminPageFramework_Format_SubMenuLink( |
|
280 | 280 | $aSubMenuLink, |
281 | 281 | $this, |
282 | 282 | count( $this->oProp->aPages ) + 1 |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function addSubMenuPage( array $aSubMenuPage ) { |
336 | 336 | |
337 | - if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
337 | + if ( !isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
338 | 338 | return; |
339 | 339 | } |
340 | 340 | |
341 | - $_oFormatter = new AdminPageFramework_Format_SubMenuPage( |
|
341 | + $_oFormatter = new AdminPageFramework_Format_SubMenuPage( |
|
342 | 342 | $aSubMenuPage, |
343 | 343 | $this, |
344 | 344 | count( $this->oProp->aPages ) + 1 |
@@ -267,12 +267,12 @@ discard block |
||
267 | 267 | public function addSubMenuLink( array $aSubMenuLink ) { |
268 | 268 | |
269 | 269 | // If required keys are not set, return. |
270 | - if ( ! isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
270 | + if ( ! isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 | |
274 | 274 | // If the set URL is not valid, return. |
275 | - if ( ! filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
275 | + if ( ! filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
276 | 276 | return; |
277 | 277 | } |
278 | 278 | |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function addSubMenuPage( array $aSubMenuPage ) { |
336 | 336 | |
337 | - if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
337 | + if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
338 | 338 | return; |
339 | 339 | } |
340 | 340 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @package AdminPageFramework |
11 | 11 | */ |
12 | 12 | |
13 | -if ( ! class_exists( 'AdminPageFramework_Registry', false ) ) : |
|
13 | +if ( !class_exists( 'AdminPageFramework_Registry', false ) ) : |
|
14 | 14 | /** |
15 | 15 | * Facilitates WordPress plugin and theme development. |
16 | 16 | * |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | final class AdminPageFramework_Registry extends AdminPageFramework_Registry_Base { |
62 | 62 | |
63 | 63 | const TEXT_DOMAIN = 'admin-page-framework'; |
64 | - const TEXT_DOMAIN_PATH = '/language'; // not used at the moment |
|
64 | + const TEXT_DOMAIN_PATH = '/language'; // not used at the moment |
|
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Indicates whether the framework is loaded from the minified version or not. |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | * Sets up static properties. |
104 | 104 | * @return void |
105 | 105 | */ |
106 | - static public function setUp( $sFilePath=__FILE__ ) { |
|
106 | + static public function setUp( $sFilePath = __FILE__ ) { |
|
107 | 107 | |
108 | 108 | self::$sFilePath = $sFilePath; |
109 | 109 | self::$sDirPath = dirname( self::$sFilePath ); |
110 | - self::$sIncludeClassListPath = self::$sDirPath . '/admin-page-framework-include-class-list.php'; |
|
110 | + self::$sIncludeClassListPath = self::$sDirPath.'/admin-page-framework-include-class-list.php'; |
|
111 | 111 | self::$aClassFiles = self::_getClassFilePathList( self::$sIncludeClassListPath ); |
112 | 112 | self::$sAutoLoaderPath = isset( self::$aClassFiles[ 'AdminPageFramework_RegisterClasses' ] ) |
113 | 113 | ? self::$aClassFiles[ 'AdminPageFramework_RegisterClasses' ] |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @return array |
123 | 123 | */ |
124 | 124 | static private function _getClassFilePathList( $sInclusionClassListPath ) { |
125 | - $aClassFiles = array(); // this will be updated if the inclusion below is successful. |
|
125 | + $aClassFiles = array(); // this will be updated if the inclusion below is successful. |
|
126 | 126 | include( $sInclusionClassListPath ); |
127 | 127 | return $aClassFiles; |
128 | 128 | } |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | */ |
136 | 136 | static public function getVersion() { |
137 | 137 | |
138 | - if ( ! isset( self::$sAutoLoaderPath ) ) { |
|
139 | - trigger_error( self::NAME . ': ' . ' : ' . sprintf( __( 'The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework' ), __METHOD__, 'setUp()' ), E_USER_WARNING ); |
|
138 | + if ( !isset( self::$sAutoLoaderPath ) ) { |
|
139 | + trigger_error( self::NAME.': '.' : '.sprintf( __( 'The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework' ), __METHOD__, 'setUp()' ), E_USER_WARNING ); |
|
140 | 140 | return self::VERSION; |
141 | 141 | } |
142 | - $_aMinifiedVesionSuffix = array( |
|
142 | + $_aMinifiedVesionSuffix = array( |
|
143 | 143 | 0 => '', |
144 | 144 | 1 => '.min', |
145 | 145 | ); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | endif; |
170 | 170 | |
171 | -if ( ! class_exists( 'AdminPageFramework_Bootstrap', false ) ) : |
|
171 | +if ( !class_exists( 'AdminPageFramework_Bootstrap', false ) ) : |
|
172 | 172 | /** |
173 | 173 | * Loads the Admin Page Framework library. |
174 | 174 | * |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function __construct( $sLibraryPath ) { |
191 | 191 | |
192 | - if ( ! $this->_isLoadable() ) { |
|
192 | + if ( !$this->_isLoadable() ) { |
|
193 | 193 | return; |
194 | 194 | } |
195 | 195 |
@@ -158,7 +158,7 @@ |
||
158 | 158 | . $this->getFrameworkNameVersion() |
159 | 159 | . ' (' |
160 | 160 | . $this->oMsg->get( 'debug_info_will_be_disabled' ) |
161 | - . ')' |
|
161 | + . ')' |
|
162 | 162 | . '</span>', |
163 | 163 | 'attributes' => array( |
164 | 164 | 'container' => array( |
@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
19 | 19 | |
20 | - public $aArguments = array( |
|
20 | + public $aArguments = array( |
|
21 | 21 | 'title' => null, |
22 | 22 | 'tag' => null, |
23 | 23 | 'section_index' => null, |
24 | 24 | |
25 | 25 | 'sectionset' => array(), |
26 | 26 | ); |
27 | - public $aFieldsets = array(); |
|
27 | + public $aFieldsets = array(); |
|
28 | 28 | public $aSavedData = array(); |
29 | 29 | public $aFieldErrors = array(); |
30 | 30 | public $aFieldTypeDefinitions = array(); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_SectionTitle`. |
91 | 91 | * @return string The section title output. |
92 | 92 | */ |
93 | - protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex=null, $aFieldTypeDefinitions=array(), $aCollapsible=array() ) { |
|
93 | + protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex = null, $aFieldTypeDefinitions = array(), $aCollapsible = array() ) { |
|
94 | 94 | |
95 | 95 | $_aSectionTitleFieldset = $this->_getSectionTitleField( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
96 | 96 | $_sFieldsInSectionTitle = $this->_getFieldsetsOutputInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $_bHasOtherFields = $_sFieldsInSectionTitle |
101 | 101 | ? ' has-fields' |
102 | 102 | : ''; |
103 | - $_sOutput = $_sTitle . $_sFieldsInSectionTitle; |
|
103 | + $_sOutput = $_sTitle.$_sFieldsInSectionTitle; |
|
104 | 104 | return $_sOutput |
105 | 105 | ? "<div class='section-title-height-fixer'></div>" |
106 | 106 | . "<div class='section-title-outer-container'>" // 3.8.13+ For vertical alignment |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @return string |
133 | 133 | */ |
134 | 134 | private function _getToolTip( $_aSectionset ) { |
135 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $this->aArguments[ 'section_index' ]; |
|
135 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$this->aArguments[ 'section_index' ]; |
|
136 | 136 | $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
137 | 137 | $_aSectionset[ 'tip' ], |
138 | 138 | $_sSectionTitleTagID |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | */ |
148 | 148 | private function _getDebugInfo( $aSectionset ) { |
149 | 149 | |
150 | - if ( ! $aSectionset[ 'show_debug_info' ] ) { |
|
150 | + if ( !$aSectionset[ 'show_debug_info' ] ) { |
|
151 | 151 | return ''; |
152 | 152 | } |
153 | - $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
153 | + $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
154 | 154 | array( |
155 | 155 | 'title' => $this->oMsg->get( 'section_arguments' ), |
156 | 156 | 'dash-icon' => 'dashicons-info', |
157 | - 'icon_alt_text' => '[' . $this->oMsg->get( 'debug' ) . ' ]', |
|
157 | + 'icon_alt_text' => '['.$this->oMsg->get( 'debug' ).' ]', |
|
158 | 158 | 'content' => AdminPageFramework_Debug::getDetails( $aSectionset ) |
159 | 159 | . '<span class="admin-page-framework-info">' |
160 | 160 | . $this->getFrameworkNameVersion() |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | ), |
169 | 169 | ) |
170 | 170 | ), |
171 | - $aSectionset[ '_section_path' ] . '_debug' |
|
171 | + $aSectionset[ '_section_path' ].'_debug' |
|
172 | 172 | ); |
173 | 173 | return $_oToolTip->get(); |
174 | 174 | |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
198 | 198 | |
199 | 199 | $_sOutput = ''; |
200 | - foreach( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
|
201 | - if ( empty( $_aFieldset ) ) { |
|
200 | + foreach ( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
|
201 | + if ( empty( $_aFieldset ) ) { |
|
202 | 202 | continue; |
203 | 203 | } |
204 | 204 | $_sOutput .= $this->getFieldsetOutput( $_aFieldset ); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | private function _getFieldsetsInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
215 | 215 | |
216 | 216 | $_aFieldsetsInSectionTitle = array(); |
217 | - foreach( $aFieldsets as $_aFieldset ) { |
|
217 | + foreach ( $aFieldsets as $_aFieldset ) { |
|
218 | 218 | |
219 | 219 | if ( 'section_title' !== $_aFieldset[ 'placement' ] ) { |
220 | 220 | continue; |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $iSectionIndex, |
226 | 226 | $aFieldTypeDefinitions |
227 | 227 | ); |
228 | - $_aFieldsetsInSectionTitle[] = $_oFieldsetOutputFormatter->get(); |
|
228 | + $_aFieldsetsInSectionTitle[ ] = $_oFieldsetOutputFormatter->get(); |
|
229 | 229 | |
230 | 230 | } |
231 | 231 | return $_aFieldsetsInSectionTitle; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
246 | 246 | |
247 | - foreach( $aFieldsets as $_aFieldset ) { |
|
247 | + foreach ( $aFieldsets as $_aFieldset ) { |
|
248 | 248 | |
249 | 249 | if ( 'section_title' !== $_aFieldset[ 'type' ] ) { |
250 | 250 | continue; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @since 3.7.0 Changed the name from `AdminPageFramework_FormPart_SectionTitle`. |
16 | 16 | * @internal |
17 | 17 | */ |
18 | -class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
|
18 | +class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
|
19 | 19 | |
20 | 20 | public $aArguments = array( |
21 | 21 | 'title' => null, |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | * @since 3.8.0 |
195 | 195 | * @internal |
196 | 196 | */ |
197 | - private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
197 | + private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
198 | 198 | |
199 | 199 | $_sOutput = ''; |
200 | 200 | foreach( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
201 | - if ( empty( $_aFieldset ) ) { |
|
201 | + if ( empty( $_aFieldset ) ) { |
|
202 | 202 | continue; |
203 | 203 | } |
204 | 204 | $_sOutput .= $this->getFieldsetOutput( $_aFieldset ); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_SectionTitle`. |
243 | 243 | * @return array|void |
244 | 244 | */ |
245 | - private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
245 | + private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
246 | 246 | |
247 | 247 | foreach( $aFieldsets as $_aFieldset ) { |
248 | 248 |
@@ -29,38 +29,38 @@ discard block |
||
29 | 29 | static public $aStructure = array( |
30 | 30 | |
31 | 31 | // Required Keys |
32 | - 'field_id' => null, // (string) |
|
33 | - 'section_id' => null, // (string) |
|
32 | + 'field_id' => null, // (string) |
|
33 | + 'section_id' => null, // (string) |
|
34 | 34 | |
35 | 35 | // Optional Keys |
36 | - 'type' => null, // (string) (3.8.0+ Became okay to omit.) |
|
37 | - 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
38 | - 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | - 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
40 | - 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
41 | - 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
36 | + 'type' => null, // (string) (3.8.0+ Became okay to omit.) |
|
37 | + 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
38 | + 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | + 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
40 | + 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
41 | + 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
42 | 42 | 'capability' => null, |
43 | 43 | 'title' => null, |
44 | 44 | 'tip' => null, |
45 | 45 | 'description' => null, |
46 | - 'error_message' => null, // error message for the field |
|
46 | + 'error_message' => null, // error message for the field |
|
47 | 47 | 'before_label' => null, |
48 | 48 | 'after_label' => null, |
49 | 49 | 'if' => true, |
50 | - 'order' => null, // do not set the default number here for this key. |
|
50 | + 'order' => null, // do not set the default number here for this key. |
|
51 | 51 | 'default' => null, |
52 | 52 | 'value' => null, |
53 | - 'help' => null, // 2.1.0 |
|
54 | - 'help_aside' => null, // 2.1.0 |
|
55 | - 'repeatable' => null, // 2.1.3 |
|
56 | - 'sortable' => null, // 2.1.3 |
|
57 | - 'show_title_column' => true, // 3.0.0 |
|
58 | - 'hidden' => null, // 3.0.0 |
|
53 | + 'help' => null, // 2.1.0 |
|
54 | + 'help_aside' => null, // 2.1.0 |
|
55 | + 'repeatable' => null, // 2.1.3 |
|
56 | + 'sortable' => null, // 2.1.3 |
|
57 | + 'show_title_column' => true, // 3.0.0 |
|
58 | + 'hidden' => null, // 3.0.0 |
|
59 | 59 | |
60 | - 'placement' => 'normal', // 3.8.0 (string) accepts either 'section_title', 'field_title', or 'normal' |
|
60 | + 'placement' => 'normal', // 3.8.0 (string) accepts either 'section_title', 'field_title', or 'normal' |
|
61 | 61 | |
62 | 62 | // @todo Examine why an array is not set but null here for the attributes argument. |
63 | - 'attributes' => null, // 3.0.0 - the array represents the attributes of input tag |
|
63 | + 'attributes' => null, // 3.0.0 - the array represents the attributes of input tag |
|
64 | 64 | 'class' => array( // 3.3.1 |
65 | 65 | 'fieldrow' => array(), |
66 | 66 | 'fieldset' => array(), |
@@ -68,29 +68,29 @@ discard block |
||
68 | 68 | 'field' => array(), |
69 | 69 | ), |
70 | 70 | |
71 | - 'save' => true, // 3.6.0 |
|
72 | - 'content' => null, // 3.6.1 - (string) An overriding field-set output. |
|
71 | + 'save' => true, // 3.6.0 |
|
72 | + 'content' => null, // 3.6.1 - (string) An overriding field-set output. |
|
73 | 73 | |
74 | - 'show_debug_info' => null, // 3.8.8+ (boolean) whether to show debug information such as field definition tool-tips. This value is inherited from the section definition argument of the same name. Not setting a value here as it is determined with another calculated value. |
|
74 | + 'show_debug_info' => null, // 3.8.8+ (boolean) whether to show debug information such as field definition tool-tips. This value is inherited from the section definition argument of the same name. Not setting a value here as it is determined with another calculated value. |
|
75 | 75 | |
76 | 76 | // Internal Keys |
77 | - '_fields_type' => null, // @deprecated 3.7.0, 3.0.0 - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
78 | - '_structure_type' => null, // 3.7.0 |
|
79 | - '_caller_object' => null, // 3.4.0 (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
77 | + '_fields_type' => null, // @deprecated 3.7.0, 3.0.0 - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
78 | + '_structure_type' => null, // 3.7.0 |
|
79 | + '_caller_object' => null, // 3.4.0 (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
80 | 80 | |
81 | - '_section_path' => '', // 3.7.0 (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
82 | - '_section_path_array' => '', // 3.7.0 (array) An array version of the above section path. |
|
83 | - '_nested_depth' => 0, // 3.4.0 (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
84 | - '_subsection_index' => null, // 3.7.0 Passed to the `field_definition_{...}` filter hook callbacks. |
|
85 | - '_section_repeatable' => false, // @deprecated |
|
86 | - '_is_section_repeatable' => false, // 3.8.0 (boolean) Whether the belonging section is repeatable or not. |
|
81 | + '_section_path' => '', // 3.7.0 (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
82 | + '_section_path_array' => '', // 3.7.0 (array) An array version of the above section path. |
|
83 | + '_nested_depth' => 0, // 3.4.0 (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
84 | + '_subsection_index' => null, // 3.7.0 Passed to the `field_definition_{...}` filter hook callbacks. |
|
85 | + '_section_repeatable' => false, // @deprecated |
|
86 | + '_is_section_repeatable' => false, // 3.8.0 (boolean) Whether the belonging section is repeatable or not. |
|
87 | 87 | |
88 | - '_field_path' => '', // 3.7.0 (string) Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
88 | + '_field_path' => '', // 3.7.0 (string) Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
89 | 89 | '_field_path_array' => array(), // 3.7.0 (array) An array version of the above field path. |
90 | - '_parent_field_path' => '', // 3.8.0 (string) |
|
90 | + '_parent_field_path' => '', // 3.8.0 (string) |
|
91 | 91 | '_parent_field_path_array' => array(), // 3.8.0 (array) |
92 | 92 | |
93 | - '_is_title_embedded' => false, // 3.8.0 (boolean) whether the field title is in the fieldset element, not in the table th element. This becomes `true` for `section_title` fields and fields with the `placement` argument with the value of `section_title` or `field_title`. |
|
93 | + '_is_title_embedded' => false, // 3.8.0 (boolean) whether the field title is in the fieldset element, not in the table th element. This becomes `true` for `section_title` fields and fields with the `placement` argument with the value of `section_title` or `field_title`. |
|
94 | 94 | |
95 | 95 | ); |
96 | 96 | |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | array( |
168 | 168 | '_fields_type' => $this->sStructureType, // @deprecated 3.7.0 backward-compatibility |
169 | 169 | '_structure_type' => $this->sStructureType, |
170 | - '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller form object. |
|
171 | - '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
170 | + '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller form object. |
|
171 | + '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
172 | 172 | ) |
173 | 173 | + $this->aFieldset, |
174 | 174 | array( |
175 | 175 | 'capability' => $this->sCapability, |
176 | 176 | 'section_id' => '_default', |
177 | - '_section_repeatable' => $this->bIsSectionRepeatable, // @deprecated 3.8.0 This was not used. |
|
177 | + '_section_repeatable' => $this->bIsSectionRepeatable, // @deprecated 3.8.0 This was not used. |
|
178 | 178 | '_is_section_repeatable' => $this->bIsSectionRepeatable, |
179 | 179 | ) |
180 | 180 | + self::$aStructure |
@@ -295,12 +295,12 @@ discard block |
||
295 | 295 | |
296 | 296 | ); |
297 | 297 | |
298 | - foreach( $aNestedFieldsets as $_isIndex => &$_aNestedFieldset ) { |
|
298 | + foreach ( $aNestedFieldsets as $_isIndex => &$_aNestedFieldset ) { |
|
299 | 299 | |
300 | 300 | // The inline-mixed type has a string element. |
301 | 301 | if ( is_scalar( $_aNestedFieldset ) ) { |
302 | 302 | $_aNestedFieldset = array( |
303 | - 'field_id' => $aParentFieldset[ 'field_id' ] . '_' . uniqid(), |
|
303 | + 'field_id' => $aParentFieldset[ 'field_id' ].'_'.uniqid(), |
|
304 | 304 | 'content' => $_aNestedFieldset, |
305 | 305 | ); |
306 | 306 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $_aFieldset[ 'class' ] = $this->getAsArray( $_aFieldset[ 'class' ] ); |
196 | 196 | |
197 | 197 | // 3.8.0+ Support nested fields and inline_mized field type. |
198 | - if ( $this->hasFieldDefinitionsInContent( $_aFieldset ) ) { |
|
198 | + if ( $this->hasFieldDefinitionsInContent( $_aFieldset ) ) { |
|
199 | 199 | $_aFieldset[ 'content' ] = $this->_getChildFieldsetsFormatted( $_aFieldset[ 'content' ], $_aFieldset ); |
200 | 200 | } |
201 | 201 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * @since 3.8.8 |
223 | 223 | * @return boolean |
224 | 224 | */ |
225 | - private function _getShowDebugInfo( $aFieldset ) { |
|
225 | + private function _getShowDebugInfo( $aFieldset ) { |
|
226 | 226 | |
227 | 227 | // If the user sets a value. use it. |
228 | 228 | if ( isset( $aFieldset[ 'show_debug_info' ] ) ) { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | foreach( $aNestedFieldsets as $_isIndex => &$_aNestedFieldset ) { |
299 | 299 | |
300 | 300 | // The inline-mixed type has a string element. |
301 | - if ( is_scalar( $_aNestedFieldset ) ) { |
|
301 | + if ( is_scalar( $_aNestedFieldset ) ) { |
|
302 | 302 | $_aNestedFieldset = array( |
303 | 303 | 'field_id' => $aParentFieldset[ 'field_id' ] . '_' . uniqid(), |
304 | 304 | 'content' => $_aNestedFieldset, |
@@ -35,47 +35,47 @@ discard block |
||
35 | 35 | // Optional |
36 | 36 | 'page_slug' => null, |
37 | 37 | 'tab_slug' => null, |
38 | - 'section_tab_slug' => null, // 3.0.0+ |
|
38 | + 'section_tab_slug' => null, // 3.0.0+ |
|
39 | 39 | 'title' => null, |
40 | 40 | 'description' => null, |
41 | 41 | 'capability' => null, |
42 | 42 | 'if' => true, |
43 | - 'order' => null, // do not set the default number here because incremented numbers will be added when registering the sections. |
|
43 | + 'order' => null, // do not set the default number here because incremented numbers will be added when registering the sections. |
|
44 | 44 | 'help' => null, |
45 | 45 | 'help_aside' => null, |
46 | - 'repeatable' => false, // (boolean|array) 3.0.0+ |
|
47 | - 'sortable' => false, // (boolean|array) 3.6.0+ |
|
46 | + 'repeatable' => false, // (boolean|array) 3.0.0+ |
|
47 | + 'sortable' => false, // (boolean|array) 3.6.0+ |
|
48 | 48 | 'attributes' => array( // 3.3.1+ |
49 | - 'class' => null, // set null to avoid undefined index warnings. |
|
50 | - 'style' => null, // set null to avoid undefined index warnings. |
|
49 | + 'class' => null, // set null to avoid undefined index warnings. |
|
50 | + 'style' => null, // set null to avoid undefined index warnings. |
|
51 | 51 | 'tab' => array(), |
52 | 52 | ), |
53 | 53 | 'class' => array( // 3.3.1+ |
54 | 54 | 'tab' => array(), |
55 | 55 | ), |
56 | - 'hidden' => false, // 3.3.1+ |
|
57 | - 'collapsible' => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property. |
|
58 | - 'save' => true, // 3.6.0+ |
|
56 | + 'hidden' => false, // 3.3.1+ |
|
57 | + 'collapsible' => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property. |
|
58 | + 'save' => true, // 3.6.0+ |
|
59 | 59 | |
60 | - 'content' => null, // 3.6.1+ (string) An overriding section-set output. |
|
60 | + 'content' => null, // 3.6.1+ (string) An overriding section-set output. |
|
61 | 61 | |
62 | - 'tip' => null, // 3.7.0 (string) Tool tip HTML strings. |
|
62 | + 'tip' => null, // 3.7.0 (string) Tool tip HTML strings. |
|
63 | 63 | |
64 | 64 | // Internal |
65 | - '_fields_type' => null, // @deprecated 3.7.0+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections. |
|
66 | - '_structure_type' => null, // 3.7.0+ |
|
67 | - '_is_first_index' => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections). |
|
68 | - '_is_last_index' => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections). |
|
65 | + '_fields_type' => null, // @deprecated 3.7.0+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections. |
|
66 | + '_structure_type' => null, // 3.7.0+ |
|
67 | + '_is_first_index' => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections). |
|
68 | + '_is_last_index' => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections). |
|
69 | 69 | |
70 | - '_section_path' => '', // 3.7.0+ (string) e.g. my_section|nested_section |
|
71 | - '_section_path_array' => '', // 3.7.0+ (array) an array version of the above section_path argument. Numerically indexed. |
|
72 | - '_nested_depth' => 0, // 3.7.0+ (integer) the nested level of the section |
|
70 | + '_section_path' => '', // 3.7.0+ (string) e.g. my_section|nested_section |
|
71 | + '_section_path_array' => '', // 3.7.0+ (array) an array version of the above section_path argument. Numerically indexed. |
|
72 | + '_nested_depth' => 0, // 3.7.0+ (integer) the nested level of the section |
|
73 | 73 | |
74 | 74 | // 3.6.0+ - (object) the caller framework factory object. This allows the framework to access the factory property when rendering the section. |
75 | 75 | // 3.7.0+ It no longer stores a factory object but a form object. |
76 | 76 | '_caller_object' => null, |
77 | 77 | |
78 | - 'show_debug_info' => null, // 3.8.8+ (boolean) Whether to display debug information. Inherits the page/in-page-tab setting (actually the factory property value of `$bShowDebugInfo` which gets updated by the page/tab setting). |
|
78 | + 'show_debug_info' => null, // 3.8.8+ (boolean) Whether to display debug information. Inherits the page/in-page-tab setting (actually the factory property value of `$bShowDebugInfo` which gets updated by the page/tab setting). |
|
79 | 79 | |
80 | 80 | ); |
81 | 81 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | public $oCaller = null; |
96 | 96 | |
97 | - public $bShowDebugInfo = true; // 3.8.8+ |
|
97 | + public $bShowDebugInfo = true; // 3.8.8+ |
|
98 | 98 | |
99 | 99 | /** |
100 | 100 | * Sets up properties. |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $this->sCapability, |
109 | 109 | $this->iCountOfElements, |
110 | 110 | $this->oCaller, |
111 | - $this->bShowDebugInfo, // 3.8.8+ |
|
111 | + $this->bShowDebugInfo, // 3.8.8+ |
|
112 | 112 | ); |
113 | 113 | $this->aSectionset = $_aParameters[ 0 ]; |
114 | 114 | $this->sSectionPath = $_aParameters[ 1 ]; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $this->sCapability = $_aParameters[ 3 ]; |
117 | 117 | $this->iCountOfElements = $_aParameters[ 4 ]; |
118 | 118 | $this->oCaller = $_aParameters[ 5 ]; |
119 | - $this->bShowDebugInfo = $_aParameters[ 6 ]; // 3.8.8+ |
|
119 | + $this->bShowDebugInfo = $_aParameters[ 6 ]; // 3.8.8+ |
|
120 | 120 | |
121 | 121 | } |
122 | 122 | |
@@ -131,16 +131,16 @@ discard block |
||
131 | 131 | $_aSectionPath = explode( '|', $this->sSectionPath ); |
132 | 132 | $_aSectionset = $this->uniteArrays( |
133 | 133 | array( |
134 | - '_fields_type' => $this->sStructureType, // @deprecated 3.7.0+ |
|
135 | - '_structure_type' => $this->sStructureType, // 3.7.0+ |
|
136 | - '_section_path' => $this->sSectionPath, // 3.7.0+ |
|
134 | + '_fields_type' => $this->sStructureType, // @deprecated 3.7.0+ |
|
135 | + '_structure_type' => $this->sStructureType, // 3.7.0+ |
|
136 | + '_section_path' => $this->sSectionPath, // 3.7.0+ |
|
137 | 137 | '_section_path_array' => $_aSectionPath, |
138 | - '_nested_depth' => count( $_aSectionPath ) - 1, // 3.7.0+ - zero base |
|
138 | + '_nested_depth' => count( $_aSectionPath ) - 1, // 3.7.0+ - zero base |
|
139 | 139 | ) |
140 | 140 | + $this->aSectionset |
141 | 141 | + array( |
142 | 142 | 'capability' => $this->sCapability, |
143 | - 'show_debug_info' => $this->bShowDebugInfo, // 3.8.8+ |
|
143 | + 'show_debug_info' => $this->bShowDebugInfo, // 3.8.8+ |
|
144 | 144 | ), |
145 | 145 | self::$aStructure |
146 | 146 | ); |
@@ -218,8 +218,8 @@ |
||
218 | 218 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
219 | 219 | */ |
220 | 220 | protected $aDefaultKeys = array( |
221 | - 'label_min_width' => '', // disabled as the embedded elements are all inline. |
|
222 | - 'show_debug_info' => false, // 3.8.8+ @todo Examine why this value does not override the default value of field definition arguments and if possible and appropriate, override it. |
|
221 | + 'label_min_width' => '', // disabled as the embedded elements are all inline. |
|
222 | + 'show_debug_info' => false, // 3.8.8+ @todo Examine why this value does not override the default value of field definition arguments and if possible and appropriate, override it. |
|
223 | 223 | ); |
224 | 224 | |
225 | 225 |
@@ -229,7 +229,7 @@ |
||
229 | 229 | * @internal |
230 | 230 | * @return string |
231 | 231 | */ |
232 | - protected function getStyles() { |
|
232 | + protected function getStyles() { |
|
233 | 233 | return <<<CSSRULES |
234 | 234 | .admin-page-framework-field-inline_mixed { |
235 | 235 | width: 98%; |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * @return void |
29 | 29 | * @since 3.8.8 |
30 | 30 | */ |
31 | - static public function showDeprecationNotice( $sDeprecated, $sAlternative='', $sProgramName='Admin Page Framework' ) { |
|
31 | + static public function showDeprecationNotice( $sDeprecated, $sAlternative = '', $sProgramName = 'Admin Page Framework' ) { |
|
32 | 32 | trigger_error( |
33 | - $sProgramName . ': ' . sprintf( |
|
33 | + $sProgramName.': '.sprintf( |
|
34 | 34 | $sAlternative |
35 | 35 | ? '<code>%1$s</code> has been deprecated. Use <code>%2$s</code> instead.' |
36 | 36 | : '<code>%1$s</code> has been deprecated.', |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * @param callable $oCallable |
53 | 53 | * @param string|array $asParameters Parameters to pass to the callback function. |
54 | 54 | */ |
55 | - public function callBack( $oCallable, $asParameters=array() ) { |
|
56 | - $_aParameters = self::getAsArray( |
|
55 | + public function callBack( $oCallable, $asParameters = array() ) { |
|
56 | + $_aParameters = self::getAsArray( |
|
57 | 57 | $asParameters, |
58 | 58 | true // preserve empty |
59 | 59 | ); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @since 3.6.3 |
90 | 90 | * @return string The captured output buffer. |
91 | 91 | */ |
92 | - static public function getOutputBuffer( $oCallable, array $aParameters=array() ) { |
|
92 | + static public function getOutputBuffer( $oCallable, array $aParameters = array() ) { |
|
93 | 93 | |
94 | 94 | ob_start(); |
95 | 95 | echo call_user_func_array( $oCallable, $aParameters ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $_iCount = count( get_object_vars( $oInstance ) ); |
112 | 112 | $_sClassName = get_class( $oInstance ); |
113 | - return '(object) ' . $_sClassName . ': ' . $_iCount . ' properties.'; |
|
113 | + return '(object) '.$_sClassName.': '.$_iCount.' properties.'; |
|
114 | 114 | |
115 | 115 | } |
116 | 116 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @param boolean|integer|double|string|array|object|resource|NULL $mTrue The value to return when the first parameter value yields false. |
128 | 128 | * @return mixed |
129 | 129 | */ |
130 | - static public function getAOrB( $mValue, $mTrue=null, $mFalse=null ) { |
|
130 | + static public function getAOrB( $mValue, $mTrue = null, $mFalse = null ) { |
|
131 | 131 | return $mValue ? $mTrue : $mFalse; |
132 | 132 | } |
133 | 133 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @deprecated 3.8.0 Use `getLengthSanitized()` instead. |
32 | 32 | * @since 3.8.8 Moved from `AdminPageFramework_Utility_String`. |
33 | 33 | */ |
34 | - static public function sanitizeLength( $sLength, $sUnit='px' ) { |
|
34 | + static public function sanitizeLength( $sLength, $sUnit = 'px' ) { |
|
35 | 35 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getLengthSanitized()' ); |
36 | 36 | return AdminPageFramework_Utility_String::getLengthSanitized( $sLength, $sUnit ); |
37 | 37 | } |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | * @since 3.5.3 Moved from `AdminPageFramework_Utility_Array`. |
51 | 51 | * @deprecated 3.5.3 Use `getElement()`. |
52 | 52 | */ |
53 | - public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault='', $bBlankToDefault=false ) { |
|
53 | + public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault = '', $bBlankToDefault = false ) { |
|
54 | 54 | |
55 | 55 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getElement()' ); |
56 | 56 | |
57 | 57 | // If $vSubject is null, |
58 | - if ( ! isset( $vSubject ) ) { |
|
58 | + if ( !isset( $vSubject ) ) { |
|
59 | 59 | return $sDefault; |
60 | 60 | } |
61 | 61 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | // If $vSubject is not an array, |
68 | - if ( ! is_array( $vSubject ) ) { |
|
68 | + if ( !is_array( $vSubject ) ) { |
|
69 | 69 | return ( string ) $vSubject; |
70 | 70 | } // consider it as string. |
71 | 71 | |
@@ -116,11 +116,11 @@ discard block |
||
116 | 116 | * @since 3.5.3 Moved from `AdminPageFramework_FieldType_Base`. |
117 | 117 | * @deprecated 3.5.3 Use the `getElement()` method. |
118 | 118 | */ |
119 | - protected function getFieldElementByKey( $asElement, $sKey, $asDefault='' ) { |
|
119 | + protected function getFieldElementByKey( $asElement, $sKey, $asDefault = '' ) { |
|
120 | 120 | |
121 | 121 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getElement()' ); |
122 | 122 | |
123 | - if ( ! is_array( $asElement ) || ! isset( $sKey ) ) { |
|
123 | + if ( !is_array( $asElement ) || !isset( $sKey ) ) { |
|
124 | 124 | return $asElement; |
125 | 125 | } |
126 | 126 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__ ); |
145 | 145 | |
146 | - foreach( $aArray as &$vElem ) { |
|
146 | + foreach ( $aArray as &$vElem ) { |
|
147 | 147 | |
148 | 148 | if ( $vElem ) { break; } |
149 | 149 | unset( $vElem ); |
@@ -177,15 +177,15 @@ discard block |
||
177 | 177 | |
178 | 178 | AdminPageFramework_Utility::showDeprecationNotice( __METHOD__, 'AdminPageFramework_WPUtility::getAttributes()' ); |
179 | 179 | |
180 | - $_sQuoteCharactor ="'"; |
|
180 | + $_sQuoteCharactor = "'"; |
|
181 | 181 | $_aOutput = array(); |
182 | - foreach( $aAttributes as $sAttribute => $sProperty ) { |
|
182 | + foreach ( $aAttributes as $sAttribute => $sProperty ) { |
|
183 | 183 | |
184 | 184 | // Must be resolved as a string. |
185 | 185 | if ( in_array( gettype( $sProperty ), array( 'array', 'object' ) ) ) { |
186 | 186 | continue; |
187 | 187 | } |
188 | - $_aOutput[] = "{$sAttribute}={$_sQuoteCharactor}{$sProperty}{$_sQuoteCharactor}"; |
|
188 | + $_aOutput[ ] = "{$sAttribute}={$_sQuoteCharactor}{$sProperty}{$_sQuoteCharactor}"; |
|
189 | 189 | |
190 | 190 | } |
191 | 191 | return implode( ' ', $_aOutput ); |
@@ -50,27 +50,27 @@ |
||
50 | 50 | * @since 3.5.3 Moved from `AdminPageFramework_Utility_Array`. |
51 | 51 | * @deprecated 3.5.3 Use `getElement()`. |
52 | 52 | */ |
53 | - public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault='', $bBlankToDefault=false ) { |
|
53 | + public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault='', $bBlankToDefault=false ) { |
|
54 | 54 | |
55 | 55 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getElement()' ); |
56 | 56 | |
57 | 57 | // If $vSubject is null, |
58 | - if ( ! isset( $vSubject ) ) { |
|
58 | + if ( ! isset( $vSubject ) ) { |
|
59 | 59 | return $sDefault; |
60 | 60 | } |
61 | 61 | |
62 | 62 | // If the $bBlankToDefault flag is set and the subject value is a blank string, return the default value. |
63 | - if ( $bBlankToDefault && $vSubject == '' ) { |
|
63 | + if ( $bBlankToDefault && $vSubject == '' ) { |
|
64 | 64 | return $sDefault; |
65 | 65 | } |
66 | 66 | |
67 | 67 | // If $vSubject is not an array, |
68 | - if ( ! is_array( $vSubject ) ) { |
|
68 | + if ( ! is_array( $vSubject ) ) { |
|
69 | 69 | return ( string ) $vSubject; |
70 | 70 | } // consider it as string. |
71 | 71 | |
72 | 72 | // Consider $vSubject as array. |
73 | - if ( isset( $vSubject[ $sKey ] ) ) { |
|
73 | + if ( isset( $vSubject[ $sKey ] ) ) { |
|
74 | 74 | return $vSubject[ $sKey ]; |
75 | 75 | } |
76 | 76 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @since 3.8.8 |
24 | 24 | * @return void |
25 | 25 | */ |
26 | - static public function showDeprecationNotice( $sDeprecated, $sAlternative='', $sProgramName='' ) { |
|
26 | + static public function showDeprecationNotice( $sDeprecated, $sAlternative = '', $sProgramName = '' ) { |
|
27 | 27 | $sProgramName = $sProgramName ? $sProgramName : self::getFrameworkName(); |
28 | 28 | parent::showDeprecationNotice( $sDeprecated, $sAlternative, $sProgramName ); |
29 | 29 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
45 | - foreach( ( array ) $GLOBALS[ '_apf_sub_menus_to_sort' ] as $_sIndex => $_sMenuSlug ) { |
|
46 | - if ( ! isset( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ) ) { |
|
45 | + foreach ( ( array ) $GLOBALS[ '_apf_sub_menus_to_sort' ] as $_sIndex => $_sMenuSlug ) { |
|
46 | + if ( !isset( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ) ) { |
|
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | ksort( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param boolean $bTrimDevVer Whether the `.dev` suffix should be removed or not. |
69 | 69 | * @return string |
70 | 70 | */ |
71 | - static public function getFrameworkVersion( $bTrimDevVer=false ) { |
|
71 | + static public function getFrameworkVersion( $bTrimDevVer = false ) { |
|
72 | 72 | $_sVersion = AdminPageFramework_Registry::getVersion(); |
73 | 73 | return $bTrimDevVer |
74 | 74 | ? self::getSuffixRemoved( $_sVersion, '.dev' ) |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return string |
97 | 97 | */ |
98 | 98 | static public function getFrameworkNameVersion() { |
99 | - return self::getFrameworkName() . ' ' . self::getFrameworkVersion(); |
|
99 | + return self::getFrameworkName().' '.self::getFrameworkVersion(); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | } |