@@ -33,7 +33,7 @@ |
||
| 33 | 33 | array( $this, '_replyToAddPostTypeQueryInEditPostLink' ), |
| 34 | 34 | 10, |
| 35 | 35 | 3 |
| 36 | - ); |
|
| 36 | + ); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | * @return array The formatted definition array. |
| 41 | 41 | */ |
| 42 | 42 | public function get() { |
| 43 | - foreach( $this->aDimensionalKeys as $_sFlatFieldAddress ) { |
|
| 43 | + foreach ( $this->aDimensionalKeys as $_sFlatFieldAddress ) { |
|
| 44 | 44 | $this->unsetDimensionalArrayElement( |
| 45 | 45 | $this->aSubject, |
| 46 | 46 | explode( '|', $_sFlatFieldAddress ) |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $this->aInput, |
| 30 | 30 | $this->aFieldAddresses, |
| 31 | 31 | ); |
| 32 | - $this->aInput = $_aParameters[ 0 ]; |
|
| 32 | + $this->aInput = $_aParameters[ 0 ]; |
|
| 33 | 33 | $this->aFieldAddresses = $_aParameters[ 1 ]; |
| 34 | 34 | |
| 35 | 35 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function get() { |
| 44 | 44 | |
| 45 | - foreach( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
| 45 | + foreach ( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
| 46 | 46 | |
| 47 | 47 | $_aDimensionalKeys = explode( '|', $_sFlatFieldAddress ); |
| 48 | 48 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | // If the retrieved value does not exist, null will be given. |
| 55 | 55 | // This occurs with page meta boxes. |
| 56 | - if ( ! is_array( $_aDynamicElements ) ) { |
|
| 56 | + if ( !is_array( $_aDynamicElements ) ) { |
|
| 57 | 57 | continue; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | class AdminPageFramework_Form_Model___DefaultValues extends AdminPageFramework_Form_Base { |
| 19 | 19 | |
| 20 | - public $aFieldsets = array(); |
|
| 20 | + public $aFieldsets = array(); |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Sets up hooks. |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $_aParameters = func_get_args() + array( |
| 29 | 29 | $this->aFieldsets, |
| 30 | 30 | ); |
| 31 | - $this->aFieldsets = $_aParameters[ 0 ]; |
|
| 31 | + $this->aFieldsets = $_aParameters[ 0 ]; |
|
| 32 | 32 | |
| 33 | 33 | } |
| 34 | 34 | |
@@ -86,13 +86,13 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | private function _getDefaultValues( $aFieldsets, $aDefaultOptions ) { |
| 88 | 88 | |
| 89 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
| 89 | + foreach ( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
| 90 | 90 | |
| 91 | 91 | $_aSectionPath = explode( '|', $_sSectionPath ); |
| 92 | - foreach( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
| 92 | + foreach ( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
| 93 | 93 | $_aFieldPath = explode( '|', $_sFieldPath ); |
| 94 | 94 | $this->setMultiDimensionalArray( |
| 95 | - $aDefaultOptions, // by reference |
|
| 95 | + $aDefaultOptions, // by reference |
|
| 96 | 96 | '_default' === $_sSectionPath |
| 97 | 97 | ? array( $_sFieldPath ) |
| 98 | 98 | : array_merge( $_aSectionPath, $_aFieldPath ), // key address |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | // If there are no sub-fields |
| 149 | 149 | if ( count( $_aSubFields ) == 0 ) { |
| 150 | 150 | return $this->getElement( |
| 151 | - $aFieldset, // subject |
|
| 152 | - 'value', // key |
|
| 151 | + $aFieldset, // subject |
|
| 152 | + 'value', // key |
|
| 153 | 153 | $this->getElement( // default value |
| 154 | - $aFieldset, // subject |
|
| 155 | - 'default', // key |
|
| 154 | + $aFieldset, // subject |
|
| 155 | + 'default', // key |
|
| 156 | 156 | null // default value |
| 157 | 157 | ) |
| 158 | 158 | ); |
@@ -161,13 +161,13 @@ discard block |
||
| 161 | 161 | // Otherwise, there are sub-fields |
| 162 | 162 | $_aDefault = array(); |
| 163 | 163 | array_unshift( $_aSubFields, $aFieldset ); // insert the main field into the very first index. |
| 164 | - foreach( $_aSubFields as $_iIndex => $_aField ) { |
|
| 164 | + foreach ( $_aSubFields as $_iIndex => $_aField ) { |
|
| 165 | 165 | $_aDefault[ $_iIndex ] = $this->getElement( |
| 166 | - $_aField, // subject |
|
| 167 | - 'value', // key |
|
| 166 | + $_aField, // subject |
|
| 167 | + 'value', // key |
|
| 168 | 168 | $this->getElement( // default value |
| 169 | - $_aField, // subject |
|
| 170 | - 'default', // key |
|
| 169 | + $_aField, // subject |
|
| 170 | + 'default', // key |
|
| 171 | 171 | null // default value |
| 172 | 172 | ) |
| 173 | 173 | ); |
@@ -60,18 +60,18 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | // Drop keys of fields-array which do not exist in the sections-array. |
| 62 | 62 | // For this reasons, the sections-array should be conditioned first before applying this method. |
| 63 | - $aFields = $this->castArrayContents( $aSections, $aFields ); |
|
| 63 | + $aFields = $this->castArrayContents( $aSections, $aFields ); |
|
| 64 | 64 | |
| 65 | 65 | $_aNewFields = array(); |
| 66 | - foreach( $aFields as $_sSectionID => $_aSubSectionOrFields ) { |
|
| 66 | + foreach ( $aFields as $_sSectionID => $_aSubSectionOrFields ) { |
|
| 67 | 67 | |
| 68 | 68 | // This type check is important as the parsing field array is content-cast, which can set null value to elements. |
| 69 | - if ( ! is_array( $_aSubSectionOrFields ) ) { |
|
| 69 | + if ( !is_array( $_aSubSectionOrFields ) ) { |
|
| 70 | 70 | continue; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $this->_setConditionedFields( |
| 74 | - $_aNewFields, // by reference - gets updated in the method. |
|
| 74 | + $_aNewFields, // by reference - gets updated in the method. |
|
| 75 | 75 | $_aSubSectionOrFields, |
| 76 | 76 | $_sSectionID |
| 77 | 77 | ); |
@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | private function _setConditionedFields( array &$_aNewFields, $_aSubSectionOrFields, $_sSectionID ) { |
| 93 | 93 | |
| 94 | - foreach( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) { |
|
| 94 | + foreach ( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) { |
|
| 95 | 95 | |
| 96 | 96 | // If it is a sub-section array. |
| 97 | 97 | if ( $this->isNumericInteger( $_sIndexOrFieldID ) ) { |
| 98 | 98 | $_sSubSectionIndex = $_sIndexOrFieldID; |
| 99 | 99 | $_aFields = $_aSubSectionOrField; |
| 100 | - foreach( $_aFields as $_aField ) { |
|
| 101 | - if ( ! $this->_isAllowed( $_aField ) ) { |
|
| 100 | + foreach ( $_aFields as $_aField ) { |
|
| 101 | + if ( !$this->_isAllowed( $_aField ) ) { |
|
| 102 | 102 | continue; |
| 103 | 103 | } |
| 104 | 104 | $_aNewFields[ $_sSectionID ][ $_sSubSectionIndex ][ $_aField[ 'field_id' ] ] = $_aField; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // Otherwise, insert the formatted field definition array. |
| 111 | 111 | $_aField = $_aSubSectionOrField; |
| 112 | - if ( ! $this->_isAllowed( $_aField ) ) { |
|
| 112 | + if ( !$this->_isAllowed( $_aField ) ) { |
|
| 113 | 113 | continue; |
| 114 | 114 | } |
| 115 | 115 | $_aNewFields[ $_sSectionID ][ $_aField[ 'field_id' ] ] = $_aField; |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | foreach( $aFields as $_sSectionID => $_aSubSectionOrFields ) { |
| 67 | 67 | |
| 68 | 68 | // This type check is important as the parsing field array is content-cast, which can set null value to elements. |
| 69 | - if ( ! is_array( $_aSubSectionOrFields ) ) { |
|
| 69 | + if ( ! is_array( $_aSubSectionOrFields ) ) { |
|
| 70 | 70 | continue; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | class AdminPageFramework_Form_Model___SectionConditioner extends AdminPageFramework_WPUtility { |
| 19 | 19 | |
| 20 | - public $aSectionsets = array(); |
|
| 20 | + public $aSectionsets = array(); |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Sets up hooks. |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $_aParameters = func_get_args() + array( |
| 29 | 29 | $this->aSectionsets, |
| 30 | 30 | ); |
| 31 | - $this->aSectionsets = $_aParameters[ 0 ]; |
|
| 31 | + $this->aSectionsets = $_aParameters[ 0 ]; |
|
| 32 | 32 | |
| 33 | 33 | } |
| 34 | 34 | |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | * @since DEVVER Moved from `AdminPageFramework_FormDefinition`. Changed the name from `getConditionedSections()`. |
| 51 | 51 | * @return array The conditioned sectionsets array. |
| 52 | 52 | */ |
| 53 | - private function _getSectionsConditioned( array $aSections=array() ) { |
|
| 53 | + private function _getSectionsConditioned( array $aSections = array() ) { |
|
| 54 | 54 | |
| 55 | - $_aNewSections = array(); |
|
| 56 | - foreach( $aSections as $_sSectionID => $_aSection ) { |
|
| 57 | - if ( ! $this->_isAllowed( $_aSection ) ) { |
|
| 55 | + $_aNewSections = array(); |
|
| 56 | + foreach ( $aSections as $_sSectionID => $_aSection ) { |
|
| 57 | + if ( !$this->_isAllowed( $_aSection ) ) { |
|
| 58 | 58 | continue; |
| 59 | 59 | } |
| 60 | 60 | $_aNewSections[ $_sSectionID ] = $_aSection; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | protected function _isAllowed( array $aDefinition ) { |
| 74 | 74 | |
| 75 | 75 | // Check capability. If the access level is not sufficient, skip. |
| 76 | - if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) { |
|
| 76 | + if ( !current_user_can( $aDefinition[ 'capability' ] ) ) { |
|
| 77 | 77 | return false; |
| 78 | 78 | } |
| 79 | 79 | return ( boolean ) $aDefinition[ 'if' ]; |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | protected function _isAllowed( array $aDefinition ) { |
| 74 | 74 | |
| 75 | 75 | // Check capability. If the access level is not sufficient, skip. |
| 76 | - if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) { |
|
| 76 | + if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) { |
|
| 77 | 77 | return false; |
| 78 | 78 | } |
| 79 | 79 | return ( boolean ) $aDefinition[ 'if' ]; |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $this->oMsg, |
| 82 | 82 | false // `false` to disable auto-registering. |
| 83 | 83 | ); |
| 84 | - foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
| 84 | + foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
| 85 | 85 | $_aFieldTypeDefinitions[ $_sSlug ] = $_oFieldType->getDefinitionArray(); |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | 'posttype', |
| 44 | 44 | 'size', |
| 45 | 45 | 'section_title', // 3.0.0+ |
| 46 | - 'system', // 3.3.0+ |
|
| 47 | - 'inline_mixed', // 3.8.0+ |
|
| 48 | - '_nested', // 3.8.0+ |
|
| 46 | + 'system', // 3.3.0+ |
|
| 47 | + 'inline_mixed', // 3.8.0+ |
|
| 48 | + '_nested', // 3.8.0+ |
|
| 49 | 49 | ); |
| 50 | 50 | |
| 51 | 51 | public $sCallerID = ''; |
@@ -75,16 +75,16 @@ discard block |
||
| 75 | 75 | public function get() { |
| 76 | 76 | |
| 77 | 77 | $_aFieldTypeDefinitions = array(); |
| 78 | - foreach( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) { |
|
| 78 | + foreach ( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) { |
|
| 79 | 79 | |
| 80 | 80 | $_sFieldTypeClassName = "AdminPageFramework_FieldType_{$_sFieldTypeSlug}"; |
| 81 | 81 | $_oFieldType = new $_sFieldTypeClassName( |
| 82 | - $this->sCallerID, // usually an instantiated class name |
|
| 83 | - null, // field type slugs - if it is different from the one defined in the class property |
|
| 82 | + $this->sCallerID, // usually an instantiated class name |
|
| 83 | + null, // field type slugs - if it is different from the one defined in the class property |
|
| 84 | 84 | $this->oMsg, |
| 85 | 85 | false // `false` to disable auto-registering. |
| 86 | 86 | ); |
| 87 | - foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
| 87 | + foreach ( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
| 88 | 88 | $_aFieldTypeDefinitions[ $_sSlug ] = $_oFieldType->getDefinitionArray(); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | * @since 2.1.5 |
| 44 | 44 | * @since 3.3.1 Changed from `_replyToGetStyles()`. |
| 45 | 45 | */ |
| 46 | - protected function getStyles() { |
|
| 46 | + protected function getStyles() { |
|
| 47 | 47 | return <<<CSSRULES |
| 48 | 48 | /* Text Field Type */ |
| 49 | 49 | .admin-page-framework-field.admin-page-framework-field-text > .admin-page-framework-input-label-container { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * Defines the field type slugs used for this field type. |
| 41 | 41 | */ |
| 42 | - public $aFieldTypeSlugs = array( 'text', 'password', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'url', 'week', ); |
|
| 42 | + public $aFieldTypeSlugs = array( 'text', 'password', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'url', 'week',); |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Defines the default key-values of this field type. |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | protected function getField( $aField ) { |
| 84 | 84 | |
| 85 | 85 | $_aOutput = array(); |
| 86 | - foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
| 87 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
| 86 | + foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
| 87 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
| 88 | 88 | $_sKey, |
| 89 | 89 | $_sLabel, |
| 90 | 90 | $aField |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // the repeatable field buttons will be replaced with this element. |
| 95 | - $_aOutput[] = "<div class='repeatable-field-buttons'></div>"; |
|
| 95 | + $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>"; |
|
| 96 | 96 | return implode( '', $_aOutput ); |
| 97 | 97 | |
| 98 | 98 | } |
@@ -112,23 +112,23 @@ discard block |
||
| 112 | 112 | $aField[ 'value' ] = $this->getElementByLabel( $aField[ 'value' ], $sKey, $aField[ 'label' ] ); |
| 113 | 113 | $_aInputAttributes = $_bIsArray |
| 114 | 114 | ? array( |
| 115 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]", |
|
| 116 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}", |
|
| 115 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]", |
|
| 116 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$sKey}", |
|
| 117 | 117 | 'value' => $aField[ 'value' ], |
| 118 | 118 | ) |
| 119 | 119 | + $aField[ 'attributes' ] |
| 120 | 120 | : $aField[ 'attributes' ]; |
| 121 | - $_aOutput = array( |
|
| 121 | + $_aOutput = array( |
|
| 122 | 122 | $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ), |
| 123 | 123 | "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>", |
| 124 | - "<label for='" . $_aInputAttributes[ 'id' ] . "'>", |
|
| 124 | + "<label for='".$_aInputAttributes[ 'id' ]."'>", |
|
| 125 | 125 | $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ), |
| 126 | 126 | $_sLabel |
| 127 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 127 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 128 | 128 | . $_sLabel |
| 129 | 129 | . "</span>" |
| 130 | 130 | : '', |
| 131 | - "<input " . $this->getAttributes( $_aInputAttributes ) . " />", |
|
| 131 | + "<input ".$this->getAttributes( $_aInputAttributes )." />", |
|
| 132 | 132 | $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ), |
| 133 | 133 | "</label>", |
| 134 | 134 | "</div>", |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Defines the field type slugs used for this field type. |
| 22 | 22 | */ |
| 23 | - public $aFieldTypeSlugs = array( 'file', ); |
|
| 23 | + public $aFieldTypeSlugs = array( 'file',); |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Defines the default key-values of this field type. |
@@ -76,15 +76,15 @@ discard block |
||
| 76 | 76 | array( |
| 77 | 77 | 'type' => 'hidden', |
| 78 | 78 | 'value' => '', |
| 79 | - 'name' => $aField[ 'attributes' ][ 'name' ] . '[_dummy_value]', |
|
| 79 | + 'name' => $aField[ 'attributes' ][ 'name' ].'[_dummy_value]', |
|
| 80 | 80 | ) |
| 81 | 81 | ) |
| 82 | 82 | . $this->getHTMLTag( |
| 83 | 83 | 'input', |
| 84 | 84 | array( |
| 85 | 85 | 'type' => 'hidden', |
| 86 | - 'name' => '__unset_' . $aField[ '_structure_type' ] . '[' . $aField[ '_input_name_flat' ] . '|_dummy_value' . ']', |
|
| 87 | - 'value' => $aField[ '_input_name_flat' ] . '|_dummy_value', |
|
| 86 | + 'name' => '__unset_'.$aField[ '_structure_type' ].'['.$aField[ '_input_name_flat' ].'|_dummy_value'.']', |
|
| 87 | + 'value' => $aField[ '_input_name_flat' ].'|_dummy_value', |
|
| 88 | 88 | 'class' => 'unset-element-names element-address', |
| 89 | 89 | ) |
| 90 | 90 | ); |
@@ -315,14 +315,14 @@ discard block |
||
| 315 | 315 | wp_enqueue_script( 'thickbox' ); |
| 316 | 316 | wp_enqueue_style( 'thickbox' ); |
| 317 | 317 | |
| 318 | - if ( function_exists( 'wp_enqueue_media' ) ) { |
|
| 318 | + if ( function_exists( 'wp_enqueue_media' ) ) { |
|
| 319 | 319 | // If the WordPress version is 3.5 or above, |
| 320 | 320 | new AdminPageFramework_Form_View___Script_MediaUploader( $this->oMsg ); |
| 321 | 321 | } else { |
| 322 | 322 | wp_enqueue_script( 'media-upload' ); |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
| 325 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
| 326 | 326 | add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
| 327 | 327 | } |
| 328 | 328 | |
@@ -338,17 +338,17 @@ discard block |
||
| 338 | 338 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
| 339 | 339 | |
| 340 | 340 | // Replace the button label in the media thick box. |
| 341 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
| 341 | + if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
| 342 | 342 | return $sTranslated; |
| 343 | 343 | } |
| 344 | - if ( $sText !== 'Insert into Post' ) { |
|
| 344 | + if ( $sText !== 'Insert into Post' ) { |
|
| 345 | 345 | return $sTranslated; |
| 346 | 346 | } |
| 347 | - if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { |
|
| 347 | + if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { |
|
| 348 | 348 | return $sTranslated; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - if ( isset( $_GET['button_label'] ) ) { |
|
| 351 | + if ( isset( $_GET['button_label'] ) ) { |
|
| 352 | 352 | return $_GET['button_label']; |
| 353 | 353 | } |
| 354 | 354 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | public function _replyToRemovingMediaLibraryTab( $aTabs ) { |
| 370 | 370 | |
| 371 | - if ( ! isset( $_REQUEST['enable_external_source'] ) ) { |
|
| 371 | + if ( ! isset( $_REQUEST['enable_external_source'] ) ) { |
|
| 372 | 372 | return $aTabs; |
| 373 | 373 | } |
| 374 | 374 | |
@@ -391,6 +391,7 @@ |
||
| 391 | 391 | * This is used for element that `label_min_width` is applied. |
| 392 | 392 | * |
| 393 | 393 | * @since 3.8.0 |
| 394 | + * @param string $asClassAttributes |
|
| 394 | 395 | * @return string |
| 395 | 396 | */ |
| 396 | 397 | protected function getLabelContainerAttributes( array $aField, $asClassAttributes, array $aAttributes=array() ) { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | 'after_label' => null, |
| 61 | 61 | 'before_field' => null, |
| 62 | 62 | 'after_field' => null, |
| 63 | - 'label_min_width' => '', // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applied via embedded CSS. When this value is set by the user, it is set inline and the value will be overridden. [3.8.4+] Changed the value from `0` to `''`. |
|
| 63 | + 'label_min_width' => '', // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applied via embedded CSS. When this value is set by the user, it is set inline and the value will be overridden. [3.8.4+] Changed the value from `0` to `''`. |
|
| 64 | 64 | 'before_fieldset' => null, // 3.1.1+ |
| 65 | 65 | 'after_fieldset' => null, // 3.1.1+ |
| 66 | 66 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @param object $oMsg The framework message object. |
| 101 | 101 | * @param boolean $bAutoRegister Whether or not to register the field type(s). |
| 102 | 102 | */ |
| 103 | - public function __construct( $asClassName='admin_page_framework', $asFieldTypeSlug=null, $oMsg=null, $bAutoRegister=true ) { |
|
| 103 | + public function __construct( $asClassName = 'admin_page_framework', $asFieldTypeSlug = null, $oMsg = null, $bAutoRegister = true ) { |
|
| 104 | 104 | |
| 105 | 105 | $this->aFieldTypeSlugs = empty( $asFieldTypeSlug ) |
| 106 | 106 | ? $this->aFieldTypeSlugs |
@@ -111,9 +111,9 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | // This automatically registers the field type. The build-in ones will be registered manually so it will be skipped. |
| 113 | 113 | if ( $bAutoRegister ) { |
| 114 | - foreach( ( array ) $asClassName as $_sClassName ) { |
|
| 114 | + foreach ( ( array ) $asClassName as $_sClassName ) { |
|
| 115 | 115 | add_filter( |
| 116 | - 'field_types_' . $_sClassName, |
|
| 116 | + 'field_types_'.$_sClassName, |
|
| 117 | 117 | array( $this, '_replyToRegisterInputFieldType' ) |
| 118 | 118 | ); |
| 119 | 119 | } |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | return is_array( $asLabel ) // if the user stes multiple items |
| 161 | 161 | ? $this->getElement( |
| 162 | - $asElement, // subject |
|
| 163 | - $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
| 162 | + $asElement, // subject |
|
| 163 | + $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
| 164 | 164 | '' // default - if the element is not found, return an empty |
| 165 | 165 | ) |
| 166 | 166 | : $asElement; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | protected function getFieldOutput( array $aFieldset ) { |
| 177 | 177 | |
| 178 | - if ( ! is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
| 178 | + if ( !is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
| 179 | 179 | return ''; |
| 180 | 180 | } |
| 181 | 181 | |
@@ -183,14 +183,14 @@ discard block |
||
| 183 | 183 | $aFieldset[ '_parent_field_object' ] = $aFieldset[ '_field_object' ]; // 3.6.0+ |
| 184 | 184 | |
| 185 | 185 | // 3.7.0+ The caller object is no longer a factory object but a form object. |
| 186 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
| 186 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
| 187 | 187 | |
| 188 | 188 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
| 189 | - $aFieldset, // the field definition array |
|
| 190 | - $_oCallerForm->aSavedData, // the stored form data |
|
| 191 | - $_oCallerForm->getFieldErrors(), // the field error array. |
|
| 192 | - $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
| 193 | - $_oCallerForm->oMsg, // the system message object |
|
| 189 | + $aFieldset, // the field definition array |
|
| 190 | + $_oCallerForm->aSavedData, // the stored form data |
|
| 191 | + $_oCallerForm->getFieldErrors(), // the field error array. |
|
| 192 | + $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
| 193 | + $_oCallerForm->oMsg, // the system message object |
|
| 194 | 194 | $_oCallerForm->aCallbacks // field output element callables. |
| 195 | 195 | ); |
| 196 | 196 | return $_oFieldset->get(); |
@@ -230,13 +230,13 @@ discard block |
||
| 230 | 230 | * @since 3.0.3 Tweaked it to have better execution speed. |
| 231 | 231 | * @internal |
| 232 | 232 | */ |
| 233 | - public function getDefinitionArray( $sFieldTypeSlug='' ) { |
|
| 233 | + public function getDefinitionArray( $sFieldTypeSlug = '' ) { |
|
| 234 | 234 | |
| 235 | 235 | // The uniteArrays() method resulted in somewhat being slow due to overhead on checking array keys for recursive array merges. |
| 236 | 236 | $_aDefaultKeys = $this->aDefaultKeys + self::$_aDefaultKeys; |
| 237 | - $_aDefaultKeys['attributes'] = isset( $this->aDefaultKeys['attributes'] ) && is_array( $this->aDefaultKeys['attributes'] ) |
|
| 238 | - ? $this->aDefaultKeys['attributes'] + self::$_aDefaultKeys['attributes'] |
|
| 239 | - : self::$_aDefaultKeys['attributes']; |
|
| 237 | + $_aDefaultKeys[ 'attributes' ] = isset( $this->aDefaultKeys[ 'attributes' ] ) && is_array( $this->aDefaultKeys[ 'attributes' ] ) |
|
| 238 | + ? $this->aDefaultKeys[ 'attributes' ] + self::$_aDefaultKeys[ 'attributes' ] |
|
| 239 | + : self::$_aDefaultKeys[ 'attributes' ]; |
|
| 240 | 240 | |
| 241 | 241 | return array( |
| 242 | 242 | 'sFieldTypeSlug' => $sFieldTypeSlug, |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | * @since 3.0.0 |
| 275 | 275 | * @internal |
| 276 | 276 | */ |
| 277 | - public function _replyToFieldTypeSetter( $sFieldSetType='' ) { |
|
| 277 | + public function _replyToFieldTypeSetter( $sFieldSetType = '' ) { |
|
| 278 | 278 | $this->_sFieldSetType = $sFieldSetType; |
| 279 | 279 | } |
| 280 | 280 | |
@@ -328,8 +328,8 @@ discard block |
||
| 328 | 328 | wp_enqueue_script( 'media-upload' ); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
| 332 | - add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
|
| 331 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php',) ) ) { |
|
| 332 | + add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ), 1, 2 ); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
| 345 | 345 | |
| 346 | 346 | // Replace the button label in the media thick box. |
| 347 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
| 347 | + if ( !in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
| 348 | 348 | return $sTranslated; |
| 349 | 349 | } |
| 350 | 350 | if ( $sText !== 'Insert into Post' ) { |
@@ -354,8 +354,8 @@ discard block |
||
| 354 | 354 | return $sTranslated; |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - if ( isset( $_GET['button_label'] ) ) { |
|
| 358 | - return $_GET['button_label']; |
|
| 357 | + if ( isset( $_GET[ 'button_label' ] ) ) { |
|
| 358 | + return $_GET[ 'button_label' ]; |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | return $this->oProp->sThickBoxButtonUseThis |
@@ -374,12 +374,12 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | public function _replyToRemovingMediaLibraryTab( $aTabs ) { |
| 376 | 376 | |
| 377 | - if ( ! isset( $_REQUEST['enable_external_source'] ) ) { |
|
| 377 | + if ( !isset( $_REQUEST[ 'enable_external_source' ] ) ) { |
|
| 378 | 378 | return $aTabs; |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | - if ( ! $_REQUEST['enable_external_source'] ) { |
|
| 382 | - unset( $aTabs['type_url'] ); // removes the 'From URL' tab in the thick box. |
|
| 381 | + if ( !$_REQUEST[ 'enable_external_source' ] ) { |
|
| 382 | + unset( $aTabs[ 'type_url' ] ); // removes the 'From URL' tab in the thick box. |
|
| 383 | 383 | } |
| 384 | 384 | return $aTabs; |
| 385 | 385 | |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | * @since 3.8.0 |
| 394 | 394 | * @return string |
| 395 | 395 | */ |
| 396 | - protected function getLabelContainerAttributes( array $aField, $asClassAttributes, array $aAttributes=array() ) { |
|
| 396 | + protected function getLabelContainerAttributes( array $aField, $asClassAttributes, array $aAttributes = array() ) { |
|
| 397 | 397 | |
| 398 | 398 | $aAttributes[ 'class' ] = $this->getClassAttribute( $asClassAttributes, $this->getElement( $aAttributes, 'class' ) ); |
| 399 | 399 | $aAttributes[ 'style' ] = $this->getStyleAttribute( |