@@ -91,6 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @since 3.5.4 |
| 93 | 93 | * @since 3.6.3 Moved from `AdminPageFramework_Form_Model_Export`. |
| 94 | + * @param string $sFileName |
|
| 94 | 95 | * @return array |
| 95 | 96 | */ |
| 96 | 97 | private function _getExportHeaderArray( array $aArguments, $sFileName, $mData ) { |
@@ -131,6 +132,7 @@ discard block |
||
| 131 | 132 | * @since 3.5.3 |
| 132 | 133 | * @since 3.6.3 Moved from `AdminPageFramework_Form_Model_Export`. |
| 133 | 134 | * @internal |
| 135 | + * @param string $mData |
|
| 134 | 136 | * @return string The export file name. |
| 135 | 137 | */ |
| 136 | 138 | private function _getExportFileName( array $aArguments, $sExportFileName, $mData ) { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
| 34 | 34 | |
| 35 | - if ( ! $this->_shouldProceed() ) { |
|
| 35 | + if ( !$this->_shouldProceed() ) { |
|
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | $this->_exportOptions( |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected function _exportOptions( $mData, $sPageSlug, $sTabSlug ) { |
| 69 | 69 | |
| 70 | - $_oExport = new AdminPageFramework_ExportOptions( |
|
| 70 | + $_oExport = new AdminPageFramework_ExportOptions( |
|
| 71 | 71 | $this->getHTTPRequestSanitized( $this->getElementAsArray( $_POST, array( '__export' ) ), true ), |
| 72 | 72 | $this->oFactory->oProp->sClassName |
| 73 | 73 | ); |
| 74 | - $_aArguments = array( |
|
| 74 | + $_aArguments = array( |
|
| 75 | 75 | 'class_name' => $this->oFactory->oProp->sClassName, |
| 76 | 76 | 'page_slug' => $sPageSlug, |
| 77 | 77 | 'tab_slug' => $sTabSlug, |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $sExportFileName, |
| 144 | 144 | $aArguments[ 'pressed_field_id' ], |
| 145 | 145 | $aArguments[ 'pressed_input_id' ], |
| 146 | - $mData, // 3.4.6+ |
|
| 146 | + $mData, // 3.4.6+ |
|
| 147 | 147 | $this->oFactory // 3.4.6+ |
| 148 | 148 | ); |
| 149 | 149 | } |
@@ -142,6 +142,7 @@ discard block |
||
| 142 | 142 | /** |
| 143 | 143 | * Sets update admin notice. |
| 144 | 144 | * @since 3.5.3 |
| 145 | + * @param boolean $bEmpty |
|
| 145 | 146 | * @return void |
| 146 | 147 | */ |
| 147 | 148 | private function _setImportAdminNotice( $bEmpty ) { |
@@ -209,6 +210,8 @@ discard block |
||
| 209 | 210 | * @since 3.5.3 |
| 210 | 211 | * @since 3.6.3 Moved from `AdminPageFramework_Form_Model_Import`. |
| 211 | 212 | * @internal |
| 213 | + * @param string $sFormatType |
|
| 214 | + * @param string $sImportOptionKey |
|
| 212 | 215 | * @return string The filtered import data. |
| 213 | 216 | */ |
| 214 | 217 | private function _getFilteredImportData( array $aArguments, $mData, $aStoredOptions, $sFormatType, $sImportOptionKey ) { |
@@ -237,6 +240,7 @@ discard block |
||
| 237 | 240 | * @param string The filter prefix. |
| 238 | 241 | * @param mixed The subject filtering value. |
| 239 | 242 | * @param array An argument array holding submit information. Part of this will be passed to the filter callbacks but this itself does not mean is for the filter callbacks. |
| 243 | + * @param string $sPrefix |
|
| 240 | 244 | */ |
| 241 | 245 | protected function _getFilteredItemForPortByPrefix( $sPrefix, $mFilteringValue, array $aArguments ) { |
| 242 | 246 | return $this->addAndApplyFilters( |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @since 3.6.3 |
| 36 | 36 | */ |
| 37 | 37 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
| 38 | - if ( ! $this->_shouldProceed() ) { |
|
| 38 | + if ( !$this->_shouldProceed() ) { |
|
| 39 | 39 | return; |
| 40 | 40 | } |
| 41 | 41 | $this->_doImportOptions( |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | private function _importOptions( $aStoredOptions, $sPageSlug, $sTabSlug ) { |
| 95 | 95 | |
| 96 | - $_oImport = new AdminPageFramework_ImportOptions( |
|
| 96 | + $_oImport = new AdminPageFramework_ImportOptions( |
|
| 97 | 97 | $this->getHTTPRequestSanitized( $_FILES[ '__import' ], false ), |
| 98 | 98 | $this->getHTTPRequestSanitized( $_POST[ '__import' ], true ) |
| 99 | 99 | ); |
| 100 | - $_aArguments = array( |
|
| 100 | + $_aArguments = array( |
|
| 101 | 101 | 'class_name' => $this->oFactory->oProp->sClassName, |
| 102 | 102 | 'page_slug' => $sPageSlug, |
| 103 | 103 | 'tab_slug' => $sTabSlug, |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | // Check the uploaded file MIME type. |
| 117 | 117 | $_aMIMEType = $this->_getImportMIMEType( $_aArguments ); |
| 118 | 118 | $_sType = $_oImport->getType(); |
| 119 | - if ( ! in_array( $_sType, $_aMIMEType ) ) { |
|
| 119 | + if ( !in_array( $_sType, $_aMIMEType ) ) { |
|
| 120 | 120 | $this->oFactory->setSettingNotice( sprintf( $this->oFactory->oMsg->get( 'uploaded_file_type_not_supported' ), $_sType ) ); |
| 121 | - return $aStoredOptions; // do not change the framework's options. |
|
| 121 | + return $aStoredOptions; // do not change the framework's options. |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | // Retrieve the importing data. |
@@ -183,9 +183,9 @@ discard block |
||
| 183 | 183 | array( |
| 184 | 184 | 'text/plain', |
| 185 | 185 | 'application/octet-stream', // .json file is dealt as a binary file. |
| 186 | - 'application/json', // 3.7.0+ some servers cannot upload json files without this |
|
| 187 | - 'text/html', // 3.7.2+ |
|
| 188 | - 'application/txt', // 3.7.2+ |
|
| 186 | + 'application/json', // 3.7.0+ some servers cannot upload json files without this |
|
| 187 | + 'text/html', // 3.7.2+ |
|
| 188 | + 'application/txt', // 3.7.2+ |
|
| 189 | 189 | ), |
| 190 | 190 | $aArguments |
| 191 | 191 | ); |
@@ -274,18 +274,18 @@ discard block |
||
| 274 | 274 | protected function _getPortFilterHookNames( $sPrefix, array $aArguments ) { |
| 275 | 275 | |
| 276 | 276 | return array( |
| 277 | - $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'pressed_input_id' ], |
|
| 277 | + $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'pressed_input_id' ], |
|
| 278 | 278 | $aArguments[ 'section_id' ] |
| 279 | - ? $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'section_id' ] .'_' . $aArguments[ 'pressed_field_id' ] |
|
| 280 | - : $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'pressed_field_id' ], |
|
| 279 | + ? $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'section_id' ].'_'.$aArguments[ 'pressed_field_id' ] |
|
| 280 | + : $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'pressed_field_id' ], |
|
| 281 | 281 | $aArguments[ 'section_id' ] |
| 282 | - ? $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'section_id' ] |
|
| 282 | + ? $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'section_id' ] |
|
| 283 | 283 | : null, |
| 284 | 284 | $aArguments[ 'tab_slug' ] |
| 285 | - ? $sPrefix . $aArguments[ 'page_slug' ] . '_' . $aArguments[ 'tab_slug' ] |
|
| 285 | + ? $sPrefix.$aArguments[ 'page_slug' ].'_'.$aArguments[ 'tab_slug' ] |
|
| 286 | 286 | : null, |
| 287 | - $sPrefix . $aArguments[ 'page_slug' ], |
|
| 288 | - $sPrefix . $aArguments[ 'class_name' ] |
|
| 287 | + $sPrefix.$aArguments[ 'page_slug' ], |
|
| 288 | + $sPrefix.$aArguments[ 'class_name' ] |
|
| 289 | 289 | ); |
| 290 | 290 | |
| 291 | 291 | } |
@@ -65,6 +65,7 @@ |
||
| 65 | 65 | * Sets the given URL's transient. |
| 66 | 66 | * @since unknown |
| 67 | 67 | * @since 3.6.3 Moved from `AdminPageFramework_Validation`. |
| 68 | + * @param string $sURL |
|
| 68 | 69 | */ |
| 69 | 70 | private function _setRedirectTransients( $sURL, $sPageSlug ) { |
| 70 | 71 | if ( empty( $sURL ) ) { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $aSubmits, |
| 35 | 35 | 'redirect_url' |
| 36 | 36 | ); |
| 37 | - if ( ! $_sRedirectURL ) { |
|
| 37 | + if ( !$_sRedirectURL ) { |
|
| 38 | 38 | return; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | if ( empty( $sURL ) ) { |
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | - $_sTransient = 'apf_rurl' . md5( trim( "redirect_{$this->oFactory->oProp->sClassName}_{$sPageSlug}" ) ); |
|
| 74 | - return $this->setTransient( $_sTransient, $sURL , 60*2 ); |
|
| 73 | + $_sTransient = 'apf_rurl'.md5( trim( "redirect_{$this->oFactory->oProp->sClassName}_{$sPageSlug}" ) ); |
|
| 74 | + return $this->setTransient( $_sTransient, $sURL, 60 * 2 ); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | } |
@@ -71,6 +71,7 @@ |
||
| 71 | 71 | * @since 3.6.3 Moved from `AdminPageFramework_Validation`. |
| 72 | 72 | * @remark `$aInputs` has only the page elements that called the validation callback. |
| 73 | 73 | * In other words, it does not hold other pages' option keys. |
| 74 | + * @param string $sKeyToReset |
|
| 74 | 75 | * @return array The modified input array. |
| 75 | 76 | */ |
| 76 | 77 | private function _resetOptions( $sKeyToReset, array $aInputs, array $aSubmitInformation ) { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
| 36 | 36 | |
| 37 | - if ( ! $this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
| 37 | + if ( !$this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
| 38 | 38 | return; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | 'reset_key' |
| 45 | 45 | ); |
| 46 | 46 | $_sKeyToReset = trim( $_sKeyToReset ); |
| 47 | - if ( ! $_sKeyToReset ) { |
|
| 47 | + if ( !$_sKeyToReset ) { |
|
| 48 | 48 | return; |
| 49 | 49 | } |
| 50 | 50 | $_oException = new Exception( 'aReturn' ); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * @return boolean |
| 62 | 62 | */ |
| 63 | 63 | protected function _shouldProceed( $oFactory, $aSubmits ) { |
| 64 | - return ! $oFactory->hasFieldError(); |
|
| 64 | + return !$oFactory->hasFieldError(); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | $this->_doResetActions( $sKeyToReset, $aInputs, $aSubmitInformation ); |
| 80 | 80 | |
| 81 | 81 | // As of 3.1.0, an empty value is accepted for the option key. |
| 82 | - if ( ! $this->oFactory->oProp->sOptionKey ) { |
|
| 82 | + if ( !$this->oFactory->oProp->sOptionKey ) { |
|
| 83 | 83 | return array(); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | // The key to delete is not specified, 1 is sent from the form input. |
| 87 | - if ( in_array( $sKeyToReset, array( '1', ), true ) ) { |
|
| 87 | + if ( in_array( $sKeyToReset, array( '1',), true ) ) { |
|
| 88 | 88 | delete_option( $this->oFactory->oProp->sOptionKey ); |
| 89 | 89 | return array(); |
| 90 | 90 | } |
@@ -233,6 +233,7 @@ discard block |
||
| 233 | 233 | * @param string the tagged HTML link text. |
| 234 | 234 | * @param string (optional) another tagged HTML link text. |
| 235 | 235 | * @param string (optional) add more as many as want by adding items to the next parameters. |
| 236 | + * @param string $sTaggedLinkHTML1 |
|
| 236 | 237 | * @access public |
| 237 | 238 | * @return void |
| 238 | 239 | */ |
@@ -258,6 +259,9 @@ discard block |
||
| 258 | 259 | * @param string the tagged HTML link text. |
| 259 | 260 | * @param string (optional) another tagged HTML link text. |
| 260 | 261 | * @param string (optional) add more as many as want by adding items to the next parameters. |
| 262 | + * @param null|string $sTaggedLinkHTML1 |
|
| 263 | + * @param string $sTaggedLinkHTML2 |
|
| 264 | + * @param string $_and_more |
|
| 261 | 265 | * @access public |
| 262 | 266 | * @return void |
| 263 | 267 | */ |
@@ -277,6 +281,7 @@ discard block |
||
| 277 | 281 | * |
| 278 | 282 | * @since 3.1.0 |
| 279 | 283 | * @since 3.3.1 Moved from `AdminPageFramework`. |
| 284 | + * @param string $sLabel |
|
| 280 | 285 | */ |
| 281 | 286 | public function setPluginSettingsLinkLabel( $sLabel ) { |
| 282 | 287 | $this->oProp->sLabelPluginSettingsLink = $sLabel; |
@@ -218,24 +218,24 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
| 221 | - * Adds the given link(s) into the description cell of the plugin listing table. |
|
| 222 | - * |
|
| 223 | - * <h4>Example</h4> |
|
| 224 | - * <code>$this->addLinkToPluginDescription( |
|
| 225 | - * "<a href='http://www.google.com'>Google</a>", |
|
| 226 | - * "<a href='http://www.yahoo.com'>Yahoo!</a>" |
|
| 227 | - * );</code> |
|
| 228 | - * |
|
| 229 | - * @since 2.0.0 |
|
| 230 | - * @since 3.0.0 Changed the scope to public from protected. |
|
| 231 | - * @since 3.3.1 Moved from `AdminPageFramework`. |
|
| 232 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
| 233 | - * @param string the tagged HTML link text. |
|
| 234 | - * @param string (optional) another tagged HTML link text. |
|
| 235 | - * @param string (optional) add more as many as want by adding items to the next parameters. |
|
| 236 | - * @access public |
|
| 237 | - * @return void |
|
| 238 | - */ |
|
| 221 | + * Adds the given link(s) into the description cell of the plugin listing table. |
|
| 222 | + * |
|
| 223 | + * <h4>Example</h4> |
|
| 224 | + * <code>$this->addLinkToPluginDescription( |
|
| 225 | + * "<a href='http://www.google.com'>Google</a>", |
|
| 226 | + * "<a href='http://www.yahoo.com'>Yahoo!</a>" |
|
| 227 | + * );</code> |
|
| 228 | + * |
|
| 229 | + * @since 2.0.0 |
|
| 230 | + * @since 3.0.0 Changed the scope to public from protected. |
|
| 231 | + * @since 3.3.1 Moved from `AdminPageFramework`. |
|
| 232 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
| 233 | + * @param string the tagged HTML link text. |
|
| 234 | + * @param string (optional) another tagged HTML link text. |
|
| 235 | + * @param string (optional) add more as many as want by adding items to the next parameters. |
|
| 236 | + * @access public |
|
| 237 | + * @return void |
|
| 238 | + */ |
|
| 239 | 239 | public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
| 240 | 240 | if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
| 241 | 241 | return; |
@@ -244,23 +244,23 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | - * Adds the given link(s) into the title cell of the plugin listing table. |
|
| 248 | - * |
|
| 249 | - * <h4>Example</h4> |
|
| 250 | - * <code>$this->addLinkToPluginTitle( |
|
| 251 | - * "<a href='http://www.wordpress.org'>WordPress</a>" |
|
| 252 | - * );</code> |
|
| 253 | - * |
|
| 254 | - * @since 2.0.0 |
|
| 255 | - * @since 3.0.0 Changed the scope to public from protected. |
|
| 256 | - * @since 3.3.1 Moved from `AdminPageFramework`. |
|
| 257 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
| 258 | - * @param string the tagged HTML link text. |
|
| 259 | - * @param string (optional) another tagged HTML link text. |
|
| 260 | - * @param string (optional) add more as many as want by adding items to the next parameters. |
|
| 261 | - * @access public |
|
| 262 | - * @return void |
|
| 263 | - */ |
|
| 247 | + * Adds the given link(s) into the title cell of the plugin listing table. |
|
| 248 | + * |
|
| 249 | + * <h4>Example</h4> |
|
| 250 | + * <code>$this->addLinkToPluginTitle( |
|
| 251 | + * "<a href='http://www.wordpress.org'>WordPress</a>" |
|
| 252 | + * );</code> |
|
| 253 | + * |
|
| 254 | + * @since 2.0.0 |
|
| 255 | + * @since 3.0.0 Changed the scope to public from protected. |
|
| 256 | + * @since 3.3.1 Moved from `AdminPageFramework`. |
|
| 257 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
| 258 | + * @param string the tagged HTML link text. |
|
| 259 | + * @param string (optional) another tagged HTML link text. |
|
| 260 | + * @param string (optional) add more as many as want by adding items to the next parameters. |
|
| 261 | + * @access public |
|
| 262 | + * @return void |
|
| 263 | + */ |
|
| 264 | 264 | public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
| 265 | 265 | |
| 266 | 266 | if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @param array $aCustomArgs (optional) The argument array for more advanced parameters. |
| 115 | 115 | * @return array The array holing the queued items. |
| 116 | 116 | */ |
| 117 | - public function enqueueStyles( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
| 117 | + public function enqueueStyles( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
| 118 | 118 | return $this->oResource->_enqueueStyles( $aSRCs, $sPageSlug, $sTabSlug, $aCustomArgs ); |
| 119 | 119 | } |
| 120 | 120 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * </ul> |
| 150 | 150 | * @return string The style handle ID. If the passed url is not a valid url string, an empty string will be returned. |
| 151 | 151 | */ |
| 152 | - public function enqueueStyle( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
| 152 | + public function enqueueStyle( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
| 153 | 153 | return $this->oResource->_enqueueStyle( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
| 154 | 154 | } |
| 155 | 155 | /** |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * @param array (optional) The argument array for more advanced parameters. |
| 175 | 175 | * @return array The array holding the queued items. |
| 176 | 176 | */ |
| 177 | - public function enqueueScripts( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
| 177 | + public function enqueueScripts( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
| 178 | 178 | return $this->oResource->_enqueueScripts( $aSRCs, $sPageSlug, $sTabSlug, $aCustomArgs ); |
| 179 | 179 | } |
| 180 | 180 | /** |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * </ul> |
| 214 | 214 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
| 215 | 215 | */ |
| 216 | - public function enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
| 216 | + public function enqueueScript( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
| 217 | 217 | return $this->oResource->_enqueueScript( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
| 218 | 218 | } |
| 219 | 219 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @access public |
| 237 | 237 | * @return void |
| 238 | 238 | */ |
| 239 | - public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
|
| 239 | + public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2 = null, $_and_more = null ) { |
|
| 240 | 240 | if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
| 241 | 241 | return; |
| 242 | 242 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | * @access public |
| 262 | 262 | * @return void |
| 263 | 263 | */ |
| 264 | - public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
|
| 264 | + public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2 = null, $_and_more = null ) { |
|
| 265 | 265 | |
| 266 | 266 | if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
| 267 | 267 | return; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * @param string (optional) The class selector used in the message HTML element. 'error' and 'updated' are prepared by WordPress but it's not limited to them and can pass a custom name. Default: 'error'. |
| 321 | 321 | * @param string (optional) The ID of the message. If not set, the hash of the message will be used. |
| 322 | 322 | */ |
| 323 | - public function setAdminNotice( $sMessage, $sClassSelector='error', $sID='' ) { |
|
| 323 | + public function setAdminNotice( $sMessage, $sClassSelector = 'error', $sID = '' ) { |
|
| 324 | 324 | |
| 325 | 325 | $sID = $sID ? $sID : md5( $sMessage ); |
| 326 | 326 | |
@@ -357,9 +357,9 @@ discard block |
||
| 357 | 357 | * @param boolean If true, the passed key(s) will be appended to the property; otherwise, it will override the property. |
| 358 | 358 | * @return void |
| 359 | 359 | */ |
| 360 | - public function setDisallowedQueryKeys( $asQueryKeys, $bAppend=true ) { |
|
| 360 | + public function setDisallowedQueryKeys( $asQueryKeys, $bAppend = true ) { |
|
| 361 | 361 | |
| 362 | - if ( ! $bAppend ) { |
|
| 362 | + if ( !$bAppend ) { |
|
| 363 | 363 | $this->oProp->aDisallowedQueryKeys = ( array ) $asQueryKeys; |
| 364 | 364 | return; |
| 365 | 365 | } |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | * @param mixed $vDefault the default value that will be returned if nothing is stored. |
| 403 | 403 | * @return mixed If the field ID is not specified |
| 404 | 404 | */ |
| 405 | - static public function getOption( $sOptionKey, $asKey=null, $vDefault=null ) { |
|
| 405 | + static public function getOption( $sOptionKey, $asKey = null, $vDefault = null ) { |
|
| 406 | 406 | return AdminPageFramework_WPUtility::getOption( $sOptionKey, $asKey, $vDefault ); |
| 407 | 407 | } |
| 408 | 408 | |
@@ -193,9 +193,6 @@ |
||
| 193 | 193 | * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
| 194 | 194 | * @access public |
| 195 | 195 | * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
| 196 | - * @param string $sSectionID1 the section ID to remove. |
|
| 197 | - * @param string $sSectionID2 (optional) another section ID to remove. |
|
| 198 | - * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
| 199 | 196 | * @return void |
| 200 | 197 | */ |
| 201 | 198 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
@@ -180,24 +180,24 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
| 183 | - * Removes the given section(s) by section ID. |
|
| 184 | - * |
|
| 185 | - * This accesses the property storing the added section arrays and removes the specified ones. |
|
| 186 | - * |
|
| 187 | - * <h4>Example</h4> |
|
| 188 | - * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
| 189 | - * </code> |
|
| 190 | - * |
|
| 191 | - * @since 2.0.0 |
|
| 192 | - * @since 3.0.0 Changed the scope to public from protected. |
|
| 193 | - * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
| 194 | - * @access public |
|
| 195 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
| 196 | - * @param string $sSectionID1 the section ID to remove. |
|
| 197 | - * @param string $sSectionID2 (optional) another section ID to remove. |
|
| 198 | - * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
| 199 | - * @return void |
|
| 200 | - */ |
|
| 183 | + * Removes the given section(s) by section ID. |
|
| 184 | + * |
|
| 185 | + * This accesses the property storing the added section arrays and removes the specified ones. |
|
| 186 | + * |
|
| 187 | + * <h4>Example</h4> |
|
| 188 | + * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
| 189 | + * </code> |
|
| 190 | + * |
|
| 191 | + * @since 2.0.0 |
|
| 192 | + * @since 3.0.0 Changed the scope to public from protected. |
|
| 193 | + * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
| 194 | + * @access public |
|
| 195 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
| 196 | + * @param string $sSectionID1 the section ID to remove. |
|
| 197 | + * @param string $sSectionID2 (optional) another section ID to remove. |
|
| 198 | + * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
| 199 | + * @return void |
|
| 200 | + */ |
|
| 201 | 201 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
| 202 | 202 | foreach( func_get_args() as $_sSectionID ) { |
| 203 | 203 | $this->oForm->removeSection( $_sSectionID ); |
@@ -262,38 +262,38 @@ discard block |
||
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | /** |
| 265 | - * Adds the given field array items into the field array property. |
|
| 266 | - * |
|
| 267 | - * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
| 268 | - * |
|
| 269 | - * @since 2.1.2 |
|
| 270 | - * @since 3.0.0 Changed the scope to public from protected. |
|
| 271 | - * @access public |
|
| 272 | - * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
| 273 | - * @return void |
|
| 274 | - */ |
|
| 265 | + * Adds the given field array items into the field array property. |
|
| 266 | + * |
|
| 267 | + * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
| 268 | + * |
|
| 269 | + * @since 2.1.2 |
|
| 270 | + * @since 3.0.0 Changed the scope to public from protected. |
|
| 271 | + * @access public |
|
| 272 | + * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
| 273 | + * @return void |
|
| 274 | + */ |
|
| 275 | 275 | public function addSettingField( $asField ) { |
| 276 | 276 | $this->oForm->addField( $asField ); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | /** |
| 280 | - * Removes the given field(s) by field ID. |
|
| 281 | - * |
|
| 282 | - * This accesses the property storing the added field arrays and removes the specified ones. |
|
| 283 | - * |
|
| 284 | - * <h4>Example</h4> |
|
| 285 | - * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
| 286 | - * </code> |
|
| 287 | - * |
|
| 288 | - * @since 2.0.0 |
|
| 289 | - * @since 3.0.0 Changed the scope to public from protected. |
|
| 290 | - * @access public |
|
| 291 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
| 292 | - * @param string $sFieldID1 the field ID to remove. |
|
| 293 | - * @param string $sFieldID2 (optional) another field ID to remove. |
|
| 294 | - * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
| 295 | - * @return void |
|
| 296 | - */ |
|
| 280 | + * Removes the given field(s) by field ID. |
|
| 281 | + * |
|
| 282 | + * This accesses the property storing the added field arrays and removes the specified ones. |
|
| 283 | + * |
|
| 284 | + * <h4>Example</h4> |
|
| 285 | + * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
| 286 | + * </code> |
|
| 287 | + * |
|
| 288 | + * @since 2.0.0 |
|
| 289 | + * @since 3.0.0 Changed the scope to public from protected. |
|
| 290 | + * @access public |
|
| 291 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
| 292 | + * @param string $sFieldID1 the field ID to remove. |
|
| 293 | + * @param string $sFieldID2 (optional) another field ID to remove. |
|
| 294 | + * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
| 295 | + * @return void |
|
| 296 | + */ |
|
| 297 | 297 | public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more ) { |
| 298 | 298 | foreach( func_get_args() as $_sFieldID ) { |
| 299 | 299 | $this->oForm->removeField( $_sFieldID ); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) { |
| 86 | 86 | |
| 87 | - foreach( func_get_args() as $asSection ) { |
|
| 87 | + foreach ( func_get_args() as $asSection ) { |
|
| 88 | 88 | $this->addSettingSection( $asSection ); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function addSettingSection( $asSection ) { |
| 109 | 109 | |
| 110 | - if ( ! is_array( $asSection ) ) { |
|
| 110 | + if ( !is_array( $asSection ) ) { |
|
| 111 | 111 | $this->_sTargetPageSlug = is_string( $asSection ) |
| 112 | 112 | ? $asSection |
| 113 | 113 | : $this->_sTargetPageSlug; |
@@ -129,10 +129,10 @@ discard block |
||
| 129 | 129 | ) |
| 130 | 130 | ); |
| 131 | 131 | |
| 132 | - $aSection[ 'section_tab_slug' ] = $this->oUtil->sanitizeSlug( $aSection[ 'section_tab_slug' ] ); |
|
| 132 | + $aSection[ 'section_tab_slug' ] = $this->oUtil->sanitizeSlug( $aSection[ 'section_tab_slug' ] ); |
|
| 133 | 133 | |
| 134 | 134 | // A page slug is required. |
| 135 | - if ( ! $aSection[ 'page_slug' ] ) { |
|
| 135 | + if ( !$aSection[ 'page_slug' ] ) { |
|
| 136 | 136 | return; |
| 137 | 137 | } |
| 138 | 138 | $this->oForm->addSection( $aSection ); |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | private function _getTargetPageSlug( $aSection ) { |
| 149 | 149 | |
| 150 | 150 | $_sTargetPageSlug = $this->oUtil->getElement( |
| 151 | - $aSection, // subject |
|
| 152 | - 'page_slug', // key |
|
| 151 | + $aSection, // subject |
|
| 152 | + 'page_slug', // key |
|
| 153 | 153 | $this->_sTargetPageSlug // default |
| 154 | 154 | ); |
| 155 | 155 | |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | private function _getTargetTabSlug( $aSection ) { |
| 171 | 171 | $_sTargetTabSlug = $this->oUtil->getElement( |
| 172 | - $aSection, // subject |
|
| 173 | - 'tab_slug', // key |
|
| 172 | + $aSection, // subject |
|
| 173 | + 'tab_slug', // key |
|
| 174 | 174 | $this->_sTargetTabSlug // default |
| 175 | 175 | ); |
| 176 | 176 | $_sTargetTabSlug = $_sTargetTabSlug |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | * @return void |
| 200 | 200 | */ |
| 201 | 201 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
| 202 | - foreach( func_get_args() as $_sSectionID ) { |
|
| 202 | + foreach ( func_get_args() as $_sSectionID ) { |
|
| 203 | 203 | $this->oForm->removeSection( $_sSectionID ); |
| 204 | 204 | } |
| 205 | 205 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * @remark The actual registration will be performed in the <em>_replyToRegisterSettings()</em> method with the <em>admin_menu</em> hook. |
| 258 | 258 | */ |
| 259 | 259 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
| 260 | - foreach( func_get_args() as $aField ) { |
|
| 260 | + foreach ( func_get_args() as $aField ) { |
|
| 261 | 261 | $this->addSettingField( $aField ); |
| 262 | 262 | } |
| 263 | 263 | } |
@@ -294,8 +294,8 @@ discard block |
||
| 294 | 294 | * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
| 295 | 295 | * @return void |
| 296 | 296 | */ |
| 297 | - public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more ) { |
|
| 298 | - foreach( func_get_args() as $_sFieldID ) { |
|
| 297 | + public function removeSettingFields( $sFieldID1, $sFieldID2 = null, $_and_more ) { |
|
| 298 | + foreach ( func_get_args() as $_sFieldID ) { |
|
| 299 | 299 | $this->oForm->removeField( $_sFieldID ); |
| 300 | 300 | } |
| 301 | 301 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $this->oProp->sOptionKey, |
| 343 | 343 | empty( $_aParams ) |
| 344 | 344 | ? null // will return the entire options array |
| 345 | - : $_aDimensionalKeys, // dimensional keys |
|
| 345 | + : $_aDimensionalKeys, // dimensional keys |
|
| 346 | 346 | $_mDefault, // default |
| 347 | 347 | $this->getSavedOptions() + $this->oForm->getDefaultFormValues() |
| 348 | 348 | ); |
@@ -361,21 +361,21 @@ discard block |
||
| 361 | 361 | * If the user has not submitted the form, the framework will try to return the default value set in the field definition array. |
| 362 | 362 | * @deprecated 3.3.0 |
| 363 | 363 | */ |
| 364 | - public function getFieldValue( $sFieldID, $sSectionID='' ) { |
|
| 364 | + public function getFieldValue( $sFieldID, $sSectionID = '' ) { |
|
| 365 | 365 | |
| 366 | 366 | $this->oUtil->showDeprecationNotice( |
| 367 | - 'The method,' . __METHOD__ . ',', // deprecated item |
|
| 367 | + 'The method,'.__METHOD__.',', // deprecated item |
|
| 368 | 368 | 'getValue()' // alternative |
| 369 | 369 | ); |
| 370 | 370 | |
| 371 | 371 | $_aOptions = $this->oUtil->uniteArrays( $this->oProp->aOptions, $this->oForm->getDefaultFormValues() ); |
| 372 | 372 | /* If it's saved, return it */ |
| 373 | - if ( ! $sSectionID ) { |
|
| 373 | + if ( !$sSectionID ) { |
|
| 374 | 374 | if ( array_key_exists( $sFieldID, $_aOptions ) ) { |
| 375 | 375 | return $_aOptions[ $sFieldID ]; |
| 376 | 376 | } |
| 377 | 377 | // loop through section elements |
| 378 | - foreach( $_aOptions as $aOptions ) { |
|
| 378 | + foreach ( $_aOptions as $aOptions ) { |
|
| 379 | 379 | if ( array_key_exists( $sFieldID, $aOptions ) ) { |
| 380 | 380 | return $aOptions[ $sFieldID ]; |
| 381 | 381 | } |
@@ -51,43 +51,6 @@ discard block |
||
| 51 | 51 | * @since 2.0.0 |
| 52 | 52 | * @since 3.0.0 Changed the scope to public. Added page slug target support. |
| 53 | 53 | * @since 3.3.1 Moved from `AdminPageFramework_Page`. |
| 54 | - * @param array $aTab1 The in-page tab array. |
|
| 55 | - * <h4>In-Page Tab Array</h4> |
|
| 56 | - * <ul> |
|
| 57 | - * <li>**page_slug** - (string) the page slug that the tab belongs to.</li> |
|
| 58 | - * <li>**tab_slug** - (string) the tab slug. Non-alphabetical characters should not be used including dots(.) and hyphens(-).</li> |
|
| 59 | - * <li>**title** - (string) the title of the tab.</li> |
|
| 60 | - * <li>**order** - (optional, integer) the order number of the tab. The lager the number is, the lower the position it is placed in the menu.</li> |
|
| 61 | - * <li>**show_in_page_tab** - (optional, boolean) default: `true`. If this is set to `false`, the tab title will not be displayed in the tab navigation menu; however, it is still accessible from the direct URL.</li> |
|
| 62 | - * <li>**parent_tab_slug** - (optional, string) this needs to be set if the above `show_in_page_tab` argument is `false` so that the parent tab will be emphasized as active when the hidden page is accessed.</li> |
|
| 63 | - * <li>**url** - [3.5.0+] (optional, string) If this is set, the link url of the navigation tab will be this url. Use this to create link only tab.</li> |
|
| 64 | - * <li>**capability** - [3.6.0+] (optional, string) The capability level.</li> |
|
| 65 | - * <li>**if** - [3.6.0+] (optional, boolean) Whether the tab should be displayed or not.</li> |
|
| 66 | - * <li>style - [3.6.3+] (optional) (string|array) The path or url of a stylesheet which gets loaded in the head tag. Or inline CSS rules. |
|
| 67 | - * When custom arguments need to be set such as whether it should be inserted in the footer, set an array holding the following arguments. |
|
| 68 | - * <ul> |
|
| 69 | - * <li>src - (required, string) the source url or path.</li> |
|
| 70 | - * <li>handle_id - (optional, string) The handle ID of the stylesheet.</li> |
|
| 71 | - * <li>dependencies - (optional, array) The dependency array.</li> |
|
| 72 | - * <li>version - (optional, string) The stylesheet version number.</li> |
|
| 73 | - * <li>media - (optional, string) the description of the field which is inserted into the after the input field tag.</li> |
|
| 74 | - * </ul> |
|
| 75 | - * </li> |
|
| 76 | - * <li>script - [3.6.3+] (optional) (string|array) The path or url of a JavaScript script which gets loaded in the head tag. Or an inline JavaScript script. |
|
| 77 | - * When custom arguments need to be set such as whether it should be inserted in the footer, set an array holding the following arguments. |
|
| 78 | - * <ul> |
|
| 79 | - * <li>src - (required, string) the source url or path.</li> |
|
| 80 | - * <li>handle_id - (optional, string) The handle ID of the stylesheet.</li> |
|
| 81 | - * <li>dependencies - (optional, array) The dependency array.</li> |
|
| 82 | - * <li>version - (optional, string) The stylesheet version number.</li> |
|
| 83 | - * <li>translation - (optional, array) an array holding translation key-value pairs.</li> |
|
| 84 | - * </ul> |
|
| 85 | - * </li> |
|
| 86 | - * <li>show_debug_info - [3.8.8+] (optional, boolean) Whether to show debug information. If `WP_DEBUG` is false, the debug output will not be displayed. Default: `true`.</li> |
|
| 87 | - * </ul> |
|
| 88 | - * @param array $aTab2 Another in-page tab array. |
|
| 89 | - * @param array $_and_more (optional) Add in-page tab arrays as many as necessary to the next parameters. |
|
| 90 | - * @param string $sPageSlug (optional) If the passed parameter item is a string, it will be stored as the target page slug so that it will be applied to the next passed tab arrays as the page_slug element. |
|
| 91 | 54 | * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
| 92 | 55 | * @remark In-page tabs are different from page-heading tabs which is automatically added with page titles. |
| 93 | 56 | * @return void |
@@ -277,6 +240,10 @@ discard block |
||
| 277 | 240 | /** |
| 278 | 241 | * Sets a page property. |
| 279 | 242 | * @since 3.6.0 |
| 243 | + * @param string $sPropertyName |
|
| 244 | + * @param string $sPropertyKey |
|
| 245 | + * @param boolean|string $mValue |
|
| 246 | + * @param string $sPageSlug |
|
| 280 | 247 | * @return void |
| 281 | 248 | */ |
| 282 | 249 | private function _setPageProperty( $sPropertyName, $sPropertyKey, $mValue, $sPageSlug ) { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @return void |
| 94 | 94 | */ |
| 95 | 95 | public function addInPageTabs( /* $aTab1, $aTab2=null, $_and_more=null */ ) { |
| 96 | - foreach( func_get_args() as $asTab ) { |
|
| 96 | + foreach ( func_get_args() as $asTab ) { |
|
| 97 | 97 | $this->addInPageTab( $asTab ); |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | // Target page slug - will be applied when no page slug is specified. |
| 117 | 117 | static $__sTargetPageSlug; |
| 118 | - if ( ! is_array( $asInPageTab ) ) { |
|
| 118 | + if ( !is_array( $asInPageTab ) ) { |
|
| 119 | 119 | $__sTargetPageSlug = is_string( $asInPageTab ) |
| 120 | 120 | ? $asInPageTab |
| 121 | 121 | : $__sTargetPageSlug; // set the target page slug |
@@ -130,23 +130,23 @@ discard block |
||
| 130 | 130 | ); |
| 131 | 131 | |
| 132 | 132 | // Set the target page slug for next calls |
| 133 | - $__sTargetPageSlug = $aInPageTab[ 'page_slug' ]; |
|
| 133 | + $__sTargetPageSlug = $aInPageTab[ 'page_slug' ]; |
|
| 134 | 134 | |
| 135 | 135 | // Required keys |
| 136 | - if ( ! isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
| 136 | + if ( !isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
| 137 | 137 | return; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // Count - the number of added in-page tabs. |
| 141 | - $_aElements = $this->oUtil->getElement( |
|
| 141 | + $_aElements = $this->oUtil->getElement( |
|
| 142 | 142 | $this->oProp->aInPageTabs, |
| 143 | 143 | $aInPageTab[ 'page_slug' ], |
| 144 | 144 | array() |
| 145 | 145 | ); |
| 146 | - $_iCountElement = count( $_aElements ); |
|
| 146 | + $_iCountElement = count( $_aElements ); |
|
| 147 | 147 | |
| 148 | 148 | // Pre-format |
| 149 | - $aInPageTab = array( |
|
| 149 | + $aInPageTab = array( |
|
| 150 | 150 | 'page_slug' => $this->oUtil->sanitizeSlug( $aInPageTab[ 'page_slug' ] ), |
| 151 | 151 | 'tab_slug' => $this->oUtil->sanitizeSlug( $aInPageTab[ 'tab_slug' ] ), |
| 152 | 152 | 'order' => $this->oUtil->getAOrB( |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * @param boolean $bShow If false, the page title will not be displayed. |
| 175 | 175 | * @return void |
| 176 | 176 | */ |
| 177 | - public function setPageTitleVisibility( $bShow=true, $sPageSlug='' ) { |
|
| 177 | + public function setPageTitleVisibility( $bShow = true, $sPageSlug = '' ) { |
|
| 178 | 178 | $this->_setPageProperty( |
| 179 | 179 | 'bShowPageTitle', |
| 180 | 180 | 'show_page_title', |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * @remark Page-heading tabs and in-page tabs are different. The former displays page titles and the latter displays tab titles. |
| 199 | 199 | * @remark If the second parameter is omitted, it sets the default value. |
| 200 | 200 | */ |
| 201 | - public function setPageHeadingTabsVisibility( $bShow=true, $sPageSlug='' ) { |
|
| 201 | + public function setPageHeadingTabsVisibility( $bShow = true, $sPageSlug = '' ) { |
|
| 202 | 202 | $this->_setPageProperty( |
| 203 | 203 | 'bShowPageHeadingTabs', |
| 204 | 204 | 'show_page_heading_tabs', |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | * @param string $sPageSlug The page to apply the visibility setting. If not set, it applies to all the pages. |
| 220 | 220 | * @remark If the second parameter is omitted, it sets the default value. |
| 221 | 221 | */ |
| 222 | - public function setInPageTabsVisibility( $bShow=true, $sPageSlug='' ) { |
|
| 222 | + public function setInPageTabsVisibility( $bShow = true, $sPageSlug = '' ) { |
|
| 223 | 223 | $this->_setPageProperty( |
| 224 | 224 | 'bShowInPageTabs', |
| 225 | 225 | 'show_in_page_tabs', |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | * @param string $sPageSlug The page slug that applies the setting. |
| 243 | 243 | * @remark If the second parameter is omitted, it sets the default value. |
| 244 | 244 | */ |
| 245 | - public function setInPageTabTag( $sTag='h3', $sPageSlug='' ) { |
|
| 245 | + public function setInPageTabTag( $sTag = 'h3', $sPageSlug = '' ) { |
|
| 246 | 246 | $this->_setPageProperty( |
| 247 | 247 | 'sInPageTabTag', |
| 248 | 248 | 'in_page_tab_tag', |
@@ -265,9 +265,9 @@ discard block |
||
| 265 | 265 | * @param string $sPageSlug The page slug that applies the setting. |
| 266 | 266 | * @remark If the second parameter is omitted, it sets the default value. |
| 267 | 267 | */ |
| 268 | - public function setPageHeadingTabTag( $sTag='h2', $sPageSlug='' ) { |
|
| 268 | + public function setPageHeadingTabTag( $sTag = 'h2', $sPageSlug = '' ) { |
|
| 269 | 269 | $this->_setPageProperty( |
| 270 | - 'sPageHeadingTabTag', // property name |
|
| 270 | + 'sPageHeadingTabTag', // property name |
|
| 271 | 271 | 'page_heading_tab_tag', // property key |
| 272 | 272 | $sTag, // value |
| 273 | 273 | $sPageSlug // page slug |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | $this->oProp->{$sPropertyName} = $mValue; |
| 291 | 291 | |
| 292 | - foreach( $this->oProp->aPages as &$_aPage ) { |
|
| 292 | + foreach ( $this->oProp->aPages as &$_aPage ) { |
|
| 293 | 293 | $_aPage[ $sPropertyKey ] = $mValue; |
| 294 | 294 | |
| 295 | 295 | } |
@@ -25,6 +25,7 @@ |
||
| 25 | 25 | * Sets up hooks and properties. |
| 26 | 26 | * |
| 27 | 27 | * @internal |
| 28 | + * @param AdminPageFramework_PostType_Model $oFactory |
|
| 28 | 29 | */ |
| 29 | 30 | public function __construct( $oFactory ) { |
| 30 | 31 | |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - /** |
|
| 95 | + /** |
|
| 96 | 96 | * Resets the rewrite rules for custom post types. |
| 97 | 97 | * |
| 98 | 98 | * This must be done after the post type is registered. So the shutdown action hook is used. |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function __construct( $oFactory ) { |
| 30 | 30 | |
| 31 | - if ( ! $this->_shouldProceed( $oFactory ) ) { |
|
| 31 | + if ( !$this->_shouldProceed( $oFactory ) ) { |
|
| 32 | 32 | return; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | private function _shouldProceed( $oFactory ) { |
| 55 | 55 | |
| 56 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
| 56 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
| 57 | 57 | return false; |
| 58 | 58 | } |
| 59 | - if ( ! $oFactory->oProp->sCallerPath ) { |
|
| 59 | + if ( !$oFactory->oProp->sCallerPath ) { |
|
| 60 | 60 | return false; |
| 61 | 61 | } |
| 62 | 62 | return 'plugin' === $oFactory->oProp->sScriptType; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // If the execution flow in the plugin activation hook, schedule flushing rewrite rules. |
| 89 | - if ( did_action( 'activate_' . plugin_basename( $this->oFactory->oProp->sCallerPath ) ) ) { |
|
| 89 | + if ( did_action( 'activate_'.plugin_basename( $this->oFactory->oProp->sCallerPath ) ) ) { |
|
| 90 | 90 | add_action( 'shutdown', array( $this, '_replyToFlushRewriteRules' ) ); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -25,6 +25,7 @@ discard block |
||
| 25 | 25 | * Sets up hooks and properties. |
| 26 | 26 | * |
| 27 | 27 | * @internal |
| 28 | + * @param AdminPageFramework_PostType_Model $oFactory |
|
| 28 | 29 | */ |
| 29 | 30 | public function __construct( $oFactory ) { |
| 30 | 31 | |
@@ -81,6 +82,7 @@ discard block |
||
| 81 | 82 | |
| 82 | 83 | /** |
| 83 | 84 | * @since 3.7.4 |
| 85 | + * @param string $sSubMenuSlug |
|
| 84 | 86 | */ |
| 85 | 87 | private function _setSubMenuSlugForSorting( $sSubMenuSlug ) { |
| 86 | 88 | |
@@ -93,6 +95,7 @@ discard block |
||
| 93 | 95 | |
| 94 | 96 | /** |
| 95 | 97 | * @since 3.7.4 |
| 98 | + * @param string $sSubMenuSlug |
|
| 96 | 99 | */ |
| 97 | 100 | private function _setSubMenuItemIndex( $sSubMenuSlug ) { |
| 98 | 101 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | $this->oFactory = $oFactory; |
| 32 | 32 | |
| 33 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
| 33 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
| 34 | 34 | return; |
| 35 | 35 | } |
| 36 | 36 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | add_action( |
| 48 | 48 | 'admin_menu', |
| 49 | - array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
| 49 | + array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
| 50 | 50 | 9999 |
| 51 | 51 | ); |
| 52 | 52 | |
@@ -61,15 +61,15 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // Check the post type `show_ui` and other related UI arguments. |
| 63 | 63 | $_bsShowInMeenu = $this->getShowInMenuPostTypeArgument( $this->oFactory->oProp->aPostTypeArgs ); |
| 64 | - if ( ! $_bsShowInMeenu ) { |
|
| 64 | + if ( !$_bsShowInMeenu ) { |
|
| 65 | 65 | return; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // If the user sets a menu slug to the 'show_in_menu' argument, use that. |
| 69 | 69 | // It is used to set a custom post type sub-menu belong to another menu. |
| 70 | - $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
| 70 | + $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
| 71 | 71 | ? $_bsShowInMeenu |
| 72 | - : 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
| 72 | + : 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
| 73 | 73 | |
| 74 | 74 | // Set the index to the framework specific global array for sorting. |
| 75 | 75 | $this->_setSubMenuSlugForSorting( $_sSubMenuSlug ); |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | // @remark This is the partial link url set in the third element ( index of 2 ) in the third dimension of submenu global array element. |
| 132 | 132 | // This is not the submenu slug. |
| 133 | - $_sLinkSlugManage = 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
| 133 | + $_sLinkSlugManage = 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
| 134 | 134 | |
| 135 | 135 | $_aLinkSlugs = array( |
| 136 | 136 | $_sLinkSlugManage => $_nSubMenuOrderManage, |
| 137 | - 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
| 137 | + 'post-new.php?post_type='.$this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
| 138 | 138 | ); |
| 139 | 139 | |
| 140 | 140 | // If the user does not set a custom value, unset it |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | // If the user does not want to show the Add New sub menu, no need to change the order. |
| 146 | - if ( ! $_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
| 147 | - unset( $_aLinkSlugs[ 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType ] ); |
|
| 146 | + if ( !$_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
| 147 | + unset( $_aLinkSlugs[ 'post-new.php?post_type='.$this->oFactory->oProp->sPostType ] ); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return $_aLinkSlugs; |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | private function _setSubMenuIndexByLinksSlugs( $sSubMenuSlug, array $aLinkSlugs ) { |
| 166 | 166 | |
| 167 | - foreach( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
| 167 | + foreach ( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
| 168 | 168 | |
| 169 | - foreach( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
| 169 | + foreach ( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
| 170 | 170 | |
| 171 | 171 | $_bIsSet = $this->_setSubMenuIndexByLinksSlug( $sSubMenuSlug, $_nIndex, $_aSubMenuItem, $_sLinkSlug, $_nOrder ); |
| 172 | 172 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | private function _setSubMenuIndexByLinksSlug( $sSubMenuSlug, $nIndex, $aSubMenuItem, $sLinkSlug, $nOrder ) { |
| 193 | 193 | |
| 194 | 194 | // The third item is the link slug. |
| 195 | - if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
| 195 | + if ( !isset( $aSubMenuItem[ 2 ] ) ) { |
|
| 196 | 196 | return false; |
| 197 | 197 | } |
| 198 | 198 | if ( $aSubMenuItem[ 2 ] !== $sLinkSlug ) { |