Completed
Branch dev (0ae946)
by
unknown
04:08 queued 23s
created
_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.
factory/_common/form/field_type/AdminPageFramework_FieldType_size.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     /**
66 66
      * Defines the field type slugs used for this field type.
67 67
      */
68
-    public $aFieldTypeSlugs = array( 'size', );
68
+    public $aFieldTypeSlugs = array( 'size',);
69 69
     
70 70
     /**
71 71
      * Defines the default key-values of this field type. 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     protected $aDefaultKeys = array(
76 76
         'is_multiple'           => false, // indicates whether the select tag alloes multiple selections.
77
-        'units'                 => null,  // do not define units here since this will be merged with the user defined field array.
77
+        'units'                 => null, // do not define units here since this will be merged with the user defined field array.
78 78
         'attributes'            => array(
79 79
             'size'      => array(
80 80
                 'min'           => null,
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     protected $aDefaultUnits = array(
104 104
         'px'    => 'px', // pixel
105
-        '%'     => '%',  // percentage
105
+        '%'     => '%', // percentage
106 106
         'em'    => 'em', // font size
107 107
         'ex'    => 'ex', // font height
108 108
         'in'    => 'in', // inch
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
         );
163 163
 
164 164
         $_aOutput = array();
165
-        foreach( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) {
166
-            $_aOutput[] = $this->_getFieldOutputByLabel( 
165
+        foreach ( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) {
166
+            $_aOutput[ ] = $this->_getFieldOutputByLabel( 
167 167
                 $_isKey, 
168 168
                 $_sLabel,
169 169
                 $aField
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 
187 187
             $_aBaseAttributes   = $_bMultiLabels
188 188
                 ? array(
189
-                        'name'  => $aField[ 'attributes' ][ 'name' ] . "[{$isKey}]",
190
-                        'id'    => $aField[ 'attributes' ][ 'id' ] . "_{$isKey}",
189
+                        'name'  => $aField[ 'attributes' ][ 'name' ]."[{$isKey}]",
190
+                        'id'    => $aField[ 'attributes' ][ 'id' ]."_{$isKey}",
191 191
                         'value' => $aField[ 'value' ],
192 192
                     ) 
193 193
                     + $aField[ 'attributes' ]
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
                      
200 200
             $_aOutput = array(
201 201
                 $this->getElementByLabel( $aField[ 'before_label' ], $isKey, $aField[ 'label' ] ),
202
-                    "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">",
203
-                        $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ),  // The size (number) part
204
-                        $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ),  // The unit (select) part
202
+                    "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">",
203
+                        $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The size (number) part
204
+                        $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The unit (select) part
205 205
                     "</div>",
206 206
                 $this->getElementByLabel( $aField[ 'after_label' ], $isKey, $aField[ 'label' ] )
207 207
             );
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             private function _getNumberInputPart( array $aField, array $aBaseAttributes, $isKey, $bMultiLabels ) {
219 219
                 
220 220
                 // Size and Size Label
221
-                $_aSizeAttributes       = $this->_getSizeAttributes( 
221
+                $_aSizeAttributes = $this->_getSizeAttributes( 
222 222
                     $aField, 
223 223
                     $aBaseAttributes,
224 224
                     $bMultiLabels
@@ -226,32 +226,32 @@  discard block
 block discarded – undo
226 226
                         : ''
227 227
                 );
228 228
 
229
-                $_aSizeLabelAttributes  = array(
229
+                $_aSizeLabelAttributes = array(
230 230
                     'for'   => $_aSizeAttributes[ 'id' ],
231 231
                     'class' => $_aSizeAttributes[ 'disabled' ] 
232 232
                         ? 'disabled' 
233 233
                         : null,
234 234
                 );                  
235 235
                 
236
-                $_sLabel                = $this->getElementByLabel( 
236
+                $_sLabel = $this->getElementByLabel( 
237 237
                     $aField[ 'label' ], 
238 238
                     $isKey, 
239 239
                     $aField[ 'label' ]
240 240
                 );
241
-                return "<label " . $this->getAttributes( $_aSizeLabelAttributes ) . ">"
241
+                return "<label ".$this->getAttributes( $_aSizeLabelAttributes ).">"
242 242
                     . $this->getElement( 
243 243
                         $aField, 
244 244
                         $bMultiLabels
245 245
                             ? array( 'before_label', $isKey, 'size' ) 
246 246
                             : array( 'before_label', 'size' ) 
247 247
                     )
248
-                    . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ]
249
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
248
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
249
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
250 250
                                 . $_sLabel 
251 251
                             . "</span>"
252 252
                         : "" 
253 253
                     )
254
-                    . "<input " . $this->getAttributes( $_aSizeAttributes ) . " />" 
254
+                    . "<input ".$this->getAttributes( $_aSizeAttributes )." />" 
255 255
                     . $this->getElement( 
256 256
                         $aField, 
257 257
                         $bMultiLabels
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                     )
295 295
                     : $aField[ 'units' ];
296 296
                 
297
-                return "<label " . $this->getAttributes( 
297
+                return "<label ".$this->getAttributes( 
298 298
                         array(
299 299
                             'for'       => $_aUnitAttributes[ 'id' ],
300 300
                             'class'     => $_aUnitAttributes[ 'disabled' ] 
@@ -326,9 +326,9 @@  discard block
 block discarded – undo
326 326
                  * @return      array       an unit attribute array
327 327
                  * @internal
328 328
                  */
329
-                private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey='' ) {
329
+                private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey = '' ) {
330 330
                     
331
-                    $_bIsMultiple    = $aField[ 'is_multiple' ] 
331
+                    $_bIsMultiple = $aField[ 'is_multiple' ] 
332 332
                         ? true 
333 333
                         : $this->getElement( 
334 334
                             $aField,
@@ -340,13 +340,13 @@  discard block
 block discarded – undo
340 340
               
341 341
                     $_aSelectAttributes = array(
342 342
                         'type'      => 'select',
343
-                        'id'        => $aField[ 'input_id' ] . ( '' === $isLabelKey ? '' : '_' . $isLabelKey ) . '_' . 'unit',
343
+                        'id'        => $aField[ 'input_id' ].( '' === $isLabelKey ? '' : '_'.$isLabelKey ).'_'.'unit',
344 344
                         'multiple'  => $_bIsMultiple 
345 345
                             ? 'multiple' 
346 346
                             : null,
347 347
                         'name'      => $_bIsMultiple 
348
-                            ? "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit][]" 
349
-                            : "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit]",
348
+                            ? "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit][]" 
349
+                            : "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit]",
350 350
                         'value'     => $this->getElement( 
351 351
                             $aField, 
352 352
                             array( 'value', 'unit' ),
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                         '' === $isLabelKey
359 359
                             ? array( 'attributes', 'unit' )
360 360
                             : array( 'attributes', $isLabelKey, 'unit' ),
361
-                        $this->aDefaultKeys['attributes']['unit'] 
361
+                        $this->aDefaultKeys[ 'attributes' ][ 'unit' ] 
362 362
                     )
363 363
                     + $aBaseAttributes;       
364 364
                     return $_aSelectAttributes;
@@ -372,15 +372,15 @@  discard block
 block discarded – undo
372 372
              * @return      array       an size attribute array
373 373
              * @internal
374 374
              */
375
-            private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey='' ) {
375
+            private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey = '' ) {
376 376
 
377 377
                 return array(
378 378
                         'type'  => 'number',
379
-                        'id'    => $aField['input_id'] . '_' . ( '' !== $sLabelKey ? $sLabelKey . '_' : '' ) . 'size',
380
-                        'name'  => $aField[ '_input_name' ] . ( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ) . '[size]',
379
+                        'id'    => $aField[ 'input_id' ].'_'.( '' !== $sLabelKey ? $sLabelKey.'_' : '' ).'size',
380
+                        'name'  => $aField[ '_input_name' ].( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ).'[size]',
381 381
                         'value' => $this->getElement(
382
-                            $aField,        // subject
383
-                            array( 'value', 'size' ),   // dimensional keys
382
+                            $aField, // subject
383
+                            array( 'value', 'size' ), // dimensional keys
384 384
                             ''  // default
385 385
                         ),
386 386
                     ) 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -211,6 +211,7 @@  discard block
 block discarded – undo
211 211
              * Returns the HTML output of the number input part.
212 212
              * 
213 213
              * @since       3.5.3
214
+             * @param boolean $bMultiLabels
214 215
              * @return      string      The number input output.
215 216
              * @internal
216 217
              */
@@ -265,6 +266,7 @@  discard block
 block discarded – undo
265 266
              * Returns the HTML output of the unit select input part.
266 267
              * 
267 268
              * @since       3.5.3
269
+             * @param boolean $bMultiLabels
268 270
              * @return      string      The unit select input output.
269 271
              * @internal
270 272
              */
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_hidden.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
                     . ( $aField[ 'label' ]
68 68
                         ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
69 69
                             . $aField[ 'label' ]
70
-                          . "</span>"
70
+                            . "</span>"
71 71
                         : "" 
72 72
                     )
73 73
                     . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,21 +60,21 @@
 block discarded – undo
60 60
     protected function getField( $aField ) {
61 61
 
62 62
         return 
63
-            $aField['before_label']
63
+            $aField[ 'before_label' ]
64 64
             . "<div class='admin-page-framework-input-label-container'>"
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' ] ) . " />" 
74
-                    . $aField['after_input']
73
+                    . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" 
74
+                    . $aField[ 'after_input' ]
75 75
                 . "</label>"
76 76
             . "</div>"
77
-            . $aField['after_label'];
77
+            . $aField[ 'after_label' ];
78 78
         
79 79
     }
80 80
     
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_system.php 3 patches
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * </code>
74 74
      * @var         array
75 75
      */
76
-    public $aFieldTypeSlugs = array( 'system', );
76
+    public $aFieldTypeSlugs = array( 'system',);
77 77
     
78 78
     /**
79 79
      * Defines the default key-values of this field type. 
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
      * @remark          `$_aDefaultKeys` holds shared default key-values defined in the base class.
94 94
      */
95 95
     protected $aDefaultKeys = array(
96
-        'data'          =>  array(),        // [3.2.0+] Stores the data to be displayed
97
-        'print_type'    =>  1,              // [3.4.6+] 1: readable representation of array. 2: print_r()
96
+        'data'          =>  array(), // [3.2.0+] Stores the data to be displayed
97
+        'print_type'    =>  1, // [3.4.6+] 1: readable representation of array. 2: print_r()
98 98
         'attributes'    =>    array(
99 99
             'rows'          => 60,
100 100
             'autofocus'     => null,
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
             . "<div class='admin-page-framework-input-label-container'>"
234 234
                 . "<label for='{$aField[ 'input_id' ]}'>"
235 235
                     . $aField[ 'before_input' ]
236
-                    . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ]
237
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
236
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
237
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
238 238
                                 . $aField[ 'label' ] 
239 239
                             . "</span>"
240 240
                         : "" 
241 241
                     )
242
-                    . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >"    
242
+                    . "<textarea ".$this->getAttributes( $_aInputAttributes )." >"    
243 243
                         . esc_textarea( $this->_getSystemInfomation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) )
244 244
                     . "</textarea>"
245 245
                     . $aField[ 'after_input' ]
@@ -254,15 +254,15 @@  discard block
 block discarded – undo
254 254
          * @return      string      The human readable system information.
255 255
          * @internal
256 256
          */
257
-        private function _getSystemInfomation( $asValue=null, $asCustomData=null, $iPrintType=1 ) {
257
+        private function _getSystemInfomation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) {
258 258
 
259 259
             if ( isset( $asValue ) ) {
260 260
                 return $asValue;
261 261
             }
262 262
 
263
-            $_aOutput   = array();
264
-            foreach( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) {
265
-                $_aOutput[] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType );
263
+            $_aOutput = array();
264
+            foreach ( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) {
265
+                $_aOutput[ ] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType );
266 266
             }
267 267
             return implode( PHP_EOL, $_aOutput );
268 268
             
@@ -277,18 +277,18 @@  discard block
 block discarded – undo
277 277
                 
278 278
                 $_aData = $this->getAsArray( $asCustomData );
279 279
                 $_aData = $_aData + array(
280
-                    'Admin Page Framework'  => isset( $_aData['Admin Page Framework'] )
280
+                    'Admin Page Framework'  => isset( $_aData[ 'Admin Page Framework' ] )
281 281
                         ? null
282 282
                         : AdminPageFramework_Registry::getInfo(),
283
-                    'WordPress'             => $this->_getSiteInfoWithCache( ! isset( $_aData['WordPress'] ) ),
284
-                    'PHP'                   => $this->_getPHPInfo( ! isset( $_aData['PHP'] ) ),
285
-                    'PHP Error Log'         => $this->_getErrorLogByType( 'php', ! isset( $_aData['PHP Error Log'] ) ),
286
-                    'MySQL'                 => isset( $_aData['MySQL'] )
283
+                    'WordPress'             => $this->_getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ),
284
+                    'PHP'                   => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ),
285
+                    'PHP Error Log'         => $this->_getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ),
286
+                    'MySQL'                 => isset( $_aData[ 'MySQL' ] )
287 287
                         ? null
288
-                        : $this->getMySQLInfo(),    // defined in the utility class.
289
-                    'MySQL Error Log'       => $this->_getErrorLogByType( 'mysql', ! isset( $_aData['MySQL Error Log'] ) ),
290
-                    'Server'                => $this->_getWebServerInfo( ! isset( $_aData['Server'] ) ),
291
-                    'Browser'               => $this->_getClientInfo( ! isset( $_aData['Browser'] ) ),
288
+                        : $this->getMySQLInfo(), // defined in the utility class.
289
+                    'MySQL Error Log'       => $this->_getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ),
290
+                    'Server'                => $this->_getWebServerInfo( !isset( $_aData[ 'Server' ] ) ),
291
+                    'Browser'               => $this->_getClientInfo( !isset( $_aData[ 'Browser' ] ) ),
292 292
                 );
293 293
                 
294 294
                 // Dropping empty elements allows the user to remove a section by setting an empty section.
@@ -305,10 +305,10 @@  discard block
 block discarded – undo
305 305
                 switch ( $iPrintType ) {
306 306
                     default:
307 307
                     case 1: // use the framework readable representation of arrays.
308
-                        return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL;
308
+                        return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL;
309 309
                     case 2: // use print_r()
310
-                        return "[{$sSectionName}]" . PHP_EOL
311
-                            . print_r( $aData, true ) . PHP_EOL;
310
+                        return "[{$sSectionName}]".PHP_EOL
311
+                            . print_r( $aData, true ).PHP_EOL;
312 312
                 }                      
313 313
             }
314 314
             /**
@@ -318,17 +318,17 @@  discard block
 block discarded – undo
318 318
              * @since       3.4.6
319 319
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
320 320
              */
321
-            private function _getClientInfo( $bGenerateInfo=true ) {
321
+            private function _getClientInfo( $bGenerateInfo = true ) {
322 322
                  
323
-                if ( ! $bGenerateInfo ) {
323
+                if ( !$bGenerateInfo ) {
324 324
                     return '';
325 325
                 }
326 326
                  
327 327
                 // Check the browscap value in the ini file first to prevent warnings from being populated
328 328
                 $_aBrowser = @ini_get( 'browscap' ) 
329
-                    ? get_browser( $_SERVER['HTTP_USER_AGENT'], true )
329
+                    ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true )
330 330
                     : array();
331
-                unset( $_aBrowser['browser_name_regex'] );  // this element causes output to be blank
331
+                unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank
332 332
                 return empty( $_aBrowser ) 
333 333
                     ? __( 'No browser information found.', 'admin-page-framework' )
334 334
                     : $_aBrowser;
@@ -344,9 +344,9 @@  discard block
 block discarded – undo
344 344
              * @param       string      $sType          The error log type. Either 'php' or 'mysql' is accepted.
345 345
              * @param       boolean     $bGenerateInfo  Whether to generate a log. This is for the caller method to reduce a conditinal statement.
346 346
              */
347
-            private function _getErrorLogByType( $sType, $bGenerateInfo=true ) {
347
+            private function _getErrorLogByType( $sType, $bGenerateInfo = true ) {
348 348
 
349
-                if ( ! $bGenerateInfo ) {
349
+                if ( !$bGenerateInfo ) {
350 350
                     return '';
351 351
                 }
352 352
                 switch ( $sType ) {
@@ -378,9 +378,9 @@  discard block
 block discarded – undo
378 378
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
379 379
              * @return      array      The generated site information array.
380 380
              */
381
-            private function _getSiteInfoWithCache( $bGenerateInfo=true ) {
381
+            private function _getSiteInfoWithCache( $bGenerateInfo = true ) {
382 382
                 
383
-                if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) {
383
+                if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) {
384 384
                     return self::$_aSiteInfo;
385 385
                 }
386 386
                 self::$_aSiteInfo = self::_getSiteInfo();
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
                         'wp_remote_get()'                                           => $this->_getWPRemoteGetStatus(),
415 415
                         __( 'Multibite String Extension', 'admin-page-framework' )  => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ),
416 416
                         __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' )    => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), 
417
-                        __( 'Active Plugins', 'admin-page-framework' )              => PHP_EOL . $this->_getActivePlugins(),
418
-                        __( 'Network Active Plugins', 'admin-page-framework' )      => PHP_EOL . $this->_getNetworkActivePlugins(),
417
+                        __( 'Active Plugins', 'admin-page-framework' )              => PHP_EOL.$this->_getActivePlugins(),
418
+                        __( 'Network Active Plugins', 'admin-page-framework' )      => PHP_EOL.$this->_getNetworkActivePlugins(),
419 419
                         __( 'Constants', 'admin-page-framework' )                   => $this->_getDefinedConstants( 'user' ),
420 420
                     );                        
421 421
                 }
@@ -425,9 +425,9 @@  discard block
 block discarded – undo
425 425
                      * @return      string|array
426 426
                      * @internal
427 427
                      */
428
-                    private function _getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) {
428
+                    private function _getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) {
429 429
                         $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories );
430
-                        if ( ! is_array( $_asConstants ) ) {
430
+                        if ( !is_array( $_asConstants ) ) {
431 431
                             return $_asConstants;
432 432
                         }
433 433
                         if ( isset( $_asConstants[ 'user' ] ) ) {
@@ -463,13 +463,13 @@  discard block
 block discarded – undo
463 463
                 private function _getActiveThemeName() {
464 464
                     
465 465
                     // If the WordPress version is less than 3.4,
466
-                    if ( version_compare( $GLOBALS['wp_version'], '3.4', '<' ) ) {
467
-                        $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' );
468
-                        return $_aThemeData['Name'] . ' ' . $_aThemeData['Version'];
466
+                    if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) {
467
+                        $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' );
468
+                        return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ];
469 469
                     } 
470 470
                     
471 471
                     $_oThemeData = wp_get_theme();
472
-                    return $_oThemeData->Name . ' ' . $_oThemeData->Version;
472
+                    return $_oThemeData->Name.' '.$_oThemeData->Version;
473 473
                     
474 474
                 }   
475 475
                 /**
@@ -483,10 +483,10 @@  discard block
 block discarded – undo
483 483
                     $_aPluginList       = array();
484 484
                     $_aActivePlugins    = get_option( 'active_plugins', array() );
485 485
                     foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) {
486
-                        if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) {
486
+                        if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) {
487 487
                             continue;
488 488
                         }
489
-                        $_aPluginList[] = '    ' . $_aPlugin['Name'] . ': ' . $_aPlugin['Version'];
489
+                        $_aPluginList[ ] = '    '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ];
490 490
                     }
491 491
                     return implode( PHP_EOL, $_aPluginList );
492 492
                     
@@ -498,17 +498,17 @@  discard block
 block discarded – undo
498 498
                  */
499 499
                 private function _getNetworkActivePlugins() {
500 500
                     
501
-                    if ( ! is_multisite() ) {
501
+                    if ( !is_multisite() ) {
502 502
                         return '';
503 503
                     }
504 504
                     $_aPluginList       = array();
505 505
                     $_aActivePlugins    = get_site_option( 'active_sitewide_plugins', array() );
506 506
                     foreach ( wp_get_active_network_plugins() as $_sPluginPath ) {
507
-                        if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) {
507
+                        if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) {
508 508
                             continue;
509 509
                         }
510 510
                         $_aPlugin       = get_plugin_data( $_sPluginPath );
511
-                        $_aPluginList[] = '    ' . $_aPlugin['Name'] . ' :' . $_aPlugin['Version'];
511
+                        $_aPluginList[ ] = '    '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ];
512 512
                     }
513 513
                     return implode( PHP_EOL, $_aPluginList );
514 514
                     
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                     $_vResponse = false === $_vResponse
527 527
                         ? wp_remote_post( 
528 528
                             // 'https://www.paypal.com/cgi-bin/webscr', 
529
-                            add_query_arg( $_GET, admin_url( $GLOBALS['pagenow'] ) ),
529
+                            add_query_arg( $_GET, admin_url( $GLOBALS[ 'pagenow' ] ) ),
530 530
                             array(
531 531
                                 'sslverify'     => false,
532 532
                                 'timeout'       => 60,
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                     $_vResponse = $this->getTransient( 'apf_rg_check' );
550 550
                     $_vResponse = false === $_vResponse
551 551
                         ? wp_remote_get( 
552
-                            add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS['pagenow'] ) ),
552
+                            add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS[ 'pagenow' ] ) ),
553 553
                             array(
554 554
                                 'sslverify'     => false,
555 555
                                 'timeout'       => 60,
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
                         if ( is_wp_error( $mResponse ) ) {
575 575
                             return true;
576 576
                         }
577
-                        if ( $mResponse[ 'response'][ 'code' ] < 200 ) {
577
+                        if ( $mResponse[ 'response' ][ 'code' ] < 200 ) {
578 578
                             return true;
579 579
                         }
580 580
                         if ( $mResponse[ 'response' ][ 'code' ] >= 300 ) {
@@ -597,13 +597,13 @@  discard block
 block discarded – undo
597 597
              * @since       3.4.6
598 598
              * @since       3.5.3       Added the $bGenerateInfo parameter. This is to reduce conditional statement in the caller method.
599 599
              */
600
-            private function _getPHPInfo( $bGenerateInfo=true ) {
600
+            private function _getPHPInfo( $bGenerateInfo = true ) {
601 601
                 
602
-                if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) {
602
+                if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) {
603 603
                     return self::$_aPHPInfo;
604 604
                 }
605 605
                 
606
-                $_oErrorReporting   = new AdminPageFramework_ErrorReporting;
606
+                $_oErrorReporting = new AdminPageFramework_ErrorReporting;
607 607
                 self::$_aPHPInfo = array(
608 608
                     __( 'Version', 'admin-page-framework' )                 => phpversion(),
609 609
                     __( 'Safe Mode', 'admin-page-framework' )               => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), 
@@ -614,16 +614,16 @@  discard block
 block discarded – undo
614 614
                     __( 'Max Execution Time', 'admin-page-framework' )      => @ini_get( 'max_execution_time' ),
615 615
                     __( 'Max Input Vars', 'admin-page-framework' )          => @ini_get( 'max_input_vars' ),
616 616
                     __( 'Argument Separator', 'admin-page-framework' )      => @ini_get( 'arg_separator.output' ),
617
-                    __( 'Allow URL File Open', 'admin-page-framework' )     => $this->getAOrB( @ini_get( 'allow_url_fopen' ),    $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
618
-                    __( 'Display Errors', 'admin-page-framework' )          => $this->getAOrB( @ini_get( 'display_errors' ),     $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
619
-                    __( 'Log Errors', 'admin-page-framework' )              => $this->getAOrB( @ini_get( 'log_errors' ),         $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
617
+                    __( 'Allow URL File Open', 'admin-page-framework' )     => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
618
+                    __( 'Display Errors', 'admin-page-framework' )          => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
619
+                    __( 'Log Errors', 'admin-page-framework' )              => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
620 620
                     __( 'Error log location', 'admin-page-framework' )      => @ini_get( 'error_log' ),
621 621
                     __( 'Error Reporting Level', 'admin-page-framework' )   => $_oErrorReporting->getErrorLevel(),
622
-                    __( 'FSOCKOPEN', 'admin-page-framework' )               => $this->getAOrB( function_exists( 'fsockopen' ),   $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
623
-                    __( 'cURL', 'admin-page-framework' )                    => $this->getAOrB( function_exists( 'curl_init' ),   $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
624
-                    __( 'SOAP', 'admin-page-framework' )                    => $this->getAOrB( class_exists( 'SoapClient' ),     $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
625
-                    __( 'SUHOSIN', 'admin-page-framework' )                 => $this->getAOrB( extension_loaded( 'suhosin' ),    $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
626
-                    'ini_set()'                                             => $this->getAOrB( function_exists( 'ini_set' ),     $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
622
+                    __( 'FSOCKOPEN', 'admin-page-framework' )               => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
623
+                    __( 'cURL', 'admin-page-framework' )                    => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
624
+                    __( 'SOAP', 'admin-page-framework' )                    => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
625
+                    __( 'SUHOSIN', 'admin-page-framework' )                 => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
626
+                    'ini_set()'                                             => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
627 627
                 ) 
628 628
                 + $this->getPHPInfo()
629 629
                 + array( 
@@ -642,11 +642,11 @@  discard block
 block discarded – undo
642 642
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
643 643
              * @return      array|string
644 644
              */                      
645
-            private function _getWebServerInfo( $bGenerateInfo=true ) {
645
+            private function _getWebServerInfo( $bGenerateInfo = true ) {
646 646
                         
647 647
                 return $bGenerateInfo 
648 648
                     ? array(
649
-                        __( 'Web Server', 'admin-page-framework' )                  => $_SERVER['SERVER_SOFTWARE'],
649
+                        __( 'Web Server', 'admin-page-framework' )                  => $_SERVER[ 'SERVER_SOFTWARE' ],
650 650
                         'SSL'                                                       => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
651 651
                         __( 'Session', 'admin-page-framework' )                     => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ),
652 652
                         __( 'Session Name', 'admin-page-framework' )                => esc_html( @ini_get( 'session.name' ) ),
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -297,6 +297,7 @@  discard block
 block discarded – undo
297 297
             /**
298 298
              * Returns the system information by section.
299 299
              * @since       3.5.3
300
+             * @param integer $iPrintType
300 301
              * @return      string      The system information by section.
301 302
              * @internal
302 303
              */
@@ -421,6 +422,8 @@  discard block
 block discarded – undo
421 422
                     /**
422 423
                      * 
423 424
                      * @since       3.5.12
425
+                     * @param string $asCategories
426
+                     * @param string $asRemovingCategories
424 427
                      * @return      string|array
425 428
                      * @internal
426 429
                      */
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      * @internal
144 144
      * @return      array
145 145
      */
146
-    protected function getEnqueuingScripts() { 
146
+    protected function getEnqueuingScripts() {
147 147
         return array();
148 148
     }
149 149
     
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      * @return      array
162 162
      * @internal
163 163
      */
164
-    protected function getEnqueuingStyles() { 
164
+    protected function getEnqueuingStyles() {
165 165
         return array();
166 166
     }            
167 167
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      * @internal
172 172
      * @return      string
173 173
      */ 
174
-    protected function getScripts() { 
174
+    protected function getScripts() {
175 175
         return '';
176 176
     }
177 177
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
      * @internal
182 182
      * @return      string
183 183
      */
184
-    protected function getIEStyles() { 
184
+    protected function getIEStyles() {
185 185
         return ''; 
186 186
     }
187 187
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      * @internal
223 223
      * @return      string
224 224
      */
225
-    protected function getField( $aField ) { 
225
+    protected function getField( $aField ) {
226 226
 
227 227
         $_aInputAttributes             = $aField[ 'attributes' ];
228 228
         $_aInputAttributes[ 'class' ] .= ' system';
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_textarea.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
     protected function getField( $aField ) {
555 555
 
556 556
         $_aOutput = array();
557
-        foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) {
558
-            $_aOutput[] = $this->_getFieldOutputByLabel( 
557
+        foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) {
558
+            $_aOutput[ ] = $this->_getFieldOutputByLabel( 
559 559
                 $_sKey, 
560 560
                 $_sLabel, 
561 561
                 $aField
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
         }
564 564
         
565 565
         // the repeatable field buttons will be replaced with this element.
566
-        $_aOutput[] = "<div class='repeatable-field-buttons'></div>";
566
+        $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>";
567 567
         return implode( '', $_aOutput );
568 568
         
569 569
     }
@@ -584,27 +584,27 @@  discard block
 block discarded – undo
584 584
             $aField[ 'rich' ]       = $this->getElementByLabel( $aField[ 'rich' ], $sKey, $aField[ 'label' ] );
585 585
             $aField[ 'attributes' ] = $_bIsArray
586 586
                 ? array(
587
-                        'name'  => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]",
588
-                        'id'    => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}",
587
+                        'name'  => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]",
588
+                        'id'    => $aField[ 'attributes' ][ 'id' ]."_{$sKey}",
589 589
                         'value' => $aField[ 'value' ],
590 590
                     ) 
591 591
                     + $aField[ 'attributes' ]
592 592
                 : $aField[ 'attributes' ];        
593
-            $_aOutput           = array(
594
-                $this->getElementByLabel( $aField['before_label'], $sKey, $aField[ 'label' ] ),
593
+            $_aOutput = array(
594
+                $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ),
595 595
                 "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>",
596
-                    "<label for='" . $aField[ 'attributes' ][ 'id' ] . "'>",
597
-                        $this->getElementByLabel( $aField['before_input'], $sKey, $aField[ 'label' ] ),
596
+                    "<label for='".$aField[ 'attributes' ][ 'id' ]."'>",
597
+                        $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ),
598 598
                         $_sLabel 
599
-                            ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
599
+                            ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
600 600
                                     . $_sLabel
601 601
                                 . "</span>"
602 602
                             : '',
603 603
                         $this->_getEditor( $aField ),
604
-                        $this->getElementByLabel( $aField['after_input'], $sKey, $aField[ 'label' ] ),
604
+                        $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ),
605 605
                     "</label>",
606 606
                 "</div>",
607
-                $this->getElementByLabel( $aField['after_label'], $sKey, $aField[ 'label' ] ),
607
+                $this->getElementByLabel( $aField[ 'after_label' ], $sKey, $aField[ 'label' ] ),
608 608
             );
609 609
             return implode( '', $_aOutput );
610 610
   
@@ -619,31 +619,31 @@  discard block
 block discarded – undo
619 619
          */
620 620
         private function _getEditor( $aField ) {
621 621
                         
622
-            unset( $aField['attributes']['value'] );
622
+            unset( $aField[ 'attributes' ][ 'value' ] );
623 623
             
624 624
             // For no TinyMCE
625
-            if ( empty( $aField['rich'] ) || ! $this->isTinyMCESupported() ) {
626
-                return "<textarea " . $this->getAttributes( $aField['attributes'] ) . " >" // this method is defined in the base class
627
-                            . esc_textarea( $aField['value'] )
625
+            if ( empty( $aField[ 'rich' ] ) || !$this->isTinyMCESupported() ) {
626
+                return "<textarea ".$this->getAttributes( $aField[ 'attributes' ] )." >" // this method is defined in the base class
627
+                            . esc_textarea( $aField[ 'value' ] )
628 628
                         . "</textarea>";
629 629
             }
630 630
 
631 631
             // Rich editor
632 632
             ob_start();
633 633
             wp_editor( 
634
-                $aField['value'],
635
-                $aField['attributes']['id'],  
634
+                $aField[ 'value' ],
635
+                $aField[ 'attributes' ][ 'id' ],  
636 636
                 $this->uniteArrays( 
637
-                    ( array ) $aField['rich'],
637
+                    ( array ) $aField[ 'rich' ],
638 638
                     array(
639 639
                         'wpautop'           => true, // use wpautop?
640 640
                         'media_buttons'     => true, // show insert/upload button(s)
641
-                        'textarea_name'     => $aField['attributes']['name'],
642
-                        'textarea_rows'     => $aField['attributes']['rows'],
641
+                        'textarea_name'     => $aField[ 'attributes' ][ 'name' ],
642
+                        'textarea_rows'     => $aField[ 'attributes' ][ 'rows' ],
643 643
                         'tabindex'          => '',
644 644
                         'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE
645 645
                         'editor_css'        => '', // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped".
646
-                        'editor_class'      => $aField['attributes']['class'], // add extra class(es) to the editor textarea
646
+                        'editor_class'      => $aField[ 'attributes' ][ 'class' ], // add extra class(es) to the editor textarea
647 647
                         'teeny'             => false, // output the minimal editor config used in Press This
648 648
                         'dfw'               => false, // replace the default fullscreen with DFW (needs specific DOM elements and css)
649 649
                         'tinymce'           => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
             ob_end_clean();
656 656
             
657 657
             return $_sContent
658
-                . $this->_getScriptForRichEditor( $aField['attributes']['id'] );
658
+                . $this->_getScriptForRichEditor( $aField[ 'attributes' ][ 'id' ] );
659 659
             
660 660
         }
661 661
     
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_default.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,21 +37,21 @@
 block discarded – undo
37 37
      */
38 38
     public function _replyToGetField( $aField ) {
39 39
         return 
40
-            $aField['before_label']
40
+            $aField[ 'before_label' ]
41 41
             . "<div class='admin-page-framework-input-label-container'>"
42
-                . "<label for='{$aField['input_id']}'>"
43
-                    . $aField['before_input']
44
-                    . ( $aField['label'] && ! $aField['repeatable']
45
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
42
+                . "<label for='{$aField[ 'input_id' ]}'>"
43
+                    . $aField[ 'before_input' ]
44
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
45
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
46 46
                                 . $aField[ 'label' ]
47 47
                             . "</span>"
48 48
                         : "" 
49 49
                     )
50
-                    . $aField['value']
51
-                    . $aField['after_input']
50
+                    . $aField[ 'value' ]
51
+                    . $aField[ 'after_input' ]
52 52
                 . "</label>"
53 53
             . "</div>"
54
-            . $aField['after_label']
54
+            . $aField[ 'after_label' ]
55 55
         ;     
56 56
     }
57 57
 
Please login to merge, or discard this patch.
development/factory/admin_page/_view/AdminPageFramework_View__Resource.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
                  */
69 69
                 public function _appendInternalAssets( $sInternal, &$aContainer ) {
70 70
                     $_aInternals = array_unique( $aContainer );
71
-                    $sInternal   = PHP_EOL . $sInternal;
72
-                    foreach( $_aInternals as $_iIndex => $_sInternal ) {
73
-                        $sInternal .= $_sInternal . PHP_EOL;
71
+                    $sInternal   = PHP_EOL.$sInternal;
72
+                    foreach ( $_aInternals as $_iIndex => $_sInternal ) {
73
+                        $sInternal .= $_sInternal.PHP_EOL;
74 74
                         unset( $_aInternals[ $_iIndex ] );
75 75
                     }
76 76
                     $aContainer = $_aInternals; // update the container array.
@@ -84,23 +84,23 @@  discard block
 block discarded – undo
84 84
         private function _parseAssets( $oFactory ) {
85 85
             
86 86
             // page
87
-            $_aPageStyles      = $this->getElementAsArray(
87
+            $_aPageStyles = $this->getElementAsArray(
88 88
                 $oFactory->oProp->aPages,
89 89
                 array( $this->sCurrentPageSlug, 'style' )
90 90
             );               
91 91
             $this->_enqueuePageAssets( $_aPageStyles, 'style' );
92 92
             
93
-            $_aPageScripts     = $this->getElementAsArray(
93
+            $_aPageScripts = $this->getElementAsArray(
94 94
                 $oFactory->oProp->aPages,
95 95
                 array( $this->sCurrentPageSlug, 'script' )
96 96
             );
97 97
             $this->_enqueuePageAssets( $_aPageScripts, 'script' );
98 98
             
99 99
             // In-page tabs 
100
-            if ( ! $this->sCurrentTabSlug ) {
100
+            if ( !$this->sCurrentTabSlug ) {
101 101
                 return;
102 102
             }        
103
-            $_aInPageTabStyles  = $this->getElementAsArray(
103
+            $_aInPageTabStyles = $this->getElementAsArray(
104 104
                 $oFactory->oProp->aInPageTabs,
105 105
                 array( $this->sCurrentPageSlug, $this->sCurrentTabSlug, 'style' )
106 106
             );              
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
              * @since       3.6.3
118 118
              * @return      void
119 119
              */    
120
-            private function _enqueuePageAssets( array $aPageAssets, $sType='style' ) {
121
-                $_sMathodName = "_enqueueAsset_" . $sType;
122
-                foreach( $aPageAssets as $_asPageAsset ) {
123
-                    $this->{$_sMathodName}( $_asPageAsset);
120
+            private function _enqueuePageAssets( array $aPageAssets, $sType = 'style' ) {
121
+                $_sMathodName = "_enqueueAsset_".$sType;
122
+                foreach ( $aPageAssets as $_asPageAsset ) {
123
+                    $this->{$_sMathodName}( $_asPageAsset );
124 124
                 }
125 125
             }
126 126
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                     }
146 146
                     
147 147
                     // Insert the CSS rule in the head tag.
148
-                    $this->aCSSRules[] = $_sSRC;
148
+                    $this->aCSSRules[ ] = $_sSRC;
149 149
                     
150 150
                 }                    
151 151
      
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                     }                
171 171
                     
172 172
                     // Insert the scripts in the head tag.                
173
-                    $this->aScripts[] = $_sSRC;
173
+                    $this->aScripts[ ] = $_sSRC;
174 174
                     
175 175
                 }        
176 176
                 
Please login to merge, or discard this patch.
admin_page/_model/delegate/AdminPageFramework_Model_Menu__RegisterMenu.php 3 patches
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         private function _getDefaultPageSlug( array $aPages ) {
168 168
 
169 169
             foreach( $aPages as $_aPage ) {
170
-                if ( ! isset( $_aPage[ 'page_slug' ] ) ) { 
170
+                if ( ! isset( $_aPage[ 'page_slug' ] ) ) {
171 171
                     continue; 
172 172
                 }
173 173
                 return $_aPage[ 'page_slug' ];                
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                     
380 380
                     foreach( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sMenuSlug ) ) as $_iIndex => $_aSubMenu ) {
381 381
                       
382
-                        if ( ! isset( $_aSubMenu[ 3 ] ) ) { 
382
+                        if ( ! isset( $_aSubMenu[ 3 ] ) ) {
383 383
                             continue; 
384 384
                         }
385 385
                                                
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
                             $sPageTitle,
395 395
                             $sPageSlug,
396 396
                         );
397
-                        if ( $_aA !== $_aB ) { 
397
+                        if ( $_aA !== $_aB ) {
398 398
                             continue;
399 399
                         }
400 400
                         return $_iIndex;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                  * @since       3.1.1       Moved from `AdminPageFramework_Menu`. Chagned the return type.
412 412
                  * @return      array       removed menu item.
413 413
                  */
414
-                private function _removePageSubmenuItem( $nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ){
414
+                private function _removePageSubmenuItem( $nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ) {
415 415
  
416 416
                     $_aRemovedMenuItem = $this->_removePageSubMenuItemByIndex( 
417 417
                         $nSubMenuPageIndex,
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
      * @callback    action      admin_menu
518 518
      * @internal
519 519
      */    
520
-    public function _replyToRemoveRootMenuPage() {      
520
+    public function _replyToRemoveRootMenuPage() {
521 521
         
522 522
         // After adding the sub menus, if the root menu is created, remove the page that is automatically created when registering the root menu.
523 523
         if ( ! $this->oFactory->oProp->aRootMenu[ 'fCreateRoot' ] ) {
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,7 @@  discard block
 block discarded – undo
26 26
      * Sets up hooks
27 27
      * 
28 28
      * @internal
29
+     * @param AdminPageFramework_Router $oFactory
29 30
      */
30 31
     public function __construct( $oFactory, $sActionHook='admin_menu' ) {
31 32
         
@@ -253,6 +254,7 @@  discard block
 block discarded – undo
253 254
              * @since       3.3.0
254 255
              * @since       3.1.1       Moved from `AdminPageFramework_Menu`.
255 256
              * @since       3.7.4       Added the `$nOrder` parameter.
257
+             * @param string $sMenuSlug
256 258
              * @return      string      The page hook of the added page.
257 259
              */
258 260
             private function _addPageSubmenuItem( $sRootPageSlug, $sMenuSlug, $sPageSlug, $sPageTitle, $sMenuTitle, $sCapability, $bShowInMenu, $nOrder ) {
@@ -354,6 +356,7 @@  discard block
 block discarded – undo
354 356
                 /**
355 357
                  * Sets up hooks for the page.
356 358
                  * @since       3.7.4
359
+                 * @param false|string $sPageHook
357 360
                  */
358 361
                 private function _setPageHooks( $sPageHook, $sPageSlug ) {
359 362
                                     
@@ -405,7 +408,7 @@  discard block
 block discarded – undo
405 408
                 /**
406 409
                  * @since       3.7.4
407 410
                  * @return      void
408
-                 * @param       numeric     $$nOrder            A user set order (menu position, index).
411
+                 * @param       numeric     $nOrder            A user set order (menu position, index).
409 412
                  * @param       array       $aSubMenuItem       The sub menu item array set in the global `$submenu` array.
410 413
                  */
411 414
                 private function _setSubMenuPageByIndex( $nOrder, $aSubMenuItem, $sMenuSlug ) {
@@ -529,6 +532,7 @@  discard block
 block discarded – undo
529 532
              * @since       3.1.1       Moved from `AdminPageFramework_Menu`.
530 533
              * @since       3.5.3       Added the `$bShowInMenu` parameter.
531 534
              * @since       3.7.4       Added the `$nOrder` parameter.
535
+             * @param string $sMenuSlug
532 536
              * @return      void
533 537
              */
534 538
             private function _addLinkSubmenuItem( $sMenuSlug, $sTitle, $sCapability, $sHref, $bShowInMenu, $nOrder ) {
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * 
28 28
      * @internal
29 29
      */
30
-    public function __construct( $oFactory, $sActionHook='admin_menu' ) {
30
+    public function __construct( $oFactory, $sActionHook = 'admin_menu' ) {
31 31
         
32 32
         $this->oFactory = $oFactory;
33 33
         
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function _replyToRegisterRootMenu() {
76 76
         
77 77
         // If the root menu label is not set but the slug is set, 
78
-        if ( ! $this->oFactory->oProp->aRootMenu[ 'fCreateRoot' ] ) {
78
+        if ( !$this->oFactory->oProp->aRootMenu[ 'fCreateRoot' ] ) {
79 79
             return;
80 80
         }
81 81
         $this->_registerRootMenuPage();
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
             }
98 98
 
99 99
             $this->oFactory->oProp->aRootMenu[ '_page_hook' ] = add_menu_page(  
100
-                $this->oFactory->oProp->sClassName,                 // Page title - will be invisible anyway
101
-                $this->oFactory->oProp->aRootMenu[ 'sTitle' ],      // Menu title - should be the root page title.
102
-                $this->oFactory->oProp->sCapability,                // Capability - access right
103
-                $this->oFactory->oProp->aRootMenu[ 'sPageSlug' ],   // Menu ID 
104
-                '',                                       // Callback function for the page content output - the root page will be removed so no need to register a function.
105
-                $this->oFactory->oProp->aRootMenu[ 'sIcon16x16' ],  // icon path
100
+                $this->oFactory->oProp->sClassName, // Page title - will be invisible anyway
101
+                $this->oFactory->oProp->aRootMenu[ 'sTitle' ], // Menu title - should be the root page title.
102
+                $this->oFactory->oProp->sCapability, // Capability - access right
103
+                $this->oFactory->oProp->aRootMenu[ 'sPageSlug' ], // Menu ID 
104
+                '', // Callback function for the page content output - the root page will be removed so no need to register a function.
105
+                $this->oFactory->oProp->aRootMenu[ 'sIcon16x16' ], // icon path
106 106
                 $this->getElement( 
107 107
                     $this->oFactory->oProp->aRootMenu, 
108 108
                     'iPosition', 
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
 
125 125
         // Let external scripts add sub-menu pages.
126 126
         $_aPages = $this->addAndApplyFilter( 
127
-            $this->oFactory,    // caller object
128
-            "pages_{$this->oFactory->oProp->sClassName}",   // filter
127
+            $this->oFactory, // caller object
128
+            "pages_{$this->oFactory->oProp->sClassName}", // filter
129 129
             $this->oFactory->oProp->aPages  // arguments
130 130
         );
131 131
         
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         // Format the `$aPages` property and register the pages.
136 136
         $_iParsedIndex    = 0;
137 137
         $_aFormattedPages = array();
138
-        foreach( $_aPages as $_aSubMenuItem ) {
138
+        foreach ( $_aPages as $_aSubMenuItem ) {
139 139
             
140 140
             // needs to be sanitized because there are hook filters applied to this array.
141 141
             $_oFormatter = new AdminPageFramework_Format_SubMenuItem( 
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
          */
171 171
         private function _getDefaultPageSlug( array $aPages ) {
172 172
 
173
-            foreach( $aPages as $_aPage ) {
174
-                if ( ! isset( $_aPage[ 'page_slug' ] ) ) { 
173
+            foreach ( $aPages as $_aPage ) {
174
+                if ( !isset( $_aPage[ 'page_slug' ] ) ) { 
175 175
                     continue; 
176 176
                 }
177 177
                 return $_aPage[ 'page_slug' ];                
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
          */ 
194 194
         private function _registerSubMenuItem( array $aArgs ) {
195 195
 
196
-            if ( ! current_user_can( $aArgs[ 'capability' ] ) ) {
196
+            if ( !current_user_can( $aArgs[ 'capability' ] ) ) {
197 197
                 return '';
198 198
             }
199 199
                                     
@@ -257,14 +257,14 @@  discard block
 block discarded – undo
257 257
              */
258 258
             private function _addPageSubmenuItem( $sRootPageSlug, $sMenuSlug, $sPageSlug, $sPageTitle, $sMenuTitle, $sCapability, $bShowInMenu, $nOrder ) {
259 259
                 
260
-                if ( ! $sPageSlug ) {
260
+                if ( !$sPageSlug ) {
261 261
                     return '';
262 262
                 }
263 263
                 $_sPageHook = $this->___addSubMenuPage(
264
-                    $sRootPageSlug,         // the root (parent) page slug
265
-                    $sPageTitle,            // page title
266
-                    $sMenuTitle,            // menu title
267
-                    $sCapability,           // capability
264
+                    $sRootPageSlug, // the root (parent) page slug
265
+                    $sPageTitle, // page title
266
+                    $sMenuTitle, // menu title
267
+                    $sCapability, // capability
268 268
                     $sPageSlug              // menu slug
269 269
                 );
270 270
 
@@ -293,14 +293,14 @@  discard block
 block discarded – undo
293 293
                 $_aRemovedMenuItem = $this->_removePageSubmenuItem( $_nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle );
294 294
                 
295 295
                 // If the visibility option is `false`, remove the one just added from the sub-menu global array
296
-                if ( ! $bShowInMenu && ! $this->_isCurrentPage( $sPageSlug ) ) {
296
+                if ( !$bShowInMenu && !$this->_isCurrentPage( $sPageSlug ) ) {
297 297
                     return $_sPageHook;
298 298
                 }                
299 299
                 
300 300
                 // Set the order index in the element of the `submenu` global array.
301 301
                 $this->_setSubMenuPageByIndex( 
302
-                    $nOrder,                // user-set order
303
-                    $_aRemovedMenuItem,     // will be reassign with a new index
302
+                    $nOrder, // user-set order
303
+                    $_aRemovedMenuItem, // will be reassign with a new index
304 304
                     $sMenuSlug
305 305
                 );
306 306
 
@@ -321,21 +321,21 @@  discard block
 block discarded – undo
321 321
                  * @uses        add_submenu_page
322 322
                  */
323 323
                 private function ___addSubMenuPage(
324
-                    $sRootPageSlug,         // the root (parent) page slug
325
-                    $sPageTitle,            // page title
326
-                    $sMenuTitle,            // menu title
327
-                    $sCapability,           // capability
324
+                    $sRootPageSlug, // the root (parent) page slug
325
+                    $sPageTitle, // page title
326
+                    $sMenuTitle, // menu title
327
+                    $sCapability, // capability
328 328
                     $sPageSlug              // menu slug
329 329
                 ) {
330 330
                     if ( $this->oFactory->oProp->bIsAdminAjax ) {
331 331
                         return $sPageSlug;
332 332
                     }
333 333
                     return add_submenu_page(
334
-                        $sRootPageSlug,         // the root (parent) page slug
335
-                        $sPageTitle,            // page title
336
-                        $sMenuTitle,            // menu title
337
-                        $sCapability,           // capability
338
-                        $sPageSlug,             // menu slug
334
+                        $sRootPageSlug, // the root (parent) page slug
335
+                        $sPageTitle, // page title
336
+                        $sMenuTitle, // menu title
337
+                        $sCapability, // capability
338
+                        $sPageSlug, // menu slug
339 339
                         array( $this->oFactory, '_replyToRenderPage' )  // callback 3.7.10+
340 340
                     );
341 341
                 }
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
                      */
370 370
                     add_action( 
371 371
                         'current_screen', 
372
-                        array( $this->oFactory, "load_pre_" . $sPageSlug ), 
372
+                        array( $this->oFactory, "load_pre_".$sPageSlug ), 
373 373
                         20 
374 374
                     );
375 375
                     /**
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
                      */
379 379
                     add_action(
380 380
                         'pseudo_current_screen',
381
-                        array( $this->oFactory, "load_pre_" . $sPageSlug ),
381
+                        array( $this->oFactory, "load_pre_".$sPageSlug ),
382 382
                         20
383 383
                     );
384 384
                     
@@ -387,15 +387,15 @@  discard block
 block discarded – undo
387 387
                      * Set a low priority because the user may add in-page tabs in their callback method of this action hook.
388 388
                      * @since       3.6.3
389 389
                      */
390
-                    add_action( "load_" . $sPageSlug, array( $this->oFactory, '_replyToFinalizeInPageTabs' ), 9999 );
390
+                    add_action( "load_".$sPageSlug, array( $this->oFactory, '_replyToFinalizeInPageTabs' ), 9999 );
391 391
                     
392 392
                     // 3.6.3+
393
-                    add_action( "load_after_" . $sPageSlug, array( $this->oFactory, '_replyToEnqueuePageAssets' ) );
394
-                    add_action( "load_after_" . $sPageSlug, array( $this->oFactory, '_replyToEnablePageMetaBoxes' ) );  // 3.7.10+
393
+                    add_action( "load_after_".$sPageSlug, array( $this->oFactory, '_replyToEnqueuePageAssets' ) );
394
+                    add_action( "load_after_".$sPageSlug, array( $this->oFactory, '_replyToEnablePageMetaBoxes' ) ); // 3.7.10+
395 395
                           
396 396
                     $this->oFactory->oProp->aPageHooks[ $sPageSlug ] = $this->getAOrB(
397 397
                         is_network_admin(),
398
-                        $sPageHook . '-network',
398
+                        $sPageHook.'-network',
399 399
                         $sPageHook
400 400
                     );                          
401 401
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 
413 413
                     $_nNewIndex = $this->getUnusedNumericIndex( 
414 414
                         $this->getElementAsArray( $GLOBALS, array( 'submenu', $sMenuSlug ) ), // subject array to parser
415
-                        $nOrder,    // a desired menu position
415
+                        $nOrder, // a desired menu position
416 416
                         5           // offset 
417 417
                     );
418 418
 
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
                  */
427 427
                 private function _getSubMenuPageIndex( $sMenuSlug, $sMenuTitle, $sPageTitle, $sPageSlug ) {
428 428
                     
429
-                    foreach( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sMenuSlug ) ) as $_iIndex => $_aSubMenu ) {
429
+                    foreach ( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sMenuSlug ) ) as $_iIndex => $_aSubMenu ) {
430 430
                       
431
-                        if ( ! isset( $_aSubMenu[ 3 ] ) ) { 
431
+                        if ( !isset( $_aSubMenu[ 3 ] ) ) { 
432 432
                             continue; 
433 433
                         }
434 434
                                                
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
                  * @since       3.1.1       Moved from `AdminPageFramework_Menu`. Chagned the return type.
461 461
                  * @return      array       removed menu item.
462 462
                  */
463
-                private function _removePageSubmenuItem( $nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ){
463
+                private function _removePageSubmenuItem( $nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ) {
464 464
  
465 465
                     $_aRemovedMenuItem = $this->_removePageSubMenuItemByIndex( 
466 466
                         $nSubMenuPageIndex,
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
              */
534 534
             private function _addLinkSubmenuItem( $sMenuSlug, $sTitle, $sCapability, $sHref, $bShowInMenu, $nOrder ) {
535 535
                 
536
-                if ( ! $bShowInMenu ) {
536
+                if ( !$bShowInMenu ) {
537 537
                     return;
538 538
                 }
539 539
     
@@ -548,9 +548,9 @@  discard block
 block discarded – undo
548 548
                     5   // offset
549 549
                 );
550 550
                 $_aSubMenuItems[ $_nIndex ] = array(
551
-                    $sTitle,        // 0
552
-                    $sCapability,   // 1
553
-                    $sHref,         // 2   
551
+                    $sTitle, // 0
552
+                    $sCapability, // 1
553
+                    $sHref, // 2   
554 554
                 );
555 555
                 $GLOBALS[ 'submenu' ][ $sMenuSlug ] = $_aSubMenuItems;                
556 556
                 
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
     public function _replyToRemoveRootMenuPage() {      
570 570
         
571 571
         // After adding the sub menus, if the root menu is created, remove the page that is automatically created when registering the root menu.
572
-        if ( ! $this->oFactory->oProp->aRootMenu[ 'fCreateRoot' ] ) {
572
+        if ( !$this->oFactory->oProp->aRootMenu[ 'fCreateRoot' ] ) {
573 573
             return;
574 574
         }
575 575
         if ( $this->oFactory->oProp->bIsAdminAjax ) {
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
          * Namespace slugs have backslashes but the registered slugs backslashes are all converted to forward-slashes.
581 581
          * @since       3.5.16
582 582
          */
583
-        $_sMenuSlug =             str_replace(
583
+        $_sMenuSlug = str_replace(
584 584
             '\\',
585 585
             '/',
586 586
             $this->oFactory->oProp->aRootMenu[ 'sPageSlug' ]
Please login to merge, or discard this patch.