@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function __construct( array $aPostElement ) { |
| 36 | 36 | |
| 37 | 37 | $this->aPost = $aPostElement; |
| 38 | - $this->sInputID = $this->getInputID( $aPostElement['submit'] ); // the submit element must be set by the field type. |
|
| 38 | + $this->sInputID = $this->getInputID( $aPostElement[ 'submit' ] ); // the submit element must be set by the field type. |
|
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 | |
@@ -47,10 +47,10 @@ discard block |
||
| 47 | 47 | * @since 2.0.0 |
| 48 | 48 | * @since 3.4.0 Changed the name from `getElement()`. |
| 49 | 49 | */ |
| 50 | - protected function getSubmitValueByType( $aElement, $sInputID, $sElementKey='format' ) { |
|
| 50 | + protected function getSubmitValueByType( $aElement, $sInputID, $sElementKey = 'format' ) { |
|
| 51 | 51 | |
| 52 | 52 | return $this->getElement( |
| 53 | - $aElement, // subject array |
|
| 53 | + $aElement, // subject array |
|
| 54 | 54 | array( $sInputID, $sElementKey ), // dimensional keys |
| 55 | 55 | null // default |
| 56 | 56 | ); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | // Only the pressed element will be stored in the array. |
| 81 | 81 | // The input tag: name="__import[submit][my_section_my_import_field_the_index]" value="Import Button" |
| 82 | 82 | // The array structure: array( 'my_section_my_import_field_the_index' => 'Import Button' ) |
| 83 | - foreach( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor. |
|
| 83 | + foreach ( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor. |
|
| 84 | 84 | $this->sInputID = $sInputID; |
| 85 | 85 | return $this->sInputID; |
| 86 | 86 | } |
@@ -80,7 +80,8 @@ |
||
| 80 | 80 | // Only the pressed element will be stored in the array. |
| 81 | 81 | // The input tag: name="__import[submit][my_section_my_import_field_the_index]" value="Import Button" |
| 82 | 82 | // The array structure: array( 'my_section_my_import_field_the_index' => 'Import Button' ) |
| 83 | - foreach( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor. |
|
| 83 | + foreach( $aSubmitElement as $sInputID => $v ) { |
|
| 84 | +// $aSubmitElement should have been set in the constructor. |
|
| 84 | 85 | $this->sInputID = $sInputID; |
| 85 | 86 | return $this->sInputID; |
| 86 | 87 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ) |
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | - if ( ! $this->_isEnabled( $_aTab ) ) { |
|
| 66 | + if ( !$this->_isEnabled( $_aTab ) ) { |
|
| 67 | 67 | return array(); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | : esc_url( |
| 78 | 78 | $this->getElement( |
| 79 | 79 | $_aTab, |
| 80 | - 'url', // if the 'url' argument is set, use it. Otherwise, use the below gnerated url. |
|
| 80 | + 'url', // if the 'url' argument is set, use it. Otherwise, use the below gnerated url. |
|
| 81 | 81 | $this->getQueryAdminURL( |
| 82 | 82 | array( |
| 83 | 83 | 'page' => $this->aArguments[ 'page_slug' ], |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @return boolean |
| 107 | 107 | */ |
| 108 | 108 | private function _isEnabled( $aTab ) { |
| 109 | - return ! in_array( |
|
| 109 | + return !in_array( |
|
| 110 | 110 | false, |
| 111 | 111 | array( |
| 112 | 112 | ( bool ) current_user_can( $aTab[ 'capability' ] ), // whether the user has the sufficient capability level |
@@ -23,12 +23,12 @@ discard block |
||
| 23 | 23 | * @static |
| 24 | 24 | */ |
| 25 | 25 | static public $aStructure = array( |
| 26 | - 'src' => null, // (required, string) the source url or path |
|
| 26 | + 'src' => null, // (required, string) the source url or path |
|
| 27 | 27 | 'handle_id' => null, |
| 28 | 28 | 'dependencies' => array(), |
| 29 | - 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
| 30 | - 'translation' => array(), // only for scripts |
|
| 31 | - 'in_footer' => false, // only for scripts |
|
| 29 | + 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
| 30 | + 'translation' => array(), // only for scripts |
|
| 31 | + 'in_footer' => false, // only for scripts |
|
| 32 | 32 | // 'attributes' => null, // (optional, array) [3.3.0+] attributes array. `array( 'data-id' => '...' )` |
| 33 | 33 | ); |
| 34 | 34 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $_aParameters = func_get_args() + array( |
| 42 | 42 | $this->asSubject, |
| 43 | 43 | ); |
| 44 | - $this->asSubject = $_aParameters[ 0 ]; |
|
| 44 | + $this->asSubject = $_aParameters[ 0 ]; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | * @static |
| 24 | 24 | */ |
| 25 | 25 | static public $aStructure = array( |
| 26 | - 'src' => null, // (required, string) the source url or path |
|
| 27 | - 'handle_id' => null, // (optional, string) The handle ID of the stylesheet |
|
| 28 | - 'dependencies' => null, // (optional, array) The dependency array. |
|
| 29 | - 'version' => null, // (optional, string) The stylesheet version number. |
|
| 30 | - 'media' => null, // (optional, string) the description of the field which is inserted into the after the input field tag. |
|
| 26 | + 'src' => null, // (required, string) the source url or path |
|
| 27 | + 'handle_id' => null, // (optional, string) The handle ID of the stylesheet |
|
| 28 | + 'dependencies' => null, // (optional, array) The dependency array. |
|
| 29 | + 'version' => null, // (optional, string) The stylesheet version number. |
|
| 30 | + 'media' => null, // (optional, string) the description of the field which is inserted into the after the input field tag. |
|
| 31 | 31 | // 'attributes' => null, // (optional, array) [3.3.0+] attributes array. `array( 'data-id' => '...' )` |
| 32 | 32 | ); |
| 33 | 33 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $_aParameters = func_get_args() + array( |
| 41 | 41 | $this->asSubject, |
| 42 | 42 | ); |
| 43 | - $this->asSubject = $_aParameters[ 0 ]; |
|
| 43 | + $this->asSubject = $_aParameters[ 0 ]; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Represents the structure of the sub-field definition array. |
| 21 | - |
|
| 22 | 21 | */ |
| 23 | 22 | static public $aStructure = array( |
| 24 | 23 | ); |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | 'page_slug' => null, // (required) |
| 32 | 32 | 'type' => 'page', // this is used to compare with the link type. |
| 33 | 33 | 'title' => null, |
| 34 | - 'page_title' => null, // (optional) 3.3.0+ When the page title is different from the above 'title' argument, set this. |
|
| 35 | - 'menu_title' => null, // (optional) 3.3.0+ When the menu title is different from the above 'title' argument, set this. |
|
| 34 | + 'page_title' => null, // (optional) 3.3.0+ When the page title is different from the above 'title' argument, set this. |
|
| 35 | + 'menu_title' => null, // (optional) 3.3.0+ When the menu title is different from the above 'title' argument, set this. |
|
| 36 | 36 | 'screen_icon' => null, // this will become either href_icon_32x32 or screen_icon_id |
| 37 | 37 | 'capability' => null, |
| 38 | 38 | 'order' => null, |
@@ -123,12 +123,12 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $aSubMenuPage = $aSubMenuPage |
| 125 | 125 | + array( |
| 126 | - 'show_page_title' => $this->oFactory->oProp->bShowPageTitle, // boolean |
|
| 126 | + 'show_page_title' => $this->oFactory->oProp->bShowPageTitle, // boolean |
|
| 127 | 127 | 'show_page_heading_tabs' => $this->oFactory->oProp->bShowPageHeadingTabs, // boolean |
| 128 | - 'show_in_page_tabs' => $this->oFactory->oProp->bShowInPageTabs, // boolean |
|
| 129 | - 'in_page_tab_tag' => $this->oFactory->oProp->sInPageTabTag, // string |
|
| 130 | - 'page_heading_tab_tag' => $this->oFactory->oProp->sPageHeadingTabTag, // string |
|
| 131 | - 'capability' => $this->oFactory->oProp->sCapability, // 3.6.0+ |
|
| 128 | + 'show_in_page_tabs' => $this->oFactory->oProp->bShowInPageTabs, // boolean |
|
| 129 | + 'in_page_tab_tag' => $this->oFactory->oProp->sInPageTabTag, // string |
|
| 130 | + 'page_heading_tab_tag' => $this->oFactory->oProp->sPageHeadingTabTag, // string |
|
| 131 | + 'capability' => $this->oFactory->oProp->sCapability, // 3.6.0+ |
|
| 132 | 132 | ) |
| 133 | 133 | + self::$aStructure; |
| 134 | 134 | |
@@ -30,15 +30,15 @@ |
||
| 30 | 30 | 'page_slug' => null, |
| 31 | 31 | 'tab_slug' => null, |
| 32 | 32 | 'title' => null, |
| 33 | - 'order' => 10, // (integer) |
|
| 34 | - 'show_in_page_tab' => true, // 3.6.0+ (boolean) |
|
| 35 | - 'parent_tab_slug' => null, // this needs to be set if the above show_in_page_tab is false so that the framework can mark the parent tab to be active when the hidden page is accessed. |
|
| 36 | - 'url' => null, // 3.5.0+ This allows the user set custom link. |
|
| 37 | - 'disabled' => null, // 3.5.10+ (boolean) If true, the link will be unlinked. |
|
| 38 | - 'attributes' => null, // 3.5.10+ (array) Applies to the navigation tab bar element. |
|
| 39 | - 'capability' => null, // 3.6.0+ (string) |
|
| 40 | - 'if' => true, // 3.6.0+ (boolean) |
|
| 41 | - 'show_debug_info' => null, // 3.8.8+ (boolean, optional) Whether to show debug information. If not set, the existent `bShowDebugInfo` property value will be used. The initial value here is `null` as the default value will be assigned in the formatting method. |
|
| 33 | + 'order' => 10, // (integer) |
|
| 34 | + 'show_in_page_tab' => true, // 3.6.0+ (boolean) |
|
| 35 | + 'parent_tab_slug' => null, // this needs to be set if the above show_in_page_tab is false so that the framework can mark the parent tab to be active when the hidden page is accessed. |
|
| 36 | + 'url' => null, // 3.5.0+ This allows the user set custom link. |
|
| 37 | + 'disabled' => null, // 3.5.10+ (boolean) If true, the link will be unlinked. |
|
| 38 | + 'attributes' => null, // 3.5.10+ (array) Applies to the navigation tab bar element. |
|
| 39 | + 'capability' => null, // 3.6.0+ (string) |
|
| 40 | + 'if' => true, // 3.6.0+ (boolean) |
|
| 41 | + 'show_debug_info' => null, // 3.8.8+ (boolean, optional) Whether to show debug information. If not set, the existent `bShowDebugInfo` property value will be used. The initial value here is `null` as the default value will be assigned in the formatting method. |
|
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public $aDisallowedQueryKeys = array( |
| 219 | 219 | 'settings-updated', |
| 220 | - 'confirmation', // 3.3.0+ |
|
| 220 | + 'confirmation', // 3.3.0+ |
|
| 221 | 221 | 'field_errors' // 3.4.1+ |
| 222 | 222 | ); |
| 223 | 223 | |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | * Stores the cache lifetime of the transient used for the form options when the user passes an integer to the option key parameter. |
| 264 | 264 | * @since 3.5.9 |
| 265 | 265 | */ |
| 266 | - public $iOptionTransientDuration = 0; |
|
| 266 | + public $iOptionTransientDuration = 0; |
|
| 267 | 267 | |
| 268 | 268 | /** |
| 269 | 269 | * Constructs the instance of AdminPageFramework_Property_admin_page class object. |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | * @since 2.0.0 |
| 273 | 273 | * @since 2.1.5 The $oCaller parameter was added. |
| 274 | 274 | */ |
| 275 | - public function __construct( $oCaller, $sCallerPath, $sClassName, $aisOptionKey, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
| 275 | + public function __construct( $oCaller, $sCallerPath, $sClassName, $aisOptionKey, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
| 276 | 276 | |
| 277 | 277 | // 3.7.0+ This must be set before the parent constructor. As the form arguments array uses this value. |
| 278 | - $this->_sFormRegistrationHook = 'load_after_' . $sClassName; |
|
| 278 | + $this->_sFormRegistrationHook = 'load_after_'.$sClassName; |
|
| 279 | 279 | |
| 280 | 280 | parent::__construct( |
| 281 | 281 | $oCaller, |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | // The user want to save options in a transient. |
| 353 | 353 | if ( in_array( $_sType, array( 'integer' ) ) ) { |
| 354 | - return 'apf_' . md5( site_url() . '_' . $sClassName . '_' . get_current_user_id() ); |
|
| 354 | + return 'apf_'.md5( site_url().'_'.$sClassName.'_'.get_current_user_id() ); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | // Unknown type - maybe the user is trying to do something advanced. |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | protected function _isAdminPage() { |
| 380 | 380 | |
| 381 | - if ( ! is_admin() ) { |
|
| 381 | + if ( !is_admin() ) { |
|
| 382 | 382 | return false; |
| 383 | 383 | } |
| 384 | 384 | return isset( $_GET[ 'page' ] ); |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | case 'transient': |
| 419 | 419 | return $this->getAsArray( |
| 420 | 420 | $this->getTransient( |
| 421 | - $this->sOptionKey, // transient key |
|
| 421 | + $this->sOptionKey, // transient key |
|
| 422 | 422 | array() // default |
| 423 | 423 | ) |
| 424 | 424 | ); |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | * @since 3.1.1 Made it return a value. |
| 433 | 433 | * @return boolean True if saved; otherwise, false. |
| 434 | 434 | */ |
| 435 | - public function updateOption( $aOptions=null ) { |
|
| 435 | + public function updateOption( $aOptions = null ) { |
|
| 436 | 436 | |
| 437 | 437 | if ( $this->_bDisableSavingOptions ) { |
| 438 | 438 | return false; |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | ); |
| 461 | 461 | case 'transient': |
| 462 | 462 | return $this->setTransient( |
| 463 | - $this->sOptionKey, // transient key |
|
| 463 | + $this->sOptionKey, // transient key |
|
| 464 | 464 | $aOptions, |
| 465 | 465 | $this->iOptionTransientDuration |
| 466 | 466 | ); |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | * @since 2.1.0 Set the default value to the parameter and if the parameter value is empty, it applies the current $_GET[ 'page' ] value. |
| 476 | 476 | * @return boolean Returns true if it is of framework's added page; otherwise, false. |
| 477 | 477 | */ |
| 478 | - public function isPageAdded( $sPageSlug='' ) { |
|
| 478 | + public function isPageAdded( $sPageSlug = '' ) { |
|
| 479 | 479 | |
| 480 | 480 | $sPageSlug = trim( $sPageSlug ); |
| 481 | 481 | $sPageSlug = $sPageSlug |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | * @return string The found tab slug. An empty string if not found. |
| 513 | 513 | * @remark Do not return `null` when not found as some framework methods check the returned value with `isset()` and if null is given, `isset()` yields `false` while it does `true` for an empty string (''). |
| 514 | 514 | */ |
| 515 | - public function getCurrentTabSlug( $sCurrentPageSlug='' ) { |
|
| 515 | + public function getCurrentTabSlug( $sCurrentPageSlug = '' ) { |
|
| 516 | 516 | |
| 517 | 517 | // It is possible that the tab slug is not set if it is the default tab. |
| 518 | 518 | $_sTabSlug = $this->getElement( $this->aQuery, 'tab', '' ); |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | * |
| 533 | 533 | * @deprecated 3.5.3 |
| 534 | 534 | */ |
| 535 | - public function getCurrentTab( $sCurrentPageSlug='' ) { |
|
| 535 | + public function getCurrentTab( $sCurrentPageSlug = '' ) { |
|
| 536 | 536 | return $this->getCurrentTabSlug( $sCurrentPageSlug ); |
| 537 | 537 | } |
| 538 | 538 | |
@@ -547,11 +547,11 @@ discard block |
||
| 547 | 547 | */ |
| 548 | 548 | public function getDefaultInPageTab( $sPageSlug ) { |
| 549 | 549 | |
| 550 | - if ( ! $sPageSlug ) { |
|
| 550 | + if ( !$sPageSlug ) { |
|
| 551 | 551 | return ''; |
| 552 | 552 | } |
| 553 | 553 | return $this->getElement( |
| 554 | - $this->aDefaultInPageTabs, // subject array |
|
| 554 | + $this->aDefaultInPageTabs, // subject array |
|
| 555 | 555 | $sPageSlug, // key |
| 556 | 556 | '' // default |
| 557 | 557 | ); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @since 3.3.0 |
| 59 | 59 | * @since 3.3.1 Moved from `AdminPageFramework_Setting_Base`. |
| 60 | 60 | */ |
| 61 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
| 61 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
| 62 | 62 | |
| 63 | 63 | parent::__construct( $sOptionKey, $sCallerPath, $sCapability, $sTextDomain ); |
| 64 | 64 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | // if ( $this->oProp->bIsAdminAjax ) { |
| 67 | 67 | // return; |
| 68 | 68 | // } |
| 69 | - if ( ! $this->oProp->bIsAdmin ) { |
|
| 69 | + if ( !$this->oProp->bIsAdmin ) { |
|
| 70 | 70 | return; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | 'section_title' => null, |
| 117 | 117 | 'section_id' => null, |
| 118 | 118 | ); |
| 119 | - if ( ! $aFieldset[ 'help' ] ) { |
|
| 119 | + if ( !$aFieldset[ 'help' ] ) { |
|
| 120 | 120 | return; |
| 121 | 121 | } |
| 122 | 122 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | 'help_tab_id' => $_sRootSectionID, |
| 135 | 135 | 'help_tab_content' => "<span class='contextual-help-tab-title'>" |
| 136 | 136 | . $aFieldset[ 'title' ] |
| 137 | - . "</span> - " . PHP_EOL |
|
| 137 | + . "</span> - ".PHP_EOL |
|
| 138 | 138 | . $aFieldset[ 'help' ], |
| 139 | 139 | 'help_tab_sidebar_content' => $aFieldset[ 'help_aside' ] |
| 140 | 140 | ? $aFieldset[ 'help_aside' ] |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | public function _registerHelpPaneItemsOfFormSections( $aSectionsets ) { |
| 169 | 169 | // @todo Test if help pane item gets displayed |
| 170 | 170 | |
| 171 | - foreach( $aSectionsets as $_aSectionset ) { |
|
| 171 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
| 172 | 172 | // @todo check capability and conditions |
| 173 | 173 | $_aSectionset = $_aSectionset + array( |
| 174 | 174 | 'help' => null, |
@@ -202,13 +202,13 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function _replyToDetermineSectionsetVisibility( $bVisible, $aSectionset ) { |
| 204 | 204 | |
| 205 | - if ( ! current_user_can( $aSectionset[ 'capability' ] ) ) { |
|
| 205 | + if ( !current_user_can( $aSectionset[ 'capability' ] ) ) { |
|
| 206 | 206 | return false; |
| 207 | 207 | } |
| 208 | - if ( ! $aSectionset[ 'if' ] ) { |
|
| 208 | + if ( !$aSectionset[ 'if' ] ) { |
|
| 209 | 209 | return false; |
| 210 | 210 | } |
| 211 | - if ( ! $this->_isSectionOfCurrentPage( $aSectionset ) ) { |
|
| 211 | + if ( !$this->_isSectionOfCurrentPage( $aSectionset ) ) { |
|
| 212 | 212 | return false; |
| 213 | 213 | } |
| 214 | 214 | return $bVisible; |
@@ -226,15 +226,15 @@ discard block |
||
| 226 | 226 | private function _isSectionOfCurrentPage( array $aSectionset ) { |
| 227 | 227 | |
| 228 | 228 | // Make sure the value type is string so that when the page_slug is not set, it won't match. |
| 229 | - $_sCurrentPageSlug = ( string ) $this->oProp->getCurrentPageSlug(); |
|
| 229 | + $_sCurrentPageSlug = ( string ) $this->oProp->getCurrentPageSlug(); |
|
| 230 | 230 | |
| 231 | 231 | // Make sure if it's in the loading page. |
| 232 | - if ( $aSectionset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
| 232 | + if ( $aSectionset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
| 233 | 233 | return false; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | // If no tag is specified, the user wants to display the section regardless of the tab. |
| 237 | - if ( ! $aSectionset[ 'tab_slug' ] ) { |
|
| 237 | + if ( !$aSectionset[ 'tab_slug' ] ) { |
|
| 238 | 238 | return true; |
| 239 | 239 | } |
| 240 | 240 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public function _replyToDetermineFieldsetVisibility( $bVisible, $aFieldset ) { |
| 252 | 252 | |
| 253 | - $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
|
| 253 | + $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
|
| 254 | 254 | |
| 255 | 255 | // If the specified field does not exist, do nothing. |
| 256 | 256 | if ( $aFieldset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | array( $_sSectionPath, 'page_slug' ), |
| 281 | 281 | $this->oProp->getCurrentPageSlugIfAdded() |
| 282 | 282 | ); |
| 283 | - $aFieldset[ 'tab_slug' ] = $this->oUtil->getElement( |
|
| 283 | + $aFieldset[ 'tab_slug' ] = $this->oUtil->getElement( |
|
| 284 | 284 | $aSectionsets, |
| 285 | 285 | array( $_sSectionPath, 'tab_slug' ), |
| 286 | 286 | $this->oProp->getCurrentInPageTabSlugIfAdded() |
@@ -291,11 +291,11 @@ discard block |
||
| 291 | 291 | $aSectionsets, |
| 292 | 292 | $_sSectionPath |
| 293 | 293 | ); |
| 294 | - $aFieldset[ 'section_title' ] = $this->oUtil->getElement( |
|
| 294 | + $aFieldset[ 'section_title' ] = $this->oUtil->getElement( |
|
| 295 | 295 | $_aSectionset, |
| 296 | 296 | 'title' |
| 297 | 297 | ); |
| 298 | - $aFieldset[ 'capability' ] = $aFieldset[ 'capability' ] |
|
| 298 | + $aFieldset[ 'capability' ] = $aFieldset[ 'capability' ] |
|
| 299 | 299 | ? $aFieldset[ 'capability' ] |
| 300 | 300 | : $this->_replyToGetCapabilityForForm( |
| 301 | 301 | $this->oUtil->getElement( $_aSectionset, 'capability' ), |
@@ -345,13 +345,13 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | // Find the capability of the parent section if nested. |
| 347 | 347 | if ( 0 < $aSectionset[ '_nested_depth' ] ) { |
| 348 | - $_aSectionPath = $aSectionset[ '_section_path_array' ]; |
|
| 348 | + $_aSectionPath = $aSectionset[ '_section_path_array' ]; |
|
| 349 | 349 | array_pop( $_aSectionPath ); // remove the last element |
| 350 | 350 | $_sParentCapability = $this->oUtil->getElement( |
| 351 | 351 | $this->oForm->aSectionsets, |
| 352 | 352 | array_merge( $_aSectionPath, array( 'capability' ) ) |
| 353 | 353 | ); |
| 354 | - if( $_sParentCapability ) { |
|
| 354 | + if ( $_sParentCapability ) { |
|
| 355 | 355 | return $_sParentCapability; |
| 356 | 356 | } |
| 357 | 357 | } |