Completed
Branch dev (06fb76)
by
unknown
04:02
created
admin-page-framework-loader.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFrameworkLoader_Registry_Base {
18 18
 
19
-    const VERSION        = '3.8.13b03';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
19
+    const VERSION        = '3.8.13b03'; // <--- 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://admin-page-framework.michaeluno.jp/';
24 24
     const AUTHOR         = 'miunosoft (Michael Uno)';
@@ -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
      * The text domain slug and its path.
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     static public $aAdminPages = array(
118 118
         // key => 'page slug'
119
-        'about'     => 'apfl_about',        // the welcome page
119
+        'about'     => 'apfl_about', // the welcome page
120 120
         'addon'     => 'apfl_addons',
121 121
         'tool'      => 'apfl_tools',
122 122
         'help'      => 'apfl_contact',
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
      * @since       3.5.0
155 155
      * @return      string
156 156
      */
157
-    public static function getPluginURL( $sRelativePath='' ) {
157
+    public static function getPluginURL( $sRelativePath = '' ) {
158 158
         if ( isset( self::$_sPluginURLCache ) ) {
159
-            return self::$_sPluginURLCache . $sRelativePath;
159
+            return self::$_sPluginURLCache.$sRelativePath;
160 160
         }
161 161
         self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) );
162
-        return self::$_sPluginURLCache . $sRelativePath;
162
+        return self::$_sPluginURLCache.$sRelativePath;
163 163
     }
164 164
         /**
165 165
          * @since       3.7.9
@@ -189,13 +189,13 @@  discard block
 block discarded – undo
189 189
      * @since       3.5.0
190 190
      * @return      void
191 191
      */ 
192
-    static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) {
193
-        if ( ! is_admin() ) {  
192
+    static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) {
193
+        if ( !is_admin() ) {  
194 194
             return; 
195 195
         }
196
-        self::$_aAdminNotices[] = array(
196
+        self::$_aAdminNotices[ ] = array(
197 197
             'message'           => $sMessage,
198
-            'class_attribute'   => trim( $sClassAttribute ) . ' notice is-dismissible',
198
+            'class_attribute'   => trim( $sClassAttribute ).' notice is-dismissible',
199 199
         );
200 200
         add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) );
201 201
     }
@@ -205,12 +205,12 @@  discard block
 block discarded – undo
205 205
          * @return      void
206 206
          */
207 207
         static public function _replyToSetAdminNotice() {
208
-            foreach( self::$_aAdminNotices as $_aAdminNotice ) {
209
-                echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>"
208
+            foreach ( self::$_aAdminNotices as $_aAdminNotice ) {
209
+                echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>"
210 210
                         ."<p>"
211 211
                             . sprintf(
212
-                                '<strong>%1$s</strong>: ' . $_aAdminNotice['message'],
213
-                                self::NAME . ' ' . self::VERSION
212
+                                '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ],
213
+                                self::NAME.' '.self::VERSION
214 214
                             )
215 215
                         . "</p>"
216 216
                     . "</div>";
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 AdminPageFrameworkLoader_Registry::setUp( __FILE__ );
223 223
 
224 224
 // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file.
225
-if ( ! defined( 'ABSPATH' ) ) {
225
+if ( !defined( 'ABSPATH' ) ) {
226 226
     return;
227 227
 }
228 228
 if ( defined( 'DOING_UNINSTALL' ) && DOING_UNINSTALL ) {
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 
235 235
     $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false );
236 236
     if (
237
-        ! $_bFrameworkLoaded
238
-        || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility
237
+        !$_bFrameworkLoaded
238
+        || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility
239 239
         || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' )
240 240
     ) {
241 241
         AdminPageFrameworkLoader_Registry::setAdminNotice(
@@ -253,18 +253,18 @@  discard block
 block discarded – undo
253 253
 add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' );
254 254
 
255 255
 // Include the library file - the development version will be available if you cloned the GitHub repository.
256
-$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php';
256
+$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php';
257 257
 $_bDebugMode              = defined( 'WP_DEBUG' ) && WP_DEBUG;
258 258
 $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath );
259 259
 include(
260 260
     $_bLoadDevelopmentVersion
261 261
         ? $_sDevelopmentVersionPath
262
-        : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php'
262
+        : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php'
263 263
 );
264 264
 
265 265
 // Include the framework loader plugin components.
266 266
 include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] );
267
-include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' );
267
+include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' );
268 268
 new AdminPageFrameworkLoader_Bootstrap(
269 269
     AdminPageFrameworkLoader_Registry::$sFilePath,
270 270
     AdminPageFrameworkLoader_Registry::HOOK_SLUG    // hook prefix
Please login to merge, or discard this patch.
development/factory/_common/_abstract/_model/AdminPageFramework_Message.php 1 patch
Spacing   +17 added lines, -17 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',     
@@ -113,14 +113,14 @@  discard block
 block discarded – undo
113 113
         'upload_file'                           => 'Upload File', 
114 114
         'use_this_file'                         => 'Use This File', 
115 115
         'select_file'                           => 'Select File', 
116
-        'remove_value'                          => 'Remove Value',  // 3.2.0+
117
-        'select_all'                            => 'Select All',    // 3.3.0+
118
-        'select_none'                           => 'Select None',   // 3.3.0+                       
116
+        'remove_value'                          => 'Remove Value', // 3.2.0+
117
+        'select_all'                            => 'Select All', // 3.3.0+
118
+        'select_none'                           => 'Select None', // 3.3.0+                       
119 119
         'no_term_found'                         => 'No term found.', // 3.3.2+
120 120
 
121 121
         // AdminPageFramework_Form_View___Script_{...}
122 122
         'select'                                => 'Select', // 3.4.2+             
123
-        'insert'                                => 'Insert',  // 3.4.2+
123
+        'insert'                                => 'Insert', // 3.4.2+
124 124
         'use_this'                              => 'Use This', // 3.4.2+
125 125
         'return_to_library'                     => 'Return to Library', // 3.4.2+
126 126
             
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
         'initial_memory_usage'                  => 'Initial memory usage  %1$s MB.', 
132 132
 
133 133
         // Repeatable sections
134
-        'repeatable_section_is_disabled'        => 'The ability to repeat sections is disabled.',   // 3.8.13+
135
-        'warning_caption'                       => 'Warning',   // 3.8.13+
134
+        'repeatable_section_is_disabled'        => 'The ability to repeat sections is disabled.', // 3.8.13+
135
+        'warning_caption'                       => 'Warning', // 3.8.13+
136 136
 
137 137
         // AdminPageFramework_FormField
138 138
         'allowed_maximum_number_of_fields'      => 'The allowed maximum number of fields is {0}.', 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      * @since       3.2.0       Changed it to create an instance per text domain basis.
210 210
      * @remark      This class should be instantiated via this method.
211 211
      */
212
-    public static function getInstance( $sTextDomain='admin-page-framework' ) {
212
+    public static function getInstance( $sTextDomain = 'admin-page-framework' ) {
213 213
         
214 214
         $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message )
215 215
             ? self::$_aInstancesByTextDomain[ $sTextDomain ]
@@ -222,21 +222,21 @@  discard block
 block discarded – undo
222 222
          * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) 
223 223
          * @deprecated  3.2.0
224 224
          */
225
-        public static function instantiate( $sTextDomain='admin-page-framework' ) {
225
+        public static function instantiate( $sTextDomain = 'admin-page-framework' ) {
226 226
             return self::getInstance( $sTextDomain );
227 227
         }
228 228
         
229 229
     /**
230 230
      * Sets up properties.
231 231
      */
232
-    public function __construct( $sTextDomain='admin-page-framework' ) {
232
+    public function __construct( $sTextDomain = 'admin-page-framework' ) {
233 233
         
234 234
         $this->_sTextDomain = $sTextDomain;  
235 235
         
236 236
         // Fill the $aMessages property with the keys extracted from the $aDefaults property
237 237
         // with the value of null.  The null is set to let it trigger the __get() method 
238 238
         // so that each translation item gets processed individually.
239
-        $this->aMessages    = array_fill_keys( 
239
+        $this->aMessages = array_fill_keys( 
240 240
             array_keys( $this->aDefaults ),
241 241
             null        
242 242
         );
@@ -270,13 +270,13 @@  discard block
 block discarded – undo
270 270
      * @since       3.7.0      If no key is specified, return the entire mesage array.
271 271
      * @return      string|array
272 272
      */
273
-    public function get( $sKey='' ) {
274
-        if ( ! $sKey ) {
273
+    public function get( $sKey = '' ) {
274
+        if ( !$sKey ) {
275 275
             return $this->_getAllMessages();
276 276
         }
277 277
         return isset( $this->aMessages[ $sKey ] )
278 278
             ? __( $this->aMessages[ $sKey ], $this->_sTextDomain )
279
-            : __( $this->{$sKey}, $this->_sTextDomain );     // triggers __get()
279
+            : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get()
280 280
     }
281 281
         /**
282 282
          * Returns the all registered messag items.
Please login to merge, or discard this patch.
_view/script/AdminPageFramework_Form_View___Script_RepeatableSection.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -441,20 +441,20 @@  discard block
 block discarded – undo
441 441
         if ( empty( $asArguments ) ) {
442 442
             return ''; 
443 443
         }
444
-        if ( self::hasBeenCalled( 'repeatable_section_' . $sContainerTagID ) ) {
444
+        if ( self::hasBeenCalled( 'repeatable_section_'.$sContainerTagID ) ) {
445 445
             return '';
446 446
         }
447 447
 
448 448
         new self( $oMsg );
449 449
         $_aArguments    = self::___getArgumentsFormatted( $asArguments, $oMsg );
450 450
         $_sButtons      = "<div class='admin-page-framework-repeatable-section-buttons-outer-container'>"
451
-                . "<div " . self::getAttributes( self::___getContainerAttributes( $_aArguments, $oMsg ) ) . ' ' . self::getDataAttributes( $_aArguments ) . '>'
452
-                    . "<a " . self::getAttributes( self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ) ) . ">-</a>"
453
-                    . "<a " . self::getAttributes( self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ) ) . ">+</a>"
451
+                . "<div ".self::getAttributes( self::___getContainerAttributes( $_aArguments, $oMsg ) ).' '.self::getDataAttributes( $_aArguments ).'>'
452
+                    . "<a ".self::getAttributes( self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ) ).">-</a>"
453
+                    . "<a ".self::getAttributes( self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ) ).">+</a>"
454 454
                 . "</div>"
455 455
             . "</div>"
456 456
             . self::___getModalForDisabledMessage( $sContainerTagID, $_aArguments );
457
-        $_sButtonsHTML  = '"' . $_sButtons . '"';
457
+        $_sButtonsHTML  = '"'.$_sButtons.'"';
458 458
         $_aJSArray      = json_encode( $_aArguments );
459 459
         $_sScript       = <<<JAVASCRIPTS
460 460
 jQuery( document ).ready( function() {
@@ -496,14 +496,14 @@  discard block
 block discarded – undo
496 496
          */
497 497
         static private function ___getArgumentsFormatted( $asArguments, $oMsg ) {
498 498
             $_aArguments = self::getAsArray( $asArguments );
499
-            unset( $_aArguments[ 0 ] );   // remove the 0 index element converted from `'repeatable   => 'true',`.
499
+            unset( $_aArguments[ 0 ] ); // remove the 0 index element converted from `'repeatable   => 'true',`.
500 500
             $_aArguments = $_aArguments
501 501
                + array(
502 502
                     'min'                       => 0,
503 503
                     'max'                       => 0,
504 504
                     'disabled'                  => false,
505 505
                );
506
-            if ( ! empty( $_aArguments[ 'disabled' ] ) ) {
506
+            if ( !empty( $_aArguments[ 'disabled' ] ) ) {
507 507
                 $_aArguments[ 'disabled' ] = $_aArguments[ 'disabled' ] + array(
508 508
                     'label'      => $oMsg->get( 'repeatable_section_is_disabled' ),
509 509
                     'caption'    => $oMsg->get( 'warning_caption' ),
@@ -570,10 +570,10 @@  discard block
 block discarded – undo
570 570
                     . 'repeatable-section-button button button-large',
571 571
                 'title'     => $oMsg->get( 'add_section' ),
572 572
                 'data-id'   => $sContainerTagID,
573
-                'href'      => ! empty( $aArguments[ 'disabled' ] )
574
-                    ? '#TB_inline?width=' . $aArguments[ 'disabled' ][ 'box_width' ]
575
-                        . '&height=' . $aArguments[ 'disabled' ][ 'box_height' ]
576
-                        . '&inlineId=' . 'repeatable_section_disabled_' . $sContainerTagID
573
+                'href'      => !empty( $aArguments[ 'disabled' ] )
574
+                    ? '#TB_inline?width='.$aArguments[ 'disabled' ][ 'box_width' ]
575
+                        . '&height='.$aArguments[ 'disabled' ][ 'box_height' ]
576
+                        . '&inlineId='.'repeatable_section_disabled_'.$sContainerTagID
577 577
                     : '',
578 578
             );
579 579
         }
Please login to merge, or discard this patch.
form/_view/fieldset/AdminPageFramework_Form_View___Fieldset_Base.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param       object      $oMsg                   An object storing the system messages.
69 69
      * @param       array       $aCallbacks             An array storing the form-field specific callbacks.     
70 70
      */
71
-    public function __construct( $aFieldset, $aOptions, $aErrors, &$aFieldTypeDefinitions, &$oMsg, array $aCallbacks=array() ) {
71
+    public function __construct( $aFieldset, $aOptions, $aErrors, &$aFieldTypeDefinitions, &$oMsg, array $aCallbacks = array() ) {
72 72
 
73 73
         // Set up the properties that will be accessed later in the methods.
74 74
         $this->aFieldset                = $this->_getFormatted( $aFieldset, $aFieldTypeDefinitions );
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
         $this->aErrors                  = $this->getAsArray( $aErrors );
78 78
         $this->oMsg                     = $oMsg;
79 79
         $this->aCallbacks               = $aCallbacks + array(
80
-            'hfID'              => null,    // the input id attribute
81
-            'hfTagID'           => null,    // the fieldset/field row container id attribute
82
-            'hfName'            => null,    // the input name attribute
83
-            'hfNameFlat'        => null,    // the flat input name attribute                
80
+            'hfID'              => null, // the input id attribute
81
+            'hfTagID'           => null, // the fieldset/field row container id attribute
82
+            'hfName'            => null, // the input name attribute
83
+            'hfNameFlat'        => null, // the flat input name attribute                
84 84
             'hfInputName'       => null,
85 85
             'hfInputNameFlat'   => null,
86
-            'hfClass'           => null,    // the class attribute
86
+            'hfClass'           => null, // the class attribute
87 87
         );        
88 88
         
89 89
         // 2. Load necessary JavaScript scripts.
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
          * @since   3.2.0   Added the `$sFieldsType` parameter.
151 151
          * @internal
152 152
          */
153
-        private function _loadScripts( $sStructureType='' ) {
153
+        private function _loadScripts( $sStructureType = '' ) {
154 154
 
155
-            if ( 'widget' === $sStructureType && ! self::$_bIsLoadedJSScripts_Widget ) {
155
+            if ( 'widget' === $sStructureType && !self::$_bIsLoadedJSScripts_Widget ) {
156 156
                 new AdminPageFramework_Form_View___Script_Widget;
157 157
                 self::$_bIsLoadedJSScripts_Widget = true;
158 158
             }
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
      */
178 178
     protected function _getRepeaterFieldEnablerScript( $sFieldsContainerID, $iFieldCount, $aSettings ) {
179 179
         
180
-        $_sSmallButtons         = '"' . $this->___getRepeatableButtonHTML( $sFieldsContainerID, ( array ) $aSettings, $iFieldCount, true ) . '"';
181
-        $_sNestedFieldsButtons  = '"' . $this->___getRepeatableButtonHTML( $sFieldsContainerID, ( array ) $aSettings, $iFieldCount, false ) . '"';
180
+        $_sSmallButtons         = '"'.$this->___getRepeatableButtonHTML( $sFieldsContainerID, ( array ) $aSettings, $iFieldCount, true ).'"';
181
+        $_sNestedFieldsButtons  = '"'.$this->___getRepeatableButtonHTML( $sFieldsContainerID, ( array ) $aSettings, $iFieldCount, false ).'"';
182 182
         $_aJSArray              = json_encode( $aSettings );
183 183
         $_sScript               = <<<JAVASCRIPTS
184 184
 jQuery( document ).ready( function() {
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
          * @since       3.8.0
225 225
          * @return      string
226 226
          */
227
-        private function ___getRepeatableButtonHTML( $sFieldsContainerID, array $aSettings, $iFieldCount, $bSmall=true ) {
227
+        private function ___getRepeatableButtonHTML( $sFieldsContainerID, array $aSettings, $iFieldCount, $bSmall = true ) {
228 228
             
229 229
             $_sAdd                  = $this->oMsg->get( 'add' );
230 230
             $_sRemove               = $this->oMsg->get( 'remove' );            
Please login to merge, or discard this patch.