@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | private function _getCaption( array $aSectionset, $iSectionIndex, $aFieldsets, $aFieldErrors, $aFieldTypeDefinitions, $aCallbacks, $oMsg ) { |
| 81 | 81 | |
| 82 | - if ( ! $aSectionset[ 'description' ] && ! $aSectionset[ 'title' ] ) { |
|
| 82 | + if ( !$aSectionset[ 'description' ] && !$aSectionset[ 'title' ] ) { |
|
| 83 | 83 | return "<caption class='admin-page-framework-section-caption' style='display:none;'></caption>"; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | 'collapsible' => $_abCollapsible, |
| 103 | 103 | 'container_type' => 'section', // section or sections |
| 104 | 104 | |
| 105 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
| 105 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
| 106 | 106 | ), |
| 107 | 107 | $aFieldsets, |
| 108 | 108 | $this->aSavedData, |
@@ -112,15 +112,15 @@ discard block |
||
| 112 | 112 | $aCallbacks // field output element callables. |
| 113 | 113 | ); |
| 114 | 114 | |
| 115 | - $_bShowTitle = empty( $_abCollapsible ) && ! $aSectionset[ 'section_tab_slug' ]; |
|
| 115 | + $_bShowTitle = empty( $_abCollapsible ) && !$aSectionset[ 'section_tab_slug' ]; |
|
| 116 | 116 | return |
| 117 | - "<caption " . $this->getAttributes( |
|
| 117 | + "<caption ".$this->getAttributes( |
|
| 118 | 118 | array( |
| 119 | 119 | 'class' => 'admin-page-framework-section-caption', |
| 120 | 120 | // data-section_tab is referred by the repeater script to hide/show the title and the description |
| 121 | 121 | 'data-section_tab' => $aSectionset[ 'section_tab_slug' ], |
| 122 | 122 | ) |
| 123 | - ) . ">" |
|
| 123 | + ).">" |
|
| 124 | 124 | . $_oCollapsibleSectionTitle->get() |
| 125 | 125 | . $this->getAOrB( |
| 126 | 126 | $_bShowTitle, |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | 'tag' => 'h3', |
| 175 | 175 | 'section_index' => $iSectionIndex, |
| 176 | 176 | |
| 177 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
| 177 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
| 178 | 178 | ), |
| 179 | 179 | $aFieldsets, |
| 180 | 180 | $this->aSavedData, |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $this->oMsg, |
| 184 | 184 | $this->aCallbacks // field output element callables. |
| 185 | 185 | ); |
| 186 | - return "<div " . $this->getAttributes( |
|
| 186 | + return "<div ".$this->getAttributes( |
|
| 187 | 187 | array( |
| 188 | 188 | 'class' => 'admin-page-framework-section-title', |
| 189 | 189 | 'style' => $this->getAOrB( |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | 'display: none;' |
| 193 | 193 | ), |
| 194 | 194 | ) |
| 195 | - ). ">" |
|
| 195 | + ).">" |
|
| 196 | 196 | . $_oSectionTitle->get() |
| 197 | 197 | . "</div>"; |
| 198 | 198 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | if ( $aSectionset[ 'collapsible' ] ) { |
| 209 | 209 | return ''; |
| 210 | 210 | } |
| 211 | - if ( ! is_callable( $hfSectionCallback ) ) { |
|
| 211 | + if ( !is_callable( $hfSectionCallback ) ) { |
|
| 212 | 212 | return ''; |
| 213 | 213 | } |
| 214 | 214 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | private function _shouldShowCaptionTitle( $aSectionset, $iSectionIndex ) { |
| 242 | 242 | |
| 243 | - if ( ! $aSectionset[ 'title' ] ){ |
|
| 243 | + if ( !$aSectionset[ 'title' ] ) { |
|
| 244 | 244 | return false; |
| 245 | 245 | } |
| 246 | 246 | if ( $aSectionset[ 'collapsible' ] ) { |
@@ -236,7 +236,7 @@ |
||
| 236 | 236 | */ |
| 237 | 237 | private function _shouldShowCaptionTitle( $aSectionset, $iSectionIndex ) { |
| 238 | 238 | |
| 239 | - if ( ! $aSectionset[ 'title' ] ){ |
|
| 239 | + if ( ! $aSectionset[ 'title' ] ) { |
|
| 240 | 240 | return false; |
| 241 | 241 | } |
| 242 | 242 | if ( $aSectionset[ 'collapsible' ] ) { |
@@ -77,15 +77,15 @@ discard block |
||
| 77 | 77 | $_oSectionTableBodyAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableBody( $this->aSectionset ); |
| 78 | 78 | |
| 79 | 79 | $_aOutput = array(); |
| 80 | - $_aOutput[] = "<table " . $_oSectionTableAttributes->get() . ">" |
|
| 80 | + $_aOutput[ ] = "<table ".$_oSectionTableAttributes->get().">" |
|
| 81 | 81 | . $_oTableCaption->get() |
| 82 | - . "<tbody " . $_oSectionTableBodyAttributes->get() . ">" |
|
| 82 | + . "<tbody ".$_oSectionTableBodyAttributes->get().">" |
|
| 83 | 83 | . $this->_getSectionContent( $_iSectionIndex ) |
| 84 | 84 | . "</tbody>" |
| 85 | 85 | . "</table>"; |
| 86 | 86 | |
| 87 | - $_oSectionTableContainerAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableContainer( $this->aSectionset ); |
|
| 88 | - return "<div " . $_oSectionTableContainerAttributes->get() . ">" |
|
| 87 | + $_oSectionTableContainerAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableContainer( $this->aSectionset ); |
|
| 88 | + return "<div ".$_oSectionTableContainerAttributes->get().">" |
|
| 89 | 89 | . implode( PHP_EOL, $_aOutput ) |
| 90 | 90 | . "</div>"; |
| 91 | 91 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | // Retrieve the formatted sectionsets of the content. |
| 136 | 136 | $_sSectionPath = $this->aSectionset[ '_section_path' ]; |
| 137 | 137 | $_aSectionsets = $this->aStructure[ 'sectionsets' ]; |
| 138 | - if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
| 138 | + if ( !isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
| 139 | 139 | return ''; |
| 140 | 140 | } |
| 141 | 141 | |
@@ -190,22 +190,22 @@ discard block |
||
| 190 | 190 | $_aNestedSectionPaths = array(); |
| 191 | 191 | |
| 192 | 192 | // List the section paths of the direct children |
| 193 | - foreach( $aNestedSctionsets as $_aNestedSectionset ) { |
|
| 193 | + foreach ( $aNestedSctionsets as $_aNestedSectionset ) { |
|
| 194 | 194 | |
| 195 | 195 | // 3.7.6+ There were cases non array gets passed (like the FAQ page in the demo) |
| 196 | 196 | // and caused warnings in PHP 7. |
| 197 | - if ( ! is_array( $_aNestedSectionset ) ) { |
|
| 197 | + if ( !is_array( $_aNestedSectionset ) ) { |
|
| 198 | 198 | continue; |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - $_sThisSectionPath = $sSubjectSectionPath . '|' . $_aNestedSectionset[ 'section_id' ]; |
|
| 201 | + $_sThisSectionPath = $sSubjectSectionPath.'|'.$_aNestedSectionset[ 'section_id' ]; |
|
| 202 | 202 | $_aNestedSectionPaths[ $_sThisSectionPath ] = $_sThisSectionPath; |
| 203 | 203 | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // Now we need children's children. |
| 207 | 207 | $_aChildSectionPaths = array(); |
| 208 | - foreach( $_aNestedSectionPaths as $_sNestedSectionPath ) { |
|
| 208 | + foreach ( $_aNestedSectionPaths as $_sNestedSectionPath ) { |
|
| 209 | 209 | $_aNestedSectionsets = $this->getElementAsArray( |
| 210 | 210 | $aSectionsets, |
| 211 | 211 | array( $_sNestedSectionPath, 'content' ) |
@@ -144,7 +144,8 @@ |
||
| 144 | 144 | // Retrieve the formatted sectionsets of the content. |
| 145 | 145 | $_sSectionPath = $this->aSectionset[ '_section_path' ]; |
| 146 | 146 | $_aSectionsets = $this->aStructure[ 'sectionsets' ]; |
| 147 | - if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
| 147 | + if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { |
|
| 148 | +// @todo not sure what this check is for |
|
| 148 | 149 | return ''; |
| 149 | 150 | } |
| 150 | 151 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * Only one depth at a time will be parsed. |
| 26 | 26 | */ |
| 27 | - public $iNestedDepth = 0; |
|
| 27 | + public $iNestedDepth = 0; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Stores the generated section tab slugs. |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | $_aFieldsBySectionTab = array(); |
| 121 | 121 | $_iIndex = 0; |
| 122 | 122 | |
| 123 | - foreach( $aSectionsets as $_sSectionPath => $_aSectionset ) { |
|
| 123 | + foreach ( $aSectionsets as $_sSectionPath => $_aSectionset ) { |
|
| 124 | 124 | |
| 125 | 125 | // If no fields for the section, no need to add the section |
| 126 | 126 | // unless the custom sectionset output is defined. |
| 127 | - if ( ! isset( $aFieldsets[ $_sSectionPath ] ) && ! $this->_isCustomContentSet( $_aSectionset ) ) { |
|
| 127 | + if ( !isset( $aFieldsets[ $_sSectionPath ] ) && !$this->_isCustomContentSet( $_aSectionset ) ) { |
|
| 128 | 128 | continue; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $_sSectionTaqbSlug = $this->getAOrB( |
| 137 | 137 | $_aSectionset[ 'section_tab_slug' ], |
| 138 | 138 | $_aSectionset[ 'section_tab_slug' ], |
| 139 | - '_default_' . $this->iNestedDepth . '_' . ( ++$_iIndex ) |
|
| 139 | + '_default_'.$this->iNestedDepth.'_'.( ++$_iIndex ) |
|
| 140 | 140 | ); |
| 141 | 141 | $_aSectionsBySectionTab[ $_sSectionTaqbSlug ][ $_sSectionPath ] = $_aSectionset; |
| 142 | 142 | $_aFieldsBySectionTab[ $_sSectionTaqbSlug ][ $_sSectionPath ] = $this->getElement( |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @since DEVVER Moved from `AdminPageFramework_FormPart_Table`. |
| 158 | 158 | * @return boolean True if a custom content value is set. |
| 159 | 159 | */ |
| 160 | - private function _isCustomContentSet( array $aSectionset, array $aKeys=array( 'content' ) ) { |
|
| 160 | + private function _isCustomContentSet( array $aSectionset, array $aKeys = array( 'content' ) ) { |
|
| 161 | 161 | return isset( $aSectionset[ 'content' ] ); |
| 162 | 162 | // @deprecated |
| 163 | 163 | // foreach( $aKeys as $_sKey ) { |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | class AdminPageFramework_Form_View___DebugInfo extends AdminPageFramework_WPUtility { |
| 20 | 20 | |
| 21 | - public $sStructureType = ''; |
|
| 21 | + public $sStructureType = ''; |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Stores the message object. |
@@ -49,18 +49,18 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function get() { |
| 51 | 51 | |
| 52 | - if ( ! $this->isDebugModeEnabled() ) { |
|
| 52 | + if ( !$this->isDebugModeEnabled() ) { |
|
| 53 | 53 | return ''; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // For the generic admin pages, do no show debug information for each section. |
| 57 | - if ( ! in_array( $this->sStructureType, array( 'widget', 'post_meta_box', 'page_meta_box', 'user_meta' ) ) ) { |
|
| 57 | + if ( !in_array( $this->sStructureType, array( 'widget', 'post_meta_box', 'page_meta_box', 'user_meta' ) ) ) { |
|
| 58 | 58 | return ''; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | return "<div class='admin-page-framework-info'>" |
| 62 | - . $this->oMsg->get( 'debug_info' ) . ': ' |
|
| 63 | - . AdminPageFramework_Registry::NAME . ' ' . AdminPageFramework_Registry::getVersion() |
|
| 62 | + . $this->oMsg->get( 'debug_info' ).': ' |
|
| 63 | + . AdminPageFramework_Registry::NAME.' '.AdminPageFramework_Registry::getVersion() |
|
| 64 | 64 | . "</div>"; |
| 65 | 65 | |
| 66 | 66 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | * @internal |
| 18 | 18 | * @extends AdminPageFramework_FrameworkUtility |
| 19 | 19 | */ |
| 20 | -class AdminPageFramework_Form_View___DebugInfo extends AdminPageFramework_FrameworkUtility { |
|
| 20 | +class AdminPageFramework_Form_View___DebugInfo extends AdminPageFramework_FrameworkUtility { |
|
| 21 | 21 | |
| 22 | 22 | public $sStructureType = ''; |
| 23 | 23 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @param object $oForm |
| 30 | 30 | * @param string $sHeadActionHook The action hook triggered inside the `<head>` tag. For front-end forms, use `wp_head`. |
| 31 | 31 | */ |
| 32 | - public function __construct( $oForm, $sHeadActionHook='admin_head' ) { |
|
| 32 | + public function __construct( $oForm, $sHeadActionHook = 'admin_head' ) { |
|
| 33 | 33 | |
| 34 | 34 | $this->oForm = $oForm; |
| 35 | 35 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * as multiple instances of the factory class is loaded among separate pages, |
| 54 | 54 | * one gets denied here and if it can load earlier than the one which should insert the below script. |
| 55 | 55 | */ |
| 56 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 56 | + if ( !$this->oForm->isInThePage() ) { |
|
| 57 | 57 | return; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | private function _getScripts_RequiredInHead() { |
| 77 | 77 | return 'document.write( "<style class=\'admin-page-framework-js-embedded-inline-style\'>' |
| 78 | 78 | . str_replace( |
| 79 | - '\\n', // search |
|
| 80 | - '', // replace |
|
| 79 | + '\\n', // search |
|
| 80 | + '', // replace |
|
| 81 | 81 | esc_js( $this->_getInlineCSS() ) // subject |
| 82 | 82 | ) |
| 83 | 83 | . '</style>" );'; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $this->oForm = $oForm; |
| 35 | 35 | |
| 36 | - if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) { |
|
| 36 | + if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @return string |
| 98 | 98 | * @since DEVVER |
| 99 | 99 | */ |
| 100 | - private function _getScriptElementConcealerCSSRules() { |
|
| 100 | + private function _getScriptElementConcealerCSSRules() { |
|
| 101 | 101 | |
| 102 | 102 | // Avoid hiding framework forms in widgets. In some cases, the user sets a form in any page, |
| 103 | 103 | // which causes a different structure form type including `admin_page` gets loaded even in widgets.php (or any page builder pages dealing with widgets) |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
| 41 | 41 | // so make sure it is processed only once per page. |
| 42 | 42 | if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
| 43 | - return; |
|
| 43 | + return; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $this->_setHooks(); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
| 41 | 41 | // so make sure it is processed only once per page. |
| 42 | - if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
|
| 42 | + if ( $this->hasBeenCalled( 'resource_'.$oForm->aArguments[ 'caller_id' ] ) ) { |
|
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -112,10 +112,10 @@ discard block |
||
| 112 | 112 | * @since 3.7.0 |
| 113 | 113 | */ |
| 114 | 114 | public function _replyToEnqueueScripts() { |
| 115 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 115 | + if ( !$this->oForm->isInThePage() ) { |
|
| 116 | 116 | return; |
| 117 | 117 | } |
| 118 | - foreach( $this->oForm->getResources( 'src_scripts' ) as $_asEnqueue ) { |
|
| 118 | + foreach ( $this->oForm->getResources( 'src_scripts' ) as $_asEnqueue ) { |
|
| 119 | 119 | $this->_enqueueScript( $_asEnqueue ); |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | private function _getFormattedEnqueueScript( $asEnqueue ) { |
| 164 | 164 | static $_iCallCount = 1; |
| 165 | 165 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
| 166 | - 'handle_id' => 'script_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
| 166 | + 'handle_id' => 'script_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
| 167 | 167 | 'src' => null, |
| 168 | 168 | 'dependencies' => null, |
| 169 | 169 | 'version' => null, |
@@ -186,10 +186,10 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | public function _replyToEnqueueStyles() { |
| 188 | 188 | |
| 189 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 189 | + if ( !$this->oForm->isInThePage() ) { |
|
| 190 | 190 | return; |
| 191 | 191 | } |
| 192 | - foreach( $this->oForm->getResources( 'src_styles' ) as $_asEnqueueItem ) { |
|
| 192 | + foreach ( $this->oForm->getResources( 'src_styles' ) as $_asEnqueueItem ) { |
|
| 193 | 193 | $this->_enqueueStyle( $_asEnqueueItem ); |
| 194 | 194 | } |
| 195 | 195 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | private function _getFormattedEnqueueStyle( $asEnqueue ) { |
| 211 | 211 | static $_iCallCount = 1; |
| 212 | 212 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
| 213 | - 'handle_id' => 'style_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
| 213 | + 'handle_id' => 'style_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
| 214 | 214 | 'src' => null, |
| 215 | 215 | 'dependencies' => null, |
| 216 | 216 | 'version' => null, |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | public function _replyToAddStyle() { |
| 236 | 236 | |
| 237 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 237 | + if ( !$this->oForm->isInThePage() ) { |
|
| 238 | 238 | return; |
| 239 | 239 | } |
| 240 | 240 | $_sCSSRules = $this->_getFormattedInlineStyles( |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | public function _replyToAddScript() { |
| 283 | 283 | |
| 284 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 284 | + if ( !$this->oForm->isInThePage() ) { |
|
| 285 | 285 | return; |
| 286 | 286 | } |
| 287 | 287 | |
@@ -230,7 +230,7 @@ |
||
| 230 | 230 | ); |
| 231 | 231 | |
| 232 | 232 | $_sID = $this->sanitizeSlug( strtolower( $this->oForm->aArguments[ 'caller_id' ] ) ); |
| 233 | - if ( $_sCSSRules ) { |
|
| 233 | + if ( $_sCSSRules ) { |
|
| 234 | 234 | echo "<style type='text/css' id='inline-style-{$_sID}' class='admin-page-framework-form-style'>" |
| 235 | 235 | . $_sCSSRules |
| 236 | 236 | . "</style>"; |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | */ |
| 140 | 140 | private function _getUnsetFlagFieldInputTag( array $aField ) { |
| 141 | 141 | |
| 142 | - if ( false !== $aField[ 'save' ] ) { |
|
| 142 | + if ( false !== $aField[ 'save' ] ) { |
|
| 143 | 143 | return ''; |
| 144 | 144 | } |
| 145 | 145 | return $this->getHTMLTag( |
@@ -324,6 +324,7 @@ discard block |
||
| 324 | 324 | * Retrieves a field output. |
| 325 | 325 | * |
| 326 | 326 | * @since 3.8.0 |
| 327 | + * @param boolean $bIsLastElement |
|
| 327 | 328 | * @return string |
| 328 | 329 | */ |
| 329 | 330 | private function _getFieldOutput( $sContent, array $aField, $bIsLastElement ) { |
@@ -402,6 +403,7 @@ discard block |
||
| 402 | 403 | * Returns the final fields output. |
| 403 | 404 | * |
| 404 | 405 | * @since 3.1.0 |
| 406 | + * @param integer $iFieldsCount |
|
| 405 | 407 | * @return string |
| 406 | 408 | */ |
| 407 | 409 | private function _getFinalOutput( array $aFieldset, array $aFieldsOutput, $iFieldsCount ) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->aFieldset[ '_field_path_array' ], |
| 39 | 39 | $this->aFieldset[ 'error_message' ] |
| 40 | 40 | ); |
| 41 | - $_aOutputs[] = $_oFieldError->get(); |
|
| 41 | + $_aOutputs[ ] = $_oFieldError->get(); |
|
| 42 | 42 | |
| 43 | 43 | // 2. Construct fields array for sub-fields. |
| 44 | 44 | $_oFieldsFormatter = new AdminPageFramework_Form_Model___Format_Fields( |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $_aFields = $_oFieldsFormatter->get(); |
| 49 | 49 | |
| 50 | 50 | // 3. Get the field and its sub-fields output. |
| 51 | - $_aOutputs[] = $this->_getFieldsOutput( |
|
| 51 | + $_aOutputs[ ] = $this->_getFieldsOutput( |
|
| 52 | 52 | $this->aFieldset, |
| 53 | 53 | $_aFields, |
| 54 | 54 | $this->aCallbacks |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | * @since 3.8.0 Added the `$aFieldset` parameter |
| 72 | 72 | * @return string |
| 73 | 73 | */ |
| 74 | - private function _getFieldsOutput( array $aFieldset, array $aFields, array $aCallbacks=array() ) { |
|
| 74 | + private function _getFieldsOutput( array $aFieldset, array $aFields, array $aCallbacks = array() ) { |
|
| 75 | 75 | |
| 76 | 76 | $_aOutput = array(); |
| 77 | - foreach( $aFields as $_isIndex => $_aField ) { |
|
| 78 | - $_aOutput[] = $this->_getEachFieldOutput( |
|
| 77 | + foreach ( $aFields as $_isIndex => $_aField ) { |
|
| 78 | + $_aOutput[ ] = $this->_getEachFieldOutput( |
|
| 79 | 79 | $_aField, |
| 80 | 80 | $_isIndex, |
| 81 | 81 | $aCallbacks, |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | * @since 3.5.3 |
| 95 | 95 | * @return string the HTML output of the given field. |
| 96 | 96 | */ |
| 97 | - private function _getEachFieldOutput( array $aField, $isIndex, array $aCallbacks, $bIsLastElement=false ) { |
|
| 97 | + private function _getEachFieldOutput( array $aField, $isIndex, array $aCallbacks, $bIsLastElement = false ) { |
|
| 98 | 98 | |
| 99 | 99 | // Field type definition - allows mixed field types in sub-fields |
| 100 | 100 | $_aFieldTypeDefinition = $this->_getFieldTypeDefinition( $aField[ 'type' ] ); |
| 101 | - if ( ! is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
| 101 | + if ( !is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
| 102 | 102 | return ''; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | private function _getFieldOutput( $sContent, array $aField, $bIsLastElement ) { |
| 133 | 133 | $_oFieldAttribute = new AdminPageFramework_Form_View___Attribute_Field( $aField ); |
| 134 | 134 | return $aField[ 'before_field' ] |
| 135 | - . "<div " . $_oFieldAttribute->get() . ">" |
|
| 135 | + . "<div ".$_oFieldAttribute->get().">" |
|
| 136 | 136 | . $sContent |
| 137 | 137 | . $this->_getUnsetFlagFieldInputTag( $aField ) |
| 138 | 138 | . $this->_getDelimiter( $aField, $bIsLastElement ) |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | 'input', |
| 155 | 155 | array( |
| 156 | 156 | 'type' => 'hidden', |
| 157 | - 'name' => '__unset_' . $aField[ '_fields_type' ] . '[' . $aField[ '_input_name_flat' ] . ']', |
|
| 157 | + 'name' => '__unset_'.$aField[ '_fields_type' ].'['.$aField[ '_input_name_flat' ].']', |
|
| 158 | 158 | 'value' => $aField[ '_input_name_flat' ], |
| 159 | 159 | 'class' => 'unset-element-names element-address', |
| 160 | 160 | ) |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | private function _getDelimiter( array $aField, $bIsLastElement ) { |
| 187 | 187 | return $aField[ 'delimiter' ] |
| 188 | - ? "<div " . $this->getAttributes( |
|
| 188 | + ? "<div ".$this->getAttributes( |
|
| 189 | 189 | array( |
| 190 | 190 | 'class' => 'delimiter', |
| 191 | 191 | 'id' => "delimiter-{$aField[ 'input_id' ]}", |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | "" |
| 196 | 196 | ), |
| 197 | 197 | ) |
| 198 | - ) . ">" |
|
| 198 | + ).">" |
|
| 199 | 199 | . $aField[ 'delimiter' ] |
| 200 | 200 | . "</div>" |
| 201 | 201 | : ''; |
@@ -209,9 +209,9 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | private function _getFinalOutput( array $aFieldset, array $aFieldsOutput, $iFieldsCount ) { |
| 211 | 211 | |
| 212 | - $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
| 212 | + $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
| 213 | 213 | return $aFieldset[ 'before_fieldset' ] |
| 214 | - . "<fieldset " . $_oFieldsetAttributes->get() . ">" |
|
| 214 | + . "<fieldset ".$_oFieldsetAttributes->get().">" |
|
| 215 | 215 | . $this->_getEmbeddedFieldTitle( $aFieldset ) |
| 216 | 216 | . $this->_getChildFieldTitle( $aFieldset ) |
| 217 | 217 | . $this->_getFieldsetContent( $aFieldset, $aFieldsOutput, $iFieldsCount ) |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | private function _getEmbeddedFieldTitle( array $aFieldset ) { |
| 230 | 230 | |
| 231 | - if ( ! $aFieldset[ '_is_title_embedded' ] ) { |
|
| 231 | + if ( !$aFieldset[ '_is_title_embedded' ] ) { |
|
| 232 | 232 | return ''; |
| 233 | 233 | } |
| 234 | 234 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | private function _getChildFieldTitle( array $aFieldset ) { |
| 255 | 255 | |
| 256 | - if ( ! $aFieldset[ '_nested_depth' ] ) { |
|
| 256 | + if ( !$aFieldset[ '_nested_depth' ] ) { |
|
| 257 | 257 | return ''; |
| 258 | 258 | } |
| 259 | 259 | if ( $aFieldset[ '_is_title_embedded' ] ) { |
@@ -282,12 +282,12 @@ discard block |
||
| 282 | 282 | return $aFieldset[ 'content' ]; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
| 285 | + $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
| 286 | 286 | $aFieldset, |
| 287 | - array(), // attribute array |
|
| 287 | + array(), // attribute array |
|
| 288 | 288 | $iFieldsCount |
| 289 | 289 | ); |
| 290 | - return "<div " . $_oFieldsAttributes->get() . ">" |
|
| 290 | + return "<div ".$_oFieldsAttributes->get().">" |
|
| 291 | 291 | . $aFieldset[ 'before_fields' ] |
| 292 | 292 | . implode( PHP_EOL, $aFieldsOutput ) |
| 293 | 293 | . $aFieldset[ 'after_fields' ] |
@@ -310,13 +310,13 @@ discard block |
||
| 310 | 310 | $aField[ 'description' ], |
| 311 | 311 | 'admin-page-framework-fields-description' // class selector |
| 312 | 312 | ); |
| 313 | - $_aOutput[] = $_oFieldDescription->get(); |
|
| 313 | + $_aOutput[ ] = $_oFieldDescription->get(); |
|
| 314 | 314 | |
| 315 | 315 | // Dimensional keys of repeatable and sortable fields |
| 316 | - $_aOutput[] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
| 316 | + $_aOutput[ ] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
| 317 | 317 | |
| 318 | 318 | // Repeatable and sortable scripts |
| 319 | - $_aOutput[] = $this->_getFieldScripts( $aField, $iFieldsCount ); |
|
| 319 | + $_aOutput[ ] = $this->_getFieldScripts( $aField, $iFieldsCount ); |
|
| 320 | 320 | |
| 321 | 321 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
| 322 | 322 | |
@@ -346,8 +346,8 @@ discard block |
||
| 346 | 346 | 'input', |
| 347 | 347 | array( |
| 348 | 348 | 'type' => 'hidden', |
| 349 | - 'name' => '__repeatable_elements_' . $aFieldset[ '_structure_type' ] |
|
| 350 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
| 349 | + 'name' => '__repeatable_elements_'.$aFieldset[ '_structure_type' ] |
|
| 350 | + . '['.$aFieldset[ '_field_address' ].']', |
|
| 351 | 351 | 'class' => 'element-address', |
| 352 | 352 | 'value' => $aFieldset[ '_field_address' ], |
| 353 | 353 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -363,8 +363,8 @@ discard block |
||
| 363 | 363 | 'input', |
| 364 | 364 | array( |
| 365 | 365 | 'type' => 'hidden', |
| 366 | - 'name' => '__sortable_elements_' . $aFieldset[ '_structure_type' ] |
|
| 367 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
| 366 | + 'name' => '__sortable_elements_'.$aFieldset[ '_structure_type' ] |
|
| 367 | + . '['.$aFieldset[ '_field_address' ].']', |
|
| 368 | 368 | 'class' => 'element-address', |
| 369 | 369 | 'value' => $aFieldset[ '_field_address' ], |
| 370 | 370 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -383,14 +383,14 @@ discard block |
||
| 383 | 383 | $_aOutput = array(); |
| 384 | 384 | |
| 385 | 385 | // Add the repeater script |
| 386 | - $_aOutput[] = $aField[ 'repeatable' ] |
|
| 387 | - ? $this->_getRepeaterFieldEnablerScript( 'fields-' . $aField['tag_id'], $iFieldsCount, $aField['repeatable'] ) |
|
| 386 | + $_aOutput[ ] = $aField[ 'repeatable' ] |
|
| 387 | + ? $this->_getRepeaterFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] ) |
|
| 388 | 388 | : ''; |
| 389 | 389 | |
| 390 | 390 | // Add the sortable script - if the number of fields is only one, no need to sort the field. |
| 391 | 391 | // Repeatable fields can make the number increase so here it checks the repeatability. |
| 392 | - $_aOutput[] = $aField['sortable'] && ( $iFieldsCount > 1 || $aField['repeatable'] ) |
|
| 393 | - ? $this->_getSortableFieldEnablerScript( 'fields-' . $aField['tag_id'] ) |
|
| 392 | + $_aOutput[ ] = $aField[ 'sortable' ] && ( $iFieldsCount > 1 || $aField[ 'repeatable' ] ) |
|
| 393 | + ? $this->_getSortableFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ] ) |
|
| 394 | 394 | : ''; |
| 395 | 395 | |
| 396 | 396 | return implode( PHP_EOL, $_aOutput ); |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | protected function _getAttributes() { |
| 29 | 29 | |
| 30 | - $_aSectionAttributes = $this->uniteArrays( |
|
| 31 | - $this->dropElementsByType( $this->aArguments[ 'attributes' ] ), // remove elements of an array. |
|
| 30 | + $_aSectionAttributes = $this->uniteArrays( |
|
| 31 | + $this->dropElementsByType( $this->aArguments[ 'attributes' ] ), // remove elements of an array. |
|
| 32 | 32 | array( |
| 33 | 33 | 'id' => $this->aArguments[ '_tag_id' ], // section-{section id}__{index} |
| 34 | 34 | 'class' => $this->getClassAttribute( |
@@ -49,19 +49,19 @@ discard block |
||
| 49 | 49 | ) |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - $_aSectionAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 52 | + $_aSectionAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 53 | 53 | $_aSectionAttributes[ 'class' ], |
| 54 | 54 | $this->dropElementsByType( $this->aArguments[ 'class' ] ) |
| 55 | - ); // 3.3.1+ |
|
| 55 | + ); // 3.3.1+ |
|
| 56 | 56 | |
| 57 | - $_aSectionAttributes[ 'style' ] = $this->getStyleAttribute( |
|
| 57 | + $_aSectionAttributes[ 'style' ] = $this->getStyleAttribute( |
|
| 58 | 58 | $_aSectionAttributes[ 'style' ], |
| 59 | 59 | $this->getAOrB( |
| 60 | 60 | $this->aArguments[ 'hidden' ], |
| 61 | 61 | 'display:none', |
| 62 | 62 | null |
| 63 | 63 | ) |
| 64 | - ); // 3.3.1+ |
|
| 64 | + ); // 3.3.1+ |
|
| 65 | 65 | |
| 66 | 66 | return $_aSectionAttributes; |
| 67 | 67 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $this->aAttributes + $this->_getAttributes() |
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 35 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 36 | 36 | $this->getElement( $_aAttributes, 'class', array() ), |
| 37 | 37 | $this->getElement( $this->aArguments, array( 'class', $this->sContext ), array() ) |
| 38 | 38 | ); |