Completed
Branch dev (d064b2)
by
unknown
24:11 queued 04:10
created
include/class/admin/dashboard/AdminPageFrameworkLoader_AdminPageWelcome.php 1 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.
form/_view/sectionset/AdminPageFramework_Form_View___Sectionsets.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -126,16 +126,16 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function get() {
128 128
         
129
-        $_oFormatSectionsetsByTab  = new AdminPageFramework_Form_View___Format_SectionsetsByTab(
129
+        $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab(
130 130
             $this->aStructure[ 'sectionsets' ],
131 131
             $this->aStructure[ 'fieldsets' ],
132 132
             $this->aArguments[ 'nested_depth' ]
133 133
         );
134 134
 
135
-        $_aOutput     = array();
136
-        foreach( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) {
135
+        $_aOutput = array();
136
+        foreach ( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) {
137 137
 
138
-            $_aOutput[] = $this->_getFormOutput(
138
+            $_aOutput[ ] = $this->_getFormOutput(
139 139
                 $_oFormatSectionsetsByTab->getSectionsets( $_sSectionTabSlug ),
140 140
                 $_oFormatSectionsetsByTab->getFieldsets( $_sSectionTabSlug ),
141 141
                 $_sSectionTabSlug,
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         // Generate id for this output
151 151
         $_sOutput = implode( PHP_EOL, $_aOutput );
152
-        $_sElementID = "admin-page-framework-sectionsets-" . uniqid();
152
+        $_sElementID = "admin-page-framework-sectionsets-".uniqid();
153 153
         return $this->_getSpinnerOutput( $_sOutput )
154 154
             .   "<div id='{$_sElementID}' class='admin-page-framework-sctionsets admin-page-framework-form-js-on'>"
155 155
                 . $_sOutput
@@ -184,17 +184,17 @@  discard block
 block discarded – undo
184 184
 
185 185
             // A sectionset is a set of sections.
186 186
             $_sSectionSet = $this->_getSectionsetsTables( 
187
-                $aSectionsets,  // sectionset definition (already devided by section tab)
188
-                $aFieldsets,    // fieldset definitions (already devided by section tab)
187
+                $aSectionsets, // sectionset definition (already devided by section tab)
188
+                $aFieldsets, // fieldset definitions (already devided by section tab)
189 189
                 $aCallbacks
190 190
             );
191 191
             return $_sSectionSet
192
-                ? "<div " . $this->getAttributes(
192
+                ? "<div ".$this->getAttributes(
193 193
                         array(
194 194
                             'class' => 'admin-page-framework-sectionset',
195
-                            'id'    => "sectionset-{$sSectionTabSlug}_" . md5( serialize( $aSectionsets ) ),
195
+                            'id'    => "sectionset-{$sSectionTabSlug}_".md5( serialize( $aSectionsets ) ),
196 196
                         ) 
197
-                    ) . ">"
197
+                    ).">"
198 198
                         . $_sSectionSet
199 199
                     . "</div>"
200 200
                 : '';
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
              * If no fields belonging to the section, return empty.
227 227
              * Otherwise, the sectionsets container gets rendered and its CSS rules such as margins give unwanted results.
228 228
              */
229
-            if ( ! count( $aFieldsets ) ) {
229
+            if ( !count( $aFieldsets ) ) {
230 230
                 return ''; 
231 231
             }           
232 232
 
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
                 'count_subsections' => 0,
239 239
             );
240 240
             $_sThisSectionID    = $_aFirstSectionset[ 'section_id' ];
241
-            $_sSectionsID       = 'sections-' . $_sThisSectionID;
241
+            $_sSectionsID       = 'sections-'.$_sThisSectionID;
242 242
             $_aCollapsible      = $this->_getCollapsibleArgumentForSections( 
243 243
                 $_aFirstSectionset 
244 244
             );
245 245
 
246
-            foreach( $aSectionsets as $_aSectionset ) {
246
+            foreach ( $aSectionsets as $_aSectionset ) {
247 247
            
248 248
                 $_sSectionTabSlug   = $_aSectionset[ 'section_tab_slug' ]; // needed outside the loop
249 249
                 $_aOutputs          = $this->_getSectionsetTable(
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
              * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`.
276 276
              * @return      array
277 277
              */
278
-            private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) {  
278
+            private function _getCollapsibleArgumentForSections( array $aSectionset = array() ) {  
279 279
                 
280 280
                 $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection(
281 281
                     $aSectionset[ 'collapsible' ],
@@ -304,17 +304,17 @@  discard block
 block discarded – undo
304 304
              */
305 305
             private function _getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) {
306 306
             
307
-                if ( ! $this->isSectionsetVisible( $_aSection ) ) {
307
+                if ( !$this->isSectionsetVisible( $_aSection ) ) {
308 308
 // var_dump( 'not visible: ' . $_aSection[ '_section_path' ] );
309 309
                     return $_aOutputs;
310 310
                 }
311 311
 
312 312
                 // If the 'save' argument is false, insert a flag that disables saving the section inputs.
313
-                $_aOutputs[ 'section_contents' ][] = $this->_getUnsetFlagSectionInputTag( $_aSection );
313
+                $_aOutputs[ 'section_contents' ][ ] = $this->_getUnsetFlagSectionInputTag( $_aSection );
314 314
                 
315 315
                 // For repeatable sections - sub-sections are divided field definition arrays by sub-section index, 
316 316
                 // not section definition arrays.
317
-                $_aSubSections      = $this->getIntegerKeyElements( 
317
+                $_aSubSections = $this->getIntegerKeyElements( 
318 318
                     $this->getElementAsArray(
319 319
                         $aFieldsInSections, // subject
320 320
                         $_aSection[ '_section_path' ], // $_aSection[ 'section_id' ],   // dimensional key
@@ -358,29 +358,29 @@  discard block
 block discarded – undo
358 358
                 private function _getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) {
359 359
                     
360 360
                     // Add the repeatable sections enabler script.
361
-                    if ( ! empty( $_aSection[ 'repeatable' ] ) ) {
362
-                        $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler( 
361
+                    if ( !empty( $_aSection[ 'repeatable' ] ) ) {
362
+                        $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler( 
363 363
                             $_sSectionsID, 
364 364
                             $_aOutputs[ 'count_subsections' ], 
365 365
                             $_aSection[ 'repeatable' ],
366 366
                             $this->oMsg
367 367
                         );
368
-                        $_aOutputs[ 'section_contents' ][] = $this->_getRepeatableSectionFlagTag( $_aSection );
368
+                        $_aOutputs[ 'section_contents' ][ ] = $this->_getRepeatableSectionFlagTag( $_aSection );
369 369
                     }
370 370
                     // Add the sortable sections enabler script. 3.6.0+
371
-                    if ( ! empty( $_aSection[ 'sortable' ] ) ) {
371
+                    if ( !empty( $_aSection[ 'sortable' ] ) ) {
372 372
 // @todo Change the name of the class to AdminPageFramework_Form_Script_...
373
-                        $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( 
373
+                        $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( 
374 374
                             $_sSectionsID, 
375 375
                             $_aSection[ 'sortable' ],
376 376
                             $this->oMsg
377 377
                         );
378
-                        $_aOutputs[ 'section_contents' ][] = $this->_getSortableSectionFlagTag( $_aSection );
378
+                        $_aOutputs[ 'section_contents' ][ ] = $this->_getSortableSectionFlagTag( $_aSection );
379 379
                     }
380 380
                     
381 381
                     // Get the section tables.
382 382
                     $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well.
383
-                    foreach( $_aSubSections as $_iIndex => $_aFields ) { 
383
+                    foreach ( $_aSubSections as $_iIndex => $_aFields ) { 
384 384
 
385 385
                         $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection(
386 386
                             $_aSection,
@@ -410,8 +410,8 @@  discard block
 block discarded – undo
410 410
                         array(
411 411
                             'class'                     => 'element-address',
412 412
                             'type'                      => 'hidden',
413
-                            'name'                      => '__repeatable_elements_' . $aSection[ '_structure_type' ] 
414
-                                . '[ ' . $aSection[ 'section_id' ] . ' ]',
413
+                            'name'                      => '__repeatable_elements_'.$aSection[ '_structure_type' ] 
414
+                                . '[ '.$aSection[ 'section_id' ].' ]',
415 415
                             // @todo examine whether this value should include a section index.
416 416
                             'value' => $aSection[ 'section_id' ],                            
417 417
                         )
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
                         array(
430 430
                             'class'                     => 'element-address',
431 431
                             'type'                      => 'hidden',
432
-                            'name'                      => '__sortable_elements_' . $aSection[ '_structure_type' ] 
433
-                                . '[ ' . $aSection[ 'section_id' ] . ' ]',
432
+                            'name'                      => '__sortable_elements_'.$aSection[ '_structure_type' ] 
433
+                                . '[ '.$aSection[ 'section_id' ].' ]',
434 434
                             // @todo examine whether this value should include a section index.
435 435
                             'value' => $aSection[ 'section_id' ],                            
436 436
                         )
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
                         'input',
453 453
                         array(
454 454
                             'type'  => 'hidden',
455
-                            'name'  => '__unset_' .  $aSection[ '_structure_type' ] . '[ ' . $aSection[ 'section_id' ] . ' ]',
456
-                            'value' => "__dummy_option_key|" . $aSection[ 'section_id' ],
455
+                            'name'  => '__unset_'.$aSection[ '_structure_type' ].'[ '.$aSection[ 'section_id' ].' ]',
456
+                            'value' => "__dummy_option_key|".$aSection[ 'section_id' ],
457 457
                             'class' => 'unset-element-names element-address',
458 458
                         )
459 459
                     );            
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
                 private function _getSectionTableWithTabList( array $_aOutputs, array $aSectionset, $aFieldsetsPerSection ) {
470 470
                                         
471 471
                     // Tab list
472
-                    $_aOutputs[ 'section_tab_list' ][] = $this->_getTabList( 
472
+                    $_aOutputs[ 'section_tab_list' ][ ] = $this->_getTabList( 
473 473
                         $aSectionset, 
474 474
                         $aFieldsetsPerSection, 
475 475
                         $this->aCallbacks[ 'fieldset_output' ]
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 
479 479
                     // Section container
480 480
                     $_oSectionTable = new AdminPageFramework_Form_View___Section(
481
-                        $this->aArguments,  // for nested sections
481
+                        $this->aArguments, // for nested sections
482 482
                         $aSectionset,
483 483
                         $this->aStructure,
484 484
                         $aFieldsetsPerSection,
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
                         $this->aCallbacks,
489 489
                         $this->oMsg
490 490
                     );
491
-                    $_aOutputs[ 'section_contents' ][] = $_oSectionTable->get();                    
491
+                    $_aOutputs[ 'section_contents' ][ ] = $_oSectionTable->get();                    
492 492
                    
493 493
                     return $_aOutputs;
494 494
                  
@@ -516,9 +516,9 @@  discard block
 block discarded – undo
516 516
                         'section_index'     => null,
517 517
                         'collapsible'       => $aCollapsible,
518 518
                         'container_type'    => 'sections', // section or sections                    
519
-                        'sectionset'        => $aSectionset,    // DEVVER+ for tooltip
519
+                        'sectionset'        => $aSectionset, // DEVVER+ for tooltip
520 520
                     ),
521
-                    array(),            // fieldsets
521
+                    array(), // fieldsets
522 522
                     $this->aSavedData,   
523 523
                     $this->aFieldErrors, 
524 524
                     $this->aStructure[ 'field_type_definitions' ], 
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
                     $aOutputs[ 'count_subsections' ]
536 536
                 );
537 537
                 return $_oCollapsibleSectionTitle->get()
538
-                    . "<div " . $_oSectionsTablesContainerAttributes->get() . ">"
538
+                    . "<div ".$_oSectionsTablesContainerAttributes->get().">"
539 539
                         . $this->_getSectionTabList( $sSectionTabSlug, $aOutputs[ 'section_tab_list' ] )
540 540
                         . implode( PHP_EOL, $aOutputs[ 'section_contents' ] )
541 541
                     . "</div>";
@@ -566,21 +566,21 @@  discard block
 block discarded – undo
566 566
              */
567 567
             private function _getTabList( array $aSection, array $aFields, $hfFieldCallback ) {
568 568
                                 
569
-                if ( ! $aSection[ 'section_tab_slug' ] ) {
569
+                if ( !$aSection[ 'section_tab_slug' ] ) {
570 570
                     return '';
571 571
                 }
572 572
                 
573 573
                 $iSectionIndex      = $aSection[ '_index' ];
574 574
 
575
-                $_sSectionTagID     = 'section-' . $aSection[ 'section_id' ] . '__' . $iSectionIndex;
575
+                $_sSectionTagID     = 'section-'.$aSection[ 'section_id' ].'__'.$iSectionIndex;
576 576
                 $_aTabAttributes    = $aSection[ 'attributes' ][ 'tab' ]
577 577
                     + array(
578 578
                         'class' => 'admin-page-framework-section-tab nav-tab',
579 579
                         'id'    => "section_tab-{$_sSectionTagID}",
580 580
                         'style' => null
581 581
                     );
582
-                $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] );  // 3.3.1+
583
-                $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null );  // 3.3.1+
582
+                $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+
583
+                $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+
584 584
                 
585 585
                 $_oSectionTitle = new AdminPageFramework_Form_View___SectionTitle(                    
586 586
                     array(
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
                         'tag'           => 'h4',
589 589
                         'section_index' => $iSectionIndex,
590 590
                         
591
-                        'sectionset'    => $aSection,   // DEVVER+      for tooltip
591
+                        'sectionset'    => $aSection, // DEVVER+      for tooltip
592 592
                     ),
593 593
                     $aFields,            
594 594
                     $this->aSavedData,   
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
                     $this->aCallbacks // field output element callables.                    
599 599
                 );                        
600 600
                 
601
-                return "<li " . $this->getAttributes( $_aTabAttributes ) . ">"
601
+                return "<li ".$this->getAttributes( $_aTabAttributes ).">"
602 602
                     . "<a href='#{$_sSectionTagID}'>"
603 603
                         . $_oSectionTitle->get()
604 604
                     ."</a>"
Please login to merge, or discard this patch.
form/_view/resource/AdminPageFramework_Form_View__Resource__Head.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
      * @param       object      $oForm
30 30
      * @param       string      $sHeadActionHook        The action hook triggered inside the `<head>` tag. For front-end forms, use `wp_head`.
31 31
      */
32
-    public function __construct( $oForm, $sHeadActionHook='admin_head' ) {
32
+    public function __construct( $oForm, $sHeadActionHook = 'admin_head' ) {
33 33
     
34 34
         $this->oForm = $oForm;
35 35
     
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
          * as multiple instances of the factory class is loaded among separate pages, 
54 54
          * one gets denied here and if it can load earlier than the one which should insert the below script.
55 55
          */
56
-        if ( ! $this->oForm->isInThePage() ) {
56
+        if ( !$this->oForm->isInThePage() ) {
57 57
             return;
58 58
         }    
59 59
     
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
         private function _getScripts_RequiredInHead() {
77 77
             return 'document.write( "<style class=\'admin-page-framework-js-embedded-inline-style\'>'
78 78
                     . str_replace(
79
-                        '\\n',   // search
80
-                        '',     // replace
79
+                        '\\n', // search
80
+                        '', // replace
81 81
                         esc_js( $this->_getInlineCSS() )    // subject
82 82
                     )
83 83
                 . '</style>" );';            
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     
34 34
         $this->oForm = $oForm;
35 35
     
36
-        if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) {       
36
+        if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) {
37 37
             return;
38 38
         }
39 39
     
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                  * @return      string
98 98
                  * @since       DEVVER
99 99
                  */
100
-                private function _getScriptElementConcealerCSSRules() {                    
100
+                private function _getScriptElementConcealerCSSRules() {
101 101
                     
102 102
                     // Avoid hiding framework forms in widgets. In some cases, the user sets a form in any page,
103 103
                     // which causes a different structure form type including `admin_page` gets loaded even in widgets.php (or any page builder pages dealing with widgets)
Please login to merge, or discard this patch.
_abstract/form/_view/resource/AdminPageFramework_Form_View__Resource.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
      * @since       DEVVER
104 104
      */
105 105
     public function _replyToEnqueueScripts() {
106
-        if ( ! $this->oForm->isInThePage() ) {
106
+        if ( !$this->oForm->isInThePage() ) {
107 107
             return;
108 108
         }
109
-        foreach( $this->oForm->getResources( 'src_scripts' ) as $_asEnqueue ) {
109
+        foreach ( $this->oForm->getResources( 'src_scripts' ) as $_asEnqueue ) {
110 110
             $this->_enqueueScript( $_asEnqueue );
111 111
         }       
112 112
     }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             private function _getFormattedEnqueueScript( $asEnqueue ) {
155 155
                 static $_iCallCount = 1;
156 156
                 $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array(
157
-                    'handle_id'     => 'script_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount,
157
+                    'handle_id'     => 'script_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount,
158 158
                     'src'           => null,
159 159
                     'dependencies'  => null,
160 160
                     'version'       => null,
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
      */    
178 178
     public function _replyToEnqueueStyles() {
179 179
 
180
-        if ( ! $this->oForm->isInThePage() ) {
180
+        if ( !$this->oForm->isInThePage() ) {
181 181
             return;
182 182
         }
183
-        foreach( $this->oForm->getResources( 'src_styles' ) as $_asEnqueueItem ) {
183
+        foreach ( $this->oForm->getResources( 'src_styles' ) as $_asEnqueueItem ) {
184 184
             $this->_enqueueStyle( $_asEnqueueItem );
185 185
         }           
186 186
     
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             private function _getFormattedEnqueueStyle( $asEnqueue ) {
202 202
                 static $_iCallCount = 1;
203 203
                 $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array(
204
-                    'handle_id'     => 'style_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount,
204
+                    'handle_id'     => 'style_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount,
205 205
                     'src'           => null,
206 206
                     'dependencies'  => null,
207 207
                     'version'       => null,
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      */    
223 223
     public function _replyToAddStyle() {
224 224
         
225
-        if ( ! $this->oForm->isInThePage() ) {
225
+        if ( !$this->oForm->isInThePage() ) {
226 226
             return;
227 227
         }   
228 228
         $_sCSSRules = $this->_getFormattedInlineStyles( 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
      */    
268 268
     public function _replyToAddScript() {
269 269
         
270
-        if ( ! $this->oForm->isInThePage() ) {
270
+        if ( !$this->oForm->isInThePage() ) {
271 271
             return;
272 272
         }        
273 273
         
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@
 block discarded – undo
230 230
         );
231 231
         
232 232
         $_sID = $this->sanitizeSlug( strtolower( $this->oForm->aArguments[ 'caller_id' ] ) );
233
-        if ( $_sCSSRules ) {            
233
+        if ( $_sCSSRules ) {
234 234
             echo "<style type='text/css' id='inline-style-{$_sID}' class='admin-page-framework-form-style'>"
235 235
                     . $_sCSSRules
236 236
                 . "</style>";
Please login to merge, or discard this patch.
development/factory/_abstract/AdminPageFramework_Factory_Controller.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @return      array|string
44 44
      * @since       DEVVER
45 45
      */
46
-    public function getMessage( $sKey='' ) {
46
+    public function getMessage( $sKey = '' ) {
47 47
         return $this->oMsg->get( $sKey );
48 48
     }
49 49
        
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      * @return      array       The array holing the queued items.
64 64
      * @internal
65 65
      */
66
-    public function enqueueStyles( $aSRCs, $_vArg2=null ) {} 
66
+    public function enqueueStyles( $aSRCs, $_vArg2 = null ) {} 
67 67
     
68 68
     /**
69 69
      * Enqueues a style of the given source.
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      * @return      string      The style handle ID. If the passed url is not a valid url string, an empty string will be returned.
84 84
      * @internal
85 85
      */
86
-    public function enqueueStyle( $sSRC, $_vArg2=null ) {}
86
+    public function enqueueStyle( $sSRC, $_vArg2 = null ) {}
87 87
     
88 88
     /**
89 89
      * Enqueues scripts by the given sources.
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      * @return      array        The array holding the queued items.
105 105
      * @internal
106 106
      */    
107
-    public function enqueueScripts( $aSRCs, $_vArg2=null ) {}
107
+    public function enqueueScripts( $aSRCs, $_vArg2 = null ) {}
108 108
     /**
109 109
      * Enqueues a script by the given source.
110 110
      *  
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      * @return      string      The script handle ID. If the passed url is not a valid url string, an empty string will be returned.
137 137
      * @internal
138 138
      */    
139
-    public function enqueueScript( $sSRC, $_vArg2=null ) {}    
139
+    public function enqueueScript( $sSRC, $_vArg2 = null ) {}    
140 140
     
141 141
     /*
142 142
      * Help Pane
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      * @since       2.1.0
155 155
      * @remark      This method just adds the given text into the class property. The actual registration will be performed with the `replyToRegisterHelpTabTextForMetaBox()` method.
156 156
      */ 
157
-    public function addHelpText( $sHTMLContent, $sHTMLSidebarContent="" ) {
157
+    public function addHelpText( $sHTMLContent, $sHTMLSidebarContent = "" ) {
158 158
         if ( method_exists( $this->oHelpPane, '_addHelpText' ) ) {
159 159
             $this->oHelpPane->_addHelpText( $sHTMLContent, $sHTMLSidebarContent );
160 160
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      */    
191 191
     public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) {
192 192
         
193
-        foreach( func_get_args() as $_asSectionset ) { 
193
+        foreach ( func_get_args() as $_asSectionset ) { 
194 194
             $this->addSettingSection( $_asSectionset ); 
195 195
         }
196 196
         
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      */
262 262
     public function addSettingSection( $aSectionset ) {
263 263
         
264
-        if ( ! is_array( $aSectionset ) ) { 
264
+        if ( !is_array( $aSectionset ) ) { 
265 265
             return; 
266 266
         }
267 267
         
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     * @return       void
295 295
     */ 
296 296
     public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) {
297
-        foreach( func_get_args() as $_aFieldset ) { 
297
+        foreach ( func_get_args() as $_aFieldset ) { 
298 298
             $this->addSettingField( $_aFieldset ); 
299 299
         }
300 300
     }    
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
     * @param        boolean     $bOverride      (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one.
672 672
     * @return       void
673 673
     */      
674
-    public function setSettingNotice( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) {
674
+    public function setSettingNotice( $sMessage, $sType = 'error', $asAttributes = array(), $bOverride = true ) {
675 675
         $this->oForm->setSubmitNotice(
676 676
             $sMessage,
677 677
             $sType,
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
      * @param       string      $sType If empty, the method will check if a message exists in all types. Otherwise, it checks the existence of a message of the specified type.
691 691
      * @return      boolean     True if a setting notice is set; otherwise, false.
692 692
      */
693
-    public function hasSettingNotice( $sType='' ) {
693
+    public function hasSettingNotice( $sType = '' ) {
694 694
         return $this->oForm->hasSubmitNotice( $sType );
695 695
     }
696 696
 
Please login to merge, or discard this patch.
development/factory/_abstract/_model/AdminPageFramework_Message.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
         'confirm_perform_task'                  => 'Please confirm your action.', 
83 83
         'specified_option_been_deleted'         => 'The specified options have been deleted.', 
84 84
         'nonce_verification_failed'             => 'A problem occurred while processing the form data. Please try again.', 
85
-        'check_max_input_vars'                  => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s',  // 3.5.11+
86
-        'send_email'                            => 'Is it okay to send the email?',     // 3.3.0+
87
-        'email_sent'                            => 'The email has been sent.',  // 3.3.0+, 3.3.5+ deprecated 
85
+        'check_max_input_vars'                  => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+
86
+        'send_email'                            => 'Is it okay to send the email?', // 3.3.0+
87
+        'email_sent'                            => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated 
88 88
         'email_scheduled'                       => 'The email has been scheduled.', // 3.3.5+
89
-        'email_could_not_send'                  => 'There was a problem sending the email',     // 3.3.0+
89
+        'email_could_not_send'                  => 'There was a problem sending the email', // 3.3.0+
90 90
         
91 91
         // AdminPageFramework_PostType
92 92
         'title'                                 => 'Title',     
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
         'upload_file'                           => 'Upload File', 
113 113
         'use_this_file'                         => 'Use This File', 
114 114
         'select_file'                           => 'Select File', 
115
-        'remove_value'                          => 'Remove Value',  // 3.2.0+
116
-        'select_all'                            => 'Select All',    // 3.3.0+
117
-        'select_none'                           => 'Select None',   // 3.3.0+                       
115
+        'remove_value'                          => 'Remove Value', // 3.2.0+
116
+        'select_all'                            => 'Select All', // 3.3.0+
117
+        'select_none'                           => 'Select None', // 3.3.0+                       
118 118
         'no_term_found'                         => 'No term found.', // 3.3.2+
119 119
 
120 120
         // AdminPageFramework_Form_View___Script_{...}
121 121
         'select'                                => 'Select', // 3.4.2+             
122
-        'insert'                                => 'Insert',  // 3.4.2+
122
+        'insert'                                => 'Insert', // 3.4.2+
123 123
         'use_this'                              => 'Use This', // 3.4.2+
124 124
         'return_to_library'                     => 'Return to Library', // 3.4.2+
125 125
             
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      * @since       3.2.0       Changed it to create an instance per text domain basis.
197 197
      * @remark      This class should be instantiated via this method.
198 198
      */
199
-    public static function getInstance( $sTextDomain='admin-page-framework' ) {
199
+    public static function getInstance( $sTextDomain = 'admin-page-framework' ) {
200 200
         
201 201
         $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message )
202 202
             ? self::$_aInstancesByTextDomain[ $sTextDomain ]
@@ -209,21 +209,21 @@  discard block
 block discarded – undo
209 209
          * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) 
210 210
          * @deprecated  3.2.0
211 211
          */
212
-        public static function instantiate( $sTextDomain='admin-page-framework' ) {
212
+        public static function instantiate( $sTextDomain = 'admin-page-framework' ) {
213 213
             return self::getInstance( $sTextDomain );
214 214
         }
215 215
         
216 216
     /**
217 217
      * Sets up properties.
218 218
      */
219
-    public function __construct( $sTextDomain='admin-page-framework' ) {
219
+    public function __construct( $sTextDomain = 'admin-page-framework' ) {
220 220
         
221 221
         $this->_sTextDomain = $sTextDomain;  
222 222
         
223 223
         // Fill the $aMessages property with the keys extracted from the $aDefaults property
224 224
         // with the value of null.  The null is set to let it trigger the __get() method 
225 225
         // so that each translation item gets processed individually.
226
-        $this->aMessages    = array_fill_keys( 
226
+        $this->aMessages = array_fill_keys( 
227 227
             array_keys( $this->aDefaults ),
228 228
             null        
229 229
         );
@@ -257,13 +257,13 @@  discard block
 block discarded – undo
257 257
      * @since       DEVVER      If no key is specified, return the entire mesage array.
258 258
      * @return      string|array
259 259
      */
260
-    public function get( $sKey='' ) {
261
-        if ( ! $sKey ) {
260
+    public function get( $sKey = '' ) {
261
+        if ( !$sKey ) {
262 262
             return $this->_getAllMessages();
263 263
         }
264 264
         return isset( $this->aMessages[ $sKey ] )
265 265
             ? __( $this->aMessages[ $sKey ], $this->_sTextDomain )
266
-            : __( $this->{$sKey}, $this->_sTextDomain );     // triggers __get()
266
+            : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get()
267 267
     }
268 268
         /**
269 269
          * Returns the all registered messag items.
Please login to merge, or discard this patch.
admin-page-framework-loader.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFrameworkLoader_Registry_Base {
18 18
 
19
-	const VERSION        = '3.7.0b27';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
20
-	const NAME           = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing.
19
+    const VERSION        = '3.7.0b27';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
20
+    const NAME           = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing.
21 21
     const SHORTNAME      = 'Admin Page Framework';  // used for a menu title etc.
22
-	const DESCRIPTION    = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.';
23
-	const URI            = 'http://en.michaeluno.jp/';
24
-	const AUTHOR         = 'miunosoft (Michael Uno)';
25
-	const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26
-	const COPYRIGHT      = 'Copyright (c) 2015, Michael Uno';
27
-	const LICENSE        = 'GPL v2 or later';
22
+    const DESCRIPTION    = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.';
23
+    const URI            = 'http://en.michaeluno.jp/';
24
+    const AUTHOR         = 'miunosoft (Michael Uno)';
25
+    const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26
+    const COPYRIGHT      = 'Copyright (c) 2015, Michael Uno';
27
+    const LICENSE        = 'GPL v2 or later';
28 28
     const CONTRIBUTORS   = '';
29 29
 	
30 30
 }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @remark      This is also accessed from `uninstall.php` so do not remove.
56 56
      * @remark      Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added.
57 57
      */
58
-	const TRANSIENT_PREFIX         = 'APFL_';
58
+    const TRANSIENT_PREFIX         = 'APFL_';
59 59
     
60 60
     /**
61 61
      * The hook slug used for the prefix of action and filter hook names.
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
      * 
71 71
      * These will be accessed from the bootstrap script.
72 72
      */
73
-	const TEXT_DOMAIN              = 'admin-page-framework-loader';
74
-	const TEXT_DOMAIN_PATH         = '/language';    
73
+    const TEXT_DOMAIN              = 'admin-page-framework-loader';
74
+    const TEXT_DOMAIN_PATH         = '/language';    
75 75
     	    
76
-	// These properties will be defined in the setUp() method.
77
-	static public $sFilePath = '';
78
-	static public $sDirPath  = '';
76
+    // These properties will be defined in the setUp() method.
77
+    static public $sFilePath = '';
78
+    static public $sDirPath  = '';
79 79
 	
80 80
     /**
81 81
      * Requirements.
@@ -136,30 +136,30 @@  discard block
 block discarded – undo
136 136
     static public $aTaxonomies = array(
137 137
     );
138 138
     
139
-	/**
140
-	 * Sets up static properties.
139
+    /**
140
+     * Sets up static properties.
141 141
      * @return      void
142
-	 */
143
-	static public function setUp( $sPluginFilePath=null ) {
142
+     */
143
+    static public function setUp( $sPluginFilePath=null ) {
144 144
 	                    
145
-		self::$sFilePath = $sPluginFilePath ? $sPluginFilePath : __FILE__;
146
-		self::$sDirPath  = dirname( self::$sFilePath );
145
+        self::$sFilePath = $sPluginFilePath ? $sPluginFilePath : __FILE__;
146
+        self::$sDirPath  = dirname( self::$sFilePath );
147 147
 	    
148
-	}    
148
+    }    
149 149
 	
150
-	/**
151
-	 * Returns the URL with the given relative path to the plugin path.
152
-	 * 
153
-	 * <h3>Example</h3>
150
+    /**
151
+     * Returns the URL with the given relative path to the plugin path.
152
+     * 
153
+     * <h3>Example</h3>
154 154
      * <code>
155 155
      * AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/css/meta_box.css' );
156 156
      * </code>
157 157
      * @since       3.5.0
158 158
      * @return      string
159
-	 */
160
-	public static function getPluginURL( $sRelativePath='' ) {
161
-		return plugins_url( $sRelativePath, self::$sFilePath );
162
-	}
159
+     */
160
+    public static function getPluginURL( $sRelativePath='' ) {
161
+        return plugins_url( $sRelativePath, self::$sFilePath );
162
+    }
163 163
     
164 164
     /**
165 165
      * Returns the information of this class.
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFrameworkLoader_Registry_Base {
18 18
 
19
-	const VERSION        = '3.7.0b27';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
19
+	const VERSION        = '3.7.0b27'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
20 20
 	const NAME           = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing.
21
-    const SHORTNAME      = 'Admin Page Framework';  // used for a menu title etc.
21
+    const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc.
22 22
 	const DESCRIPTION    = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.';
23 23
 	const URI            = 'http://en.michaeluno.jp/';
24 24
 	const AUTHOR         = 'miunosoft (Michael Uno)';
25 25
 	const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26 26
 	const COPYRIGHT      = 'Copyright (c) 2015, Michael Uno';
27 27
 	const LICENSE        = 'GPL v2 or later';
28
-    const CONTRIBUTORS   = '';
28
+    const CONTRIBUTORS = '';
29 29
 	
30 30
 }
31 31
 /**
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
      * @remark      This is also accessed from `uninstall.php` so do not remove.
56 56
      * @remark      Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added.
57 57
      */
58
-	const TRANSIENT_PREFIX         = 'APFL_';
58
+	const TRANSIENT_PREFIX = 'APFL_';
59 59
     
60 60
     /**
61 61
      * The hook slug used for the prefix of action and filter hook names.
62 62
      * 
63 63
      * @remark      The ending underscore is not necessary.
64 64
      */
65
-    const HOOK_SLUG                = 'admin_page_framework_loader';
65
+    const HOOK_SLUG = 'admin_page_framework_loader';
66 66
         
67 67
     
68 68
     /**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     static public $aAdminPages = array(
119 119
         // key => 'page slug'
120
-        'about'     => 'apfl_about',        // the welcome page
120
+        'about'     => 'apfl_about', // the welcome page
121 121
         'addon'     => 'apfl_addons',
122 122
         'tool'      => 'apfl_tools',
123 123
         'help'      => 'apfl_contact',
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * Sets up static properties.
141 141
      * @return      void
142 142
 	 */
143
-	static public function setUp( $sPluginFilePath=null ) {
143
+	static public function setUp( $sPluginFilePath = null ) {
144 144
 	                    
145 145
 		self::$sFilePath = $sPluginFilePath ? $sPluginFilePath : __FILE__;
146 146
 		self::$sDirPath  = dirname( self::$sFilePath );
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @since       3.5.0
158 158
      * @return      string
159 159
 	 */
160
-	public static function getPluginURL( $sRelativePath='' ) {
160
+	public static function getPluginURL( $sRelativePath = '' ) {
161 161
 		return plugins_url( $sRelativePath, self::$sFilePath );
162 162
 	}
163 163
     
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
      * @since       3.5.0
185 185
      * @return      void
186 186
      */ 
187
-    static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) {
188
-        if ( ! is_admin() ) {  
187
+    static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) {
188
+        if ( !is_admin() ) {  
189 189
             return; 
190 190
         }
191
-        self::$_aAdminNotices[] = array(
191
+        self::$_aAdminNotices[ ] = array(
192 192
             'message'           => $sMessage,
193
-            'class_attribute'   => trim( $sClassAttribute ) . ' notice is-dismissible',
193
+            'class_attribute'   => trim( $sClassAttribute ).' notice is-dismissible',
194 194
         );
195 195
         add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) );
196 196
     }
@@ -200,12 +200,12 @@  discard block
 block discarded – undo
200 200
          * @return      void
201 201
          */
202 202
         static public function _replyToSetAdminNotice() {
203
-            foreach( self::$_aAdminNotices as $_aAdminNotice ) {                
204
-                echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>"
203
+            foreach ( self::$_aAdminNotices as $_aAdminNotice ) {                
204
+                echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>"
205 205
                         ."<p>" 
206 206
                             . sprintf( 
207
-                                '<strong>%1$s</strong>: ' . $_aAdminNotice['message'],
208
-                                self::NAME . ' ' . self::VERSION
207
+                                '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ],
208
+                                self::NAME.' '.self::VERSION
209 209
                             )
210 210
                         . "</p>"
211 211
                     . "</div>";
@@ -217,24 +217,24 @@  discard block
 block discarded – undo
217 217
 AdminPageFrameworkLoader_Registry::setUp( __FILE__ );
218 218
 
219 219
 // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file.
220
-if ( ! defined( 'ABSPATH' ) ) { return; }
220
+if ( !defined( 'ABSPATH' ) ) { return; }
221 221
 if ( defined( 'DOING_UNINSTALL' ) ) { return; }
222 222
 
223 223
 // Include the library file 
224
-if ( ! class_exists( 'AdminPageFramework' ) ) {    
224
+if ( !class_exists( 'AdminPageFramework' ) ) {    
225 225
     // The development version is available in the repository cloned via GitHub.
226
-    $_sDevelopmentVersionPath = dirname( __FILE__ ) . '/development/admin-page-framework.php';
226
+    $_sDevelopmentVersionPath = dirname( __FILE__ ).'/development/admin-page-framework.php';
227 227
     $_bDebugMode              = defined( 'WP_DEBUG' ) && WP_DEBUG;
228 228
     include( 
229 229
         $_bDebugMode && file_exists( $_sDevelopmentVersionPath )
230 230
             ? $_sDevelopmentVersionPath
231
-            : dirname( __FILE__ ) . '/library/admin-page-framework/admin-page-framework.php'
231
+            : dirname( __FILE__ ).'/library/admin-page-framework/admin-page-framework.php'
232 232
     );
233 233
 } 
234 234
  
235 235
 if ( 
236
-    ! class_exists( 'AdminPageFramework_Registry' ) 
237
-    || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility
236
+    !class_exists( 'AdminPageFramework_Registry' ) 
237
+    || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility
238 238
     || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' )
239 239
 ) {
240 240
     AdminPageFrameworkLoader_Registry::setAdminNotice(
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 }
250 250
 
251 251
 // Include the framework loader plugin components.
252
-include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/boot/AdminPageFrameworkLoader_Bootstrap.php' );
252
+include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/boot/AdminPageFrameworkLoader_Bootstrap.php' );
253 253
 if ( class_exists( 'AdminPageFrameworkLoader_Bootstrap' ) ) {   // for backward compatibility
254 254
     new AdminPageFrameworkLoader_Bootstrap( 
255 255
         AdminPageFrameworkLoader_Registry::$sFilePath,
Please login to merge, or discard this patch.