Completed
Branch master (b13b1d)
by Michael
19:31
created
admin-page-framework/addon/AdminPageFrameworkLoader_AdminPage_Addon_Top.php 2 patches
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
         // add_filter( 'wp_feed_cache_transient_lifetime', '__return_zero' );        
34 34
 
35 35
         // Styles
36
-        $this->oFactory->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/column.css' );  
37
-        $this->oFactory->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/feed-list.css' );  
36
+        $this->oFactory->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/column.css' );  
37
+        $this->oFactory->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/feed-list.css' );  
38 38
         
39 39
         // $this->oFactory->setPageTitleVisibility( false );
40 40
         $this->oFactory->setInPageTabsVisibility( false );
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
     public function replyToDoTab() {
48 48
         
49 49
         $_oFeedList  = new AdminPageFrameworkLoader_FeedList( $this->sRSSURL );
50
-        $_aFeedItems = apply_filters( AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_add_ons', $this->_getDemo() + $_oFeedList->get() );
50
+        $_aFeedItems = apply_filters( AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_admin_add_ons', $this->_getDemo() + $_oFeedList->get() );
51 51
         if ( empty( $_aFeedItems ) ) {
52
-            echo "<p>" . __( 'No add-on could be found.', 'admin-page-framework-loader' ) . "</p>";
52
+            echo "<p>".__( 'No add-on could be found.', 'admin-page-framework-loader' )."</p>";
53 53
             return;
54 54
         }        
55 55
         
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
         private function _getList( array $aFeedItems ) {
68 68
 
69 69
             $_aOutput       = array();
70
-            $_aColumnInfo   = array (    // this will be modified as the items get rendered
70
+            $_aColumnInfo   = array(    // this will be modified as the items get rendered
71 71
                 'bRowTagOpened'      => false,
72 72
                 'bRowTagClosed'      => false,
73 73
                 'iCurrRowPos'        => 0,
74 74
                 'iCurrColPos'        => 0,
75 75
             );            
76
-            $_aColumnOption = array (
76
+            $_aColumnOption = array(
77 77
                 'iMaxCols'           => 3,
78 78
                 'sClassAttr'         => 'apfl_columns',
79 79
                 'sClassAttrGroup'    => 'apfl_columns_box',
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
                 'sClassAttrFirstCol' => 'apfl_columns_first_col',
83 83
             );                
84 84
                 
85
-            $_sSiteURLWOQuery   = preg_replace( '/\?.*/', '', get_bloginfo( 'url' ) );
86
-            foreach( $aFeedItems as $_aItem ) {
87
-                $_aOutput[] = $this->_getFeedListItem( 
85
+            $_sSiteURLWOQuery = preg_replace( '/\?.*/', '', get_bloginfo( 'url' ) );
86
+            foreach ( $aFeedItems as $_aItem ) {
87
+                $_aOutput[ ] = $this->_getFeedListItem( 
88 88
                     ( array ) $_aItem, 
89 89
                     $_aColumnInfo, 
90 90
                     $_aColumnOption, 
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
             }
94 94
             
95 95
             // If the section (row) tag is not closed, close it.
96
-            if ( $_aColumnInfo[ 'bRowTagOpened' ] && ! $_aColumnInfo[ 'bRowTagClosed' ] ) { 
97
-                $_aOutput[] = '</div>';    
96
+            if ( $_aColumnInfo[ 'bRowTagOpened' ] && !$_aColumnInfo[ 'bRowTagClosed' ] ) { 
97
+                $_aOutput[ ] = '</div>';    
98 98
             }
99 99
             $_aColumnInfo[ 'bRowTagClosed' ] = true;
100 100
             
101 101
             // Enclose the output in the group tag
102 102
             return '<div class="apfl_addon_list_container">' 
103
-                    . '<div class="' . $_aColumnOption[ 'sClassAttr' ] . ' ' . $_aColumnOption[ 'sClassAttrGroup' ] . '">'
103
+                    . '<div class="'.$_aColumnOption[ 'sClassAttr' ].' '.$_aColumnOption[ 'sClassAttrGroup' ].'">'
104 104
                         . implode( '', $_aOutput )
105 105
                     . '</div>'
106 106
                 . '</div>';
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
              * Returns an HTML output from the given feed item array.
111 111
              * @return      string
112 112
              */
113
-            private function _getFeedListItem( array $aItem, array &$aColumnInfo, array $aColumnOption, $sSiteURLWOQuery='' ) {
113
+            private function _getFeedListItem( array $aItem, array &$aColumnInfo, array $aColumnOption, $sSiteURLWOQuery = '' ) {
114 114
                 
115 115
                 // Initial checks
116
-                if ( ! isset( $aItem[ 'title' ] ) ) { 
116
+                if ( !isset( $aItem[ 'title' ] ) ) { 
117 117
                     return ''; 
118 118
                 }
119 119
                 
@@ -139,20 +139,20 @@  discard block
 block discarded – undo
139 139
                 $_sTarget = '';
140 140
                 
141 141
                 // Enclose the item buffer into the item container
142
-                $_sItem = '<div class="' . $aColumnOption['sClassAttrCol'] 
143
-                    . ' apfl_col_element_of_' . $aColumnOption['iMaxCols'] . ' '
142
+                $_sItem = '<div class="'.$aColumnOption[ 'sClassAttrCol' ] 
143
+                    . ' apfl_col_element_of_'.$aColumnOption[ 'iMaxCols' ].' '
144 144
                     . ' apfl_extension '
145
-                    . ( ( 1 == $aColumnInfo['iCurrColPos'] ) ?  $aColumnOption['sClassAttrFirstCol']  : '' )
145
+                    . ( ( 1 == $aColumnInfo[ 'iCurrColPos' ] ) ? $aColumnOption[ 'sClassAttrFirstCol' ] : '' )
146 146
                     . '"'
147 147
                     . '>' 
148 148
                         . '<div class="apfl_addon_item">' 
149
-                            . "<h4 class='apfl_feed_item_title'>{$aItem['title']}</h4>"
149
+                            . "<h4 class='apfl_feed_item_title'>{$aItem[ 'title' ]}</h4>"
150 150
                             . "<div class='apfl_feed_item_description'>"
151
-                                . $aItem['description'] 
151
+                                . $aItem[ 'description' ] 
152 152
                             . "</div>"
153 153
                             . "<div class='get-now apfl_feed_item_link_button'>"
154
-                                . "<a href='" . esc_url( $aItem[ 'link' ] ) . "' target='{$_sTarget}' rel='nofollow' class='button button-secondary'>" 
155
-                                    . $aItem['label']
154
+                                . "<a href='".esc_url( $aItem[ 'link' ] )."' target='{$_sTarget}' rel='nofollow' class='button button-secondary'>" 
155
+                                    . $aItem[ 'label' ]
156 156
                                 . "</a>"
157 157
                             . "</div>"
158 158
                         . '</div>'
@@ -160,18 +160,18 @@  discard block
 block discarded – undo
160 160
                 
161 161
                 // If it's the first item in the row, add the class attribute. 
162 162
                 // Be aware that at this point, the tag will be unclosed. Therefore, it must be closed later at some point. 
163
-                if ( 1 == $aColumnInfo['iCurrColPos'] ) {
164
-                    $aColumnInfo['bRowTagOpened'] = true;
165
-                    $_sItem = '<div class="' . $aColumnOption['sClassAttrRow']  . '">' 
163
+                if ( 1 == $aColumnInfo[ 'iCurrColPos' ] ) {
164
+                    $aColumnInfo[ 'bRowTagOpened' ] = true;
165
+                    $_sItem = '<div class="'.$aColumnOption[ 'sClassAttrRow' ].'">' 
166 166
                         . $_sItem;
167 167
                 }
168 168
             
169 169
                 // If the current column position reached the set max column, increment the current position of row
170
-                if ( 0 === ( $aColumnInfo['iCurrColPos'] % $aColumnOption['iMaxCols'] ) ) {
171
-                    $aColumnInfo['iCurrRowPos']++;          // increment the row number
172
-                    $aColumnInfo['iCurrColPos'] = 0;        // reset the current column position
173
-                    $_sItem .= '</div>';  // close the section(row) div tag
174
-                    $aColumnInfo['bRowTagClosed'] = true;
170
+                if ( 0 === ( $aColumnInfo[ 'iCurrColPos' ] % $aColumnOption[ 'iMaxCols' ] ) ) {
171
+                    $aColumnInfo[ 'iCurrRowPos' ]++; // increment the row number
172
+                    $aColumnInfo[ 'iCurrColPos' ] = 0; // reset the current column position
173
+                    $_sItem .= '</div>'; // close the section(row) div tag
174
+                    $aColumnInfo[ 'bRowTagClosed' ] = true;
175 175
                 }        
176 176
                 return $_sItem;
177 177
                 
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
          */
184 184
         private function _getDemo() {
185 185
             
186
-            $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys['main'] );
186
+            $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] );
187 187
             $_bEnabled = $_oOption->get( 'enable_demo' );
188 188
             
189 189
             $_sTitle = __( 'Demo', 'admin=page-framework-loader' );
190 190
             return array( 
191 191
                 $_sTitle => array(
192 192
                     'title'         => $_sTitle,
193
-                    'description'   => '<div style="text-align: center;" class="aligncenter"><img class="aligncenter" src="' . AdminPageFrameworkLoader_Registry::getPluginURL( '/asset/image/icon-128x128.png' ) . '" alt="' . esc_attr( $_sTitle ) . '"/></div>'
193
+                    'description'   => '<div style="text-align: center;" class="aligncenter"><img class="aligncenter" src="'.AdminPageFrameworkLoader_Registry::getPluginURL( '/asset/image/icon-128x128.png' ).'" alt="'.esc_attr( $_sTitle ).'"/></div>'
194 194
                         . '<p>'
195 195
                             . __( 'Showcases the features of Admin Page Framework.', 'admin-page-framework-loader' )
196 196
                         . '</p>',
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                                 ? 0 
201 201
                                 : 1,
202 202
                         ) + $_GET,
203
-                        admin_url( $GLOBALS['pagenow'] )
203
+                        admin_url( $GLOBALS[ 'pagenow' ] )
204 204
                     ),
205 205
                     'label'         => $_bEnabled
206 206
                         ? __( 'Deactivate', 'admin-page-framework-loader' )
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             }
94 94
             
95 95
             // If the section (row) tag is not closed, close it.
96
-            if ( $_aColumnInfo[ 'bRowTagOpened' ] && ! $_aColumnInfo[ 'bRowTagClosed' ] ) { 
96
+            if ( $_aColumnInfo[ 'bRowTagOpened' ] && ! $_aColumnInfo[ 'bRowTagClosed' ] ) {
97 97
                 $_aOutput[] = '</div>';    
98 98
             }
99 99
             $_aColumnInfo[ 'bRowTagClosed' ] = true;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             private function _getFeedListItem( array $aItem, array &$aColumnInfo, array $aColumnOption, $sSiteURLWOQuery='' ) {
114 114
                 
115 115
                 // Initial checks
116
-                if ( ! isset( $aItem[ 'title' ] ) ) { 
116
+                if ( ! isset( $aItem[ 'title' ] ) ) {
117 117
                     return ''; 
118 118
                 }
119 119
                 
Please login to merge, or discard this patch.
admin/admin-page-framework/help/AdminPageFrameworkLoader_AdminPage_Help.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
         
24 24
         // Tabs
25 25
         new AdminPageFrameworkLoader_AdminPage_Help_Information(
26
-            $oFactory,    // factory object
27
-            $this->sPageSlug,   // page slug
26
+            $oFactory, // factory object
27
+            $this->sPageSlug, // page slug
28 28
             array(  // tab definition
29 29
                 'tab_slug'  => 'information',
30 30
                 'title'     => __( 'Support', 'admin-page-framework-loader' ),             
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
                 'title'         => __( 'Getting Started', 'admin-page-framework-loader' ),
39 39
                 'url'           => add_query_arg( 
40 40
                     array( 
41
-                        'page'  => AdminPageFrameworkLoader_Registry::$aAdminPages['about'],
41
+                        'page'  => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ],
42 42
                         // 'tab'   => 'guide',
43 43
                     ),
44 44
                     admin_url( 'index.php' )   // Dashboard
45
-                ) . '#section-getting_started__'
45
+                ).'#section-getting_started__'
46 46
             )                          
47 47
         );                 
48 48
         new AdminPageFrameworkLoader_AdminPage_Help_Tip(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 'title'     => __( 'About', 'admin-page-framework-loader' ),
86 86
                 'url'       => add_query_arg( 
87 87
                     array( 
88
-                        'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['about']
88
+                        'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]
89 89
                     ),
90 90
                     admin_url( 'index.php' )   // Dashboard
91 91
                 )           
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         add_action( "do_after_{$this->sPageSlug}", array( $this, 'replyToDoAfterPage' ) );    
116 116
         
117 117
         $oFactory->enqueueStyle( 
118
-            AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/help.css', 
118
+            AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/help.css', 
119 119
             $this->sPageSlug
120 120
         );
121 121
         
Please login to merge, or discard this patch.
admin-page-framework/help/AdminPageFrameworkLoader_AdminPage_Help_Debug.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     
35 35
     public function replyToDoTab( $oFactory ) {
36 36
         
37
-        echo "<h3>" . __( 'Saved Options', 'admin-page-framework-loader' ) . "</h3>";
37
+        echo "<h3>".__( 'Saved Options', 'admin-page-framework-loader' )."</h3>";
38 38
         $oFactory->oDebug->dump( $oFactory->oProp->aOptions );
39 39
         
40 40
     }
Please login to merge, or discard this patch.
help/AdminPageFrameworkLoader_AdminPage_Help_Informationt.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
     public function replyToDoTab( /* $oFactory */ ) {
22 22
     
23 23
         echo $this->_getReadmeContents( 
24
-            AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt', 
25
-            '',     // no TOC
24
+            AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt', 
25
+            '', // no TOC
26 26
             array( 'Support' )
27 27
         );    
28 28
  
Please login to merge, or discard this patch.
help/AdminPageFrameworkLoader_AdminPage_Help_Report_Report.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 'title'             => __( 'Your Name', 'admin-page-framework-loader' ),
30 30
                 'type'              => 'text',
31 31
                 'default'           => $_oCurrentUser->user_lastname || $_oCurrentUser->user_firstname 
32
-                    ? $_oCurrentUser->user_lastname . ' ' .  $_oCurrentUser->user_lastname 
32
+                    ? $_oCurrentUser->user_lastname.' '.$_oCurrentUser->user_lastname 
33 33
                     : '',
34 34
                 'attributes'        => array(
35 35
                     'required'      => 'required',
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             array(
113 113
                 'field_id'          => 'allow_sending_system_information',
114 114
                 'title'             => __( 'Confirmation', 'admin-page-framework-loader' ) 
115
-                    . ' (' . __( 'required', 'admin-page-framework-loader' ) . ')',
115
+                    . ' ('.__( 'required', 'admin-page-framework-loader' ).')',
116 116
                 'type'              => 'checkbox',
117 117
                 'label'             => __( 'I understand that the system information including a PHP version and WordPress version etc. will be sent along with the messages to help developer trouble-shoot the problem.', 'admin-page-framework-loader' ),
118 118
                 'attributes'        => array(
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
         $_bIsValid = true;
168 168
         $_aErrors  = array();
169 169
       
170
-        if ( ! $aInput[ 'allow_sending_system_information' ] ) {
170
+        if ( !$aInput[ 'allow_sending_system_information' ] ) {
171 171
             $_bIsValid = false;
172 172
             $_aErrors[ 'allow_sending_system_information' ] = __( 'We need necessary information to help you.', 'admin-page-framework-loader' );
173 173
         }
174 174
         
175
-        if ( ! $_bIsValid ) {
175
+        if ( !$_bIsValid ) {
176 176
         
177 177
             $oFactory->setFieldErrors( $_aErrors );     
178 178
             $oFactory->setSettingNotice( __( 'Please help us to help you.', 'admin-page-framework-loader' ) );
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
      */
164 164
     public function validate( $aInput, $aOldInput, $oFactory, $aSubmit ) {
165 165
     
166
-       // Local variables
166
+        // Local variables
167 167
         $_bIsValid = true;
168 168
         $_aErrors  = array();
169 169
       
Please login to merge, or discard this patch.
tool/generator/AdminPageFrameworkLoader_AdminPage_Tool_Generator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             $oAdminPage,
27 27
             $this->sPageSlug, 
28 28
             array(
29
-                'section_id'    => $this->sTabSlug,       // avoid hyphen(dash), dots, and white spaces
29
+                'section_id'    => $this->sTabSlug, // avoid hyphen(dash), dots, and white spaces
30 30
                 'tab_slug'      => $this->sTabSlug,
31 31
                 'title'         => __( 'Download Framework', 'admin-page-framework-loader' ),
32 32
                 'description'   => array(
Please login to merge, or discard this patch.
AdminPageFrameworkLoader_AdminPage_Tool_Generator_CustomFieldTypes.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                     'class_name'           => 'AceCustomFieldType',
87 87
                     'label'                => __( 'ACE', 'admin-page-framework-loader' ),
88 88
                     'description'          => __( 'provides code syntax highlighting in a text area field.', 'admin-page-framework-loader' ),
89
-                    'directory_path'       => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/ace-custom-field-type',
89
+                    'directory_path'       => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/ace-custom-field-type',
90 90
                     'archive_file_path'    => 'custom-field-types/ace-custom-field-type/AceCustomFieldType.php',
91 91
                     'archive_dir_path'     => 'custom-field-types/ace-custom-field-type',
92 92
                 ),
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                     'class_name'           => 'GitHubCustomFieldType',
95 95
                     'label'                => __( 'GitHub Buttons', 'admin-page-framework-loader' ),
96 96
                     'description'          => __( 'allows you to display GitHub buttons in a field.', 'admin-page-framework-loader' ),
97
-                    'directory_path'       => AdminPageFrameworkLoader_Registry::$sDirPath . '/include/library/github-custom-field-type',
97
+                    'directory_path'       => AdminPageFrameworkLoader_Registry::$sDirPath.'/include/library/github-custom-field-type',
98 98
                     'archive_file_path'    => 'custom-field-types/github-custom-field-type/GitHubCustomFieldType.php',
99 99
                     'archive_dir_path'     => 'custom-field-types/github-custom-field-type',
100 100
                 ),                
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
                 
103 103
             // Let third-party scripts add custom field types.
104 104
             $this->aCustomFieldTypes = apply_filters(
105
-                AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_custom_field_types',
105
+                AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_custom_field_types',
106 106
                 $this->aCustomFieldTypes
107 107
             );                    
108 108
             
109
-            foreach( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) {
109
+            foreach ( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) {
110 110
                 $this->aCustomFieldTypeLabels[ $_sKey ] = $_aCustomFieldType[ 'label' ]
111
-                    . ' - <span class="description">' . $_aCustomFieldType[ 'description' ] . '</span>';
111
+                    . ' - <span class="description">'.$_aCustomFieldType[ 'description' ].'</span>';
112 112
             }
113 113
      
114 114
         }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             public function replyToModifyFileContents( $sFileContents, $sPathInArchive, $aFormData, $oFactory ) {
122 122
 
123 123
                 // Check the file extension.
124
-                if ( ! in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), array( 'php', 'css', 'js' ) ) ) {
124
+                if ( !in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), array( 'php', 'css', 'js' ) ) ) {
125 125
                     return $sFileContents;
126 126
                 }            
127 127
                 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 private function _getModifiedInclusionList( $sFileContents ) {
152 152
                     return str_replace(
153 153
                         ');', // search
154
-                        $this->_getClassListOfCustomFieldTypes() . ');', // replace - @todo insert the selected class list here
154
+                        $this->_getClassListOfCustomFieldTypes().');', // replace - @todo insert the selected class list here
155 155
                         $sFileContents // subject
156 156
                     );
157 157
                 }
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
                             ''
175 175
                         );
176 176
                         $_aOutput = array();
177
-                        foreach( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) {
178
-                            $_aOutput[] = '    "' . $_sClassPrefix . $_sClassName . '"'
177
+                        foreach ( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) {
178
+                            $_aOutput[ ] = '    "'.$_sClassPrefix.$_sClassName.'"'
179 179
                                 . ' => ' 
180
-                                . 'AdminPageFramework_Registry::$sDirPath . ' . '"/' . ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ) . '",';
180
+                                . 'AdminPageFramework_Registry::$sDirPath . '.'"/'.ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ).'",';
181 181
                         }
182
-                        return implode( PHP_EOL, $_aOutput ) . PHP_EOL;
182
+                        return implode( PHP_EOL, $_aOutput ).PHP_EOL;
183 183
                     
184 184
                     }
185 185
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                         $this->aCustomFieldTypes // ArchiveFilePaths
195 195
                     );
196 196
                     $_aArchiveFilePaths = array();
197
-                    foreach( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) {
197
+                    foreach ( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) {
198 198
                         $_aArchiveFilePaths[ $_sClassName ] = $this->oFactory->oUtil->getElement(
199 199
                             $_aCustomFieldType,
200 200
                             'archive_file_path',
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
                     $_aReplaces = $_aPrefixedClassNames;                    
239 239
                     
240 240
                     // Change the text domain.
241
-                    $_aSearches[] = 'admin-page-framework';
242
-                    $_aReplaces[] = $this->oFactory->oUtil->getElement(
241
+                    $_aSearches[ ] = 'admin-page-framework';
242
+                    $_aReplaces[ ] = $this->oFactory->oUtil->getElement(
243 243
                         $_POST,
244 244
                         array( 
245 245
                             $this->oFactory->oProp->sOptionKey, 
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
                      * @since       3.6.0
262 262
                      * @callback    function        array_walk
263 263
                      */
264
-                    public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix='' ) {
265
-                        $sClassName = $sPrefix . $sClassName;
264
+                    public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix = '' ) {
265
+                        $sClassName = $sPrefix.$sClassName;
266 266
                     }   
267 267
                                     
268 268
  
@@ -283,12 +283,12 @@  discard block
 block discarded – undo
283 283
              */
284 284
             public function replyToSetAdditionalDirectoriesForGenerator( $aDirPaths ) {
285 285
                                 
286
-                $_aCheckedCustomFieldTypes        = $this->_getSelectedCustomFieldTypes(
286
+                $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes(
287 287
                     $this->aCustomFieldTypes
288 288
                 );
289 289
                 
290 290
                 $_aDirPathInfo = array();
291
-                foreach( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) {
291
+                foreach ( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) {
292 292
                     
293 293
                     $_sArchiveDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'archive_dir_path' );
294 294
                     $_sSourceDirPath  = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'directory_path' );
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                  * @return      array       The array keys of the checked items.
305 305
                  * @since       3.6.0
306 306
                  */
307
-                private function _getSelectedCustomFieldTypes( array $aSubject=array() ) {
307
+                private function _getSelectedCustomFieldTypes( array $aSubject = array() ) {
308 308
                     
309 309
                     $_aCheckedCustomFieldTypes = $this->oFactory->oUtil->getElementAsArray(
310 310
                         $_POST,
Please login to merge, or discard this patch.
include/class/admin/dashboard/AdminPageFrameworkLoader_AdminPageWelcome.php 3 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                 
48 48
             // When newly installed, the 'welcomed' value is not set.
49 49
             $_oOption = AdminPageFrameworkLoader_Option::getInstance();
50
-            if ( ! $_oOption->get( 'welcomed' ) ) {                
50
+            if ( ! $_oOption->get( 'welcomed' ) ) {
51 51
                 $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION );
52 52
                 $this->_gotToWelcomePage(); // will exit
53 53
             }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 
71 71
             }
72 72
             
73
-        private function _gotToWelcomePage() {        
73
+        private function _gotToWelcomePage() {
74 74
             $_sWelcomePageURL = apply_filters(
75 75
                 AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url',
76 76
                 add_query_arg( 
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function start() {
27 27
         
28
-        if ( ! is_admin() ) {
28
+        if ( !is_admin() ) {
29 29
             return;
30 30
         }
31 31
         
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                 
48 48
             // When newly installed, the 'welcomed' value is not set.
49 49
             $_oOption = AdminPageFrameworkLoader_Option::getInstance();
50
-            if ( ! $_oOption->get( 'welcomed' ) ) {                
50
+            if ( !$_oOption->get( 'welcomed' ) ) {                
51 51
                 $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION );
52 52
                 $this->_gotToWelcomePage(); // will exit
53 53
             }
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
             
73 73
         private function _gotToWelcomePage() {        
74 74
             $_sWelcomePageURL = apply_filters(
75
-                AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url',
75
+                AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_admin_welcome_redirect_url',
76 76
                 add_query_arg( 
77
-                    array( 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['about'] ),
77
+                    array( 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ] ),
78 78
                     admin_url( 'index.php' )   // Dashboard
79 79
                 )                
80 80
             );
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function setUp() {
92 92
         
93
-        $this->sPageSlug  = AdminPageFrameworkLoader_Registry::$aAdminPages['about'];
93
+        $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ];
94 94
         
95 95
         // Root page
96 96
         $this->setRootMenuPage( 
@@ -101,20 +101,20 @@  discard block
 block discarded – undo
101 101
         $this->addSubMenuItems( 
102 102
             array(
103 103
                 'title'         => AdminPageFrameworkLoader_Registry::SHORTNAME,
104
-                'page_slug'     => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ],    // page slug
104
+                'page_slug'     => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug
105 105
                 'show_in_menu'  => false,
106 106
                 'style'         => array(
107
-                    AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/about.css', 
108
-                    AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/column.css', 
109
-                    AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.css',
110
-                    version_compare( $GLOBALS['wp_version'], '3.8', '<' )
107
+                    AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/about.css', 
108
+                    AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/column.css', 
109
+                    AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.css',
110
+                    version_compare( $GLOBALS[ 'wp_version' ], '3.8', '<' )
111 111
                         ? ".about-wrap .introduction h2 {
112 112
                                 padding: 1em;
113 113
                             }"
114 114
                         : "",
115 115
                 ),
116 116
                 'script'        => array(
117
-                    AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.js',
117
+                    AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.js',
118 118
                     "jQuery( document ).ready( function() {
119 119
                         jQuery( '.apf-badge-image' ).mflip();
120 120
                     } );",
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         $this->setPluginSettingsLinkLabel( '' ); // pass an empty string to disable it.
130 130
            
131 131
         // Hook
132
-        add_action( "load_" . AdminPageFrameworkLoader_Registry::$aAdminPages['about'], array( $this, 'replyToLoadPage' ) );
132
+        add_action( "load_".AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], array( $this, 'replyToLoadPage' ) );
133 133
         
134 134
     }   
135 135
         
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
          */
141 141
         public function replyToLoadPage( $oFactory ) {
142 142
             
143
-            $_sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages['about'];
143
+            $_sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ];
144 144
             new AdminPageFrameworkLoader_AdminPageWelcome_Welcome( 
145
-                $this,              // factory object
146
-                $_sPageSlug,        // page slug
145
+                $this, // factory object
146
+                $_sPageSlug, // page slug
147 147
                 array(
148 148
                     'tab_slug'      => 'welcome',
149 149
                     // 'title'         => __( "What's New", 'admin-page-framework-loader' ),   // '
150 150
                     'style'         => array(
151
-                        AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css',
152
-                        AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css',
151
+                        AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css',
152
+                        AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css',
153 153
                         ' .main-image, .main-image img { text-align: center; max-width: 90%; margin-left: auto; margin-right: auto; } ',
154 154
                     ),
155 155
                 )                
@@ -179,24 +179,24 @@  discard block
 block discarded – undo
179 179
      */
180 180
     public function replyToFilterContentTop( $sContent ) {
181 181
 
182
-        $_sVersion      = '- ' . AdminPageFrameworkLoader_Registry::VERSION;
183
-        $_sPluginName   = AdminPageFrameworkLoader_Registry::SHORTNAME . ' ' . $_sVersion;
182
+        $_sVersion      = '- '.AdminPageFrameworkLoader_Registry::VERSION;
183
+        $_sPluginName   = AdminPageFrameworkLoader_Registry::SHORTNAME.' '.$_sVersion;
184 184
         
185 185
         $_sBadgeURL     = esc_url( AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/image/icon-128x128.png' ) );
186 186
         
187 187
         $_aOutput   = array();
188
-        $_aOutput[] = "<h1>" 
188
+        $_aOutput[ ] = "<h1>" 
189 189
                 . sprintf( __( 'Welcome to %1$s', 'admin-page-framework-loader' ), $_sPluginName )
190 190
             . "</h1>";
191
-        $_aOutput[] = "<div class='about-text'>"
191
+        $_aOutput[ ] = "<div class='about-text'>"
192 192
                 . sprintf( __( 'Thank you for updating to the latest version! %1$s is ready to make your plugin or theme development faster, more organized and better!', 'admin-page-framework-loader' ), $_sPluginName )
193 193
             . "</div>";
194
-        $_aOutput[] = ''
194
+        $_aOutput[ ] = ''
195 195
                 . "<div class='apf-badge'>"
196 196
                     . "<div class='apf-badge-image m-flip'>"
197 197
                         . "<img src='{$_sBadgeURL}' />"
198 198
                     . "</div>"
199
-                    . "<span class='label'>" . sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion ) . "</span>"
199
+                    . "<span class='label'>".sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion )."</span>"
200 200
                 . "</div>";
201 201
            
202 202
         return implode( PHP_EOL, $_aOutput )
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * One of the abstract class of the plugin admin page class.
4
- * 
5
- * @package      Admin Page Framework Loader
6
- * @copyright    Copyright (c) 2014, Michael Uno
7
- * @author       Michael Uno
8
- * @authorurl    http://michaeluno.jp
9
- * @since        3.5.0
10
- */
3
+     * One of the abstract class of the plugin admin page class.
4
+     * 
5
+     * @package      Admin Page Framework Loader
6
+     * @copyright    Copyright (c) 2014, Michael Uno
7
+     * @author       Michael Uno
8
+     * @authorurl    http://michaeluno.jp
9
+     * @since        3.5.0
10
+     */
11 11
 
12 12
 /**
13 13
  * Constructs the Welcome admin page
Please login to merge, or discard this patch.
dashboard/welcome/AdminPageFrameworkLoader_AdminPageWelcome_Welcome.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
                 'tab_slug'          => $this->sTabSlug,
30 30
                 'section_id'        => $this->sTabSlug,
31 31
                 'section_tab_slug'  => 'welcome',
32
-                'title'             => __( "What's New", 'admin-page-framework-loader' ),   // '
32
+                'title'             => __( "What's New", 'admin-page-framework-loader' ), // '
33 33
                 'content'           => $this->_getReadmeContents( 
34
-                    AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt',
34
+                    AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt',
35 35
                     '', // TOC title
36 36
                     array( 'New Features' ) // section
37 37
                 )
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
                 'tab_slug'          => $this->sTabSlug,
41 41
                 'section_tab_slug'  => $this->sTabSlug,
42 42
                 'section_id'        => 'getting_started',
43
-                'title'             => __( "Getting Started", 'admin-page-framework-loader' ),   // '
43
+                'title'             => __( "Getting Started", 'admin-page-framework-loader' ), // '
44 44
                 'content'           => $this->_getReadmeContents( 
45
-                    AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt', 
46
-                    "<h3>" . __( 'Contents', 'admin-page-framework-loader' ) . "</h3>", 
45
+                    AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt', 
46
+                    "<h3>".__( 'Contents', 'admin-page-framework-loader' )."</h3>", 
47 47
                     array( 'Getting Started', 'Tutorials' )
48 48
                 ),
49 49
             ),
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 'tab_slug'          => $this->sTabSlug,
52 52
                 'section_tab_slug'  => $this->sTabSlug,
53 53
                 'section_id'        => 'change_log',
54
-                'title'             => __( "Change Log", 'admin-page-framework-loader' ),   // '
54
+                'title'             => __( "Change Log", 'admin-page-framework-loader' ), // '
55 55
                 'content'           => $this->_getChangeLog(),
56 56
             )             
57 57
         );
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
             array(
88 88
                 'field_id'      => 'github_star',
89 89
                 'type'          => 'github',     
90
-                'user_name'     => 'michaeluno',    // the GitHub account ID
91
-                'button_type'   => 'star',          // either of the followings: follow, star, watch, fork, issue
90
+                'user_name'     => 'michaeluno', // the GitHub account ID
91
+                'button_type'   => 'star', // either of the followings: follow, star, watch, fork, issue
92 92
                 'count'         => false,
93 93
                 'repository'    => 'admin-page-framework',
94 94
                 'size'          => 'mega',
95 95
                 'attributes'    => array(
96
-                    'data-text' => ' ' . AdminPageFramework_Registry::NAME . ' ' . AdminPageFramework_Registry::getVersion() . ' ',
96
+                    'data-text' => ' '.AdminPageFramework_Registry::NAME.' '.AdminPageFramework_Registry::getVersion().' ',
97 97
                     // 'data-icon' => 'octicon-mark-github',
98 98
                 ),
99 99
                 'description'   => __( 'Star the repository and get Involved!', 'admin-page-framework-loader' ),
@@ -133,26 +133,26 @@  discard block
 block discarded – undo
133 133
          * @since       3.6.1
134 134
          * @return      void
135 135
          */
136
-        private function _getChangeLog( $sSection='Changelog' ) {
136
+        private function _getChangeLog( $sSection = 'Changelog' ) {
137 137
             
138
-            $_aReplacements   = array(
138
+            $_aReplacements = array(
139 139
                 '%PLUGIN_DIR_URL%'  => AdminPageFrameworkLoader_Registry::getPluginURL(),
140 140
                 '%WP_ADMIN_URL%'    => admin_url(),
141 141
             );
142 142
             $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( 
143
-                AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt',
143
+                AdminPageFrameworkLoader_Registry::$sDirPath.'/readme.txt',
144 144
                 $_aReplacements
145 145
             );    
146 146
             $_sChangeLog = $_oWPReadmeParser->getSection( $sSection );  
147 147
             $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( 
148
-                AdminPageFrameworkLoader_Registry::$sDirPath . '/changelog.md',
148
+                AdminPageFrameworkLoader_Registry::$sDirPath.'/changelog.md',
149 149
                 $_aReplacements
150 150
             );    
151 151
             $_sChangeLog .= $_oWPReadmeParser->getSection( $sSection );  
152 152
                
153 153
             $_sChangeLog = $_sChangeLog
154 154
                 ? $_sChangeLog
155
-                : '<p>' . __( 'No valid changlog was found.', 'admin-page-framework-loader' ) . '</p>';
155
+                : '<p>'.__( 'No valid changlog was found.', 'admin-page-framework-loader' ).'</p>';
156 156
             return "<div class='changelog'>"
157 157
                 . $_sChangeLog
158 158
                 . "</div>";
@@ -183,18 +183,18 @@  discard block
 block discarded – undo
183 183
                 return '';
184 184
             }
185 185
         
186
-            $_aOutput   = array();
186
+            $_aOutput = array();
187 187
             foreach ( $_aContributors as $_oContributor ) {
188
-                $_aOutput[] = '<li class="wp-person">';
189
-                $_aOutput[] .= sprintf( '<a href="%s" title="%s">',
190
-                    esc_url( 'https://github.com/' . $_oContributor->login ),
188
+                $_aOutput[ ] = '<li class="wp-person">';
189
+                $_aOutput[ ] .= sprintf( '<a href="%s" title="%s">',
190
+                    esc_url( 'https://github.com/'.$_oContributor->login ),
191 191
                     esc_html( sprintf( __( 'View %s', 'admin-page-framework-loader' ), $_oContributor->login ) )
192 192
                 );
193
-                $_aOutput[] .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $_oContributor->avatar_url ), esc_html( $_oContributor->login ) );
194
-                $_aOutput[] .= '</a>';
195
-                $_aOutput[] .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $_oContributor->login ), esc_html( $_oContributor->login ) );
196
-                $_aOutput[] .= '</a>';
197
-                $_aOutput[] .= '</li>';
193
+                $_aOutput[ ] .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $_oContributor->avatar_url ), esc_html( $_oContributor->login ) );
194
+                $_aOutput[ ] .= '</a>';
195
+                $_aOutput[ ] .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/'.$_oContributor->login ), esc_html( $_oContributor->login ) );
196
+                $_aOutput[ ] .= '</a>';
197
+                $_aOutput[ ] .= '</li>';
198 198
             }
199 199
 
200 200
             return '<ul class="wp-people-group">'
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                 return $_aContributors;
219 219
             }
220 220
 
221
-            $_mResponse = wp_remote_get( $sRepositoryURL . '/contributors', array( 'sslverify' => false ) );
221
+            $_mResponse = wp_remote_get( $sRepositoryURL.'/contributors', array( 'sslverify' => false ) );
222 222
 
223 223
             if ( is_wp_error( $_mResponse ) || 200 != wp_remote_retrieve_response_code( $_mResponse ) ) {
224 224
                 return array();
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
             $_aContributors = json_decode( wp_remote_retrieve_body( $_mResponse ) );
228 228
 
229
-            if ( ! is_array( $_aContributors ) )
229
+            if ( !is_array( $_aContributors ) )
230 230
                 return array();
231 231
 
232 232
             set_transient( 'apfl_contributors', $_aContributors, 3600 );
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -226,8 +226,9 @@
 block discarded – undo
226 226
 
227 227
             $_aContributors = json_decode( wp_remote_retrieve_body( $_mResponse ) );
228 228
 
229
-            if ( ! is_array( $_aContributors ) )
230
-                return array();
229
+            if ( ! is_array( $_aContributors ) ) {
230
+                            return array();
231
+            }
231 232
 
232 233
             set_transient( 'apfl_contributors', $_aContributors, 3600 );
233 234
 
Please login to merge, or discard this patch.