Completed
Branch master (21eef4)
by
unknown
06:35
created
factory/term_meta/_model/AdminPageFramework_TermMeta_Model___TermMeta.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,6 +21,6 @@
 block discarded – undo
21 21
     /**
22 22
      * The callback function name or the callable object to retrieve meta data.
23 23
      */
24
-    protected $osCallable   = 'get_term_meta'; 
24
+    protected $osCallable = 'get_term_meta'; 
25 25
         
26 26
 }
Please login to merge, or discard this patch.
development/factory/term_meta/form/AdminPageFramework_Form_term_meta.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             '' // default value
55 55
         );    
56 56
     
57
-        if ( ! $this->canUserView( $this->sCapability ) ) {
57
+        if ( !$this->canUserView( $this->sCapability ) ) {
58 58
             return '';
59 59
         }    
60 60
 
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
         );        
83 83
         
84 84
         $_sAddNewTerm     = $bEditTerm ? '' : ' add-new-term';
85
-        $_sClassSelectors = 'admin-page-framework-form-table-term_meta' . $_sAddNewTerm;
85
+        $_sClassSelectors = 'admin-page-framework-form-table-term_meta'.$_sAddNewTerm;
86 86
         return '<tr class="admin-page-framework-form-table-outer-row-term_meta">'
87 87
             . '<td colspan=2>'
88
-                . '<table class="' . $_sClassSelectors . '">'
88
+                . '<table class="'.$_sClassSelectors.'">'
89 89
                     . '<tbody>'
90 90
                         . '<tr>'
91 91
                             . '<td>'
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      * @since       3.8.0
27 27
      * @return      void
28 28
      */
29
-    public function construct() {        
29
+    public function construct() {
30 30
         $this->_addDefaultResources();
31 31
     }
32 32
         /**
Please login to merge, or discard this patch.
development/factory/term_meta/AdminPageFramework_TermMeta_Model.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
      * @since       3.8.0
57 57
      * @internal
58 58
      */
59
-    protected function _setOptionArray( $iTermID=null, $_deprecated=null ) {
59
+    protected function _setOptionArray( $iTermID = null, $_deprecated = null ) {
60 60
         $this->oForm->aSavedData = $this->oUtil->addAndApplyFilter(
61 61
             $this, // the caller factory object
62
-            'options_' . $this->oProp->sClassName,
62
+            'options_'.$this->oProp->sClassName,
63 63
             $this->_getSavedTermMetas( $iTermID, $this->oForm->aFieldsets )
64 64
             // @todo maybe pass the term id because the user will not know whihch form data is
65 65
         );        
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function _replyToValidateOptions( $iTermID ) {
93 93
 
94
-        if ( ! $this->_shouldProceedValidation() ) {
94
+        if ( !$this->_shouldProceedValidation() ) {
95 95
             return;
96 96
         }              
97 97
 
@@ -99,19 +99,19 @@  discard block
 block discarded – undo
99 99
         $_aSubmittedFormData    = $this->oForm->getSubmittedData( $_POST ); 
100 100
         $_aSubmittedFormData    = $this->oUtil->addAndApplyFilters( 
101 101
             $this, 
102
-            'validation_' . $this->oProp->sClassName, 
102
+            'validation_'.$this->oProp->sClassName, 
103 103
             call_user_func_array(       // 1st param
104 104
                 array( $this, 'validate' ), // triggers __call()
105 105
                 array( $_aSubmittedFormData, $_aSavedFormData, $this )
106 106
             ), // 3.5.10+
107
-            $_aSavedFormData,   // 2nd param
107
+            $_aSavedFormData, // 2nd param
108 108
             $this   // 3rd param
109 109
         );
110 110
         
111 111
         // @todo Update term metas
112 112
         $this->oForm->updateMetaDataByType( 
113
-            $iTermID,  // object id
114
-            $_aSubmittedFormData,  // user submit form data
113
+            $iTermID, // object id
114
+            $_aSubmittedFormData, // user submit form data
115 115
             $this->oForm->dropRepeatableElements( $_aSavedFormData ), // Drop repeatable section elements from the saved meta array.
116 116
             $this->oForm->sStructureType   // fields type
117 117
         );             
Please login to merge, or discard this patch.
_common/form/_view/sectionset/AdminPageFramework_Form_View___FieldTitle.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
                     $aField[ '_structure_type' ], 
167 167
                     array( 'widget', 'post_meta_box', 'page_meta_box' ) 
168 168
                 ) 
169
-            ){
169
+            ) {
170 170
                 return "<span class='title-colon'>:</span>" ;
171 171
             }                                                 
172 172
             
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@
 block discarded – undo
172 172
                             . $this->getFrameworkNameVersion()
173 173
                             . '  ('
174 174
                                 . $this->oMsg->get( 'debug_info_will_be_disabled' )
175
-                              . ')'
175
+                                . ')'
176 176
                         . '</span>',
177 177
                     'attributes'    => array(
178 178
                         'container' => array(
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         
70 70
         $aField = $this->aFieldset;
71 71
         
72
-        if ( ! $aField[ 'show_title_column' ] ) {
72
+        if ( !$aField[ 'show_title_column' ] ) {
73 73
             return '';
74 74
         }          
75 75
             
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             'for'   => $_oInputTagIDGenerator->get(),
84 84
         );
85 85
         $_sOutput .= $aField[ 'title' ]
86
-            ? "<label " . $this->getAttributes( $_aLabelAttributes ) . "'>"
86
+            ? "<label ".$this->getAttributes( $_aLabelAttributes )."'>"
87 87
                     . "<a id='{$aField[ 'field_id' ]}'></a>"  // to allow the browser to link to the element.
88 88
                     . "<span title='" 
89 89
                             . esc_attr( 
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
          */
115 115
         private function _getFieldOutputsInFieldTitleAreaFromNestedFields( $aField ) {
116 116
             
117
-            if ( ! $this->hasNestedFields( $aField ) ) {
117
+            if ( !$this->hasNestedFields( $aField ) ) {
118 118
                 return '';
119 119
             }
120 120
             
121 121
             $_sOutput = '';
122
-            foreach( $aField[ 'content' ] as $_aNestedField ) {
122
+            foreach ( $aField[ 'content' ] as $_aNestedField ) {
123 123
                 
124 124
                 if ( 'field_title' !== $_aNestedField[ 'placement' ] ) {
125 125
                     continue;
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
 
128 128
                 $_oFieldset = new AdminPageFramework_Form_View___Fieldset( 
129 129
                     $_aNestedField, 
130
-                    $this->aSavedData,    // passed by reference. @todo: examine why it needs to be passed by reference.
130
+                    $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference.
131 131
                     $this->aFieldErrors, 
132 132
                     $this->aFieldTypeDefinitions,
133 133
                     $this->oMsg,
134 134
                     $this->aCallbacks // field output element callables.
135 135
                 );
136
-                $_sOutput   .= $_oFieldset->get(); // field output                
136
+                $_sOutput .= $_oFieldset->get(); // field output                
137 137
 
138 138
             }
139 139
             return $_sOutput;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
          * @since       3.7.0
146 146
          */
147 147
         private function _getToolTip( $asTip, $sElementID ) {
148
-            $_oToolTip           = new AdminPageFramework_Form_View___ToolTip(
148
+            $_oToolTip = new AdminPageFramework_Form_View___ToolTip(
149 149
                 $asTip,
150 150
                 $sElementID
151 151
             );            
@@ -159,14 +159,14 @@  discard block
 block discarded – undo
159 159
          */
160 160
         private function _getDebugInfo( $aField ) {
161 161
             
162
-            if ( ! $this->_shouldShowDebugInfo( $aField ) ) {
162
+            if ( !$this->_shouldShowDebugInfo( $aField ) ) {
163 163
                 return '';
164 164
             }
165
-            $_oToolTip           = new AdminPageFramework_Form_View___ToolTip(
165
+            $_oToolTip = new AdminPageFramework_Form_View___ToolTip(
166 166
                 array(
167 167
                     'title'         => $this->oMsg->get( 'field_arguments' ),
168 168
                     'dash-icon'     => 'dashicons-info',
169
-                    'icon_alt_text' => '[' . $this->oMsg->get( 'debug' ) . ' ]',
169
+                    'icon_alt_text' => '['.$this->oMsg->get( 'debug' ).' ]',
170 170
                     'content'       => AdminPageFramework_Debug::getDetails( $aField )
171 171
                         . '<span class="admin-page-framework-info">'
172 172
                             . $this->getFrameworkNameVersion()
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                         ),
181 181
                     )
182 182
                 ),
183
-                $aField[ 'field_id' ] . '_debug'
183
+                $aField[ 'field_id' ].'_debug'
184 184
             );            
185 185
             return $_oToolTip->get();                    
186 186
             
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
              */
192 192
             private function _shouldShowDebugInfo( $aField ) {
193 193
                 
194
-                if ( ! $aField[ 'show_debug_info' ] ) {
194
+                if ( !$aField[ 'show_debug_info' ] ) {
195 195
                     return false;
196 196
                 }
197 197
                 if ( strlen( $aField[ '_parent_field_path' ] ) ) {
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
          */
208 208
         private function _getTitleColon( $aField ) {
209 209
             
210
-            if ( ! isset( $aField[ 'title' ] ) || '' === $aField[ 'title' ] ) {
210
+            if ( !isset( $aField[ 'title' ] ) || '' === $aField[ 'title' ] ) {
211 211
                 return '';
212 212
             }                    
213 213
             if ( 
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
                     $aField[ '_structure_type' ], 
216 216
                     array( 'widget', 'post_meta_box', 'page_meta_box' ) 
217 217
                 ) 
218
-            ){
219
-                return "<span class='title-colon'>:</span>" ;
218
+            ) {
219
+                return "<span class='title-colon'>:</span>";
220 220
             }                                                 
221 221
             
222 222
         }
Please login to merge, or discard this patch.
form/_view/sectionset/AdminPageFramework_Form_View___FieldsetRow.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
         $_aParameters = func_get_args() + array( 
34 34
             $this->aFieldset, 
35
-            $this->aSavedData,    // passed by reference. @todo: examine why it needs to be passed by reference.
35
+            $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference.
36 36
             $this->aFieldErrors, 
37 37
             $this->aFieldTypeDefinitions, 
38 38
             $this->aCallbacks, // field output element callables.        
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         
61 61
         $aFieldset = $this->aFieldset;
62 62
         
63
-        if ( ! $this->isNormalPlacement( $aFieldset ) ) {
63
+        if ( !$this->isNormalPlacement( $aFieldset ) ) {
64 64
             return '';
65 65
         }
66 66
    
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         return $this->_getFieldByContainer( 
72 72
             $aFieldset, 
73 73
             array(
74
-                'open_main'     => "<div " . $_oFieldrowAttribute->get() . ">",
74
+                'open_main'     => "<div ".$_oFieldrowAttribute->get().">",
75 75
                 'close_main'    => "</div>",
76 76
             )
77 77
         ); 
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType__nested.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
      */
68 68
     protected function getField( $aField ) {
69 69
 
70
-        $_oCallerForm   = $aField[ '_caller_object' ];
70
+        $_oCallerForm = $aField[ '_caller_object' ];
71 71
 
72 72
         $_aInlineMixedOutput = array();
73
-        foreach( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) {
73
+        foreach ( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) {
74 74
          
75 75
             if ( is_scalar( $_aChildFieldset ) ) {
76 76
                 continue;
77 77
             }
78 78
             
79
-            if ( ! $this->isNormalPlacement( $_aChildFieldset ) ) {
79
+            if ( !$this->isNormalPlacement( $_aChildFieldset ) ) {
80 80
                 continue;
81 81
             }
82 82
             
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
             $_oFieldset = new AdminPageFramework_Form_View___Fieldset(
93 93
                 $_aChildFieldset,  
94 94
                 $_oCallerForm->aSavedData,
95
-                $_oCallerForm->getFieldErrors(),    // @todo Generate field errors. $this->aErrors, 
95
+                $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, 
96 96
                 $_oCallerForm->aFieldTypeDefinitions, 
97 97
                 $_oCallerForm->oMsg,
98 98
                 $_oCallerForm->aCallbacks // field output element callables.
99 99
             );
100
-            $_aInlineMixedOutput[] = $_oFieldset->get(); // field output            
100
+            $_aInlineMixedOutput[ ] = $_oFieldset->get(); // field output            
101 101
             
102 102
          
103 103
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
      * 
37 37
      * @since       3.8.0
38 38
      */        
39
-    protected function getStyles() { 
39
+    protected function getStyles() {
40 40
         return <<<CSSRULES
41 41
 /* Nested fieldsets 3.8.0+ */
42 42
 .admin-page-framework-fieldset > .admin-page-framework-fields > .admin-page-framework-field.with-nested-fields > .admin-page-framework-fieldset.multiple-nesting {
Please login to merge, or discard this patch.
development/utility/pointer_tool_tip/AdminPageFramework_PointerToolTip.php 4 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -112,18 +112,18 @@  discard block
 block discarded – undo
112 112
          */
113 113
         private function _setHooks( $aScreenIDs ) {
114 114
             
115
-            foreach( $aScreenIDs as $_sScreenID ) {            
116
-                if ( ! $_sScreenID ) {
115
+            foreach ( $aScreenIDs as $_sScreenID ) {            
116
+                if ( !$_sScreenID ) {
117 117
                     continue;
118 118
                 }
119 119
                 add_filter( 
120
-                    get_class( $this ) . '-' . $_sScreenID, 
120
+                    get_class( $this ).'-'.$_sScreenID, 
121 121
                     array( $this, '_replyToSetPointer' )
122 122
                 );
123 123
                                 
124 124
             }       
125 125
             
126
-            if ( ! $this->_hasBeenCalled() ) {
126
+            if ( !$this->_hasBeenCalled() ) {
127 127
                 return;
128 128
             } 
129 129
             
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     
171 171
         $_aPointers = $this->_getValidPointers( $this->_getPointers() );
172 172
              
173
-        if ( empty( $_aPointers ) || ! is_array( $_aPointers ) ) {
173
+        if ( empty( $_aPointers ) || !is_array( $_aPointers ) ) {
174 174
             return;
175 175
         }
176 176
         
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
             $_oScreen   = get_current_screen();
191 191
             $_sScreenID = $_oScreen->id;    
192 192
             if ( in_array( $_sScreenID, $this->aScreenIDs ) ) {
193
-                return apply_filters( get_class( $this ) . '-' . $_sScreenID, array() );
193
+                return apply_filters( get_class( $this ).'-'.$_sScreenID, array() );
194 194
             } 
195 195
             
196 196
             if ( isset( $_GET[ 'page' ] ) ) {
197
-                return apply_filters( get_class( $this ) . '-' . $_GET[ 'page' ], array() );
197
+                return apply_filters( get_class( $this ).'-'.$_GET[ 'page' ], array() );
198 198
             }
199 199
             return array();
200 200
             
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         private function _getValidPointers( $_aPointers ) {
209 209
         
210 210
             // Get dismissed pointers
211
-            $_aDismissed      = explode( 
211
+            $_aDismissed = explode( 
212 212
                 ',', 
213 213
                 ( string ) get_user_meta( 
214 214
                     get_current_user_id(), 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                 $_aPointer[ 'pointer_id' ] = $_iPointerID;
237 237
                 
238 238
                 // Add the pointer to $_aValidPointers array
239
-                $_aValidPointers[] =  $_aPointer;
239
+                $_aValidPointers[ ] = $_aPointer;
240 240
                 
241 241
             }            
242 242
             return $_aValidPointers;
@@ -312,9 +312,9 @@  discard block
 block discarded – undo
312 312
          * @return      string  
313 313
          * @internal
314 314
          */
315
-        public function _getInternalScript( $aPointers=array() ) {
315
+        public function _getInternalScript( $aPointers = array() ) {
316 316
 
317
-            $_aJSArray      = json_encode( $aPointers );
317
+            $_aJSArray = json_encode( $aPointers );
318 318
 
319 319
             /**
320 320
              * Checks check-boxes in siblings.
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
      * 
70 70
      * @since       3.7.0
71 71
      * @see         https://codex.wordpress.org/Plugin_API/Admin_Screen_Reference
72
-     * @param       array|strin     $asScreenIDs        Screen IDs or page slug.
72
+     * @param       string[]     $asScreenIDs        Screen IDs or page slug.
73 73
      * @param       string          $sPointerID         A unique pointer ID.
74 74
      * @param       array           $aPointerData       The pointer data.
75 75
      * <h4>Arguments</h4>
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@
 block discarded – undo
213 213
                     get_current_user_id(), 
214 214
                     'dismissed_wp_pointers', 
215 215
                     true 
216
-               )
216
+                )
217 217
             );
218 218
             $_aValidPointers = array();
219 219
          
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public function __construct( $asScreenIDs, $sPointerID, array $aPointerData ) {
92 92
 
93 93
         // Bail if the WordPress version is less than 3.3,
94
-        if ( version_compare( $GLOBALS[ 'wp_version' ], '3.3', '<' ) ) {        
94
+        if ( version_compare( $GLOBALS[ 'wp_version' ], '3.3', '<' ) ) {
95 95
             return false;
96 96
         }       
97 97
     
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
          */
112 112
         private function _setHooks( $aScreenIDs ) {
113 113
             
114
-            foreach( $aScreenIDs as $_sScreenID ) {            
114
+            foreach( $aScreenIDs as $_sScreenID ) {
115 115
                 if ( ! $_sScreenID ) {
116 116
                     continue;
117 117
                 }
Please login to merge, or discard this patch.
_common/form/_model/AdminPageFramework_Form_Model___FieldTypeResource.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,23 +59,23 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function get() {
61 61
 
62
-        $this->aResources[ 'internal_scripts' ]      = $this->_getUpdatedInternalItemsByCallback( 
62
+        $this->aResources[ 'internal_scripts' ] = $this->_getUpdatedInternalItemsByCallback( 
63 63
             $this->aResources[ 'internal_scripts' ], 
64 64
             'hfGetScripts' 
65 65
         );
66
-        $this->aResources[ 'internal_styles' ]       = $this->_getUpdatedInternalItemsByCallback( 
66
+        $this->aResources[ 'internal_styles' ] = $this->_getUpdatedInternalItemsByCallback( 
67 67
             $this->aResources[ 'internal_styles' ], 
68 68
             'hfGetStyles'
69 69
         );
70
-        $this->aResources[ 'internal_styles_ie' ]    = $this->_getUpdatedInternalItemsByCallback( 
70
+        $this->aResources[ 'internal_styles_ie' ] = $this->_getUpdatedInternalItemsByCallback( 
71 71
             $this->aResources[ 'internal_styles_ie' ], 
72 72
             'hfGetIEStyles'
73 73
         );        
74
-        $this->aResources[ 'src_styles' ]          = $this->_getUpdatedEnqueuingItemsByCallback( 
74
+        $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( 
75 75
             $this->aResources[ 'src_styles' ], 
76 76
             'aEnqueueStyles' 
77 77
         );
78
-        $this->aResources[ 'src_scripts' ]         = $this->_getUpdatedEnqueuingItemsByCallback( 
78
+        $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( 
79 79
             $this->aResources[ 'src_scripts' ], 
80 80
             'aEnqueueScripts' 
81 81
         );
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
          */
90 90
         private function _getUpdatedInternalItemsByCallback( array $aSubject, $sKey ) {
91 91
             $_oCallable = $this->getElement( $this->aFieldTypeDefinition, $sKey );
92
-            if ( ! is_callable( $_oCallable ) ) {
92
+            if ( !is_callable( $_oCallable ) ) {
93 93
                 return $aSubject;
94 94
             }
95
-            $aSubject[] = call_user_func_array( 
95
+            $aSubject[ ] = call_user_func_array( 
96 96
                 $_oCallable, 
97 97
                 array() 
98 98
             );            
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_image.php 3 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     /**
60 60
      * Defines the field type slugs used for this field type.
61 61
      */
62
-    public $aFieldTypeSlugs = array( 'image', );
62
+    public $aFieldTypeSlugs = array( 'image',);
63 63
     
64 64
     /**
65 65
      * Defines the default key-values of this field type. 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected $aDefaultKeys = array(
70 70
         'attributes_to_store'       => array(), // ( array ) This is for the image and media field type. The attributes to save besides URL. e.g. ( for the image field type ) array( 'title', 'alt', 'width', 'height', 'caption', 'id', 'align', 'link' ).
71
-        'show_preview'              => true,    // ( boolean ) Indicates whether the image preview should be displayed or not.
72
-        'allow_external_source'     => true,    // ( boolean ) Indicates whether the media library box has the From URL tab.
71
+        'show_preview'              => true, // ( boolean ) Indicates whether the image preview should be displayed or not.
72
+        'allow_external_source'     => true, // ( boolean ) Indicates whether the media library box has the From URL tab.
73 73
         'attributes'                => array(
74 74
             'input'     => array(
75 75
                 'size'      => 40,
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         return // $this->_getScript_CustomMediaUploaderObject() . PHP_EOL    
100 100
             $this->_getScript_ImageSelector( 
101 101
                 "admin_page_framework"
102
-            )  . PHP_EOL
102
+            ).PHP_EOL
103 103
             . $this->_getScript_RegisterCallbacks();
104 104
     }
105 105
         /**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             $_sInsertFromURL         = esc_js( $this->oMsg->get( 'insert_from_url' ) );
218 218
 
219 219
             // if the WordPress version is 3.4.x or below
220
-            if ( ! function_exists( 'wp_enqueue_media' ) ) {
220
+            if ( !function_exists( 'wp_enqueue_media' ) ) {
221 221
             
222 222
                 return <<<JAVASCRIPTS
223 223
 /**
@@ -605,13 +605,13 @@  discard block
 block discarded – undo
605 605
                 . "<label for='{$aField[ 'input_id' ]}'>"
606 606
                     . $aField[ 'before_input' ]
607 607
                     . $this->getAOrB(
608
-                        $aField[ 'label' ] && ! $aField[ 'repeatable' ],
609
-                        "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
608
+                        $aField[ 'label' ] && !$aField[ 'repeatable' ],
609
+                        "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
610 610
                             . $aField[ 'label' ] 
611 611
                         . "</span>",                        
612 612
                         ''                        
613 613
                     )
614
-                    . "<input " . $this->getAttributes( $this->_getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) ) . " />" 
614
+                    . "<input ".$this->getAttributes( $this->_getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) )." />" 
615 615
                     . $aField[ 'after_input' ]
616 616
                     . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element.
617 617
                     . $this->getExtraInputFields( $aField )
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
          */
652 652
         private function _getBaseAttributes( array $aField ) {
653 653
             
654
-            $_aBaseAttributes   = $aField[ 'attributes' ] + array( 'class' => null );
654
+            $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null );
655 655
             unset( 
656 656
                 $_aBaseAttributes[ 'input' ], 
657 657
                 $_aBaseAttributes[ 'button' ], 
@@ -720,8 +720,8 @@  discard block
 block discarded – undo
720 720
         protected function getExtraInputFields( array $aField ) {
721 721
             
722 722
             $_aOutputs = array();
723
-            foreach( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) {
724
-                $_aOutputs[] = "<input " . $this->getAttributes( 
723
+            foreach ( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) {
724
+                $_aOutputs[ ] = "<input ".$this->getAttributes( 
725 725
                     array(
726 726
                         'id'        => "{$aField[ 'input_id' ]}_{$sAttribute}",
727 727
                         'type'      => 'hidden',
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
                             ''
738 738
                         ),
739 739
                     )
740
-                ) . "/>";
740
+                )."/>";
741 741
             }
742 742
             return implode( PHP_EOL, $_aOutputs );
743 743
             
@@ -750,17 +750,17 @@  discard block
 block discarded – undo
750 750
          */
751 751
         protected function _getPreviewContainer( $aField, $sImageURL, $aPreviewAtrributes ) {
752 752
 
753
-            if ( ! $aField[ 'show_preview' ] ) { 
753
+            if ( !$aField[ 'show_preview' ] ) { 
754 754
                 return ''; 
755 755
             }
756 756
             
757 757
             $sImageURL = esc_url( $this->getResolvedSRC( $sImageURL, true ) );
758 758
             return 
759
-                "<div " . $this->getAttributes( 
759
+                "<div ".$this->getAttributes( 
760 760
                         array(
761 761
                             'id'    => "image_preview_container_{$aField[ 'input_id' ]}",     
762
-                            'class' => 'image_preview ' . $this->getElement( $aPreviewAtrributes, 'class', '' ),
763
-                            'style' => $this->getAOrB( $sImageURL, '', "display: none; "  ) 
762
+                            'class' => 'image_preview '.$this->getElement( $aPreviewAtrributes, 'class', '' ),
763
+                            'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) 
764 764
                                 . $this->getElement( $aPreviewAtrributes, 'style', '' ),
765 765
                         ) + $aPreviewAtrributes
766 766
                     )
@@ -783,12 +783,12 @@  discard block
 block discarded – undo
783 783
          */
784 784
         protected function _getUploaderButtonScript( $sInputID, $abRepeatable, $bExternalSource, array $aButtonAttributes ) {
785 785
             
786
-            $_bRepeatable     = ! empty( $abRepeatable );
786
+            $_bRepeatable = !empty( $abRepeatable );
787 787
             
788 788
             // Do not include the escaping character (backslash) in the heredoc variable declaration 
789 789
             // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (")
790 790
             // which causes the PHP syntax error.                
791
-            $_sButtonHTML     = '"' . $this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $_bRepeatable, $bExternalSource ) . '"';
791
+            $_sButtonHTML     = '"'.$this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $_bRepeatable, $bExternalSource ).'"';
792 792
             $_sRepeatable     = $this->getAOrB( $_bRepeatable, 'true', 'false' );
793 793
             $_bExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' );
794 794
             $_sScript = <<<JAVASCRIPTS
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
                     . '/* <![CDATA[ */'
805 805
                     . $_sScript 
806 806
                     . '/* ]]> */'
807
-                . "</script>". PHP_EOL;
807
+                . "</script>".PHP_EOL;
808 808
 
809 809
         }
810 810
             /**
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
                     $bRepeatable, 
824 824
                     $bExternalSource 
825 825
                 );
826
-                return "<a " . $this->getAttributes( $_aAttributes ) . ">"
826
+                return "<a ".$this->getAttributes( $_aAttributes ).">"
827 827
                         . ( $_bIsLabelSet
828 828
                             ? $_aAttributes[ 'data-label' ] 
829 829
                             : ( strrpos( $_aAttributes[ 'class' ], 'dashicons' )
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
                  */
843 843
                 private function _getFormattedUploadButtonAttributes( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bRepeatable, $bExternalSource ) {
844 844
                         
845
-                    $_aAttributes           = array(
845
+                    $_aAttributes = array(
846 846
                             'id'        => "select_image_{$sInputID}",
847 847
                             'href'      => '#',            
848 848
                             'data-uploader_type'            => ( string ) function_exists( 'wp_enqueue_media' ),
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
                                 : $this->oMsg->get( 'select_image' ),
856 856
                             'data-label' => null,
857 857
                         );
858
-                    $_aAttributes[ 'class' ]  = $this->getClassAttribute( 
858
+                    $_aAttributes[ 'class' ] = $this->getClassAttribute( 
859 859
                         'select_image button button-small ',
860 860
                         $this->getAOrB(
861 861
                             trim( $aButtonAttributes[ 'class' ] ),
@@ -883,16 +883,16 @@  discard block
 block discarded – undo
883 883
          * @return      string
884 884
          * @internal
885 885
          */
886
-        protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType='image' ) {
886
+        protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType = 'image' ) {
887 887
            
888
-            if ( ! function_exists( 'wp_enqueue_media' ) ) {
888
+            if ( !function_exists( 'wp_enqueue_media' ) ) {
889 889
                 return '';
890 890
             }
891 891
     
892 892
             // Do not include the escaping character (backslash) in the heredoc variable declaration 
893 893
             // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (")
894 894
             // which causes the PHP syntax error.                
895
-            $_sButtonHTML  = '"' . $this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ) . '"';
895
+            $_sButtonHTML = '"'.$this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ).'"';
896 896
             $_sScript = <<<JAVASCRIPTS
897 897
                 if ( 0 === jQuery( 'a#remove_{$sType}_{$sInputID}' ).length ) {
898 898
                     jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML );
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
                     . '/* <![CDATA[ */'
904 904
                     . $_sScript 
905 905
                     . '/* ]]> */'
906
-                . "</script>". PHP_EOL;
906
+                . "</script>".PHP_EOL;
907 907
            
908 908
         }
909 909
         
@@ -913,11 +913,11 @@  discard block
 block discarded – undo
913 913
          * @return      string      The generated HTML remove button output.
914 914
          * @internal
915 915
          */
916
-        protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType='image' ) {
916
+        protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType = 'image' ) {
917 917
         
918 918
             $_bIsLabelSet   = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ];
919 919
             $_aAttributes   = $this->_getFormattedRemoveButtonAttributesByType( $sInputID, $aButtonAttributes, $_bIsLabelSet, $sType );
920
-            return "<a " . $this->getAttributes( $_aAttributes ) . ">"
920
+            return "<a ".$this->getAttributes( $_aAttributes ).">"
921 921
                     . ( $_bIsLabelSet
922 922
                         ? $_aAttributes[ 'data-label' ] 
923 923
                         : $this->getAOrB(
@@ -936,9 +936,9 @@  discard block
 block discarded – undo
936 936
              * @return      array       The formatted remove button attributes array.
937 937
              * @internal
938 938
              */
939
-            protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType='image' ) {
939
+            protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType = 'image' ) {
940 940
 
941
-                $_sOnClickFunctionName  = 'removeInputValuesFor' . ucfirst( $sType );
941
+                $_sOnClickFunctionName  = 'removeInputValuesFor'.ucfirst( $sType );
942 942
                 $_aAttributes           = array(
943 943
                         'id'        => "remove_{$sType}_{$sInputID}",
944 944
                         'href'      => '#',            
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
                             ? $aButtonAttributes[ 'data-label' ] 
951 951
                             : $this->oMsg->get( 'remove_value' ),
952 952
                     );
953
-                $_aAttributes[ 'class' ]  = $this->getClassAttribute( 
953
+                $_aAttributes[ 'class' ] = $this->getClassAttribute( 
954 954
                     "remove_value remove_{$sType} button button-small", 
955 955
                     $this->getAOrB(
956 956
                         trim( $aButtonAttributes[ 'class' ] ),
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -625,7 +625,7 @@
 block discarded – undo
625 625
             return $_aBaseAttributes;
626 626
             
627 627
         }    
628
-       /**
628
+        /**
629 629
          * Returns the set image url.
630 630
          * 
631 631
          * When the 'attributes_to_store' argument is present, there will be sub elements to the field value.
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
      * Returns the field type specific CSS rules.
477 477
      * @internal
478 478
      */ 
479
-    protected function getStyles() { 
479
+    protected function getStyles() {
480 480
         return <<<CSSRULES
481 481
 /* Image Field Preview Container */
482 482
 .admin-page-framework-field .image_preview {
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
          */
715 715
         protected function _getPreviewContainer( $aField, $sImageURL, $aPreviewAtrributes ) {
716 716
 
717
-            if ( ! $aField[ 'show_preview' ] ) { 
717
+            if ( ! $aField[ 'show_preview' ] ) {
718 718
                 return ''; 
719 719
             }
720 720
             
Please login to merge, or discard this patch.