@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @since 3.7.0 |
| 94 | 94 | * @return array The modified section-sets definition array. |
| 95 | 95 | */ |
| 96 | - public function _replyToModifySectionsets( $aSectionsets ) { |
|
| 96 | + public function _replyToModifySectionsets( $aSectionsets ) { |
|
| 97 | 97 | |
| 98 | 98 | return $this->oUtil->addAndApplyFilter( |
| 99 | 99 | $this, // caller factory object |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | * An alias of `_setLastInputs()`. |
| 365 | 365 | * @deprecated 3.7.0 |
| 366 | 366 | */ |
| 367 | - public function _setLastInput( $aLastInputs ) { |
|
| 367 | + public function _setLastInput( $aLastInputs ) { |
|
| 368 | 368 | return $this->setLastInputs( $aLastInputs ); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | add_filter( |
| 33 | 33 | // 'field_types_admin_page_framework', |
| 34 | - 'field_types_' . $oProp->sClassName, |
|
| 34 | + 'field_types_'.$oProp->sClassName, |
|
| 35 | 35 | array( $this, '_replyToFilterFieldTypeDefinitions' ) |
| 36 | 36 | ); |
| 37 | 37 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | 'title' => null, |
| 54 | 54 | 'help_aside' => null, |
| 55 | 55 | ); |
| 56 | - if ( ! $aFieldset[ 'help' ] ) { |
|
| 56 | + if ( !$aFieldset[ 'help' ] ) { |
|
| 57 | 57 | return; |
| 58 | 58 | } |
| 59 | 59 | $this->oHelpPane->_addHelpTextForFormFields( |
@@ -73,9 +73,9 @@ discard block |
||
| 73 | 73 | public function _replyToFilterFieldTypeDefinitions( $aFieldTypeDefinitions ) { |
| 74 | 74 | |
| 75 | 75 | // Not triggering `__call()` as the filter is fired manually in the form class. |
| 76 | - if ( method_exists( $this, 'field_types_' . $this->oProp->sClassName ) ) { |
|
| 76 | + if ( method_exists( $this, 'field_types_'.$this->oProp->sClassName ) ) { |
|
| 77 | 77 | return call_user_func_array( |
| 78 | - array( $this, 'field_types_' . $this->oProp->sClassName ), |
|
| 78 | + array( $this, 'field_types_'.$this->oProp->sClassName ), |
|
| 79 | 79 | array( $aFieldTypeDefinitions ) |
| 80 | 80 | ); |
| 81 | 81 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | public function _replyToModifySectionsets( $aSectionsets ) { |
| 97 | 97 | |
| 98 | 98 | return $this->oUtil->addAndApplyFilter( |
| 99 | - $this, // caller factory object |
|
| 99 | + $this, // caller factory object |
|
| 100 | 100 | "sections_{$this->oProp->sClassName}", |
| 101 | 101 | $aSectionsets |
| 102 | 102 | ); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | public function _replyToModifyFieldsets( $aFieldsets, $aSectionsets ) { |
| 117 | 117 | |
| 118 | 118 | // Apply filters to added field-sets |
| 119 | - foreach( $aFieldsets as $_sSectionPath => $_aFields ) { |
|
| 119 | + foreach ( $aFieldsets as $_sSectionPath => $_aFields ) { |
|
| 120 | 120 | $_aSectionPath = explode( '|', $_sSectionPath ); |
| 121 | 121 | $_sFilterSuffix = implode( '_', $_aSectionPath ); |
| 122 | 122 | $aFieldsets[ $_sSectionPath ] = $this->oUtil->addAndApplyFilter( |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $_aFields |
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | - $aFieldsets = $this->oUtil->addAndApplyFilter( |
|
| 128 | + $aFieldsets = $this->oUtil->addAndApplyFilter( |
|
| 129 | 129 | $this, |
| 130 | 130 | "fields_{$this->oProp->sClassName}", |
| 131 | 131 | $aFieldsets |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | private function _getHookNameByFieldsetAndPrefix( $sPrefix, $aFieldset ) { |
| 197 | 197 | |
| 198 | - $_sFieldPart = '_' . implode( '_', $aFieldset[ '_field_path_array' ] ); |
|
| 198 | + $_sFieldPart = '_'.implode( '_', $aFieldset[ '_field_path_array' ] ); |
|
| 199 | 199 | $_sSectionPart = implode( '_', $aFieldset[ '_section_path_array' ] ); |
| 200 | 200 | $_sSectionPart = $this->oUtil->getAOrB( |
| 201 | 201 | '_default' === $_sSectionPart, |
| 202 | 202 | '', |
| 203 | - '_' . $_sSectionPart |
|
| 203 | + '_'.$_sSectionPart |
|
| 204 | 204 | ); |
| 205 | - return $sPrefix . $this->oProp->sClassName . $_sSectionPart . $_sFieldPart; |
|
| 205 | + return $sPrefix.$this->oProp->sClassName.$_sSectionPart.$_sFieldPart; |
|
| 206 | 206 | |
| 207 | 207 | } |
| 208 | 208 | |
@@ -272,9 +272,9 @@ discard block |
||
| 272 | 272 | public function _replyToGetSavedFormData() { |
| 273 | 273 | |
| 274 | 274 | // Must update the property with the filtered value. |
| 275 | - $this->oProp->aOptions = $this->oUtil->addAndApplyFilter( |
|
| 275 | + $this->oProp->aOptions = $this->oUtil->addAndApplyFilter( |
|
| 276 | 276 | $this, // the caller factory object |
| 277 | - 'options_' . $this->oProp->sClassName, |
|
| 277 | + 'options_'.$this->oProp->sClassName, |
|
| 278 | 278 | $this->oProp->aOptions // subject value to be filtered |
| 279 | 279 | ); |
| 280 | 280 | return $this->oProp->aOptions; |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | * An alias of `_setLastInputs()`. |
| 365 | 365 | * @deprecated 3.7.0 |
| 366 | 366 | */ |
| 367 | - public function _setLastInput( $aLastInputs ) { |
|
| 367 | + public function _setLastInput( $aLastInputs ) { |
|
| 368 | 368 | return $this->setLastInputs( $aLastInputs ); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function _replyToRegisterHelpTabText() { |
| 30 | 30 | |
| 31 | 31 | // Check if the currently loaded page is of meta box page. |
| 32 | - if ( ! $this->oProp->oCaller->isInThePage() ) { |
|
| 32 | + if ( !$this->oProp->oCaller->isInThePage() ) { |
|
| 33 | 33 | return false; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @since 3.7.0 |
| 31 | 31 | */ |
| 32 | 32 | public function add( $sCSSRules ) { |
| 33 | - $this->aAdded[] = $sCSSRules; |
|
| 33 | + $this->aAdded[ ] = $sCSSRules; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function get() { |
| 41 | 41 | |
| 42 | - $_sCSSRules = $this->_get() . PHP_EOL; |
|
| 42 | + $_sCSSRules = $this->_get().PHP_EOL; |
|
| 43 | 43 | $_sCSSRules .= $this->_getVersionSpecific(); |
| 44 | 44 | $_sCSSRules .= implode( PHP_EOL, $this->aAdded ); |
| 45 | 45 | return $_sCSSRules; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * @return string The generated field name model. |
| 35 | 35 | */ |
| 36 | 36 | public function getModel() { |
| 37 | - return $this->get() . '|' . $this->sIndexMark; |
|
| 37 | + return $this->get().'|'.$this->sIndexMark; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | return $_sResult; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function getModel() { |
|
| 29 | + public function getModel() { |
|
| 30 | 30 | return $this->get() . '[' . $this->sIndexMark . ']'; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | return $_sResult; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public function getModel() { |
|
| 29 | - return $this->get() . '[' . $this->sIndexMark . ']'; |
|
| 28 | + public function getModel() { |
|
| 29 | + return $this->get().'['.$this->sIndexMark.']'; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | protected function _getFieldName() { |
| 36 | 36 | |
| 37 | - $_aFieldPath = $this->aArguments[ '_field_path_array' ]; |
|
| 38 | - if ( ! $this->_isSectionSet() ) { |
|
| 37 | + $_aFieldPath = $this->aArguments[ '_field_path_array' ]; |
|
| 38 | + if ( !$this->_isSectionSet() ) { |
|
| 39 | 39 | return $this->_getInputNameConstructed( $_aFieldPath ); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $_aSectionPath = $this->aArguments[ '_section_path_array' ]; |
| 43 | 43 | if ( $this->_isSectionSet() && isset( $this->aArguments[ '_section_index' ] ) ) { |
| 44 | - $_aSectionPath[] = $this->aArguments[ '_section_index' ]; |
|
| 44 | + $_aSectionPath[ ] = $this->aArguments[ '_section_index' ]; |
|
| 45 | 45 | } |
| 46 | 46 | $_sFieldName = $this->_getInputNameConstructed( |
| 47 | 47 | array_merge( $_aSectionPath, $_aFieldPath ) |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @since 3.7.0 Changed the name from `AdminPageFramework_FormPart_SectionTitle`. |
| 16 | 16 | * @internal |
| 17 | 17 | */ |
| 18 | -class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
|
| 18 | +class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
|
| 19 | 19 | |
| 20 | 20 | public $aArguments = array( |
| 21 | 21 | 'title' => null, |
@@ -194,11 +194,11 @@ discard block |
||
| 194 | 194 | * @since 3.8.0 |
| 195 | 195 | * @internal |
| 196 | 196 | */ |
| 197 | - private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
| 197 | + private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
| 198 | 198 | |
| 199 | 199 | $_sOutput = ''; |
| 200 | 200 | foreach( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
| 201 | - if ( empty( $_aFieldset ) ) { |
|
| 201 | + if ( empty( $_aFieldset ) ) { |
|
| 202 | 202 | continue; |
| 203 | 203 | } |
| 204 | 204 | $_sOutput .= $this->getFieldsetOutput( $_aFieldset ); |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_SectionTitle`. |
| 243 | 243 | * @return array|void |
| 244 | 244 | */ |
| 245 | - private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
| 245 | + private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
| 246 | 246 | |
| 247 | 247 | foreach( $aFieldsets as $_aFieldset ) { |
| 248 | 248 | |
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
| 19 | 19 | |
| 20 | - public $aArguments = array( |
|
| 20 | + public $aArguments = array( |
|
| 21 | 21 | 'title' => null, |
| 22 | 22 | 'tag' => null, |
| 23 | 23 | 'section_index' => null, |
| 24 | 24 | |
| 25 | 25 | 'sectionset' => array(), |
| 26 | 26 | ); |
| 27 | - public $aFieldsets = array(); |
|
| 27 | + public $aFieldsets = array(); |
|
| 28 | 28 | public $aSavedData = array(); |
| 29 | 29 | public $aFieldErrors = array(); |
| 30 | 30 | public $aFieldTypeDefinitions = array(); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_SectionTitle`. |
| 91 | 91 | * @return string The section title output. |
| 92 | 92 | */ |
| 93 | - protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex=null, $aFieldTypeDefinitions=array(), $aCollapsible=array() ) { |
|
| 93 | + protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex = null, $aFieldTypeDefinitions = array(), $aCollapsible = array() ) { |
|
| 94 | 94 | |
| 95 | 95 | $_aSectionTitleFieldset = $this->_getSectionTitleField( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
| 96 | 96 | $_sFieldsInSectionTitle = $this->_getFieldsetsOutputInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $_bHasOtherFields = $_sFieldsInSectionTitle |
| 101 | 101 | ? ' has-fields' |
| 102 | 102 | : ''; |
| 103 | - $_sOutput = $_sTitle . $_sFieldsInSectionTitle; |
|
| 103 | + $_sOutput = $_sTitle.$_sFieldsInSectionTitle; |
|
| 104 | 104 | return $_sOutput |
| 105 | 105 | ? "<div class='section-title-height-fixer'></div>" |
| 106 | 106 | . "<div class='section-title-outer-container'>" // 3.8.13+ For vertical alignment |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * @return string |
| 129 | 129 | */ |
| 130 | 130 | private function _getToolTip( $_aSectionset ) { |
| 131 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $this->aArguments[ 'section_index' ]; |
|
| 131 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$this->aArguments[ 'section_index' ]; |
|
| 132 | 132 | $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
| 133 | 133 | $_aSectionset[ 'tip' ], |
| 134 | 134 | $_sSectionTitleTagID |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
| 161 | 161 | |
| 162 | 162 | $_sOutput = ''; |
| 163 | - foreach( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
|
| 164 | - if ( empty( $_aFieldset ) ) { |
|
| 163 | + foreach ( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
|
| 164 | + if ( empty( $_aFieldset ) ) { |
|
| 165 | 165 | continue; |
| 166 | 166 | } |
| 167 | 167 | $_sOutput .= $this->getFieldsetOutput( $_aFieldset ); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | private function _getFieldsetsInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
| 178 | 178 | |
| 179 | 179 | $_aFieldsetsInSectionTitle = array(); |
| 180 | - foreach( $aFieldsets as $_aFieldset ) { |
|
| 180 | + foreach ( $aFieldsets as $_aFieldset ) { |
|
| 181 | 181 | |
| 182 | 182 | if ( 'section_title' !== $_aFieldset[ 'placement' ] ) { |
| 183 | 183 | continue; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $iSectionIndex, |
| 189 | 189 | $aFieldTypeDefinitions |
| 190 | 190 | ); |
| 191 | - $_aFieldsetsInSectionTitle[] = $_oFieldsetOutputFormatter->get(); |
|
| 191 | + $_aFieldsetsInSectionTitle[ ] = $_oFieldsetOutputFormatter->get(); |
|
| 192 | 192 | |
| 193 | 193 | } |
| 194 | 194 | return $_aFieldsetsInSectionTitle; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
| 209 | 209 | |
| 210 | - foreach( $aFieldsets as $_aFieldset ) { |
|
| 210 | + foreach ( $aFieldsets as $_aFieldset ) { |
|
| 211 | 211 | |
| 212 | 212 | if ( 'section_title' !== $_aFieldset[ 'type' ] ) { |
| 213 | 213 | continue; |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | private function ___setFieldResourcesBySection( $_aFieldsets ) { |
| 130 | 130 | |
| 131 | 131 | $_bIsSubSectionLoaded = false; |
| 132 | - foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
| 132 | + foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
| 133 | 133 | // @todo Examine if this structure is correct or not. |
| 134 | 134 | // It may not be necessary to check the sub-section dimensions as this is not the saved options array. |
| 135 | 135 | // if it's a sub-section |
@@ -105,26 +105,26 @@ discard block |
||
| 105 | 105 | 'ajaxURL' => admin_url( 'admin-ajax.php' ), |
| 106 | 106 | 'spinnerURL' => admin_url( 'images/loading.gif' ), |
| 107 | 107 | ); |
| 108 | - $this->aResources[ 'src_scripts' ][] = array( |
|
| 108 | + $this->aResources[ 'src_scripts' ][ ] = array( |
|
| 109 | 109 | 'handle_id' => 'admin-page-framework-script-form-main', |
| 110 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/js/form.bundle.js', |
|
| 110 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/js/form.bundle.js', |
|
| 111 | 111 | 'dependencies' => array( 'jquery', 'wp-pointer', 'jquery-ui-sortable' ), |
| 112 | 112 | 'in_footer' => true, |
| 113 | 113 | 'version' => AdminPageFramework_Registry::VERSION, |
| 114 | 114 | 'translation' => $_aData, |
| 115 | 115 | 'translation_var' => 'AdminPageFrameworkScriptFormMain', |
| 116 | 116 | ); |
| 117 | - $this->aResources[ 'register' ][ 'scripts' ][] = array( |
|
| 117 | + $this->aResources[ 'register' ][ 'scripts' ][ ] = array( |
|
| 118 | 118 | 'handle_id' => 'admin-page-framework-script-form-collapsible-sections', |
| 119 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/js/form-collapsible-sections.js', |
|
| 119 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/js/form-collapsible-sections.js', |
|
| 120 | 120 | 'dependencies' => array( 'jquery', 'jquery-ui-accordion', 'admin-page-framework-script-form-main' ), |
| 121 | 121 | 'in_footer' => true, |
| 122 | 122 | 'version' => AdminPageFramework_Registry::VERSION, |
| 123 | 123 | ); |
| 124 | 124 | if ( function_exists( 'wp_enqueue_media' ) ) { |
| 125 | - $this->aResources[ 'register' ][ 'scripts' ][] = array( |
|
| 125 | + $this->aResources[ 'register' ][ 'scripts' ][ ] = array( |
|
| 126 | 126 | 'handle_id' => 'admin-page-framework-script-form-media-uploader', |
| 127 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/js/form-media-uploader.js', |
|
| 127 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/js/form-media-uploader.js', |
|
| 128 | 128 | 'dependencies' => array( 'jquery', 'admin-page-framework-script-form-main' ), |
| 129 | 129 | 'in_footer' => false, |
| 130 | 130 | 'version' => AdminPageFramework_Registry::VERSION, |
@@ -145,16 +145,16 @@ discard block |
||
| 145 | 145 | * @since 3.9.0 |
| 146 | 146 | */ |
| 147 | 147 | private function ___setCommonFormExternalStylesheets() { |
| 148 | - $this->aResources[ 'src_styles' ][] = array( |
|
| 148 | + $this->aResources[ 'src_styles' ][ ] = array( |
|
| 149 | 149 | 'handle_id' => 'admin-page-framework-form', |
| 150 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/css/form/form.css', |
|
| 150 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/css/form/form.css', |
|
| 151 | 151 | ); |
| 152 | - $this->aResources[ 'src_styles' ][] = array( |
|
| 152 | + $this->aResources[ 'src_styles' ][ ] = array( |
|
| 153 | 153 | 'handle_id' => 'admin-page-framework-form-ie', |
| 154 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/css/form_ie/form_ie.css', |
|
| 154 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/css/form_ie/form_ie.css', |
|
| 155 | 155 | 'conditional' => 'IE', |
| 156 | 156 | ); |
| 157 | - $this->aResources[ 'src_styles' ][] = array( |
|
| 157 | + $this->aResources[ 'src_styles' ][ ] = array( |
|
| 158 | 158 | 'handle_id' => 'wp-pointer', |
| 159 | 159 | ); |
| 160 | 160 | |
@@ -162,32 +162,32 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | // WordPress 5.3 or above |
| 164 | 164 | if ( version_compare( $GLOBALS[ 'wp_version' ], '5.3', '>=' ) ) { |
| 165 | - $this->aResources[ 'src_styles' ][] = array( |
|
| 165 | + $this->aResources[ 'src_styles' ][ ] = array( |
|
| 166 | 166 | 'handle_id' => 'admin-page-framework-form-5_3-or-above', |
| 167 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/css/form_5_3_or_above/form_5_3_or_above.css', |
|
| 167 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/css/form_5_3_or_above/form_5_3_or_above.css', |
|
| 168 | 168 | ); |
| 169 | 169 | } |
| 170 | 170 | // WordPress 4.7 or above |
| 171 | 171 | if ( version_compare( $GLOBALS[ 'wp_version' ], '4.7', '>=' ) ) { |
| 172 | - $this->aResources[ 'src_styles' ][] = array( |
|
| 172 | + $this->aResources[ 'src_styles' ][ ] = array( |
|
| 173 | 173 | 'handle_id' => 'admin-page-framework-form-4_7-or-above', |
| 174 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/css/form_4_7_or_above/form_4_7_or_above.css', |
|
| 174 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/css/form_4_7_or_above/form_4_7_or_above.css', |
|
| 175 | 175 | ); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | // WordPress below 3.8 |
| 179 | 179 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '<' ) ) { |
| 180 | - $this->aResources[ 'src_styles' ][] = array( |
|
| 180 | + $this->aResources[ 'src_styles' ][ ] = array( |
|
| 181 | 181 | 'handle_id' => 'admin-page-framework-form-4_8-below', |
| 182 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/css/form_3_8_below/form_3_8_below.css', |
|
| 182 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/css/form_3_8_below/form_3_8_below.css', |
|
| 183 | 183 | ); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | // WordPress 3.8 or above |
| 187 | 187 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
| 188 | - $this->aResources[ 'src_styles' ][] = array( |
|
| 188 | + $this->aResources[ 'src_styles' ][ ] = array( |
|
| 189 | 189 | 'handle_id' => 'admin-page-framework-form-3_8-or-above', |
| 190 | - 'src' => AdminPageFramework_Registry::$sDirPath . '/factory/_common/form/asset/css/form_3_8_or_above/form_3_8_or_above.css', |
|
| 190 | + 'src' => AdminPageFramework_Registry::$sDirPath.'/factory/_common/form/asset/css/form_3_8_or_above/form_3_8_or_above.css', |
|
| 191 | 191 | ); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * @return void |
| 207 | 207 | */ |
| 208 | 208 | private function ___set( $aAllFieldsets ) { |
| 209 | - foreach( $aAllFieldsets as $_aFieldsets ) { |
|
| 209 | + foreach ( $aAllFieldsets as $_aFieldsets ) { |
|
| 210 | 210 | $this->___setFieldResourcesBySection( $_aFieldsets ); |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | private function ___setFieldResourcesBySection( $_aFieldsets ) { |
| 219 | 219 | |
| 220 | 220 | $_bIsSubSectionLoaded = false; |
| 221 | - foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
| 221 | + foreach ( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
| 222 | 222 | // @todo Examine if this structure is correct or not. |
| 223 | 223 | // It may not be necessary to check the sub-section dimensions as this is not the saved options array. |
| 224 | 224 | // if it's a sub-section |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | continue; |
| 230 | 230 | } |
| 231 | 231 | $_bIsSubSectionLoaded = true; |
| 232 | - foreach( $_aSubSectionOrField as $_aField ) { |
|
| 232 | + foreach ( $_aSubSectionOrField as $_aField ) { |
|
| 233 | 233 | $this->___setFieldResources( $_aField ); |
| 234 | 234 | } |
| 235 | 235 | continue; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | private function ___setFieldResources( $aFieldset ) { |
| 255 | 255 | |
| 256 | 256 | // Check the field conditions. |
| 257 | - if ( ! $this->___isFieldsetAllowed( $aFieldset ) ) { |
|
| 257 | + if ( !$this->___isFieldsetAllowed( $aFieldset ) ) { |
|
| 258 | 258 | return; |
| 259 | 259 | } |
| 260 | 260 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | return $this->callBack( |
| 286 | 286 | $this->aCallbacks[ 'is_fieldset_registration_allowed' ], |
| 287 | 287 | array( |
| 288 | - true, // 1st parameter |
|
| 288 | + true, // 1st parameter |
|
| 289 | 289 | $aFieldset, // 2nd parameter |
| 290 | 290 | ) |
| 291 | 291 | ); |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | private function ___setResourcesOfNestedFields( $aFieldset ) { |
| 299 | 299 | |
| 300 | - if ( ! $this->hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
| 300 | + if ( !$this->hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
| 301 | 301 | return; |
| 302 | 302 | } |
| 303 | 303 | foreach ( $aFieldset[ 'content' ] as $_asNestedFieldset ) { |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $this->callBack( |
| 338 | 338 | $this->aCallbacks[ 'load_fieldset_resource' ], |
| 339 | 339 | array( |
| 340 | - $aFieldset, // 1st parameter |
|
| 340 | + $aFieldset, // 1st parameter |
|
| 341 | 341 | ) |
| 342 | 342 | ); |
| 343 | 343 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | // Be careful not to add duplicate items as currently the sub-field items are parsed. |
| 346 | 346 | |
| 347 | 347 | // Is already registered? |
| 348 | - if ( $this->hasBeenCalled( 'registered_' . $_sFieldtype . '_' . $this->aArguments[ 'structure_type' ] ) ) { |
|
| 348 | + if ( $this->hasBeenCalled( 'registered_'.$_sFieldtype.'_'.$this->aArguments[ 'structure_type' ] ) ) { |
|
| 349 | 349 | return; |
| 350 | 350 | } |
| 351 | 351 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $_aFieldTypeDefinition, |
| 361 | 361 | $this->aResources |
| 362 | 362 | ); |
| 363 | - $this->aResources = $_oFieldTypeResources->get(); |
|
| 363 | + $this->aResources = $_oFieldTypeResources->get(); |
|
| 364 | 364 | |
| 365 | 365 | } |
| 366 | 366 | |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | $this->oProp->aPluginTitleLinks = array_merge( |
| 91 | 91 | $this->oProp->aPluginTitleLinks, |
| 92 | 92 | $asLinks |
| 93 | - ); |
|
| 93 | + ); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $this->_addFilterHook_PluginTitleActionLink(); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function _replyToSetFooterInfo() { |
| 38 | 38 | |
| 39 | - if ( ! $this->oProp->isPageAdded() ) { |
|
| 39 | + if ( !$this->oProp->isPageAdded() ) { |
|
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 | parent::_replyToSetFooterInfo(); |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function _addLinkToPluginDescription( $asLinks ) { |
| 58 | 58 | |
| 59 | - if ( ! is_array( $asLinks ) ) { |
|
| 60 | - $this->oProp->aPluginDescriptionLinks[] = $asLinks; |
|
| 59 | + if ( !is_array( $asLinks ) ) { |
|
| 60 | + $this->oProp->aPluginDescriptionLinks[ ] = $asLinks; |
|
| 61 | 61 | } else { |
| 62 | 62 | $this->oProp->aPluginDescriptionLinks = array_merge( |
| 63 | 63 | $this->oProp->aPluginDescriptionLinks, |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function _addLinkToPluginTitle( $asLinks ) { |
| 86 | 86 | |
| 87 | - if ( ! is_array( $asLinks ) ) { |
|
| 88 | - $this->oProp->aPluginTitleLinks[] = $asLinks; |
|
| 87 | + if ( !is_array( $asLinks ) ) { |
|
| 88 | + $this->oProp->aPluginTitleLinks[ ] = $asLinks; |
|
| 89 | 89 | } else { |
| 90 | 90 | $this->oProp->aPluginTitleLinks = array_merge( |
| 91 | 91 | $this->oProp->aPluginTitleLinks, |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | $_sPluginBaseName = plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ); |
| 122 | 122 | add_filter( |
| 123 | - $this->_sFilterSuffix_PluginActionLinks . $_sPluginBaseName, |
|
| 123 | + $this->_sFilterSuffix_PluginActionLinks.$_sPluginBaseName, |
|
| 124 | 124 | array( $this, '_replyToAddPluginActionLinks' ) |
| 125 | 125 | ); |
| 126 | 126 | } |
@@ -133,14 +133,14 @@ discard block |
||
| 133 | 133 | * @return string |
| 134 | 134 | * @internal |
| 135 | 135 | */ |
| 136 | - public function _replyToAddInfoInFooterLeft( $sLinkHTML='' ) { |
|
| 136 | + public function _replyToAddInfoInFooterLeft( $sLinkHTML = '' ) { |
|
| 137 | 137 | |
| 138 | - if ( ! $this->_isPageAdded() ) { |
|
| 138 | + if ( !$this->_isPageAdded() ) { |
|
| 139 | 139 | return $sLinkHTML; // $sLinkHTML is given by the hook. |
| 140 | 140 | } |
| 141 | - $sLinkHTML = empty( $this->oProp->aScriptInfo['sName'] ) |
|
| 141 | + $sLinkHTML = empty( $this->oProp->aScriptInfo[ 'sName' ] ) |
|
| 142 | 142 | ? $sLinkHTML |
| 143 | - : $this->oProp->aFooterInfo['sLeft']; |
|
| 143 | + : $this->oProp->aFooterInfo[ 'sLeft' ]; |
|
| 144 | 144 | |
| 145 | 145 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
| 146 | 146 | $_sTabSlug = $this->oProp->getCurrentTabSlug(); |
@@ -151,11 +151,11 @@ discard block |
||
| 151 | 151 | array( |
| 152 | 152 | $this->getAOrB( |
| 153 | 153 | $_sTabSlug, |
| 154 | - 'footer_left_' . $_sPageSlug . '_' . $_sTabSlug, |
|
| 154 | + 'footer_left_'.$_sPageSlug.'_'.$_sTabSlug, |
|
| 155 | 155 | null // will be ignored |
| 156 | 156 | ), |
| 157 | - 'footer_left_' . $_sPageSlug, |
|
| 158 | - 'footer_left_' . $this->oProp->sClassName |
|
| 157 | + 'footer_left_'.$_sPageSlug, |
|
| 158 | + 'footer_left_'.$this->oProp->sClassName |
|
| 159 | 159 | ), |
| 160 | 160 | $sLinkHTML |
| 161 | 161 | ); |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | * @return string |
| 170 | 170 | * @internal |
| 171 | 171 | */ |
| 172 | - public function _replyToAddInfoInFooterRight( $sLinkHTML='' ) { |
|
| 172 | + public function _replyToAddInfoInFooterRight( $sLinkHTML = '' ) { |
|
| 173 | 173 | |
| 174 | - if ( ! $this->_isPageAdded() ) { |
|
| 174 | + if ( !$this->_isPageAdded() ) { |
|
| 175 | 175 | return $sLinkHTML; // $sLinkTHML is given by the hook. |
| 176 | 176 | } |
| 177 | 177 | |
@@ -184,13 +184,13 @@ discard block |
||
| 184 | 184 | array( |
| 185 | 185 | $this->getAOrB( |
| 186 | 186 | $_sTabSlug, |
| 187 | - 'footer_right_' . $_sPageSlug . '_' . $_sTabSlug, |
|
| 187 | + 'footer_right_'.$_sPageSlug.'_'.$_sTabSlug, |
|
| 188 | 188 | null // will be ignored |
| 189 | 189 | ), |
| 190 | - 'footer_right_' . $_sPageSlug, |
|
| 191 | - 'footer_right_' . $this->oProp->sClassName |
|
| 190 | + 'footer_right_'.$_sPageSlug, |
|
| 191 | + 'footer_right_'.$this->oProp->sClassName |
|
| 192 | 192 | ), |
| 193 | - $this->oProp->aFooterInfo['sRight'] |
|
| 193 | + $this->oProp->aFooterInfo[ 'sRight' ] |
|
| 194 | 194 | ); |
| 195 | 195 | |
| 196 | 196 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | * @internal |
| 203 | 203 | */ |
| 204 | 204 | private function _isPageAdded() { |
| 205 | - if ( ! isset( $_GET[ 'page' ] ) ) { // sanitization unnecessary |
|
| 205 | + if ( !isset( $_GET[ 'page' ] ) ) { // sanitization unnecessary |
|
| 206 | 206 | return false; |
| 207 | 207 | } |
| 208 | 208 | return ( boolean ) $this->oProp->isPageAdded( $_GET[ 'page' ] ); // sanitization unnecessary |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | : $this->oProp->sLabelPluginSettingsLink; |
| 227 | 227 | |
| 228 | 228 | // If the user disables the settings link, the label property is empty. If so, do not add it. |
| 229 | - if ( ! $this->oProp->sLabelPluginSettingsLink ) { |
|
| 229 | + if ( !$this->oProp->sLabelPluginSettingsLink ) { |
|
| 230 | 230 | return $aLinks; |
| 231 | 231 | } |
| 232 | 232 | |
@@ -244,13 +244,13 @@ discard block |
||
| 244 | 244 | array_unshift( |
| 245 | 245 | $aLinks, |
| 246 | 246 | // '<a href="' . esc_url( $_sLinkURL ) . '">' |
| 247 | - '<a ' . $this->getAttributes( |
|
| 247 | + '<a '.$this->getAttributes( |
|
| 248 | 248 | array( |
| 249 | 249 | 'href' => esc_url( $_sLinkURL ), |
| 250 | 250 | // 3.5.7+ Added for acceptance testing |
| 251 | 251 | 'class' => 'apf-plugin-title-action-link apf-post-type', |
| 252 | 252 | ) |
| 253 | - ) . '>' |
|
| 253 | + ).'>' |
|
| 254 | 254 | . $this->oProp->sLabelPluginSettingsLink |
| 255 | 255 | . '</a>' |
| 256 | 256 | ); |
@@ -273,16 +273,16 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | // Backward compatibility sanitisation. |
| 275 | 275 | $_aAddingLinks = array(); |
| 276 | - foreach( array_filter( $this->oProp->aPluginDescriptionLinks ) as $_sLLinkHTML ) { |
|
| 276 | + foreach ( array_filter( $this->oProp->aPluginDescriptionLinks ) as $_sLLinkHTML ) { |
|
| 277 | 277 | |
| 278 | - if ( ! $_sLLinkHTML ) { |
|
| 278 | + if ( !$_sLLinkHTML ) { |
|
| 279 | 279 | continue; |
| 280 | 280 | } |
| 281 | 281 | if ( is_array( $_sLLinkHTML ) ) { // should not be an array |
| 282 | 282 | $_aAddingLinks = array_merge( $_sLLinkHTML, $_aAddingLinks ); |
| 283 | 283 | continue; |
| 284 | 284 | } |
| 285 | - $_aAddingLinks[] = ( string ) $_sLLinkHTML; |
|
| 285 | + $_aAddingLinks[ ] = ( string ) $_sLLinkHTML; |
|
| 286 | 286 | |
| 287 | 287 | } |
| 288 | 288 | return array_merge( $aLinks, $_aAddingLinks ); |
@@ -299,13 +299,13 @@ discard block |
||
| 299 | 299 | public function _replyToAddPluginActionLinks( $aLinks ) { |
| 300 | 300 | |
| 301 | 301 | $_aAddingLinks = array(); |
| 302 | - foreach( array_filter( $this->oProp->aPluginTitleLinks ) as $_sLinkHTML ) { |
|
| 302 | + foreach ( array_filter( $this->oProp->aPluginTitleLinks ) as $_sLinkHTML ) { |
|
| 303 | 303 | |
| 304 | 304 | if ( is_array( $_sLinkHTML ) ) { |
| 305 | 305 | $_aAddingLinks = array_merge( $_sLinkHTML, $_aAddingLinks ); |
| 306 | 306 | continue; |
| 307 | 307 | } |
| 308 | - $_aAddingLinks[] = ( string ) $_sLinkHTML; |
|
| 308 | + $_aAddingLinks[ ] = ( string ) $_sLinkHTML; |
|
| 309 | 309 | |
| 310 | 310 | } |
| 311 | 311 | return array_merge( $aLinks, $_aAddingLinks ); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function _replyToSetFooterInfo() { |
| 38 | 38 | |
| 39 | - if ( ! $this->oProp->isPageAdded() ) { |
|
| 39 | + if ( ! $this->oProp->isPageAdded() ) { |
|
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 | parent::_replyToSetFooterInfo(); |
@@ -202,7 +202,8 @@ discard block |
||
| 202 | 202 | * @internal |
| 203 | 203 | */ |
| 204 | 204 | private function _isPageAdded() { |
| 205 | - if ( ! isset( $_GET[ 'page' ] ) ) { // sanitization unnecessary |
|
| 205 | + if ( ! isset( $_GET[ 'page' ] ) ) { |
|
| 206 | +// sanitization unnecessary |
|
| 206 | 207 | return false; |
| 207 | 208 | } |
| 208 | 209 | return ( boolean ) $this->oProp->isPageAdded( $_GET[ 'page' ] ); // sanitization unnecessary |
@@ -217,7 +218,7 @@ discard block |
||
| 217 | 218 | public function _replyToAddSettingsLinkInPluginListingPage( $aLinks ) { |
| 218 | 219 | |
| 219 | 220 | // If the sub-pages are not added, do nothing. |
| 220 | - if ( count( $this->oProp->aPages ) < 1 ) { |
|
| 221 | + if ( count( $this->oProp->aPages ) < 1 ) { |
|
| 221 | 222 | return $aLinks; |
| 222 | 223 | } |
| 223 | 224 | |
@@ -267,7 +268,7 @@ discard block |
||
| 267 | 268 | */ |
| 268 | 269 | public function _replyToAddLinkToPluginDescription( $aLinks, $sFile ) { |
| 269 | 270 | |
| 270 | - if ( $sFile !== plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ) ) { |
|
| 271 | + if ( $sFile !== plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ) ) { |
|
| 271 | 272 | return $aLinks; |
| 272 | 273 | } |
| 273 | 274 | |
@@ -278,7 +279,8 @@ discard block |
||
| 278 | 279 | if ( ! $_sLLinkHTML ) { |
| 279 | 280 | continue; |
| 280 | 281 | } |
| 281 | - if ( is_array( $_sLLinkHTML ) ) { // should not be an array |
|
| 282 | + if ( is_array( $_sLLinkHTML ) ) { |
|
| 283 | +// should not be an array |
|
| 282 | 284 | $_aAddingLinks = array_merge( $_sLLinkHTML, $_aAddingLinks ); |
| 283 | 285 | continue; |
| 284 | 286 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $_sTag = $this->_getInPageTabTag( $sTag, $_aPage ); |
| 74 | 74 | |
| 75 | 75 | // If the in-page tabs' visibility is set to false, returns the title. |
| 76 | - if ( ! $_aPage[ 'show_in_page_tabs' ] ) { |
|
| 76 | + if ( !$_aPage[ 'show_in_page_tabs' ] ) { |
|
| 77 | 77 | return $this->getElement( $aInPageTabs, array( $_sCurrentTabSlug, 'title' ) ) |
| 78 | 78 | ? "<{$_sTag} class='admin-page-framework-in-page-tab-title'>" |
| 79 | 79 | . $aInPageTabs[ $_sCurrentTabSlug ][ 'title' ] |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | private function _getInPageTabNavigationBar( array $aTabs, $sActiveTab, $sCurrentPageSlug, $sTag ) { |
| 101 | 101 | |
| 102 | 102 | $_oTabBar = new AdminPageFramework_TabNavigationBar( |
| 103 | - $aTabs, // tabs |
|
| 103 | + $aTabs, // tabs |
|
| 104 | 104 | $sActiveTab, // active tab slug |
| 105 | - $sTag, // container tag |
|
| 105 | + $sTag, // container tag |
|
| 106 | 106 | array( // container attributes |
| 107 | 107 | 'class' => 'in-page-tab', |
| 108 | 108 | ), |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * @since 3.5.10 |
| 131 | 131 | * @since 3.6.3 Moved from `AdminPageFramework_Page_View`. |
| 132 | 132 | */ |
| 133 | - public function _replyToFormatNavigationTabItem_InPageTab( array $aTab, array $aStructure, array $aTabs, array $aArguments=array() ) { |
|
| 133 | + public function _replyToFormatNavigationTabItem_InPageTab( array $aTab, array $aStructure, array $aTabs, array $aArguments = array() ) { |
|
| 134 | 134 | $_oFormatter = new AdminPageFramework_Format_NavigationTab_InPageTab( |
| 135 | 135 | $aTab, |
| 136 | 136 | $aStructure, |