@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
| 42 | 42 | // so make sure it is processed only once per page. |
| 43 | - if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
|
| 43 | + if ( $this->hasBeenCalled( 'resource_'.$oForm->aArguments[ 'caller_id' ] ) ) { |
|
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | * @since 3.7.0 |
| 114 | 114 | */ |
| 115 | 115 | public function _replyToEnqueueScripts() { |
| 116 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 116 | + if ( !$this->oForm->isInThePage() ) { |
|
| 117 | 117 | return; |
| 118 | 118 | } |
| 119 | - foreach( $this->oForm->getResources( 'src_scripts' ) as $_isIndex => $_asEnqueue ) { |
|
| 119 | + foreach ( $this->oForm->getResources( 'src_scripts' ) as $_isIndex => $_asEnqueue ) { |
|
| 120 | 120 | $this->_enqueueScript( $_asEnqueue ); |
| 121 | - $this->oForm->unsetResources( array( 'src_scripts', $_isIndex ) ); // no longer needed |
|
| 121 | + $this->oForm->unsetResources( array( 'src_scripts', $_isIndex ) ); // no longer needed |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | private function _getFormattedEnqueueScript( $asEnqueue ) { |
| 166 | 166 | static $_iCallCount = 1; |
| 167 | 167 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
| 168 | - 'handle_id' => 'script_form_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
| 168 | + 'handle_id' => 'script_form_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
| 169 | 169 | 'src' => null, |
| 170 | 170 | 'dependencies' => null, |
| 171 | 171 | 'version' => null, |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | public function _replyToEnqueueStyles() { |
| 190 | 190 | |
| 191 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 191 | + if ( !$this->oForm->isInThePage() ) { |
|
| 192 | 192 | return; |
| 193 | 193 | } |
| 194 | - foreach( $this->oForm->getResources( 'src_styles' ) as $_isIndex => $_asEnqueueItem ) { |
|
| 194 | + foreach ( $this->oForm->getResources( 'src_styles' ) as $_isIndex => $_asEnqueueItem ) { |
|
| 195 | 195 | $this->_enqueueStyle( $_asEnqueueItem ); |
| 196 | 196 | $this->oForm->unsetResources( array( 'src_styles', $_isIndex ) ); // no longer needed |
| 197 | 197 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | private function _getFormattedEnqueueStyle( $asEnqueue ) { |
| 214 | 214 | static $_iCallCount = 1; |
| 215 | 215 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
| 216 | - 'handle_id' => 'style_form_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
| 216 | + 'handle_id' => 'style_form_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
| 217 | 217 | 'src' => null, |
| 218 | 218 | 'dependencies' => null, |
| 219 | 219 | 'version' => null, |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | public function _replyToAddStyle() { |
| 239 | 239 | |
| 240 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 240 | + if ( !$this->oForm->isInThePage() ) { |
|
| 241 | 241 | return; |
| 242 | 242 | } |
| 243 | 243 | $_sCSSRules = $this->_getFormattedInternalStyles( |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function _replyToAddScript() { |
| 281 | 281 | |
| 282 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 282 | + if ( !$this->oForm->isInThePage() ) { |
|
| 283 | 283 | return; |
| 284 | 284 | } |
| 285 | 285 | |
@@ -173,7 +173,7 @@ |
||
| 173 | 173 | . $this->getFrameworkNameVersion() |
| 174 | 174 | . ' (' |
| 175 | 175 | . __( 'This information will be disabled when <code>WP_DEBUG</code> is set to <code>false</code> in <code>wp-config.php</code>.', 'admin-page-framework' ) |
| 176 | - . ')' |
|
| 176 | + . ')' |
|
| 177 | 177 | . '</span>', |
| 178 | 178 | 'attributes' => array( |
| 179 | 179 | 'container' => array( |
@@ -37,19 +37,19 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | /* The system internal keys. */ |
| 39 | 39 | 'sSRC' => null, |
| 40 | - 'aPostTypes' => array(), // for meta box class |
|
| 40 | + 'aPostTypes' => array(), // for meta box class |
|
| 41 | 41 | 'sPageSlug' => null, |
| 42 | 42 | 'sTabSlug' => null, |
| 43 | - 'sType' => null, // script or style |
|
| 43 | + 'sType' => null, // script or style |
|
| 44 | 44 | |
| 45 | 45 | /* The below keys are for users. */ |
| 46 | 46 | 'handle_id' => null, |
| 47 | 47 | 'dependencies' => array(), |
| 48 | - 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
| 49 | - 'translation' => array(), // only for scripts |
|
| 50 | - 'in_footer' => false, // only for scripts |
|
| 51 | - 'media' => 'all', // only for styles |
|
| 52 | - 'attributes' => array(), // 3.3.0+ - the attribute array |
|
| 48 | + 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
| 49 | + 'translation' => array(), // only for scripts |
|
| 50 | + 'in_footer' => false, // only for scripts |
|
| 51 | + 'media' => 'all', // only for styles |
|
| 52 | + 'attributes' => array(), // 3.3.0+ - the attribute array |
|
| 53 | 53 | |
| 54 | 54 | ); |
| 55 | 55 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @remark This value should be overridden in an extended class. |
| 61 | 61 | * @internal |
| 62 | 62 | */ |
| 63 | - protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
| 63 | + protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * Stores the class selector used to the class-specific script. |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * @remark This value should be overridden in an extended class. |
| 70 | 70 | * @internal |
| 71 | 71 | */ |
| 72 | - protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
| 72 | + protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * Stores hand IDs by resource url to look up handle id and add custom arguments. |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | * @internal |
| 144 | 144 | */ |
| 145 | 145 | |
| 146 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) {} |
|
| 147 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) {} |
|
| 146 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) {} |
|
| 147 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) {} |
|
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | 150 | * A helper function for the _replyToEnqueueScripts() and the `_replyToEnqueueStyle()` methods. |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | $_sAttributes = $this->getAttributes( $_aAttributes ); |
| 208 | - $_sModifiedURL = $sSanitizedURL . "' " . rtrim( $_sAttributes, "'\"" ); // '" |
|
| 208 | + $_sModifiedURL = $sSanitizedURL."' ".rtrim( $_sAttributes, "'\"" ); // '" |
|
| 209 | 209 | |
| 210 | 210 | return $_sModifiedURL; |
| 211 | 211 | |
@@ -253,10 +253,10 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | private function _getStyleTag( $oCaller, $sIDPrefix ) { |
| 255 | 255 | |
| 256 | - $_sStyle = $this->addAndApplyFilters( |
|
| 256 | + $_sStyle = $this->addAndApplyFilters( |
|
| 257 | 257 | $oCaller, |
| 258 | 258 | array( |
| 259 | - "style_common_admin_page_framework", // 3.2.1+ |
|
| 259 | + "style_common_admin_page_framework", // 3.2.1+ |
|
| 260 | 260 | "style_common_{$this->oProp->sClassName}", |
| 261 | 261 | ), |
| 262 | 262 | AdminPageFramework_CSS::getDefaultCSS() |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | // : $this->getCSSMinified( $_sStyle ); |
| 270 | 270 | |
| 271 | 271 | if ( $_sStyle ) { |
| 272 | - echo "<style type='text/css' id='" . esc_attr( $sIDPrefix ) . "'>" |
|
| 272 | + echo "<style type='text/css' id='".esc_attr( $sIDPrefix )."'>" |
|
| 273 | 273 | . $_sStyle |
| 274 | 274 | . "</style>"; |
| 275 | 275 | } |
@@ -283,10 +283,10 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | private function _getIEStyleTag( $oCaller, $sIDPrefix ) { |
| 285 | 285 | |
| 286 | - $_sStyleIE = $this->addAndApplyFilters( |
|
| 286 | + $_sStyleIE = $this->addAndApplyFilters( |
|
| 287 | 287 | $oCaller, |
| 288 | 288 | array( |
| 289 | - "style_ie_common_admin_page_framework", // 3.2.1+ |
|
| 289 | + "style_ie_common_admin_page_framework", // 3.2.1+ |
|
| 290 | 290 | "style_ie_common_{$this->oProp->sClassName}", |
| 291 | 291 | ), |
| 292 | 292 | AdminPageFramework_CSS::getDefaultCSSIE() |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | // ? trim( $_sStyleIE ) |
| 298 | 298 | // : $this->getCSSMinified( $_sStyleIE ); |
| 299 | 299 | return $_sStyleIE |
| 300 | - ? "<!--[if IE]><style type='text/css' id='" . esc_attr( $sIDPrefix . "-ie" ) . "'>" |
|
| 300 | + ? "<!--[if IE]><style type='text/css' id='".esc_attr( $sIDPrefix."-ie" )."'>" |
|
| 301 | 301 | . $_sStyleIE |
| 302 | 302 | . "</style><![endif]-->" |
| 303 | 303 | : ''; |
@@ -330,14 +330,14 @@ discard block |
||
| 330 | 330 | $_sScript = $this->addAndApplyFilters( |
| 331 | 331 | $this->oProp->oCaller, |
| 332 | 332 | array( |
| 333 | - "script_common_admin_page_framework", // 3.2.1+ |
|
| 333 | + "script_common_admin_page_framework", // 3.2.1+ |
|
| 334 | 334 | "script_common_{$this->oProp->sClassName}", |
| 335 | 335 | ), |
| 336 | 336 | AdminPageFramework_Property_Base::$_sDefaultScript |
| 337 | 337 | ); |
| 338 | 338 | $_sScript = trim( $_sScript ); |
| 339 | 339 | if ( $_sScript ) { |
| 340 | - echo "<script type='text/javascript' id='" . esc_attr( $sIDPrefix ) . "'>" |
|
| 340 | + echo "<script type='text/javascript' id='".esc_attr( $sIDPrefix )."'>" |
|
| 341 | 341 | . '/* <![CDATA[ */' |
| 342 | 342 | . $_sScript |
| 343 | 343 | . '/* ]]> */' |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | */ |
| 357 | 357 | protected function _printClassSpecificStyles( $sIDPrefix ) { |
| 358 | 358 | |
| 359 | - $_oCaller = $this->oProp->oCaller; |
|
| 359 | + $_oCaller = $this->oProp->oCaller; |
|
| 360 | 360 | echo $this->_getClassSpecificStyleTag( $_oCaller, $sIDPrefix ); |
| 361 | 361 | echo $this->_getClassSpecificIEStyleTag( $_oCaller, $sIDPrefix ); |
| 362 | 362 | |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | // : $this->getCSSMinified( $_sStyle ); |
| 388 | 388 | if ( $_sStyle ) { |
| 389 | 389 | $_iCallCount++; |
| 390 | - return "<style type='text/css' id='" . esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ) . "'>" |
|
| 390 | + return "<style type='text/css' id='".esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" )."'>" |
|
| 391 | 391 | . $_sStyle |
| 392 | 392 | . "</style>"; |
| 393 | 393 | } |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | // : $this->getCSSMinified( $_sStyleIE ); |
| 416 | 416 | if ( $_sStyleIE ) { |
| 417 | 417 | $_iCallCountIE++; |
| 418 | - return "<!--[if IE]><style type='text/css' id='" . esc_attr( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ) . "'>" |
|
| 418 | + return "<!--[if IE]><style type='text/css' id='".esc_attr( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" )."'>" |
|
| 419 | 419 | . $_sStyleIE |
| 420 | 420 | . "</style><![endif]-->"; |
| 421 | 421 | } |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | $_sScript = trim( $_sScript ); |
| 444 | 444 | if ( $_sScript ) { |
| 445 | 445 | $_iCallCount++; |
| 446 | - echo "<script type='text/javascript' id='" . esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ) . "'>" |
|
| 446 | + echo "<script type='text/javascript' id='".esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" )."'>" |
|
| 447 | 447 | . '/* <![CDATA[ */' |
| 448 | 448 | . $_sScript |
| 449 | 449 | . '/* ]]> */' |
@@ -468,12 +468,12 @@ discard block |
||
| 468 | 468 | public function _replyToAddStyle() { |
| 469 | 469 | |
| 470 | 470 | $_oCaller = $this->oProp->oCaller; |
| 471 | - if ( ! $_oCaller->_isInThePage() ) { |
|
| 471 | + if ( !$_oCaller->_isInThePage() ) { |
|
| 472 | 472 | return; |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | $this->_printCommonStyles( 'admin-page-framework-style-common', get_class() ); |
| 476 | - $this->_printClassSpecificStyles( $this->_sClassSelector_Style . '-' . $this->oProp->sStructureType ); |
|
| 476 | + $this->_printClassSpecificStyles( $this->_sClassSelector_Style.'-'.$this->oProp->sStructureType ); |
|
| 477 | 477 | |
| 478 | 478 | } |
| 479 | 479 | /** |
@@ -488,12 +488,12 @@ discard block |
||
| 488 | 488 | public function _replyToAddScript() { |
| 489 | 489 | |
| 490 | 490 | $_oCaller = $this->oProp->oCaller; |
| 491 | - if ( ! $_oCaller->_isInThePage() ) { |
|
| 491 | + if ( !$_oCaller->_isInThePage() ) { |
|
| 492 | 492 | return; |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | $this->_printCommonScripts( 'admin-page-framework-script-common', get_class() ); |
| 496 | - $this->_printClassSpecificScripts( $this->_sClassSelector_Script . '-' . $this->oProp->sStructureType ); |
|
| 496 | + $this->_printClassSpecificScripts( $this->_sClassSelector_Script.'-'.$this->oProp->sStructureType ); |
|
| 497 | 497 | |
| 498 | 498 | } |
| 499 | 499 | |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | * @internal |
| 546 | 546 | */ |
| 547 | 547 | public function _replyToEnqueueStyles() { |
| 548 | - foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
| 548 | + foreach ( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
| 549 | 549 | $this->_enqueueSRCByCondition( $_aEnqueuingStyle ); |
| 550 | 550 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
| 551 | 551 | } |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | * @internal |
| 563 | 563 | */ |
| 564 | 564 | public function _replyToEnqueueScripts() { |
| 565 | - foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
| 565 | + foreach ( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
| 566 | 566 | $this->_enqueueSRCByCondition( $_aEnqueuingScript ); |
| 567 | 567 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
| 568 | 568 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | 'class_name' => 'AceCustomFieldType', |
| 89 | 89 | 'label' => __( 'ACE', 'admin-page-framework-loader' ), |
| 90 | 90 | 'description' => __( 'provides code syntax highlighting in a text area field.', 'admin-page-framework-loader' ), |
| 91 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/ace-custom-field-type', |
|
| 91 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/ace-custom-field-type', |
|
| 92 | 92 | 'archive_file_path' => 'custom-field-types/ace-custom-field-type/AceCustomFieldType.php', |
| 93 | 93 | 'archive_dir_path' => 'custom-field-types/ace-custom-field-type', |
| 94 | 94 | 'text_domain' => 'admin-page-framework', |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | 'class_name' => 'GitHubCustomFieldType', |
| 98 | 98 | 'label' => __( 'GitHub Buttons', 'admin-page-framework-loader' ), |
| 99 | 99 | 'description' => __( 'allows you to display GitHub buttons in a field.', 'admin-page-framework-loader' ), |
| 100 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/include/library/github-custom-field-type', |
|
| 100 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/include/library/github-custom-field-type', |
|
| 101 | 101 | 'archive_file_path' => 'custom-field-types/github-custom-field-type/GitHubCustomFieldType.php', |
| 102 | 102 | 'archive_dir_path' => 'custom-field-types/github-custom-field-type', |
| 103 | 103 | 'text_domain' => 'admin-page-framework', |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | 'class_name' => 'PathCustomFieldType', |
| 107 | 107 | 'label' => __( 'Path', 'admin-page-framework-loader' ), |
| 108 | 108 | 'description' => __( 'allows the user to select a file path on the server.', 'admin-page-framework-loader' ), |
| 109 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/path-custom-field-type', |
|
| 109 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/path-custom-field-type', |
|
| 110 | 110 | 'archive_file_path' => 'custom-field-types/path-custom-field-type/PathCustomFieldType.php', |
| 111 | 111 | 'archive_dir_path' => 'custom-field-types/path-custom-field-type', |
| 112 | 112 | 'text_domain' => 'admin-page-framework', |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | 'class_name' => 'ToggleCustomFieldType', |
| 116 | 116 | 'label' => __( 'Toggle', 'admin-page-framework-loader' ), |
| 117 | 117 | 'description' => __( 'allows the user to switch a button.', 'admin-page-framework-loader' ), |
| 118 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/toggle-custom-field-type', |
|
| 118 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/toggle-custom-field-type', |
|
| 119 | 119 | 'archive_file_path' => 'custom-field-types/toggle-custom-field-type/ToggleCustomFieldType.php', |
| 120 | 120 | 'archive_dir_path' => 'custom-field-types/toggle-custom-field-type', |
| 121 | 121 | 'text_domain' => 'admin-page-framework', |
@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | // Let third-party scripts add custom field types. |
| 126 | 126 | $this->aCustomFieldTypes = apply_filters( |
| 127 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_custom_field_types', |
|
| 127 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_custom_field_types', |
|
| 128 | 128 | $this->aCustomFieldTypes |
| 129 | 129 | ); |
| 130 | 130 | |
| 131 | - foreach( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) { |
|
| 131 | + foreach ( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) { |
|
| 132 | 132 | $this->aCustomFieldTypeLabels[ $_sKey ] = $_aCustomFieldType[ 'label' ] |
| 133 | - . ' - <span class="description">' . $_aCustomFieldType[ 'description' ] . '</span>'; |
|
| 133 | + . ' - <span class="description">'.$_aCustomFieldType[ 'description' ].'</span>'; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | } |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | // Check the file extension. |
| 148 | 148 | $_aAllowedExtensions = apply_filters( |
| 149 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_allowed_file_extensions', |
|
| 149 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_allowed_file_extensions', |
|
| 150 | 150 | array( 'php', 'css', 'js' ) |
| 151 | 151 | ); |
| 152 | - if ( ! in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), $_aAllowedExtensions ) ) { |
|
| 152 | + if ( !in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), $_aAllowedExtensions ) ) { |
|
| 153 | 153 | return $sFileContents; |
| 154 | 154 | } |
| 155 | 155 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | private function _getModifiedInclusionList( $sFileContents ) { |
| 180 | 180 | return str_replace( |
| 181 | 181 | ');', // search |
| 182 | - $this->_getClassListOfCustomFieldTypes() . ');', // replace - @todo insert the selected class list here |
|
| 182 | + $this->_getClassListOfCustomFieldTypes().');', // replace - @todo insert the selected class list here |
|
| 183 | 183 | $sFileContents // subject |
| 184 | 184 | ); |
| 185 | 185 | } |
@@ -196,18 +196,18 @@ discard block |
||
| 196 | 196 | $_POST, |
| 197 | 197 | array( |
| 198 | 198 | $this->oFactory->oProp->sOptionKey, |
| 199 | - 'generator', // section id |
|
| 199 | + 'generator', // section id |
|
| 200 | 200 | 'class_prefix' // field id |
| 201 | 201 | ), |
| 202 | 202 | '' |
| 203 | 203 | ); |
| 204 | 204 | $_aOutput = array(); |
| 205 | - foreach( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
| 206 | - $_aOutput[] = ' "' . $_sClassPrefix . $_sClassName . '"' |
|
| 205 | + foreach ( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
| 206 | + $_aOutput[ ] = ' "'.$_sClassPrefix.$_sClassName.'"' |
|
| 207 | 207 | . ' => ' |
| 208 | - . 'AdminPageFramework_Registry::$sDirPath . ' . '"/' . ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ) . '",'; |
|
| 208 | + . 'AdminPageFramework_Registry::$sDirPath . '.'"/'.ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ).'",'; |
|
| 209 | 209 | } |
| 210 | - return implode( PHP_EOL, $_aOutput ) . PHP_EOL; |
|
| 210 | + return implode( PHP_EOL, $_aOutput ).PHP_EOL; |
|
| 211 | 211 | |
| 212 | 212 | } |
| 213 | 213 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $this->aCustomFieldTypes // ArchiveFilePaths |
| 226 | 226 | ); |
| 227 | 227 | $_aArchiveFilePaths = array(); |
| 228 | - foreach( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
| 228 | + foreach ( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
| 229 | 229 | $_aArchiveFilePaths[ $_sClassName ] = $this->oFactory->oUtil->getElement( |
| 230 | 230 | $_aCustomFieldType, |
| 231 | 231 | 'archive_file_path', |
@@ -277,17 +277,17 @@ discard block |
||
| 277 | 277 | array( $sParsingClassName, 'text_domain' ) |
| 278 | 278 | ); |
| 279 | 279 | if ( $_sFieldTypeTextDomain ) { |
| 280 | - $_aSearches[] = $_sFieldTypeTextDomain; |
|
| 281 | - $_aReplaces[] = $_sUserTextDomain; |
|
| 280 | + $_aSearches[ ] = $_sFieldTypeTextDomain; |
|
| 281 | + $_aReplaces[ ] = $_sUserTextDomain; |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - $_aSearches[] = 'admin-page-framework'; |
|
| 285 | - $_aReplaces[] = $_sUserTextDomain; |
|
| 284 | + $_aSearches[ ] = 'admin-page-framework'; |
|
| 285 | + $_aReplaces[ ] = $_sUserTextDomain; |
|
| 286 | 286 | |
| 287 | 287 | // Return the converted string. |
| 288 | 288 | return str_replace( |
| 289 | - $_aSearches, // search |
|
| 290 | - $_aReplaces, // replace |
|
| 289 | + $_aSearches, // search |
|
| 290 | + $_aReplaces, // replace |
|
| 291 | 291 | $sFileContents // subject |
| 292 | 292 | ); |
| 293 | 293 | |
@@ -305,8 +305,8 @@ discard block |
||
| 305 | 305 | ); |
| 306 | 306 | |
| 307 | 307 | return preg_replace( |
| 308 | - $this->_getClassPrefixRegexPatterns( $_aSelectedFieldTypeClassNames ), // search |
|
| 309 | - $this->_getClassPrefixRegexReplacements( $_aSelectedFieldTypeClassNames ), // replace |
|
| 308 | + $this->_getClassPrefixRegexPatterns( $_aSelectedFieldTypeClassNames ), // search |
|
| 309 | + $this->_getClassPrefixRegexReplacements( $_aSelectedFieldTypeClassNames ), // replace |
|
| 310 | 310 | $sFileContents // subject |
| 311 | 311 | ); |
| 312 | 312 | |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | private function _getClassPrefixRegexPatterns( array $aSelectedFieldTypeClassNames ) { |
| 320 | 320 | |
| 321 | 321 | $_aPregSearches = array(); |
| 322 | - foreach( $aSelectedFieldTypeClassNames as $_sClassName ) { |
|
| 323 | - $_aPregSearches[] = '/(?<=[^a-zA-Z0-9])(' . $_sClassName . ')/'; |
|
| 322 | + foreach ( $aSelectedFieldTypeClassNames as $_sClassName ) { |
|
| 323 | + $_aPregSearches[ ] = '/(?<=[^a-zA-Z0-9])('.$_sClassName.')/'; |
|
| 324 | 324 | } |
| 325 | 325 | return $_aPregSearches; |
| 326 | 326 | |
@@ -332,9 +332,9 @@ discard block |
||
| 332 | 332 | */ |
| 333 | 333 | private function _getClassPrefixRegexReplacements( array $aSelectedFieldTypeClassNames ) { |
| 334 | 334 | |
| 335 | - $_aPrefixedClassNames = $aSelectedFieldTypeClassNames; |
|
| 335 | + $_aPrefixedClassNames = $aSelectedFieldTypeClassNames; |
|
| 336 | 336 | array_walk( |
| 337 | - $_aPrefixedClassNames, // passed by reference |
|
| 337 | + $_aPrefixedClassNames, // passed by reference |
|
| 338 | 338 | array( $this, '_replyToSetPrefix' ), |
| 339 | 339 | $this->oFactory->oUtil->getElement( |
| 340 | 340 | $_POST, |
@@ -355,8 +355,8 @@ discard block |
||
| 355 | 355 | * @callback function array_walk |
| 356 | 356 | * @return string |
| 357 | 357 | */ |
| 358 | - public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix='' ) { |
|
| 359 | - $sClassName = $sPrefix . '$0'; |
|
| 358 | + public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix = '' ) { |
|
| 359 | + $sClassName = $sPrefix.'$0'; |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | |
@@ -377,12 +377,12 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | public function replyToSetAdditionalDirectoriesForGenerator( $aDirPaths ) { |
| 379 | 379 | |
| 380 | - $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes( |
|
| 380 | + $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes( |
|
| 381 | 381 | $this->aCustomFieldTypes |
| 382 | 382 | ); |
| 383 | 383 | |
| 384 | 384 | $_aDirPathInfo = array(); |
| 385 | - foreach( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) { |
|
| 385 | + foreach ( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) { |
|
| 386 | 386 | |
| 387 | 387 | $_sArchiveDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'archive_dir_path' ); |
| 388 | 388 | $_sSourceDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'directory_path' ); |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | * @return array The array keys of the checked items. |
| 399 | 399 | * @since 3.6.0 |
| 400 | 400 | */ |
| 401 | - private function _getSelectedCustomFieldTypes( array $aSubject=array() ) { |
|
| 401 | + private function _getSelectedCustomFieldTypes( array $aSubject = array() ) { |
|
| 402 | 402 | |
| 403 | 403 | $_aCheckedCustomFieldTypes = $this->oFactory->oUtil->getElementAsArray( |
| 404 | 404 | $_POST, |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
| 18 | 18 | |
| 19 | - const VERSION = '3.8.5b04'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 19 | + const VERSION = '3.8.5b04'; // <--- 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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' ) ) { |
@@ -234,8 +234,8 @@ discard block |
||
| 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 |
||
| 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 |