@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @since 3.6.0 |
| 27 | 27 | */ |
| 28 | - public $sContext = ''; |
|
| 28 | + public $sContext = ''; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * |
| 25 | 25 | * @since 3.6.0 |
| 26 | 26 | */ |
| 27 | - public $sContext = 'fieldrow'; |
|
| 27 | + public $sContext = 'fieldrow'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * @return array The formatted attributes array. |
@@ -61,15 +61,15 @@ discard block |
||
| 61 | 61 | 'class' => $this->getClassAttribute( |
| 62 | 62 | 'admin-page-framework-sections', |
| 63 | 63 | $this->getAOrB( |
| 64 | - ! $this->sSectionTabSlug || '_default' === $this->sSectionTabSlug, |
|
| 64 | + !$this->sSectionTabSlug || '_default' === $this->sSectionTabSlug, |
|
| 65 | 65 | null, |
| 66 | 66 | 'admin-page-framework-section-tabs-contents' |
| 67 | 67 | ), |
| 68 | 68 | $this->getAOrB( |
| 69 | 69 | empty( $this->aCollapsible ), |
| 70 | 70 | null, |
| 71 | - 'admin-page-framework-collapsible-sections-content' . ' ' |
|
| 72 | - . 'admin-page-framework-collapsible-content' . ' ' |
|
| 71 | + 'admin-page-framework-collapsible-sections-content'.' ' |
|
| 72 | + . 'admin-page-framework-collapsible-content'.' ' |
|
| 73 | 73 | . 'accordion-section-content' |
| 74 | 74 | |
| 75 | 75 | ), |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | // 3.6.0+ - dimensional section address without the option key, used by the 'save' argument and when sorting dynamic elements. |
| 86 | 86 | 'data-section_address' => $this->aSectionset[ 'section_id' ], |
| 87 | - 'data-section_address_model' => $this->aSectionset[ 'section_id' ] . '|' . '___i___', |
|
| 87 | + 'data-section_address_model' => $this->aSectionset[ 'section_id' ].'|'.'___i___', |
|
| 88 | 88 | |
| 89 | 89 | ) |
| 90 | 90 | + $this->_getDynamicElementArguments( $this->aSectionset ); |
@@ -123,12 +123,12 @@ discard block |
||
| 123 | 123 | return array( |
| 124 | 124 | // 3.6.0+ Stores the total number of dynamic elements, used to generate the input id and name of repeated sections which contain an incremented index number. |
| 125 | 125 | 'data-largest_index' => max( |
| 126 | - ( int ) $this->iSubSectionCount - 1, // zero-base index |
|
| 126 | + ( int ) $this->iSubSectionCount - 1, // zero-base index |
|
| 127 | 127 | 0 |
| 128 | 128 | ), // convert negative numbers to zero. |
| 129 | 129 | |
| 130 | - 'data-section_id_model' => $aSectionset[ 'section_id' ] . '__' . '___i___', |
|
| 131 | - 'data-flat_section_name_model' => $aSectionset[ 'section_id' ] . '|___i___', |
|
| 130 | + 'data-section_id_model' => $aSectionset[ 'section_id' ].'__'.'___i___', |
|
| 131 | + 'data-flat_section_name_model' => $aSectionset[ 'section_id' ].'|___i___', |
|
| 132 | 132 | // @todo apply a callback |
| 133 | 133 | // 'data-section_name_model' => $aSectionset[ 'section_id' ] . '[___i___]', |
| 134 | 134 | 'data-section_name_model' => $_oSectionNameGenerator->getModel(), |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @since 3.6.0 |
| 26 | 26 | */ |
| 27 | - public $sContext = 'field'; |
|
| 27 | + public $sContext = 'field'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Returns the field container attribute array. |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | protected function _getAttributes() { |
| 41 | 41 | |
| 42 | 42 | // 3.8.0+ Supports omitting the `type` argument. |
| 43 | - $_sFieldTypeSelector = $this->getAOrB( |
|
| 43 | + $_sFieldTypeSelector = $this->getAOrB( |
|
| 44 | 44 | $this->aArguments[ 'type' ], |
| 45 | 45 | " admin-page-framework-field-{$this->aArguments[ 'type' ]}", |
| 46 | 46 | '' |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | return array( |
| 67 | 67 | 'id' => $this->aArguments[ '_field_container_id' ], |
| 68 | - 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
| 68 | + 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
| 69 | 69 | 'class' => "admin-page-framework-field{$_sFieldTypeSelector}{$_sNestedFieldSelector}{$_sMixedFieldSelector}{$_sChildFieldSelector}" |
| 70 | 70 | . $this->getAOrB( |
| 71 | 71 | $this->aArguments[ 'attributes' ][ 'disabled' ], |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->aAttributes, |
| 39 | 39 | $this->iFieldsCount, |
| 40 | 40 | ); |
| 41 | - $this->aArguments = $_aParameters[ 0 ]; |
|
| 41 | + $this->aArguments = $_aParameters[ 0 ]; |
|
| 42 | 42 | $this->aAttributes = $_aParameters[ 1 ]; |
| 43 | 43 | $this->iFieldsCount = $_aParameters[ 2 ]; |
| 44 | 44 | |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | protected function _getAttributes() { |
| 53 | 53 | return array( |
| 54 | - 'id' => $this->sContext . '-' . $this->aArguments[ 'tag_id' ], |
|
| 55 | - 'class' => 'admin-page-framework-' . $this->sContext |
|
| 56 | - . $this->getAOrB( ! empty( $this->aArguments[ 'repeatable' ] ), ' repeatable dynamic-fields', '' ) // 3.6.0+ Added the 'dynamic-fields' class selector. |
|
| 57 | - . $this->getAOrB( ! empty( $this->aArguments[ 'sortable' ] ), ' sortable dynamic-fields', '' ), |
|
| 54 | + 'id' => $this->sContext.'-'.$this->aArguments[ 'tag_id' ], |
|
| 55 | + 'class' => 'admin-page-framework-'.$this->sContext |
|
| 56 | + . $this->getAOrB( !empty( $this->aArguments[ 'repeatable' ] ), ' repeatable dynamic-fields', '' ) // 3.6.0+ Added the 'dynamic-fields' class selector. |
|
| 57 | + . $this->getAOrB( !empty( $this->aArguments[ 'sortable' ] ), ' sortable dynamic-fields', '' ), |
|
| 58 | 58 | |
| 59 | 59 | // referred by the sortable field JavaScript script. |
| 60 | 60 | 'data-type' => $this->aArguments[ 'type' ], |
| 61 | 61 | |
| 62 | 62 | // 3.6.0+ Stores the total number of dynamic fields, used to generate the input id and name of repeated fields which contain an incremented index number. |
| 63 | 63 | 'data-largest_index' => max( |
| 64 | - ( int ) $this->iFieldsCount - 1, // zero-base index |
|
| 64 | + ( int ) $this->iFieldsCount - 1, // zero-base index |
|
| 65 | 65 | 0 |
| 66 | 66 | ), // convert negative numbers to zero. |
| 67 | 67 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @since 3.6.0 |
| 26 | 26 | */ |
| 27 | - public $sContext = 'fieldset'; |
|
| 27 | + public $sContext = 'fieldset'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Returns an attribute array. |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function _getAttributes() { |
| 34 | 34 | return array( |
| 35 | - 'id' => $this->sContext . '-' . $this->aArguments[ 'tag_id' ], |
|
| 35 | + 'id' => $this->sContext.'-'.$this->aArguments[ 'tag_id' ], |
|
| 36 | 36 | 'class' => implode( |
| 37 | 37 | ' ', |
| 38 | 38 | array( |
| 39 | - 'admin-page-framework-' . $this->sContext, |
|
| 39 | + 'admin-page-framework-'.$this->sContext, |
|
| 40 | 40 | $this->_getSelectorForChildFieldset() |
| 41 | 41 | ) |
| 42 | 42 | ), |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | return ''; |
| 68 | 68 | } |
| 69 | 69 | if ( $this->aArguments[ '_nested_depth' ] == 1 ) { |
| 70 | - return 'child-fieldset nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
| 70 | + return 'child-fieldset nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
| 71 | 71 | } |
| 72 | - return 'child-fieldset multiple-nesting nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
| 72 | + return 'child-fieldset multiple-nesting nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
| 73 | 73 | |
| 74 | 74 | } |
| 75 | 75 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param object $oForm |
| 31 | 31 | * @param string $sHeadActionHook The action hook triggered inside the `<head>` tag. For front-end forms, use `wp_head`. |
| 32 | 32 | */ |
| 33 | - public function __construct( $oForm, $sHeadActionHook='admin_head' ) { |
|
| 33 | + public function __construct( $oForm, $sHeadActionHook = 'admin_head' ) { |
|
| 34 | 34 | |
| 35 | 35 | $this->oForm = $oForm; |
| 36 | 36 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * as multiple instances of the factory class is loaded among separate pages, |
| 55 | 55 | * one gets denied here and if it can load earlier than the one which should insert the below script. |
| 56 | 56 | */ |
| 57 | - if ( ! $this->oForm->isInThePage() ) { |
|
| 57 | + if ( !$this->oForm->isInThePage() ) { |
|
| 58 | 58 | return; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | private function _getScripts_RequiredInHead() { |
| 78 | 78 | return 'document.write( "<style class=\'admin-page-framework-js-embedded-internal-style\'>' |
| 79 | 79 | . str_replace( |
| 80 | - '\\n', // search |
|
| 81 | - '', // replace |
|
| 80 | + '\\n', // search |
|
| 81 | + '', // replace |
|
| 82 | 82 | esc_js( $this->_getInternalCSS() ) // subject |
| 83 | 83 | ) |
| 84 | 84 | . '</style>" );'; |
@@ -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' ) |
@@ -135,7 +135,8 @@ |
||
| 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 ] ) ) { |
|
| 139 | +// @todo not sure what this check is for |
|
| 139 | 140 | return ''; |
| 140 | 141 | } |
| 141 | 142 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * Only one depth at a time will be parsed. |
| 27 | 27 | */ |
| 28 | - public $iNestedDepth = 0; |
|
| 28 | + public $iNestedDepth = 0; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Stores the generated section tab slugs. |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | $_aFieldsBySectionTab = array(); |
| 122 | 122 | $_iIndex = 0; |
| 123 | 123 | |
| 124 | - foreach( $aSectionsets as $_sSectionPath => $_aSectionset ) { |
|
| 124 | + foreach ( $aSectionsets as $_sSectionPath => $_aSectionset ) { |
|
| 125 | 125 | |
| 126 | 126 | // If no fields for the section, no need to add the section |
| 127 | 127 | // unless the custom sectionset output is defined. |
| 128 | - if ( ! isset( $aFieldsets[ $_sSectionPath ] ) && ! $this->_isCustomContentSet( $_aSectionset ) ) { |
|
| 128 | + if ( !isset( $aFieldsets[ $_sSectionPath ] ) && !$this->_isCustomContentSet( $_aSectionset ) ) { |
|
| 129 | 129 | continue; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $_sSectionTaqbSlug = $this->getAOrB( |
| 138 | 138 | $_aSectionset[ 'section_tab_slug' ], |
| 139 | 139 | $_aSectionset[ 'section_tab_slug' ], |
| 140 | - '_default_' . $this->iNestedDepth . '_' . ( ++$_iIndex ) |
|
| 140 | + '_default_'.$this->iNestedDepth.'_'.( ++$_iIndex ) |
|
| 141 | 141 | ); |
| 142 | 142 | $_aSectionsBySectionTab[ $_sSectionTaqbSlug ][ $_sSectionPath ] = $_aSectionset; |
| 143 | 143 | $_aFieldsBySectionTab[ $_sSectionTaqbSlug ][ $_sSectionPath ] = $this->getElement( |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_Table`. |
| 159 | 159 | * @return boolean True if a custom content value is set. |
| 160 | 160 | */ |
| 161 | - private function _isCustomContentSet( array $aSectionset, array $aKeys=array( 'content' ) ) { |
|
| 161 | + private function _isCustomContentSet( array $aSectionset, array $aKeys = array( 'content' ) ) { |
|
| 162 | 162 | return isset( $aSectionset[ 'content' ] ); |
| 163 | 163 | // @deprecated |
| 164 | 164 | // foreach( $aKeys as $_sKey ) { |