@@ -66,7 +66,7 @@ |
||
66 | 66 | . ( $aField[ 'label' ] |
67 | 67 | ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
68 | 68 | . $aField[ 'label' ] |
69 | - . "</span>" |
|
69 | + . "</span>" |
|
70 | 70 | : "" |
71 | 71 | ) |
72 | 72 | . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
@@ -65,12 +65,12 @@ |
||
65 | 65 | . "<label for='{$aField[ 'input_id' ]}'>" |
66 | 66 | . $aField[ 'before_input' ] |
67 | 67 | . ( $aField[ 'label' ] |
68 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
68 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
69 | 69 | . $aField[ 'label' ] |
70 | 70 | . "</span>" |
71 | 71 | : "" |
72 | 72 | ) |
73 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
73 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
74 | 74 | . $aField[ 'after_input' ] |
75 | 75 | . "</label>" |
76 | 76 | . "</div>" |
@@ -36,21 +36,21 @@ |
||
36 | 36 | */ |
37 | 37 | public function _replyToGetField( $aField ) { |
38 | 38 | return |
39 | - $aField['before_label'] |
|
39 | + $aField[ 'before_label' ] |
|
40 | 40 | . "<div class='admin-page-framework-input-label-container'>" |
41 | - . "<label for='{$aField['input_id']}'>" |
|
42 | - . $aField['before_input'] |
|
43 | - . ( $aField['label'] && ! $aField['repeatable'] |
|
44 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
41 | + . "<label for='{$aField[ 'input_id' ]}'>" |
|
42 | + . $aField[ 'before_input' ] |
|
43 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
44 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
45 | 45 | . $aField[ 'label' ] |
46 | 46 | . "</span>" |
47 | 47 | : "" |
48 | 48 | ) |
49 | - . $aField['value'] |
|
50 | - . $aField['after_input'] |
|
49 | + . $aField[ 'value' ] |
|
50 | + . $aField[ 'after_input' ] |
|
51 | 51 | . "</label>" |
52 | 52 | . "</div>" |
53 | - . $aField['after_label'] |
|
53 | + . $aField[ 'after_label' ] |
|
54 | 54 | ; |
55 | 55 | } |
56 | 56 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * Defines the field type slugs used for this field type. |
53 | 53 | */ |
54 | - public $aFieldTypeSlugs = array( 'export', ); |
|
54 | + public $aFieldTypeSlugs = array( 'export',); |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Defines the default key-values of this field type. |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
60 | 60 | */ |
61 | 61 | protected $aDefaultKeys = array( |
62 | - 'data' => null, // ( array|string|object ) This is for the export field type. Do not set a value here. |
|
63 | - 'format' => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported. |
|
64 | - 'file_name' => null, // ( string ) for the export field type. Do not set a default value here. |
|
62 | + 'data' => null, // ( array|string|object ) This is for the export field type. Do not set a value here. |
|
63 | + 'format' => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported. |
|
64 | + 'file_name' => null, // ( string ) for the export field type. Do not set a default value here. |
|
65 | 65 | 'attributes' => array( |
66 | 66 | 'class' => 'button button-primary', |
67 | 67 | ), |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | protected function getField( $aField ) { |
79 | 79 | |
80 | 80 | /* Set the transient data to export - If the value is not an array and the export data is set. */ |
81 | - if ( isset( $aField['data'] ) ) { |
|
82 | - $this->setTransient( md5( "{$aField['class_name']}_{$aField['input_id']}" ), $aField['data'], 60*2 ); // 2 minutes. |
|
81 | + if ( isset( $aField[ 'data' ] ) ) { |
|
82 | + $this->setTransient( md5( "{$aField[ 'class_name' ]}_{$aField[ 'input_id' ]}" ), $aField[ 'data' ], 60 * 2 ); // 2 minutes. |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /* Set some required values */ |
86 | - $aField['attributes']['name'] = "__export[submit][{$aField['input_id']}]"; |
|
87 | - $aField['file_name'] = $aField['file_name'] ? $aField['file_name'] : $this->___generateExportFileName( $aField['option_key'] ? $aField['option_key'] : $aField['class_name'], $aField['format'] ); |
|
88 | - $aField['label'] = $aField['label'] ? $aField['label'] : $this->oMsg->get( 'export' ); |
|
86 | + $aField[ 'attributes' ][ 'name' ] = "__export[submit][{$aField[ 'input_id' ]}]"; |
|
87 | + $aField[ 'file_name' ] = $aField[ 'file_name' ] ? $aField[ 'file_name' ] : $this->___generateExportFileName( $aField[ 'option_key' ] ? $aField[ 'option_key' ] : $aField[ 'class_name' ], $aField[ 'format' ] ); |
|
88 | + $aField[ 'label' ] = $aField[ 'label' ] ? $aField[ 'label' ] : $this->oMsg->get( 'export' ); |
|
89 | 89 | |
90 | 90 | return parent::getField( $aField ); |
91 | 91 | |
@@ -101,42 +101,42 @@ discard block |
||
101 | 101 | |
102 | 102 | $_aAttributes = array( 'type' => 'hidden' ); |
103 | 103 | return |
104 | - "<input " . $this->getAttributes( |
|
104 | + "<input ".$this->getAttributes( |
|
105 | 105 | array( |
106 | - 'name' => "__export[{$aField['input_id']}][input_id]", |
|
107 | - 'value' => $aField['input_id'], |
|
106 | + 'name' => "__export[{$aField[ 'input_id' ]}][input_id]", |
|
107 | + 'value' => $aField[ 'input_id' ], |
|
108 | 108 | ) + $_aAttributes |
109 | - ) . "/>" |
|
110 | - . "<input " . $this->getAttributes( |
|
109 | + )."/>" |
|
110 | + . "<input ".$this->getAttributes( |
|
111 | 111 | array( |
112 | - 'name' => "__export[{$aField['input_id']}][field_id]", |
|
113 | - 'value' => $aField['field_id'], |
|
112 | + 'name' => "__export[{$aField[ 'input_id' ]}][field_id]", |
|
113 | + 'value' => $aField[ 'field_id' ], |
|
114 | 114 | ) + $_aAttributes |
115 | - ) . "/>" |
|
116 | - . "<input " . $this->getAttributes( |
|
115 | + )."/>" |
|
116 | + . "<input ".$this->getAttributes( |
|
117 | 117 | array( |
118 | - 'name' => "__export[{$aField['input_id']}][section_id]", |
|
119 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
118 | + 'name' => "__export[{$aField[ 'input_id' ]}][section_id]", |
|
119 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
120 | 120 | ) + $_aAttributes |
121 | - ) . "/>" |
|
122 | - . "<input " . $this->getAttributes( |
|
121 | + )."/>" |
|
122 | + . "<input ".$this->getAttributes( |
|
123 | 123 | array( |
124 | - 'name' => "__export[{$aField['input_id']}][file_name]", |
|
125 | - 'value' => $aField['file_name'], |
|
124 | + 'name' => "__export[{$aField[ 'input_id' ]}][file_name]", |
|
125 | + 'value' => $aField[ 'file_name' ], |
|
126 | 126 | ) + $_aAttributes |
127 | - ) . "/>" |
|
128 | - . "<input " . $this->getAttributes( |
|
127 | + )."/>" |
|
128 | + . "<input ".$this->getAttributes( |
|
129 | 129 | array( |
130 | - 'name' => "__export[{$aField['input_id']}][format]", |
|
131 | - 'value' => $aField['format'], |
|
130 | + 'name' => "__export[{$aField[ 'input_id' ]}][format]", |
|
131 | + 'value' => $aField[ 'format' ], |
|
132 | 132 | ) + $_aAttributes |
133 | - ) . "/>" |
|
134 | - . "<input " . $this->getAttributes( |
|
133 | + )."/>" |
|
134 | + . "<input ".$this->getAttributes( |
|
135 | 135 | array( |
136 | - 'name' => "__export[{$aField['input_id']}][transient]", |
|
137 | - 'value' => isset( $aField['data'] ), |
|
136 | + 'name' => "__export[{$aField[ 'input_id' ]}][transient]", |
|
137 | + 'value' => isset( $aField[ 'data' ] ), |
|
138 | 138 | ) + $_aAttributes |
139 | - ) . "/>" |
|
139 | + )."/>" |
|
140 | 140 | ; |
141 | 141 | } |
142 | 142 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @since 2.1.5 Moved from the AdminPageFramework_FormField class. |
151 | 151 | * @internal |
152 | 152 | */ |
153 | - private function ___generateExportFileName( $sOptionKey, $sExportFormat='json' ) { |
|
153 | + private function ___generateExportFileName( $sOptionKey, $sExportFormat = 'json' ) { |
|
154 | 154 | |
155 | 155 | switch ( trim( strtolower( $sExportFormat ) ) ) { |
156 | 156 | case 'text': // for plain text. |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | break; |
166 | 166 | } |
167 | 167 | |
168 | - return $sOptionKey . '_' . date("Ymd") . '.' . $sExt; |
|
168 | + return $sOptionKey.'_'.date( "Ymd" ).'.'.$sExt; |
|
169 | 169 | |
170 | 170 | } |
171 | 171 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public $sNotice = ''; |
46 | 46 | public $aAttributes = array(); |
47 | 47 | public $aCallbacks = array( |
48 | - 'should_show' => null, // determines whether the admin notice should be displayed. |
|
48 | + 'should_show' => null, // determines whether the admin notice should be displayed. |
|
49 | 49 | ); |
50 | 50 | /**#@-*/ |
51 | 51 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * </ul> |
62 | 62 | * @since 3.5.0 |
63 | 63 | */ |
64 | - public function __construct( $sNotice, array $aAttributes=array( 'class' => 'error' ), array $aCallbacks=array() ) { |
|
64 | + public function __construct( $sNotice, array $aAttributes = array( 'class' => 'error' ), array $aCallbacks = array() ) { |
|
65 | 65 | |
66 | 66 | $this->aAttributes = $aAttributes + array( |
67 | 67 | 'class' => 'error', // 'updated' etc. |
@@ -69,17 +69,17 @@ discard block |
||
69 | 69 | $this->aAttributes[ 'class' ] = $this->getClassAttribute( |
70 | 70 | $this->aAttributes[ 'class' ], |
71 | 71 | 'admin-page-framework-settings-notice-message', |
72 | - 'admin-page-framework-settings-notice-container', // Moved from `AdminPageFramework_Factory_View`. |
|
72 | + 'admin-page-framework-settings-notice-container', // Moved from `AdminPageFramework_Factory_View`. |
|
73 | 73 | 'notice', |
74 | 74 | 'is-dismissible' // 3.5.12+ |
75 | 75 | ); |
76 | - $this->aCallbacks = $aCallbacks + $this->aCallbacks; |
|
76 | + $this->aCallbacks = $aCallbacks + $this->aCallbacks; |
|
77 | 77 | |
78 | 78 | // Load resources. |
79 | 79 | new AdminPageFramework_AdminNotice___Script; |
80 | 80 | |
81 | 81 | // An empty value may be set in order only to load the fade-in script. |
82 | - if ( ! $sNotice ) { |
|
82 | + if ( !$sNotice ) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function _replyToDisplayAdminNotice() { |
101 | 101 | |
102 | - if ( ! $this->___shouldProceed() ) { |
|
102 | + if ( !$this->___shouldProceed() ) { |
|
103 | 103 | return; |
104 | 104 | } |
105 | 105 | |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | 'display: none' |
111 | 111 | ); |
112 | 112 | |
113 | - echo "<div " . $this->getAttributes( $_aAttributes ) . ">" |
|
113 | + echo "<div ".$this->getAttributes( $_aAttributes ).">" |
|
114 | 114 | . "<p>" |
115 | 115 | . self::$___aNotices[ $this->sNotice ] |
116 | 116 | . "</p>" |
117 | 117 | . "</div>" |
118 | 118 | // Insert the same message except it is not hidden. |
119 | 119 | . "<noscript>" |
120 | - . "<div " . $this->getAttributes( $this->aAttributes ) . ">" |
|
120 | + . "<div ".$this->getAttributes( $this->aAttributes ).">" |
|
121 | 121 | . "<p>" |
122 | 122 | . self::$___aNotices[ $this->sNotice ] |
123 | 123 | . "</p>" |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | * @internal |
135 | 135 | */ |
136 | 136 | private function ___shouldProceed() { |
137 | - if ( ! is_callable( $this->aCallbacks[ 'should_show' ] ) ) { |
|
137 | + if ( !is_callable( $this->aCallbacks[ 'should_show' ] ) ) { |
|
138 | 138 | return true; |
139 | 139 | } |
140 | - return call_user_func_array( $this->aCallbacks[ 'should_show' ], array( true, ) ); |
|
140 | + return call_user_func_array( $this->aCallbacks[ 'should_show' ], array( true,) ); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | } |
144 | 144 | \ No newline at end of file |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">"; |
330 | 330 | $_sOutput .= "<td " . self::getAttributes( $_aTDAttrFirst ) . ">" |
331 | 331 | . "<p " . self::getAttributes( $_aPAttr ) . ">" . self::___getHTMLEscaped( $_sColumnName, $bEscape ) . "</p>" |
332 | - . "</td>"; |
|
332 | + . "</td>"; |
|
333 | 333 | $_sOutput .= self::___getColumnValue( $_asValue, $aAllAttributes, $bEscape, 1 ); |
334 | 334 | $_sOutput .= "</tr>"; |
335 | 335 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | if ( is_scalar( $mValue ) ) { |
397 | 397 | return "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
398 | 398 | . "<p " . self::getAttributes( $_aPAttr ) . ">" . self::___getHTMLEscaped( $mValue, $bEscape ) . "</p>" |
399 | - . "</td>"; |
|
399 | + . "</td>"; |
|
400 | 400 | } |
401 | 401 | if ( is_array( $mValue ) ) { |
402 | 402 | return self::isAssociativeArray( $mValue ) || self::isMultiDimensional( $mValue ) |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | static public function getReadableListOfArray( array $aArray ) { |
28 | 28 | |
29 | - $_aOutput = array(); |
|
30 | - foreach( $aArray as $_sKey => $_vValue ) { |
|
31 | - $_aOutput[] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ) . PHP_EOL; |
|
29 | + $_aOutput = array(); |
|
30 | + foreach ( $aArray as $_sKey => $_vValue ) { |
|
31 | + $_aOutput[ ] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ).PHP_EOL; |
|
32 | 32 | } |
33 | 33 | return implode( PHP_EOL, $_aOutput ); |
34 | 34 | |
@@ -40,37 +40,37 @@ discard block |
||
40 | 40 | * @since 3.9.0 Moved from `AdminPageFramework_Utility_Array.php`. |
41 | 41 | * @return string The generated human-readable array contents. |
42 | 42 | */ |
43 | - static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths=16, $iOffset=0 ) { |
|
43 | + static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths = 16, $iOffset = 0 ) { |
|
44 | 44 | |
45 | 45 | $_aOutput = array(); |
46 | - $_aOutput[] = ( $iOffset |
|
47 | - ? str_pad( ' ', $iOffset ) |
|
46 | + $_aOutput[ ] = ( $iOffset |
|
47 | + ? str_pad( ' ', $iOffset ) |
|
48 | 48 | : '' |
49 | 49 | ) |
50 | 50 | . ( $sKey |
51 | - ? '[' . $sKey . ']' |
|
51 | + ? '['.$sKey.']' |
|
52 | 52 | : '' |
53 | 53 | ); |
54 | 54 | |
55 | - if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) { |
|
56 | - $_aOutput[] = $vValue; |
|
55 | + if ( !in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) { |
|
56 | + $_aOutput[ ] = $vValue; |
|
57 | 57 | return implode( PHP_EOL, $_aOutput ); |
58 | 58 | } |
59 | 59 | |
60 | 60 | foreach ( $vValue as $_sTitle => $_asDescription ) { |
61 | - if ( ! in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) { |
|
62 | - $_aOutput[] = str_pad( ' ', $iOffset ) |
|
61 | + if ( !in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) { |
|
62 | + $_aOutput[ ] = str_pad( ' ', $iOffset ) |
|
63 | 63 | . $_sTitle |
64 | 64 | . str_pad( ':', $sLabelCharLengths - self::getStringLength( $_sTitle ) ) |
65 | 65 | . $_asDescription; |
66 | 66 | continue; |
67 | 67 | } |
68 | - $_aOutput[] = str_pad( ' ', $iOffset ) |
|
68 | + $_aOutput[ ] = str_pad( ' ', $iOffset ) |
|
69 | 69 | . $_sTitle |
70 | 70 | . ": {" |
71 | 71 | . self::getReadableArrayContents( '', $_asDescription, 16, $iOffset + 4 ) |
72 | 72 | . PHP_EOL |
73 | - . str_pad( ' ', $iOffset ) . "}"; |
|
73 | + . str_pad( ' ', $iOffset )."}"; |
|
74 | 74 | } |
75 | 75 | return implode( PHP_EOL, $_aOutput ); |
76 | 76 | |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | * @return string The HTML list generated from the given array. |
84 | 84 | */ |
85 | 85 | static public function getReadableListOfArrayAsHTML( array $aArray ) { |
86 | - $_aOutput = array(); |
|
87 | - foreach( $aArray as $_sKey => $_vValue ) { |
|
88 | - $_aOutput[] = "<ul class='array-contents'>" |
|
86 | + $_aOutput = array(); |
|
87 | + foreach ( $aArray as $_sKey => $_vValue ) { |
|
88 | + $_aOutput[ ] = "<ul class='array-contents'>" |
|
89 | 89 | . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) |
90 | - . "</ul>" . PHP_EOL; |
|
90 | + . "</ul>".PHP_EOL; |
|
91 | 91 | } |
92 | 92 | return implode( PHP_EOL, $_aOutput ); |
93 | 93 | } |
@@ -105,25 +105,25 @@ discard block |
||
105 | 105 | $_aOutput = array(); |
106 | 106 | |
107 | 107 | // Title - array key |
108 | - $_aOutput[] = $sKey |
|
109 | - ? "<h3 class='array-key'>" . $sKey . "</h3>" |
|
108 | + $_aOutput[ ] = $sKey |
|
109 | + ? "<h3 class='array-key'>".$sKey."</h3>" |
|
110 | 110 | : ""; |
111 | 111 | |
112 | 112 | // If it does not have a nested array or object, |
113 | - if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ), true ) ) { |
|
114 | - $_aOutput[] = "<div class='array-value'>" |
|
113 | + if ( !in_array( gettype( $vValue ), array( 'array', 'object' ), true ) ) { |
|
114 | + $_aOutput[ ] = "<div class='array-value'>" |
|
115 | 115 | . html_entity_decode( nl2br( $vValue ), ENT_QUOTES ) |
116 | 116 | . "</div>"; |
117 | - return "<li>" . implode( PHP_EOL, $_aOutput ) . "</li>"; |
|
117 | + return "<li>".implode( PHP_EOL, $_aOutput )."</li>"; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | // Now it is a nested item. |
121 | 121 | foreach ( $vValue as $_sKey => $_vValue ) { |
122 | - $_aOutput[] = "<ul class='array-contents'>" |
|
122 | + $_aOutput[ ] = "<ul class='array-contents'>" |
|
123 | 123 | . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) |
124 | 124 | . "</ul>"; |
125 | 125 | } |
126 | - return implode( PHP_EOL, $_aOutput ) ; |
|
126 | + return implode( PHP_EOL, $_aOutput ); |
|
127 | 127 | |
128 | 128 | } |
129 | 129 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @return string |
143 | 143 | * @since 3.9.0 |
144 | 144 | */ |
145 | - static public function getTableOfKeyValues( array $aArray, array $aAllAttributes=array(), array $aHeader=array(), array $aFooter=array(), $bEscape=true, $sCaption='' ) { |
|
145 | + static public function getTableOfKeyValues( array $aArray, array $aAllAttributes = array(), array $aHeader = array(), array $aFooter = array(), $bEscape = true, $sCaption = '' ) { |
|
146 | 146 | $_aAllAttributes = $aAllAttributes + array( |
147 | 147 | 'table' => array(), |
148 | 148 | 'caption' => array(), |
@@ -157,10 +157,10 @@ discard block |
||
157 | 157 | 'li' => array(), |
158 | 158 | 'p' => array(), |
159 | 159 | ); |
160 | - return "<table " . self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'table' ) ) . ">" |
|
160 | + return "<table ".self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'table' ) ).">" |
|
161 | 161 | . self::___getTableCaption( $sCaption, $_aAllAttributes, $bEscape ) |
162 | 162 | . self::___getTableHeaderOfKeyValuePair( $aHeader, $aAllAttributes, $bEscape ) |
163 | - . "<tbody " . self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'tbody' ) ) . ">" |
|
163 | + . "<tbody ".self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'tbody' ) ).">" |
|
164 | 164 | . self::___getRowsOfKeyValuePair( $aArray, $aAllAttributes, $bEscape ) |
165 | 165 | . "</tbody>" |
166 | 166 | . self::___getTableFooterOfKeyValuePair( $aFooter, $aAllAttributes, $bEscape ) |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @return string |
181 | 181 | * @since 3.9.0 |
182 | 182 | */ |
183 | - static public function getTableOfArray( array $aArray, array $aAllAttributes=array(), array $aHeader=array(), array $aFooter=array(), $bEscape=true, $sCaption='' ) { |
|
183 | + static public function getTableOfArray( array $aArray, array $aAllAttributes = array(), array $aHeader = array(), array $aFooter = array(), $bEscape = true, $sCaption = '' ) { |
|
184 | 184 | |
185 | 185 | $_aAllAttributes = $aAllAttributes + array( |
186 | 186 | 'table' => array(), |
@@ -196,10 +196,10 @@ discard block |
||
196 | 196 | 'li' => array(), |
197 | 197 | 'p' => array(), |
198 | 198 | ); |
199 | - return "<table " . self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'table' ) ) . ">" |
|
199 | + return "<table ".self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'table' ) ).">" |
|
200 | 200 | . self::___getTableCaption( $sCaption, $_aAllAttributes, $bEscape ) |
201 | 201 | . self::___getTableHeader( $aHeader, $_aAllAttributes, $bEscape ) |
202 | - . "<tbody " . self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'tbody' ) ) . ">" |
|
202 | + . "<tbody ".self::getAttributes( self::getElementAsArray( $_aAllAttributes, 'tbody' ) ).">" |
|
203 | 203 | . self::___getTableRows( $aArray, $_aAllAttributes, $bEscape ) |
204 | 204 | . "</tbody>" |
205 | 205 | . self::___getTableFooter( $aFooter, $_aAllAttributes, $bEscape ) |
@@ -207,14 +207,14 @@ discard block |
||
207 | 207 | } |
208 | 208 | static private function ___getTableCaption( $sCaption, $aAllAttributes, $bEscape ) { |
209 | 209 | $sCaption = ( string ) $sCaption; |
210 | - if ( ! strlen( $sCaption ) ) { |
|
210 | + if ( !strlen( $sCaption ) ) { |
|
211 | 211 | return ''; |
212 | 212 | } |
213 | 213 | $_aCapAttr = self::getElementAsArray( $aAllAttributes, 'caption' ); |
214 | 214 | $_sCaption = $bEscape |
215 | 215 | ? htmlspecialchars( $sCaption ) |
216 | 216 | : $sCaption; |
217 | - return "<caption " . self::getAttributes( $_aCapAttr ) . ">" |
|
217 | + return "<caption ".self::getAttributes( $_aCapAttr ).">" |
|
218 | 218 | . $_sCaption |
219 | 219 | . "</caption>"; |
220 | 220 | } |
@@ -237,24 +237,24 @@ discard block |
||
237 | 237 | $_aTHAttr1 = self::getElementAsArray( $aAllAttributes, array( 'th', 0 ) ) + $_aTHAttr; |
238 | 238 | $_aTHAttr2 = self::getElementAsArray( $aAllAttributes, array( 'th', 1 ) ) + $_aTHAttr; |
239 | 239 | $_sOutput = ''; |
240 | - foreach( $aHeader as $_sKey => $_sValue ) { |
|
241 | - $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">" |
|
242 | - . "<th " . self::getAttributes( $_aTHAttr1 ) . ">" . self::___getHTMLEscaped( $_sKey, $bEscape ) . "</th>" |
|
243 | - . "<th " . self::getAttributes( $_aTHAttr2 ) . ">" . self::___getHTMLEscaped( $_sValue, $bEscape ) . "</th>" |
|
240 | + foreach ( $aHeader as $_sKey => $_sValue ) { |
|
241 | + $_sOutput .= "<tr ".self::getAttributes( $_aTRAttr ).">" |
|
242 | + . "<th ".self::getAttributes( $_aTHAttr1 ).">".self::___getHTMLEscaped( $_sKey, $bEscape )."</th>" |
|
243 | + . "<th ".self::getAttributes( $_aTHAttr2 ).">".self::___getHTMLEscaped( $_sValue, $bEscape )."</th>" |
|
244 | 244 | . "</tr>"; |
245 | 245 | } |
246 | - return "<thead>" . $_sOutput . "</thead>"; |
|
246 | + return "<thead>".$_sOutput."</thead>"; |
|
247 | 247 | } |
248 | 248 | static private function ___getTableHeaderOfMultiColumns( array $aHeader, array $aAllAttributes, $bEscape ) { |
249 | 249 | $_aTRAttr = self::getElementAsArray( $aAllAttributes, 'tr' ); |
250 | 250 | $_aTHAttr = self::getElementAsArray( $aAllAttributes, 'th' ); |
251 | - $_sOutput = "<tr " . self::getAttributes( $_aTRAttr ) . ">"; |
|
252 | - foreach( array_values( $aHeader ) as $_iIndex => $_sColumnName ) { |
|
251 | + $_sOutput = "<tr ".self::getAttributes( $_aTRAttr ).">"; |
|
252 | + foreach ( array_values( $aHeader ) as $_iIndex => $_sColumnName ) { |
|
253 | 253 | $_aTHAttrNth = self::getElementAsArray( $aAllAttributes, array( 'th', $_iIndex ) ) + $_aTHAttr; |
254 | - $_sOutput .= "<th " . self::getAttributes( $_aTHAttrNth ) . ">" . self::___getHTMLEscaped( ( string ) $_sColumnName, $bEscape ) . "</th>"; |
|
254 | + $_sOutput .= "<th ".self::getAttributes( $_aTHAttrNth ).">".self::___getHTMLEscaped( ( string ) $_sColumnName, $bEscape )."</th>"; |
|
255 | 255 | } |
256 | 256 | $_sOutput .= "</tr>"; |
257 | - return "<thead>" . $_sOutput . "</thead>"; |
|
257 | + return "<thead>".$_sOutput."</thead>"; |
|
258 | 258 | } |
259 | 259 | static private function ___getTableFooter( array $aFooter, array $aAllAttributes, $bEscape ) { |
260 | 260 | if ( empty( $aFooter ) ) { |
@@ -271,24 +271,24 @@ discard block |
||
271 | 271 | $_aTDAttr1 = self::getElementAsArray( $aAllAttributes, array( 'td', 0 ) ) + $_aTDAttr; |
272 | 272 | $_aTDAttr2 = self::getElementAsArray( $aAllAttributes, array( 'td', 1 ) ) + $_aTDAttr; |
273 | 273 | $_sOutput = ''; |
274 | - foreach( $aFooter as $_sKey => $_sValue ) { |
|
275 | - $_sOutput = "<tr " . self::getAttributes( $_aTRAttr ) . ">" |
|
276 | - . "<td " . self::getAttributes( $_aTDAttr1 ) . ">" . self::___getHTMLEscaped( $_sKey, $bEscape ) . "</td>" |
|
277 | - . "<td " . self::getAttributes( $_aTDAttr2 ) . ">" . self::___getHTMLEscaped( $_sValue, $bEscape ) . "</td>" |
|
274 | + foreach ( $aFooter as $_sKey => $_sValue ) { |
|
275 | + $_sOutput = "<tr ".self::getAttributes( $_aTRAttr ).">" |
|
276 | + . "<td ".self::getAttributes( $_aTDAttr1 ).">".self::___getHTMLEscaped( $_sKey, $bEscape )."</td>" |
|
277 | + . "<td ".self::getAttributes( $_aTDAttr2 ).">".self::___getHTMLEscaped( $_sValue, $bEscape )."</td>" |
|
278 | 278 | . "</tr>"; |
279 | 279 | } |
280 | - return "<tfoot>" . $_sOutput . "</tfoot>"; |
|
280 | + return "<tfoot>".$_sOutput."</tfoot>"; |
|
281 | 281 | } |
282 | 282 | static private function ___getTableFooterOfMultiColumns( array $aFooter, array $aAllAttributes, $bEscape ) { |
283 | 283 | $_aTRAttr = self::getElementAsArray( $aAllAttributes, 'tr' ); |
284 | 284 | $_aTDAttr = self::getElementAsArray( $aAllAttributes, 'td' ); |
285 | - $_sOutput = "<tr " . self::getAttributes( $_aTRAttr ) . ">"; |
|
286 | - foreach( array_values( $aFooter ) as $_iIndex => $_sColumnName ) { |
|
285 | + $_sOutput = "<tr ".self::getAttributes( $_aTRAttr ).">"; |
|
286 | + foreach ( array_values( $aFooter ) as $_iIndex => $_sColumnName ) { |
|
287 | 287 | $_aTDAttrNth = self::getElementAsArray( $aAllAttributes, array( 'td', $_iIndex ) ) + $_aTDAttr; |
288 | - $_sOutput .= "<td " . self::getAttributes( $_aTDAttrNth ) . ">" . self::___getHTMLEscaped( ( string ) $_sColumnName, $bEscape ) . "</td>"; |
|
288 | + $_sOutput .= "<td ".self::getAttributes( $_aTDAttrNth ).">".self::___getHTMLEscaped( ( string ) $_sColumnName, $bEscape )."</td>"; |
|
289 | 289 | } |
290 | 290 | $_sOutput .= "</tr>"; |
291 | - return "<tfoot>" . $_sOutput . "</tfoot>"; |
|
291 | + return "<tfoot>".$_sOutput."</tfoot>"; |
|
292 | 292 | } |
293 | 293 | static private function ___getTableRows( array $aArray, array $aAllAttributes, $bEscape ) { |
294 | 294 | if ( empty( $aArray ) ) { |
@@ -325,10 +325,10 @@ discard block |
||
325 | 325 | $_aTDAttrFirst = self::getElementAsArray( $aAllAttributes, array( 'td', 0 ) ) + $_aTDAttr; |
326 | 326 | $_aTDAttrFirst[ 'class' ] = self::getClassAttribute( 'column-key', self::getElement( $_aTDAttrFirst, array( 'class' ), '' ) ); |
327 | 327 | $_sOutput = ''; |
328 | - foreach( $aItem as $_sColumnName => $_asValue ) { |
|
329 | - $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">"; |
|
330 | - $_sOutput .= "<td " . self::getAttributes( $_aTDAttrFirst ) . ">" |
|
331 | - . "<p " . self::getAttributes( $_aPAttr ) . ">" . self::___getHTMLEscaped( $_sColumnName, $bEscape ) . "</p>" |
|
328 | + foreach ( $aItem as $_sColumnName => $_asValue ) { |
|
329 | + $_sOutput .= "<tr ".self::getAttributes( $_aTRAttr ).">"; |
|
330 | + $_sOutput .= "<td ".self::getAttributes( $_aTDAttrFirst ).">" |
|
331 | + . "<p ".self::getAttributes( $_aPAttr ).">".self::___getHTMLEscaped( $_sColumnName, $bEscape )."</p>" |
|
332 | 332 | . "</td>"; |
333 | 333 | $_sOutput .= self::___getColumnValue( $_asValue, $aAllAttributes, $bEscape, 1 ); |
334 | 334 | $_sOutput .= "</tr>"; |
@@ -342,15 +342,15 @@ discard block |
||
342 | 342 | static private function ___getRowsOfMultiColumns( array $aArray, array $aAllAttributes, $bEscape ) { |
343 | 343 | $_aTRAttr = self::getElementAsArray( $aAllAttributes, 'tr' ); |
344 | 344 | $_sOutput = ''; |
345 | - foreach( $aArray as $_iRowIndex => $_asValue ) { |
|
345 | + foreach ( $aArray as $_iRowIndex => $_asValue ) { |
|
346 | 346 | if ( is_scalar( $_asValue ) ) { |
347 | - $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">" |
|
347 | + $_sOutput .= "<tr ".self::getAttributes( $_aTRAttr ).">" |
|
348 | 348 | . self::___getColumnValue( $_asValue, $aAllAttributes, $bEscape, 0 ) |
349 | 349 | . "</tr>"; |
350 | 350 | continue; |
351 | 351 | } |
352 | 352 | $_aColumns = self::getAsArray( $_asValue ); |
353 | - $_sOutput .= "<tr " . self::getAttributes( $_aTRAttr ) . ">" |
|
353 | + $_sOutput .= "<tr ".self::getAttributes( $_aTRAttr ).">" |
|
354 | 354 | . self::___getColumns( $_aColumns, $aAllAttributes, $bEscape ) |
355 | 355 | . "</tr>"; |
356 | 356 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | } |
359 | 359 | static private function ___getColumns( array $aColumns, $aAllAttributes, $bEscape ) { |
360 | 360 | $_sOutput = ''; |
361 | - foreach( array_values( $aColumns ) as $_iIndex => $_asValue ) { |
|
361 | + foreach ( array_values( $aColumns ) as $_iIndex => $_asValue ) { |
|
362 | 362 | $_sOutput .= self::___getColumnValue( $_asValue, $aAllAttributes, $bEscape, $_iIndex ); |
363 | 363 | } |
364 | 364 | return $_sOutput; |
@@ -380,24 +380,24 @@ discard block |
||
380 | 380 | if ( is_null( $mValue ) ) { |
381 | 381 | $mValue = '(null)'; |
382 | 382 | } |
383 | - $_aPAttr = self::getElementAsArray( $aAllAttributes, 'p' ); |
|
383 | + $_aPAttr = self::getElementAsArray( $aAllAttributes, 'p' ); |
|
384 | 384 | if ( is_scalar( $mValue ) ) { |
385 | - return "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
|
386 | - . "<p " . self::getAttributes( $_aPAttr ) . ">" . self::___getHTMLEscaped( $mValue, $bEscape ) . "</p>" |
|
385 | + return "<td ".self::getAttributes( $_aTDAttrNth ).">" |
|
386 | + . "<p ".self::getAttributes( $_aPAttr ).">".self::___getHTMLEscaped( $mValue, $bEscape )."</p>" |
|
387 | 387 | . "</td>"; |
388 | 388 | } |
389 | 389 | if ( is_array( $mValue ) ) { |
390 | 390 | return self::isAssociativeArray( $mValue ) || self::isMultiDimensional( $mValue ) |
391 | - ? "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
|
391 | + ? "<td ".self::getAttributes( $_aTDAttrNth ).">" |
|
392 | 392 | . self::getTableOfKeyValues( $mValue, $aAllAttributes ) |
393 | 393 | . "</td>" |
394 | - : "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
|
394 | + : "<td ".self::getAttributes( $_aTDAttrNth ).">" |
|
395 | 395 | // @todo may ought to be numeric-rows table |
396 | 396 | . self::___getList( $mValue, $aAllAttributes, $bEscape ) |
397 | 397 | . "</td>"; |
398 | 398 | } |
399 | - return "<td " . self::getAttributes( $_aTDAttrNth ) . ">" |
|
400 | - . '(' . gettype( $mValue ) . ')' . ( is_object( $mValue ) ? get_class( $mValue ) : '' ) |
|
399 | + return "<td ".self::getAttributes( $_aTDAttrNth ).">" |
|
400 | + . '('.gettype( $mValue ).')'.( is_object( $mValue ) ? get_class( $mValue ) : '' ) |
|
401 | 401 | . "</td>"; |
402 | 402 | } |
403 | 403 | /** |
@@ -414,16 +414,16 @@ discard block |
||
414 | 414 | if ( empty( $aArray ) ) { |
415 | 415 | return ''; |
416 | 416 | } |
417 | - $_sList = "<ul " . self::getAttributes( $_aULAttr ) . ">"; |
|
418 | - foreach( $aArray as $_asValue ) { |
|
417 | + $_sList = "<ul ".self::getAttributes( $_aULAttr ).">"; |
|
418 | + foreach ( $aArray as $_asValue ) { |
|
419 | 419 | $_sItem = is_array( $_asValue ) |
420 | 420 | ? self::___getList( $_asValue, $aAllAttributes, $bEscape ) |
421 | 421 | : self::___getHTMLEscaped( $_asValue, $bEscape ); |
422 | - $_sList .= "<li " . self::getAttributes( $_aLIAttr ) . ">" |
|
422 | + $_sList .= "<li ".self::getAttributes( $_aLIAttr ).">" |
|
423 | 423 | . $_sItem |
424 | 424 | . "</li>"; |
425 | 425 | } |
426 | - $_sList .= "</ul>"; |
|
426 | + $_sList .= "</ul>"; |
|
427 | 427 | return $_sList; |
428 | 428 | } |
429 | 429 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @deprecated 3.8.0 Use `getLengthSanitized()` instead. |
31 | 31 | * @since 3.8.8 Moved from `AdminPageFramework_Utility_String`. |
32 | 32 | */ |
33 | - static public function sanitizeLength( $sLength, $sUnit='px' ) { |
|
33 | + static public function sanitizeLength( $sLength, $sUnit = 'px' ) { |
|
34 | 34 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getLengthSanitized()' ); |
35 | 35 | return AdminPageFramework_Utility_String::getLengthSanitized( $sLength, $sUnit ); |
36 | 36 | } |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | * @since 3.5.3 Moved from `AdminPageFramework_Utility_Array`. |
50 | 50 | * @deprecated 3.5.3 Use `getElement()`. |
51 | 51 | */ |
52 | - public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault='', $bBlankToDefault=false ) { |
|
52 | + public static function getCorrespondingArrayValue( $vSubject, $sKey, $sDefault = '', $bBlankToDefault = false ) { |
|
53 | 53 | |
54 | 54 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getElement()' ); |
55 | 55 | |
56 | 56 | // If $vSubject is null, |
57 | - if ( ! isset( $vSubject ) ) { |
|
57 | + if ( !isset( $vSubject ) ) { |
|
58 | 58 | return $sDefault; |
59 | 59 | } |
60 | 60 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | // If $vSubject is not an array, |
67 | - if ( ! is_array( $vSubject ) ) { |
|
67 | + if ( !is_array( $vSubject ) ) { |
|
68 | 68 | return ( string ) $vSubject; |
69 | 69 | } // consider it as string. |
70 | 70 | |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | * @since 3.5.3 Moved from `AdminPageFramework_FieldType_Base`. |
105 | 105 | * @deprecated 3.5.3 Use the `getElement()` method. |
106 | 106 | */ |
107 | - protected function getFieldElementByKey( $asElement, $sKey, $asDefault='' ) { |
|
107 | + protected function getFieldElementByKey( $asElement, $sKey, $asDefault = '' ) { |
|
108 | 108 | |
109 | 109 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__, 'getElement()' ); |
110 | 110 | |
111 | - if ( ! is_array( $asElement ) || ! isset( $sKey ) ) { |
|
111 | + if ( !is_array( $asElement ) || !isset( $sKey ) ) { |
|
112 | 112 | return $asElement; |
113 | 113 | } |
114 | 114 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | AdminPageFramework_Utility::showDeprecationNotice( __FUNCTION__ ); |
133 | 133 | |
134 | - foreach( $aArray as &$vElem ) { |
|
134 | + foreach ( $aArray as &$vElem ) { |
|
135 | 135 | |
136 | 136 | if ( $vElem ) { break; } |
137 | 137 | unset( $vElem ); |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | */ |
40 | 40 | static public function getAttributes( array $aAttributes ) { |
41 | 41 | |
42 | - $_sQuoteCharactor ="'"; |
|
42 | + $_sQuoteCharactor = "'"; |
|
43 | 43 | $_aOutput = array(); |
44 | - foreach( $aAttributes as $sAttribute => $sProperty ) { |
|
45 | - if ( ! is_scalar( $sProperty ) ) { |
|
44 | + foreach ( $aAttributes as $sAttribute => $sProperty ) { |
|
45 | + if ( !is_scalar( $sProperty ) ) { |
|
46 | 46 | continue; |
47 | 47 | } |
48 | - $_aOutput[] = "{$sAttribute}={$_sQuoteCharactor}{$sProperty}{$_sQuoteCharactor}"; |
|
48 | + $_aOutput[ ] = "{$sAttribute}={$_sQuoteCharactor}{$sProperty}{$_sQuoteCharactor}"; |
|
49 | 49 | } |
50 | 50 | return implode( ' ', $_aOutput ); |
51 | 51 | |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | */ |
72 | 72 | static public function getInlineCSS( array $aCSSRules ) { |
73 | 73 | $_aOutput = array(); |
74 | - foreach( $aCSSRules as $_sProperty => $_sValue ) { |
|
74 | + foreach ( $aCSSRules as $_sProperty => $_sValue ) { |
|
75 | 75 | if ( is_null( $_sValue ) ) { |
76 | 76 | continue; |
77 | 77 | } |
78 | - $_aOutput[] = $_sProperty . ': ' . $_sValue; |
|
78 | + $_aOutput[ ] = $_sProperty.': '.$_sValue; |
|
79 | 79 | } |
80 | 80 | return implode( '; ', $_aOutput ); |
81 | 81 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | static public function getStyleAttribute( $asInlineCSSes ) { |
107 | 107 | |
108 | 108 | $_aCSSRules = array(); |
109 | - foreach( array_reverse( func_get_args() ) as $_asCSSRules ) { |
|
109 | + foreach ( array_reverse( func_get_args() ) as $_asCSSRules ) { |
|
110 | 110 | |
111 | 111 | // For array, store in the container. |
112 | 112 | if ( is_array( $_asCSSRules ) ) { |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | |
117 | 117 | // At this point, it is a string. Break them down to array elements. |
118 | 118 | $__aCSSRules = explode( ';', $_asCSSRules ); |
119 | - foreach( $__aCSSRules as $_sPair ) { |
|
119 | + foreach ( $__aCSSRules as $_sPair ) { |
|
120 | 120 | $_aCSSPair = explode( ':', $_sPair ); |
121 | - if ( ! isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) { |
|
121 | + if ( !isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) { |
|
122 | 122 | continue; |
123 | 123 | } |
124 | 124 | $_aCSSRules[ $_aCSSPair[ 0 ] ] = $_aCSSPair[ 1 ]; |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | */ |
156 | 156 | static public function getClassAttribute( /* $asClassSelectors1, $asClassSelectors12, ... */ ) { |
157 | 157 | |
158 | - $_aClasses = array(); |
|
159 | - foreach( func_get_args() as $_asClasses ) { |
|
160 | - if ( ! in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) { |
|
158 | + $_aClasses = array(); |
|
159 | + foreach ( func_get_args() as $_asClasses ) { |
|
160 | + if ( !in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) { |
|
161 | 161 | continue; |
162 | 162 | } |
163 | 163 | $_aClasses = array_merge( |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | : explode( ' ', $_asClasses ) |
168 | 168 | ); |
169 | 169 | } |
170 | - $_aClasses = array_unique( array_filter( $_aClasses ) ); |
|
170 | + $_aClasses = array_unique( array_filter( $_aClasses ) ); |
|
171 | 171 | |
172 | 172 | // @todo examine if it is okay to remove the trim() function below. |
173 | 173 | return trim( implode( ' ', $_aClasses ) ); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | static public function generateClassAttribute( /* $asClassSelectors1, $asClassSelectors12 ... */ ) { |
184 | 184 | $_aParams = func_get_args(); |
185 | 185 | return call_user_func_array( |
186 | - array( __CLASS__ , 'getClassAttribute' ), |
|
186 | + array( __CLASS__, 'getClassAttribute' ), |
|
187 | 187 | $_aParams |
188 | 188 | ); |
189 | 189 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | static public function getDataAttributeArray( array $aArray ) { |
201 | 201 | |
202 | 202 | $_aNewArray = array(); |
203 | - foreach( $aArray as $sKey => $v ) { |
|
203 | + foreach ( $aArray as $sKey => $v ) { |
|
204 | 204 | |
205 | 205 | if ( in_array( gettype( $v ), array( 'object', 'NULL' ) ) ) { |
206 | 206 | continue; |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * @since 3.8.9 |
29 | 29 | * @since 3.8.32 Moved from `AdminPageFramework_Debug_Base` and renamed from `___getArrayMappedRecursive()` and made public as a part of the utility class. |
30 | 30 | */ |
31 | - static public function getArrayMappedRecursive( $cCallback, $aArray, array $aArguments=array() ) { |
|
31 | + static public function getArrayMappedRecursive( $cCallback, $aArray, array $aArguments = array() ) { |
|
32 | 32 | $_aOutput = array(); |
33 | - foreach( $aArray as $_isKey => $_vValue ) { |
|
33 | + foreach ( $aArray as $_isKey => $_vValue ) { |
|
34 | 34 | if ( is_array( $_vValue ) ) { |
35 | 35 | $_aOutput[ $_isKey ] = self::getArrayMappedRecursive( $cCallback, $_vValue, $aArguments ); |
36 | 36 | continue; |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | * @return numeric |
48 | 48 | * @since 3.7.4 |
49 | 49 | */ |
50 | - static public function getUnusedNumericIndex( $aArray, $nIndex, $iOffset=1 ) { |
|
50 | + static public function getUnusedNumericIndex( $aArray, $nIndex, $iOffset = 1 ) { |
|
51 | 51 | |
52 | 52 | // Check if the order value is not used. |
53 | - if ( ! isset( $aArray[ $nIndex ] ) ) { |
|
53 | + if ( !isset( $aArray[ $nIndex ] ) ) { |
|
54 | 54 | return $nIndex; |
55 | 55 | } |
56 | 56 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @return boolean |
66 | 66 | */ |
67 | 67 | static public function isAssociative( array $aArray ) { |
68 | - return array_keys ( $aArray ) !== range( 0, count( $aArray ) - 1 ); |
|
68 | + return array_keys( $aArray ) !== range( 0, count( $aArray ) - 1 ); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @param boolean $bAdjustGMT |
23 | 23 | * @return string |
24 | 24 | */ |
25 | - static public function getSiteReadableDate( $iTimeStamp, $sDateTimeFormat=null, $bAdjustGMT=false ) { |
|
25 | + static public function getSiteReadableDate( $iTimeStamp, $sDateTimeFormat = null, $bAdjustGMT = false ) { |
|
26 | 26 | |
27 | 27 | static $_iOffsetSeconds, $_sDateFormat, $_sTimeFormat; |
28 | 28 | $_iOffsetSeconds = $_iOffsetSeconds |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | : get_option( 'time_format' ); |
37 | 37 | $sDateTimeFormat = $sDateTimeFormat |
38 | 38 | ? $sDateTimeFormat |
39 | - : $_sDateFormat . ' ' . $_sTimeFormat; |
|
39 | + : $_sDateFormat.' '.$_sTimeFormat; |
|
40 | 40 | |
41 | - if ( ! $iTimeStamp ) { |
|
41 | + if ( !$iTimeStamp ) { |
|
42 | 42 | return 'n/a'; |
43 | 43 | } |
44 | 44 | $iTimeStamp = $bAdjustGMT ? $iTimeStamp + $_iOffsetSeconds : $iTimeStamp; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | try { |
72 | 72 | $_sTimeZone = self::___getSiteTimeZone(); |
73 | 73 | $_oDateTimeZone = new DateTimeZone( $_sTimeZone ); |
74 | - $_oDateTime = new DateTime("now", $_oDateTimeZone ); |
|
74 | + $_oDateTime = new DateTime( "now", $_oDateTimeZone ); |
|
75 | 75 | } catch ( Exception $oException ) { |
76 | 76 | self::setObjectCache( __METHOD__, 0 ); |
77 | 77 | return 0; |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | */ |
88 | 88 | static private function ___getSiteTimeZone() { |
89 | 89 | $_sTimeZone = get_option( 'timezone_string' ); |
90 | - if ( ! empty( $_sTimeZone ) ) { |
|
90 | + if ( !empty( $_sTimeZone ) ) { |
|
91 | 91 | return $_sTimeZone; |
92 | 92 | } |
93 | - $_fOffset = get_option( 'gmt_offset', 0 ); // e.g. 5.5 |
|
93 | + $_fOffset = get_option( 'gmt_offset', 0 ); // e.g. 5.5 |
|
94 | 94 | return self::___getNumberedOffsetString( $_fOffset ); |
95 | 95 | } |
96 | 96 |