@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | * @param integer $iLines The number of lines to read. |
28 | 28 | * @return string |
29 | 29 | */ |
30 | - static public function getFileTailContents( $asPath=array(), $iLines=1 ) { |
|
30 | + static public function getFileTailContents( $asPath = array(), $iLines = 1 ) { |
|
31 | 31 | |
32 | - $_sPath = self::_getFirstItem( $asPath ); |
|
33 | - if ( ! @is_readable( $_sPath ) ) { |
|
32 | + $_sPath = self::_getFirstItem( $asPath ); |
|
33 | + if ( !@is_readable( $_sPath ) ) { |
|
34 | 34 | return ''; |
35 | 35 | } |
36 | 36 | return trim( |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @since 3.4.6 |
61 | 61 | * @return string |
62 | 62 | */ |
63 | - static public function sanitizeFileName( $sFileName, $sReplacement='_' ) { |
|
63 | + static public function sanitizeFileName( $sFileName, $sReplacement = '_' ) { |
|
64 | 64 | |
65 | 65 | // Remove anything which isn't a word, white space, number |
66 | 66 | // or any of the following characters -_~,;:[](). |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | */ |
37 | 37 | static public function getInlineCSS( array $aCSSRules ) { |
38 | 38 | $_aOutput = array(); |
39 | - foreach( $aCSSRules as $_sProperty => $_sValue ) { |
|
39 | + foreach ( $aCSSRules as $_sProperty => $_sValue ) { |
|
40 | 40 | if ( is_null( $_sValue ) ) { |
41 | 41 | continue; |
42 | 42 | } |
43 | - $_aOutput[] = $_sProperty . ': ' . $_sValue; |
|
43 | + $_aOutput[ ] = $_sProperty.': '.$_sValue; |
|
44 | 44 | } |
45 | 45 | return implode( '; ', $_aOutput ); |
46 | 46 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | static public function getStyleAttribute( $asInlineCSSes ) { |
72 | 72 | |
73 | 73 | $_aCSSRules = array(); |
74 | - foreach( array_reverse( func_get_args() ) as $_asCSSRules ) { |
|
74 | + foreach ( array_reverse( func_get_args() ) as $_asCSSRules ) { |
|
75 | 75 | |
76 | 76 | // For array, store in the container. |
77 | 77 | if ( is_array( $_asCSSRules ) ) { |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | // At this point, it is a string. Break them down to array elements. |
83 | 83 | $__aCSSRules = explode( ';', $_asCSSRules ); |
84 | - foreach( $__aCSSRules as $_sPair ) { |
|
84 | + foreach ( $__aCSSRules as $_sPair ) { |
|
85 | 85 | $_aCSSPair = explode( ':', $_sPair ); |
86 | - if ( ! isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) { |
|
86 | + if ( !isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | $_aCSSRules[ $_aCSSPair[ 0 ] ] = $_aCSSPair[ 1 ]; |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | */ |
121 | 121 | static public function getClassAttribute( /* $asClassSelectors1, $asClassSelectors12, ... */ ) { |
122 | 122 | |
123 | - $_aClasses = array(); |
|
124 | - foreach( func_get_args() as $_asClasses ) { |
|
125 | - if ( ! in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) { |
|
123 | + $_aClasses = array(); |
|
124 | + foreach ( func_get_args() as $_asClasses ) { |
|
125 | + if ( !in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) { |
|
126 | 126 | continue; |
127 | 127 | } |
128 | 128 | $_aClasses = array_merge( |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | : explode( ' ', $_asClasses ) |
133 | 133 | ); |
134 | 134 | } |
135 | - $_aClasses = array_unique( array_filter( $_aClasses ) ); |
|
135 | + $_aClasses = array_unique( array_filter( $_aClasses ) ); |
|
136 | 136 | |
137 | 137 | // @todo examine if it is okay to remove the trim() function below. |
138 | 138 | return trim( implode( ' ', $_aClasses ) ); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | static public function generateClassAttribute( /* $asClassSelectors1, $asClassSelectors12 ... */ ) { |
149 | 149 | $_aParams = func_get_args(); |
150 | 150 | return call_user_func_array( |
151 | - array( __CLASS__ , 'getClassAttribute' ), |
|
151 | + array( __CLASS__, 'getClassAttribute' ), |
|
152 | 152 | $_aParams |
153 | 153 | ); |
154 | 154 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | static public function getDataAttributeArray( array $aArray ) { |
166 | 166 | |
167 | 167 | $_aNewArray = array(); |
168 | - foreach( $aArray as $sKey => $v ) { |
|
168 | + foreach ( $aArray as $sKey => $v ) { |
|
169 | 169 | |
170 | 170 | if ( in_array( gettype( $v ), array( 'object', 'NULL' ) ) ) { |
171 | 171 | continue; |
@@ -47,8 +47,8 @@ |
||
47 | 47 | * @since 3.6.3 |
48 | 48 | * @return boolean If the passed value is not null, true; otherwise, false. |
49 | 49 | */ |
50 | - static public function isNotNull( $mValue=null ) { |
|
51 | - return ! is_null( $mValue ); |
|
50 | + static public function isNotNull( $mValue = null ) { |
|
51 | + return !is_null( $mValue ); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @since 3.6.2 Supported a text content to be passed to the first parameter. |
28 | 28 | * @access public |
29 | 29 | */ |
30 | - static public function getScriptData( $sPathOrContent, $sType='plugin', $aDefaultHeaderKeys=array() ) { |
|
30 | + static public function getScriptData( $sPathOrContent, $sType = 'plugin', $aDefaultHeaderKeys = array() ) { |
|
31 | 31 | |
32 | 32 | $_aHeaderKeys = $aDefaultHeaderKeys + array( |
33 | 33 | // storing array key => the comment entry header label |
@@ -65,19 +65,19 @@ discard block |
||
65 | 65 | |
66 | 66 | switch ( trim( $sType ) ) { |
67 | 67 | case 'theme': |
68 | - $aData['sName'] = $aData['sThemeName']; |
|
69 | - $aData['sURI'] = $aData['sThemeURI']; |
|
68 | + $aData[ 'sName' ] = $aData[ 'sThemeName' ]; |
|
69 | + $aData[ 'sURI' ] = $aData[ 'sThemeURI' ]; |
|
70 | 70 | break; |
71 | 71 | case 'library': |
72 | - $aData['sName'] = $aData['sLibraryName']; |
|
73 | - $aData['sURI'] = $aData['sLibraryURI']; |
|
72 | + $aData[ 'sName' ] = $aData[ 'sLibraryName' ]; |
|
73 | + $aData[ 'sURI' ] = $aData[ 'sLibraryURI' ]; |
|
74 | 74 | break; |
75 | 75 | case 'script': |
76 | - $aData['sName'] = $aData['sScriptName']; |
|
76 | + $aData[ 'sName' ] = $aData[ 'sScriptName' ]; |
|
77 | 77 | break; |
78 | 78 | case 'plugin': |
79 | - $aData['sName'] = $aData['sPluginName']; |
|
80 | - $aData['sURI'] = $aData['sPluginURI']; |
|
79 | + $aData[ 'sName' ] = $aData[ 'sPluginName' ]; |
|
80 | + $aData[ 'sURI' ] = $aData[ 'sPluginURI' ]; |
|
81 | 81 | break; |
82 | 82 | default: |
83 | 83 | break; |
@@ -92,22 +92,22 @@ discard block |
||
92 | 92 | * @since 3.6.2 |
93 | 93 | * @return array The script data |
94 | 94 | */ |
95 | - static public function getScriptDataFromContents( $sContent, $sType='plugin', $aDefaultHeaderKeys=array() ) { |
|
95 | + static public function getScriptDataFromContents( $sContent, $sType = 'plugin', $aDefaultHeaderKeys = array() ) { |
|
96 | 96 | |
97 | 97 | // Make sure we catch CR-only line endings. |
98 | 98 | $sContent = str_replace( "\r", "\n", $sContent ); |
99 | 99 | |
100 | - $_aHeaders = $aDefaultHeaderKeys; |
|
100 | + $_aHeaders = $aDefaultHeaderKeys; |
|
101 | 101 | if ( $sType ) { |
102 | 102 | $_aExtraHeaders = apply_filters( "extra_{$sType}_headers", array() ); |
103 | - if ( ! empty( $_aExtraHeaders ) ) { |
|
103 | + if ( !empty( $_aExtraHeaders ) ) { |
|
104 | 104 | $_aExtraHeaders = array_combine( $_aExtraHeaders, $_aExtraHeaders ); // keys equal values |
105 | 105 | $_aHeaders = array_merge( $_aExtraHeaders, ( array ) $aDefaultHeaderKeys ); |
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | 109 | foreach ( $_aHeaders as $_sHeaderKey => $_sRegex ) { |
110 | - $_bFound = preg_match( '/^[ \t\/*#@]*' . preg_quote( $_sRegex, '/' ) . ':(.*)$/mi', $sContent, $_aMatch ); |
|
110 | + $_bFound = preg_match( '/^[ \t\/*#@]*'.preg_quote( $_sRegex, '/' ).':(.*)$/mi', $sContent, $_aMatch ); |
|
111 | 111 | $_aHeaders[ $_sHeaderKey ] = $_bFound && $_aMatch[ 1 ] |
112 | 112 | ? _cleanup_header_comment( $_aMatch[ 1 ] ) |
113 | 113 | : ''; |
@@ -124,14 +124,14 @@ discard block |
||
124 | 124 | * @since 3.4.2 |
125 | 125 | * @see download_url() in file.php in core. |
126 | 126 | */ |
127 | - static public function download( $sURL, $iTimeOut=300 ) { |
|
127 | + static public function download( $sURL, $iTimeOut = 300 ) { |
|
128 | 128 | |
129 | 129 | if ( false === filter_var( $sURL, FILTER_VALIDATE_URL ) ) { |
130 | 130 | return false; |
131 | 131 | } |
132 | 132 | |
133 | 133 | $_sTmpFileName = self::setTempPath( self::getBaseNameOfURL( $sURL ) ); |
134 | - if ( ! $_sTmpFileName ) { |
|
134 | + if ( !$_sTmpFileName ) { |
|
135 | 135 | return false; |
136 | 136 | } |
137 | 137 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | return false; |
150 | 150 | } |
151 | 151 | |
152 | - if ( 200 != wp_remote_retrieve_response_code( $_aoResponse ) ){ |
|
152 | + if ( 200 != wp_remote_retrieve_response_code( $_aoResponse ) ) { |
|
153 | 153 | unlink( $_sTmpFileName ); |
154 | 154 | return false; |
155 | 155 | } |
@@ -174,16 +174,16 @@ discard block |
||
174 | 174 | * @since 3.4.2 |
175 | 175 | * @return string The set file path. |
176 | 176 | */ |
177 | - static public function setTempPath( $sFilePath='' ) { |
|
177 | + static public function setTempPath( $sFilePath = '' ) { |
|
178 | 178 | |
179 | 179 | $_sDir = get_temp_dir(); |
180 | 180 | |
181 | 181 | $sFilePath = basename( $sFilePath ); |
182 | 182 | if ( empty( $sFilePath ) ) { |
183 | - $sFilePath = time() . '.tmp'; |
|
183 | + $sFilePath = time().'.tmp'; |
|
184 | 184 | } |
185 | 185 | |
186 | - $sFilePath = $_sDir . wp_unique_filename( $_sDir, $sFilePath ); |
|
186 | + $sFilePath = $_sDir.wp_unique_filename( $_sDir, $sFilePath ); |
|
187 | 187 | touch( $sFilePath ); |
188 | 188 | return $sFilePath; |
189 | 189 |
@@ -149,7 +149,7 @@ |
||
149 | 149 | return false; |
150 | 150 | } |
151 | 151 | |
152 | - if ( 200 != wp_remote_retrieve_response_code( $_aoResponse ) ){ |
|
152 | + if ( 200 != wp_remote_retrieve_response_code( $_aoResponse ) ) { |
|
153 | 153 | unlink( $_sTmpFileName ); |
154 | 154 | return false; |
155 | 155 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @since 3.4.2 |
26 | 26 | * @todo Create a similar function for filters. |
27 | 27 | */ |
28 | - static public function registerAction( $sActionHook, $oCallable, $iPriority=10 ) { |
|
28 | + static public function registerAction( $sActionHook, $oCallable, $iPriority = 10 ) { |
|
29 | 29 | |
30 | 30 | if ( did_action( $sActionHook ) ) { |
31 | 31 | return call_user_func_array( $oCallable, array() ); |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | * @param mixed $_and_more add as many arguments as necessary to the next parameters. |
63 | 63 | * @return void does not return a value. |
64 | 64 | */ |
65 | - static public function doActions( $aActionHooks, $vArgs1=null, $vArgs2=null, $_and_more=null ) { |
|
65 | + static public function doActions( $aActionHooks, $vArgs1 = null, $vArgs2 = null, $_and_more = null ) { |
|
66 | 66 | |
67 | 67 | $aArgs = func_get_args(); |
68 | 68 | $aActionHooks = $aArgs[ 0 ]; |
69 | - foreach( ( array ) $aActionHooks as $sActionHook ) { |
|
69 | + foreach ( ( array ) $aActionHooks as $sActionHook ) { |
|
70 | 70 | $aArgs[ 0 ] = $sActionHook; |
71 | - call_user_func_array( 'do_action' , $aArgs ); |
|
71 | + call_user_func_array( 'do_action', $aArgs ); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | } |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | $aArgs = func_get_args(); |
101 | 101 | $oCallerObject = $aArgs[ 0 ]; |
102 | 102 | $aActionHooks = $aArgs[ 1 ]; |
103 | - foreach( ( array ) $aActionHooks as $sActionHook ) { |
|
104 | - if ( ! $sActionHook ) { |
|
103 | + foreach ( ( array ) $aActionHooks as $sActionHook ) { |
|
104 | + if ( !$sActionHook ) { |
|
105 | 105 | continue; |
106 | 106 | } |
107 | 107 | $aArgs[ 1 ] = $sActionHook; |
108 | - call_user_func_array( array( get_class(), 'addAndDoAction' ) , $aArgs ); |
|
108 | + call_user_func_array( array( get_class(), 'addAndDoAction' ), $aArgs ); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $_aArgs = func_get_args(); |
125 | 125 | $_oCallerObject = $_aArgs[ 0 ]; |
126 | 126 | $_sActionHook = $_aArgs[ 1 ]; |
127 | - if ( ! $_sActionHook ) { |
|
127 | + if ( !$_sActionHook ) { |
|
128 | 128 | return; |
129 | 129 | } |
130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | // Remove the first element, the caller object. |
138 | 138 | array_shift( $_aArgs ); |
139 | - call_user_func_array( 'do_action' , $_aArgs ); |
|
139 | + call_user_func_array( 'do_action', $_aArgs ); |
|
140 | 140 | |
141 | 141 | } |
142 | 142 | |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | $_aFilters = $_aArgs[ 1 ]; |
165 | 165 | $_vInput = $_aArgs[ 2 ]; |
166 | 166 | |
167 | - foreach( ( array ) $_aFilters as $_sFilter ) { |
|
168 | - if ( ! $_sFilter ) { |
|
167 | + foreach ( ( array ) $_aFilters as $_sFilter ) { |
|
168 | + if ( !$_sFilter ) { |
|
169 | 169 | continue; |
170 | 170 | } |
171 | 171 | $_aArgs[ 1 ] = $_sFilter; |
172 | - $_aArgs[ 2 ] = $_vInput; // assigns the updated value as it is filtered in previous iterations |
|
172 | + $_aArgs[ 2 ] = $_vInput; // assigns the updated value as it is filtered in previous iterations |
|
173 | 173 | $_vInput = call_user_func_array( |
174 | 174 | array( get_class(), 'addAndApplyFilter' ), |
175 | 175 | $_aArgs |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $_aArgs = func_get_args(); |
204 | 204 | $_oCallerObject = $_aArgs[ 0 ]; |
205 | 205 | $_sFilter = $_aArgs[ 1 ]; |
206 | - if ( ! $_sFilter ) { |
|
206 | + if ( !$_sFilter ) { |
|
207 | 207 | return $_aArgs[ 2 ]; |
208 | 208 | } |
209 | 209 | |
@@ -234,17 +234,17 @@ discard block |
||
234 | 234 | * @access public |
235 | 235 | * @return array Returns an array consisting of the filters. |
236 | 236 | */ |
237 | - static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse=false ) { |
|
237 | + static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse = false ) { |
|
238 | 238 | |
239 | 239 | $_aFilters = array(); |
240 | 240 | if ( $sTabSlug && $sPageSlug ) { |
241 | - $_aFilters[] = "{$sPrefix}{$sPageSlug}_{$sTabSlug}"; |
|
241 | + $_aFilters[ ] = "{$sPrefix}{$sPageSlug}_{$sTabSlug}"; |
|
242 | 242 | } |
243 | 243 | if ( $sPageSlug ) { |
244 | - $_aFilters[] = "{$sPrefix}{$sPageSlug}"; |
|
244 | + $_aFilters[ ] = "{$sPrefix}{$sPageSlug}"; |
|
245 | 245 | } |
246 | 246 | if ( $sClassName ) { |
247 | - $_aFilters[] = "{$sPrefix}{$sClassName}"; |
|
247 | + $_aFilters[ ] = "{$sPrefix}{$sClassName}"; |
|
248 | 248 | } |
249 | 249 | return $bReverse |
250 | 250 | ? array_reverse( $_aFilters ) |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @since 3.8.8 |
23 | 23 | * @return void |
24 | 24 | */ |
25 | - static public function showDeprecationNotice( $sDeprecated, $sAlternative='', $sProgramName='' ) { |
|
25 | + static public function showDeprecationNotice( $sDeprecated, $sAlternative = '', $sProgramName = '' ) { |
|
26 | 26 | $sProgramName = $sProgramName ? $sProgramName : self::getFrameworkName(); |
27 | 27 | parent::showDeprecationNotice( $sDeprecated, $sAlternative, $sProgramName ); |
28 | 28 | } |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | return; |
42 | 42 | } |
43 | 43 | |
44 | - foreach( ( array ) $GLOBALS[ '_apf_sub_menus_to_sort' ] as $_sIndex => $_sMenuSlug ) { |
|
45 | - if ( ! isset( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ) ) { |
|
44 | + foreach ( ( array ) $GLOBALS[ '_apf_sub_menus_to_sort' ] as $_sIndex => $_sMenuSlug ) { |
|
45 | + if ( !isset( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ) ) { |
|
46 | 46 | continue; |
47 | 47 | } |
48 | 48 | ksort( $GLOBALS[ 'submenu' ][ $_sMenuSlug ] ); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @param boolean $bTrimDevVer Whether the `.dev` suffix should be removed or not. |
68 | 68 | * @return string |
69 | 69 | */ |
70 | - static public function getFrameworkVersion( $bTrimDevVer=false ) { |
|
70 | + static public function getFrameworkVersion( $bTrimDevVer = false ) { |
|
71 | 71 | $_sVersion = AdminPageFramework_Registry::getVersion(); |
72 | 72 | return $bTrimDevVer |
73 | 73 | ? self::getSuffixRemoved( $_sVersion, '.dev' ) |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @return string |
96 | 96 | */ |
97 | 97 | static public function getFrameworkNameVersion() { |
98 | - return self::getFrameworkName() . ' ' . self::getFrameworkVersion(); |
|
98 | + return self::getFrameworkName().' '.self::getFrameworkVersion(); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | } |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | * @since 3.6.0 |
52 | 52 | * @var array |
53 | 53 | */ |
54 | - public $aData = array(); |
|
54 | + public $aData = array(); |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Stores the default values. |
58 | 58 | * @since 3.6.0 |
59 | 59 | * @var array |
60 | 60 | */ |
61 | - public $aDefault = array(); |
|
61 | + public $aDefault = array(); |
|
62 | 62 | /**#@-*/ |
63 | 63 | |
64 | 64 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $_aKeys = func_get_args() + array( null ); |
97 | 97 | |
98 | 98 | // If no key is specified, return the whole array. |
99 | - if ( ! isset( $_aKeys[ 0 ] ) ) { |
|
99 | + if ( !isset( $_aKeys[ 0 ] ) ) { |
|
100 | 100 | return $this->uniteArrays( |
101 | 101 | $this->aData, |
102 | 102 | $this->aDefault |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | |
112 | 112 | // Now either the section ID or field ID is given. |
113 | 113 | return $this->getArrayValueByArrayKeys( |
114 | - $this->aData, // subject array |
|
115 | - $_aKeys, // dimensional keys |
|
114 | + $this->aData, // subject array |
|
115 | + $_aKeys, // dimensional keys |
|
116 | 116 | $this->_getDefaultValue( // default value |
117 | 117 | $_mDefault, |
118 | 118 | $_aKeys |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function set( /* $asKeys, $mValue */ ) { |
147 | 147 | |
148 | - $_aParameters = func_get_args(); |
|
149 | - if ( ! isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
148 | + $_aParameters = func_get_args(); |
|
149 | + if ( !isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
150 | 150 | return; |
151 | 151 | } |
152 | 152 | $_asKeys = $_aParameters[ 0 ]; |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function delete( /* $sKey1, $sKey2, $sKey3 ... OR $aKeys */ ) { |
176 | 176 | |
177 | - $_aParameters = func_get_args(); |
|
178 | - if ( ! isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
177 | + $_aParameters = func_get_args(); |
|
178 | + if ( !isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
179 | 179 | return; |
180 | 180 | } |
181 | 181 | $_asKeys = $_aParameters[ 0 ]; |
@@ -39,7 +39,7 @@ |
||
39 | 39 | '' // default value |
40 | 40 | ); |
41 | 41 | |
42 | - if ( ! $this->canUserView( $this->sCapability ) ) { |
|
42 | + if ( !$this->canUserView( $this->sCapability ) ) { |
|
43 | 43 | return ''; |
44 | 44 | } |
45 | 45 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | // Output |
49 | 49 | return |
50 | - "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">" |
|
50 | + "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">" |
|
51 | 51 | . $this->_getInputElements( $_aAttributes, $this->aOptions ) |
52 | 52 | . "</{$this->aOptions[ 'input_container_tag' ]}>" |
53 | 53 | . "<{$this->aOptions[ 'label_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ) . ">" |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | public function get( /* $sLabel, $aAttributes=array() */ ) { |
34 | 34 | |
35 | 35 | // Parameters |
36 | - $_aParams = func_get_args() + array( |
|
37 | - 0 => '', // 1st parameter |
|
36 | + $_aParams = func_get_args() + array( |
|
37 | + 0 => '', // 1st parameter |
|
38 | 38 | 1 => array() // 2nd parameter |
39 | 39 | ); |
40 | - $_sLabel = $_aParams[ 0 ]; // first parameter |
|
40 | + $_sLabel = $_aParams[ 0 ]; // first parameter |
|
41 | 41 | |
42 | 42 | // Attributes |
43 | 43 | $_aAttributes = $this->uniteArrays( // second parameter |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | |
48 | 48 | // Output |
49 | 49 | return |
50 | - "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">" |
|
50 | + "<{$this->aOptions[ 'input_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ).">" |
|
51 | 51 | . $this->_getInputElements( $_aAttributes, $this->aOptions ) |
52 | 52 | . "</{$this->aOptions[ 'input_container_tag' ]}>" |
53 | - . "<{$this->aOptions[ 'label_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ) . ">" |
|
53 | + . "<{$this->aOptions[ 'label_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ).">" |
|
54 | 54 | . $_sLabel |
55 | 55 | . "</{$this->aOptions[ 'label_container_tag' ]}>" |
56 | 56 | ; |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | private function _getInputElements( $aAttributes, $aOptions ) { |
65 | 65 | $_sOutput = $this->aOptions[ 'save_unchecked' ] |
66 | 66 | // the unchecked value must be set prior to the checkbox input field. |
67 | - ? "<input " . $this->getAttributes( |
|
67 | + ? "<input ".$this->getAttributes( |
|
68 | 68 | array( |
69 | 69 | 'type' => 'hidden', |
70 | 70 | 'class' => $aAttributes[ 'class' ], |
71 | 71 | 'name' => $aAttributes[ 'name' ], |
72 | 72 | 'value' => '0', |
73 | 73 | ) |
74 | - ) . " />" |
|
74 | + )." />" |
|
75 | 75 | : ''; |
76 | - $_sOutput .= "<input " . $this->getAttributes( $aAttributes ) . " />"; |
|
76 | + $_sOutput .= "<input ".$this->getAttributes( $aAttributes )." />"; |
|
77 | 77 | return $_sOutput; |
78 | 78 | } |
79 | 79 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function getAttributesByKey( /* $sKey */ ) { |
87 | 87 | |
88 | 88 | // Parameters |
89 | - $_aParams = func_get_args() + array( 0 => '', ); |
|
89 | + $_aParams = func_get_args() + array( 0 => '',); |
|
90 | 90 | $_sKey = $_aParams[ 0 ]; |
91 | 91 | $_bIsMultiple = '' !== $_sKey; |
92 | 92 | |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | // The type needs to be specified since the postytpe field type extends this class. If not set, the 'posttype' will be passed to the type attribute. |
99 | 99 | + array( |
100 | 100 | 'type' => 'checkbox', |
101 | - 'id' => $this->aAttributes[ 'id' ] . '_' . $_sKey, |
|
101 | + 'id' => $this->aAttributes[ 'id' ].'_'.$_sKey, |
|
102 | 102 | 'checked' => $this->_getCheckedAttributeValue( $_sKey ), |
103 | - 'value' => 1, // this must be always 1 because the key value can be zero. In that case, the value always will be false and unchecked. |
|
103 | + 'value' => 1, // this must be always 1 because the key value can be zero. In that case, the value always will be false and unchecked. |
|
104 | 104 | 'name' => $_bIsMultiple |
105 | 105 | ? "{$this->aAttributes[ 'name' ]}[{$_sKey}]" |
106 | 106 | : $this->aAttributes[ 'name' ], |
107 | - 'data-id' => $this->aAttributes[ 'id' ], // referenced by the JavaScript scripts such as the revealer script. |
|
107 | + 'data-id' => $this->aAttributes[ 'id' ], // referenced by the JavaScript scripts such as the revealer script. |
|
108 | 108 | ) |
109 | 109 | + $this->aAttributes |
110 | 110 | ; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | : array( 'value', $_sKey ); |
122 | 122 | return $this->getElement( $this->aAttributes, $_aValueDimension ) |
123 | 123 | ? 'checked' |
124 | - : null; // to not to set, pass null. An empty value '' will still set the attribute. |
|
124 | + : null; // to not to set, pass null. An empty value '' will still set the attribute. |
|
125 | 125 | |
126 | 126 | } |
127 | 127 |