@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | final class AdminPageFramework_Registry extends AdminPageFramework_Registry_Base { |
56 | 56 | |
57 | 57 | const TEXT_DOMAIN = 'admin-page-framework'; |
58 | - const TEXT_DOMAIN_PATH = '/language'; // not used at the moment |
|
58 | + const TEXT_DOMAIN_PATH = '/language'; // not used at the moment |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Indicates whether the framework is loaded from the minified version or not. |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | * Sets up static properties. |
99 | 99 | * @return void |
100 | 100 | */ |
101 | - static public function setUp( $sFilePath=__FILE__ ) { |
|
101 | + static public function setUp( $sFilePath = __FILE__ ) { |
|
102 | 102 | |
103 | 103 | self::$sFilePath = $sFilePath; |
104 | 104 | self::$sDirPath = dirname( self::$sFilePath ); |
105 | 105 | self::$sFileURI = plugins_url( '', self::$sFilePath ); |
106 | - self::$sIncludeClassListPath = self::$sDirPath . '/admin-page-framework-include-class-list.php'; |
|
106 | + self::$sIncludeClassListPath = self::$sDirPath.'/admin-page-framework-include-class-list.php'; |
|
107 | 107 | self::$aClassFiles = self::_getClassFilePathList( self::$sIncludeClassListPath ); |
108 | 108 | self::$sAutoLoaderPath = isset( self::$aClassFiles[ 'AdminPageFramework_RegisterClasses' ] ) |
109 | 109 | ? self::$aClassFiles[ 'AdminPageFramework_RegisterClasses' ] |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @return array |
118 | 118 | */ |
119 | 119 | static private function _getClassFilePathList( $sInclusionClassListPath ) { |
120 | - $aClassFiles = array(); // this will be updated if the inclusion below is successful. |
|
120 | + $aClassFiles = array(); // this will be updated if the inclusion below is successful. |
|
121 | 121 | include( $sInclusionClassListPath ); |
122 | 122 | return $aClassFiles; |
123 | 123 | } |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | */ |
131 | 131 | static public function getVersion() { |
132 | 132 | |
133 | - if ( ! isset( self::$sAutoLoaderPath ) ) { |
|
134 | - trigger_error( 'Admin Page Framework: ' . ' : ' . sprintf( __( 'The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework' ), __METHOD__, 'setUp()' ), E_USER_WARNING ); |
|
133 | + if ( !isset( self::$sAutoLoaderPath ) ) { |
|
134 | + trigger_error( 'Admin Page Framework: '.' : '.sprintf( __( 'The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework' ), __METHOD__, 'setUp()' ), E_USER_WARNING ); |
|
135 | 135 | return self::VERSION; |
136 | 136 | } |
137 | 137 | $_aMinifiedVesionSuffix = array( |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | */ |
180 | 180 | final class AdminPageFramework_Bootstrap { |
181 | 181 | |
182 | - public function __construct( $sLibraryPath=__FILE__ ) { |
|
182 | + public function __construct( $sLibraryPath = __FILE__ ) { |
|
183 | 183 | |
184 | - if ( ! $this->_isLoadable() ) { |
|
184 | + if ( !$this->_isLoadable() ) { |
|
185 | 185 | return; |
186 | 186 | } |
187 | 187 |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
7 | 7 | * |
8 | 8 | */ |
9 | -if ( ! class_exists( 'AdminPageFramework_NetworkAdmin_Documentation' ) ) : |
|
9 | +if ( !class_exists( 'AdminPageFramework_NetworkAdmin_Documentation' ) ) : |
|
10 | 10 | /** |
11 | 11 | * Provides an abstract base to create admin pages in the network admin area. |
12 | 12 | * |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // Property object |
134 | 134 | $this->oProp = $oProp; |
135 | 135 | |
136 | - if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) { |
|
136 | + if ( $this->oProp->bIsAdmin && !$this->oProp->bIsAdminAjax ) { |
|
137 | 137 | if ( did_action( 'current_screen' ) ) { |
138 | 138 | $this->_replyToLoadComponents(); |
139 | 139 | } else { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->oLink = $this->oLink; |
161 | 161 | } |
162 | 162 | |
163 | - if ( ! $this->_isInThePage() ) { |
|
163 | + if ( !$this->_isInThePage() ) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | 'network_admin_page' => 'AdminPageFramework_HelpPane_Page', |
297 | 297 | 'post_meta_box' => 'AdminPageFramework_HelpPane_MetaBox', |
298 | 298 | 'page_meta_box' => 'AdminPageFramework_HelpPane_MetaBox_Page', |
299 | - 'post_type' => null, // no help pane class for the post type factory class. |
|
299 | + 'post_type' => null, // no help pane class for the post type factory class. |
|
300 | 300 | 'taxonomy_field' => 'AdminPageFramework_HelpPane_TaxonomyField', |
301 | 301 | 'widget' => 'AdminPageFramework_HelpPane_Widget', |
302 | 302 | 'user_meta' => 'AdminPageFramework_HelpPane_UserMeta', |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | protected function _getPageLoadInfoInstance( $oProp, $oMsg ) { |
359 | 359 | |
360 | - if ( ! isset( $this->_aPageLoadClassNameMap[ $oProp->sStructureType ] ) ) { |
|
360 | + if ( !isset( $this->_aPageLoadClassNameMap[ $oProp->sStructureType ] ) ) { |
|
361 | 361 | return null; |
362 | 362 | } |
363 | 363 | $_sClassName = $this->_aPageLoadClassNameMap[ $oProp->sStructureType ]; |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | $_aClassNameMap = array_shift( $_aParams ); |
380 | 380 | $_sKey = array_shift( $_aParams ); |
381 | 381 | |
382 | - if ( ! isset( $_aClassNameMap[ $_sKey ] ) ) { |
|
382 | + if ( !isset( $_aClassNameMap[ $_sKey ] ) ) { |
|
383 | 383 | return null; |
384 | 384 | } |
385 | 385 | |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | */ |
444 | 444 | public function __get( $sPropertyName ) { |
445 | 445 | |
446 | - switch( $sPropertyName ) { |
|
446 | + switch ( $sPropertyName ) { |
|
447 | 447 | case 'oHeadTag': // 3.3.0+ for backward compatibility |
448 | 448 | $sPropertyName = 'oResource'; |
449 | 449 | break; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | // Set and return the sub class object instance. |
453 | 453 | if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
454 | 454 | return call_user_func( |
455 | - array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
455 | + array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
456 | 456 | ); |
457 | 457 | } |
458 | 458 | |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | * |
534 | 534 | * @internal |
535 | 535 | */ |
536 | - public function __call( $sMethodName, $aArgs=null ) { |
|
536 | + public function __call( $sMethodName, $aArgs = null ) { |
|
537 | 537 | |
538 | 538 | $_mFirstArg = $this->oUtil->getElement( $aArgs, 0 ); |
539 | 539 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | } |
559 | 559 | |
560 | 560 | trigger_error( |
561 | - 'Admin Page Framework: ' . ' : ' . sprintf( |
|
561 | + 'Admin Page Framework: '.' : '.sprintf( |
|
562 | 562 | __( 'The method is not defined: %1$s', $this->oProp->sTextDomain ), |
563 | 563 | $sMethodName |
564 | 564 | ), |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( $oProp ); |
29 | 29 | |
30 | - if ( ! $this->_isInThePage() ) { |
|
30 | + if ( !$this->_isInThePage() ) { |
|
31 | 31 | return; |
32 | 32 | } |
33 | 33 | if ( $this->oProp->bIsAdminAjax ) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @return string the input id attribute |
47 | 47 | */ |
48 | 48 | public function _replyToGetSectionName( /* $sSectionName, $aSectionset */ ) { |
49 | - $_aParams = func_get_args() + array( null, null, ); |
|
49 | + $_aParams = func_get_args() + array( null, null,); |
|
50 | 50 | return $_aParams[ 0 ]; |
51 | 51 | } |
52 | 52 | |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * @since 3.6.0 |
75 | 75 | * @return string |
76 | 76 | */ |
77 | - public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
78 | - $_aParams = func_get_args() + array( null, null, ); |
|
77 | + public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
78 | + $_aParams = func_get_args() + array( null, null,); |
|
79 | 79 | return $_aParams[ 0 ]; |
80 | 80 | } |
81 | 81 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return string |
86 | 86 | */ |
87 | 87 | public function _replyToGetFlatFieldName( /* $sFieldName, $aFieldset */ ) { |
88 | - $_aParams = func_get_args() + array( null, null, ); |
|
88 | + $_aParams = func_get_args() + array( null, null,); |
|
89 | 89 | return $_aParams[ 0 ]; |
90 | 90 | } |
91 | 91 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @return string the flat input name attribute |
108 | 108 | */ |
109 | 109 | public function _replyToGetFlatInputName( /* $sFlatNameAttribute, $aField, $sKey */ ) { |
110 | - $_aParams = func_get_args() + array( null, null, null ); |
|
110 | + $_aParams = func_get_args() + array( null, null, null ); |
|
111 | 111 | return $_aParams[ 0 ]; |
112 | 112 | } |
113 | 113 | |
@@ -149,14 +149,14 @@ discard block |
||
149 | 149 | 'if' => true, |
150 | 150 | 'capability' => '', |
151 | 151 | ); |
152 | - if ( ! $aElementDefinition[ 'if' ] ) { |
|
152 | + if ( !$aElementDefinition[ 'if' ] ) { |
|
153 | 153 | return false; |
154 | 154 | } |
155 | 155 | // For front-end forms that allow guests, the capability level can be empty. In that case, return true. |
156 | - if ( ! $aElementDefinition[ 'capability' ] ) { |
|
156 | + if ( !$aElementDefinition[ 'capability' ] ) { |
|
157 | 157 | return true; |
158 | 158 | } |
159 | - if ( ! current_user_can( $aElementDefinition[ 'capability' ] ) ) { |
|
159 | + if ( !current_user_can( $aElementDefinition[ 'capability' ] ) ) { |
|
160 | 160 | return false; |
161 | 161 | } |
162 | 162 | return $bDefault; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $this, |
193 | 193 | array( |
194 | 194 | // section_{instantiated class name}_{section id} |
195 | - 'section_head_' . $this->oProp->sClassName . '_' . $aSectionset[ 'section_id' ] |
|
195 | + 'section_head_'.$this->oProp->sClassName.'_'.$aSectionset[ 'section_id' ] |
|
196 | 196 | ), |
197 | 197 | $sSectionDescription |
198 | 198 | ); |
@@ -209,15 +209,15 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function _replyToGetFieldOutput( $sFieldOutput, $aFieldset ) { |
211 | 211 | |
212 | - $_sSectionPart = $this->oUtil->getAOrB( |
|
212 | + $_sSectionPart = $this->oUtil->getAOrB( |
|
213 | 213 | isset( $aFieldset[ 'section_id' ] ) && '_default' !== $aFieldset[ 'section_id' ], |
214 | - '_' . $aFieldset[ 'section_id' ], |
|
214 | + '_'.$aFieldset[ 'section_id' ], |
|
215 | 215 | '' |
216 | 216 | ); |
217 | 217 | return $this->oUtil->addAndApplyFilters( |
218 | 218 | $this, |
219 | 219 | array( |
220 | - 'field_' . $this->oProp->sClassName . $_sSectionPart . '_' . $aFieldset[ 'field_id' ] |
|
220 | + 'field_'.$this->oProp->sClassName.$_sSectionPart.'_'.$aFieldset[ 'field_id' ] |
|
221 | 221 | ), |
222 | 222 | $sFieldOutput, |
223 | 223 | $aFieldset // the field array |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @since 2.1.0 |
61 | 61 | * @internal |
62 | 62 | */ |
63 | - protected function _setHelpTab( $sID, $sTitle, $aContents, $aSideBarContents=array() ) { |
|
63 | + protected function _setHelpTab( $sID, $sTitle, $aContents, $aSideBarContents = array() ) { |
|
64 | 64 | |
65 | 65 | if ( empty( $aContents ) ) { |
66 | 66 | return; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ) |
78 | 78 | ); |
79 | 79 | |
80 | - if ( ! empty( $aSideBarContents ) ) { |
|
80 | + if ( !empty( $aSideBarContents ) ) { |
|
81 | 81 | $this->_oScreen->set_help_sidebar( implode( PHP_EOL, $aSideBarContents ) ); |
82 | 82 | } |
83 | 83 | |
@@ -89,6 +89,6 @@ discard block |
||
89 | 89 | * @internal |
90 | 90 | */ |
91 | 91 | protected function _formatHelpDescription( $sHelpDescription ) { |
92 | - return "<div class='contextual-help-description'>" . $sHelpDescription . "</div>"; |
|
92 | + return "<div class='contextual-help-description'>".$sHelpDescription."</div>"; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | \ No newline at end of file |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Sets up hooks and properties. |
24 | 24 | */ |
25 | - public function __construct( $oProp, $oMsg=null ) { |
|
25 | + public function __construct( $oProp, $oMsg = null ) { |
|
26 | 26 | |
27 | - if ( ! $this->_isLoadable( $oProp ) ) { |
|
27 | + if ( !$this->_isLoadable( $oProp ) ) { |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | add_action( 'in_admin_footer', array( $this, '_replyToSetFooterInfo' ) ); |
35 | 35 | |
36 | 36 | // Add an action link in the plugin listing page |
37 | - if ( 'plugins.php' === $this->oProp->sPageNow && 'plugin' === $this->oProp->aScriptInfo['sType'] ) { |
|
37 | + if ( 'plugins.php' === $this->oProp->sPageNow && 'plugin' === $this->oProp->aScriptInfo[ 'sType' ] ) { |
|
38 | 38 | add_filter( |
39 | - 'plugin_action_links_' . plugin_basename( $this->oProp->aScriptInfo['sPath'] ), |
|
39 | + 'plugin_action_links_'.plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
|
40 | 40 | array( $this, '_replyToAddSettingsLinkInPluginListingPage' ), |
41 | 41 | 20 // set a lower priority so that the link will be embedded at the beginning ( the most left hand side ). |
42 | 42 | ); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @return boolean |
51 | 51 | */ |
52 | 52 | private function _isLoadable( $oProp ) { |
53 | - if ( ! $oProp->bIsAdmin ) { |
|
53 | + if ( !$oProp->bIsAdmin ) { |
|
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | if ( $oProp->bIsAdminAjax ) { |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | */ |
81 | 81 | protected function _setDefaultFooterText() { |
82 | 82 | |
83 | - $this->oProp->aFooterInfo['sLeft'] = str_replace( |
|
83 | + $this->oProp->aFooterInfo[ 'sLeft' ] = str_replace( |
|
84 | 84 | '__SCRIPT_CREDIT__', |
85 | 85 | $this->_getFooterInfoLeft( $this->oProp->aScriptInfo ), |
86 | - $this->oProp->aFooterInfo['sLeft'] |
|
86 | + $this->oProp->aFooterInfo[ 'sLeft' ] |
|
87 | 87 | ); |
88 | - $this->oProp->aFooterInfo['sRight'] = str_replace( |
|
88 | + $this->oProp->aFooterInfo[ 'sRight' ] = str_replace( |
|
89 | 89 | '__FRAMEWORK_CREDIT__', |
90 | 90 | $this->_getFooterInfoRight( $this->oProp->_getLibraryData() ), |
91 | - $this->oProp->aFooterInfo['sRight'] |
|
91 | + $this->oProp->aFooterInfo[ 'sRight' ] |
|
92 | 92 | ); |
93 | 93 | |
94 | 94 | } |
@@ -102,52 +102,52 @@ discard block |
||
102 | 102 | private function _getFooterInfoLeft( $aScriptInfo ) { |
103 | 103 | |
104 | 104 | $_sDescription = $this->getAOrB( |
105 | - empty( $aScriptInfo['sDescription'] ), |
|
105 | + empty( $aScriptInfo[ 'sDescription' ] ), |
|
106 | 106 | '', |
107 | - " {$aScriptInfo['sDescription']}" |
|
107 | + " {$aScriptInfo[ 'sDescription' ]}" |
|
108 | 108 | ); |
109 | 109 | $_sVersion = $this->getAOrB( |
110 | - empty( $aScriptInfo['sVersion'] ), |
|
110 | + empty( $aScriptInfo[ 'sVersion' ] ), |
|
111 | 111 | '', |
112 | - " {$aScriptInfo['sVersion']}" |
|
112 | + " {$aScriptInfo[ 'sVersion' ]}" |
|
113 | 113 | ); |
114 | 114 | $_sPluginInfo = $this->getAOrB( |
115 | - empty( $aScriptInfo['sURI'] ), |
|
116 | - $aScriptInfo['sName'], |
|
115 | + empty( $aScriptInfo[ 'sURI' ] ), |
|
116 | + $aScriptInfo[ 'sName' ], |
|
117 | 117 | $this->getHTMLTag( |
118 | 118 | 'a', |
119 | 119 | array( |
120 | - 'href' => $aScriptInfo['sURI'], |
|
120 | + 'href' => $aScriptInfo[ 'sURI' ], |
|
121 | 121 | 'target' => '_blank', |
122 | - 'title' => $aScriptInfo['sName'] . $_sVersion . $_sDescription |
|
122 | + 'title' => $aScriptInfo[ 'sName' ].$_sVersion.$_sDescription |
|
123 | 123 | ), |
124 | - $aScriptInfo['sName'] |
|
124 | + $aScriptInfo[ 'sName' ] |
|
125 | 125 | ) |
126 | 126 | ); |
127 | 127 | |
128 | 128 | $_sAuthorInfo = $this->getAOrB( |
129 | - empty( $aScriptInfo['sAuthorURI'] ), |
|
129 | + empty( $aScriptInfo[ 'sAuthorURI' ] ), |
|
130 | 130 | '', |
131 | 131 | $this->getHTMLTag( |
132 | 132 | 'a', |
133 | 133 | array( |
134 | - 'href' => $aScriptInfo['sAuthorURI'], |
|
134 | + 'href' => $aScriptInfo[ 'sAuthorURI' ], |
|
135 | 135 | 'target' => '_blank', |
136 | - 'title' => $aScriptInfo['sAuthor'], |
|
136 | + 'title' => $aScriptInfo[ 'sAuthor' ], |
|
137 | 137 | ), |
138 | - $aScriptInfo['sAuthor'] |
|
138 | + $aScriptInfo[ 'sAuthor' ] |
|
139 | 139 | ) |
140 | 140 | ); |
141 | 141 | $_sAuthorInfo = $this->getAOrB( |
142 | - empty( $aScriptInfo['sAuthor'] ), |
|
142 | + empty( $aScriptInfo[ 'sAuthor' ] ), |
|
143 | 143 | $_sAuthorInfo, |
144 | - ' by ' . $_sAuthorInfo |
|
144 | + ' by '.$_sAuthorInfo |
|
145 | 145 | ); |
146 | 146 | |
147 | 147 | // Enclosing the output in a span tag as the outer element is a '<p>' tag. So this cannot be div. |
148 | 148 | // 3.5.7+ Added the class attribute for acceptance testing |
149 | 149 | return "<span class='apf-script-info'>" |
150 | - . $_sPluginInfo . $_sAuthorInfo |
|
150 | + . $_sPluginInfo.$_sAuthorInfo |
|
151 | 151 | . "</span>"; |
152 | 152 | |
153 | 153 | } |
@@ -161,32 +161,32 @@ discard block |
||
161 | 161 | private function _getFooterInfoRight( $aScriptInfo ) { |
162 | 162 | |
163 | 163 | $_sDescription = $this->getAOrB( |
164 | - empty( $aScriptInfo['sDescription'] ), |
|
164 | + empty( $aScriptInfo[ 'sDescription' ] ), |
|
165 | 165 | '', |
166 | - " {$aScriptInfo['sDescription']}" |
|
166 | + " {$aScriptInfo[ 'sDescription' ]}" |
|
167 | 167 | ); |
168 | 168 | $_sVersion = $this->getAOrB( |
169 | - empty( $aScriptInfo['sVersion'] ), |
|
169 | + empty( $aScriptInfo[ 'sVersion' ] ), |
|
170 | 170 | '', |
171 | - " {$aScriptInfo['sVersion']}" |
|
171 | + " {$aScriptInfo[ 'sVersion' ]}" |
|
172 | 172 | ); |
173 | 173 | $_sLibraryInfo = $this->getAOrB( |
174 | - empty( $aScriptInfo['sURI'] ), |
|
175 | - $aScriptInfo['sName'], |
|
174 | + empty( $aScriptInfo[ 'sURI' ] ), |
|
175 | + $aScriptInfo[ 'sName' ], |
|
176 | 176 | $this->getHTMLTag( |
177 | 177 | 'a', |
178 | 178 | array( |
179 | - 'href' => $aScriptInfo['sURI'], |
|
179 | + 'href' => $aScriptInfo[ 'sURI' ], |
|
180 | 180 | 'target' => '_blank', |
181 | - 'title' => $aScriptInfo['sName'] . $_sVersion . $_sDescription, |
|
181 | + 'title' => $aScriptInfo[ 'sName' ].$_sVersion.$_sDescription, |
|
182 | 182 | ), |
183 | - $aScriptInfo['sName'] |
|
183 | + $aScriptInfo[ 'sName' ] |
|
184 | 184 | ) |
185 | 185 | ); |
186 | 186 | |
187 | 187 | // Update the variable |
188 | 188 | return "<span class='apf-credit'>" // 3.5.7+ added 'apf-credit' class attribute for acceptance testing |
189 | - . $this->oMsg->get( 'powered_by' ) . ' ' |
|
189 | + . $this->oMsg->get( 'powered_by' ).' ' |
|
190 | 190 | . $_sLibraryInfo |
191 | 191 | . ", " |
192 | 192 | . $this->getHTMLTag( |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | array( |
195 | 195 | 'href' => 'https://wordpress.org', |
196 | 196 | 'target' => '_blank', |
197 | - 'title' => 'WordPress' . $GLOBALS['wp_version'] |
|
197 | + 'title' => 'WordPress'.$GLOBALS[ 'wp_version' ] |
|
198 | 198 | ), |
199 | 199 | 'WordPress' |
200 | 200 | ) |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | protected function _setFooterHooks() { |
212 | 212 | |
213 | - add_filter( 'admin_footer_text' , array( $this, '_replyToAddInfoInFooterLeft' ) ); |
|
213 | + add_filter( 'admin_footer_text', array( $this, '_replyToAddInfoInFooterLeft' ) ); |
|
214 | 214 | add_filter( 'update_footer', array( $this, '_replyToAddInfoInFooterRight' ), 11 ); |
215 | 215 | |
216 | 216 | } |
@@ -222,15 +222,15 @@ discard block |
||
222 | 222 | * @callback filter admin_footer_text |
223 | 223 | * @internal |
224 | 224 | */ |
225 | - public function _replyToAddInfoInFooterLeft( $sLinkHTML='' ) { |
|
225 | + public function _replyToAddInfoInFooterLeft( $sLinkHTML = '' ) { |
|
226 | 226 | |
227 | - $sLinkHTML = empty( $this->oProp->aScriptInfo['sName'] ) |
|
227 | + $sLinkHTML = empty( $this->oProp->aScriptInfo[ 'sName' ] ) |
|
228 | 228 | ? $sLinkHTML |
229 | - : $this->oProp->aFooterInfo['sLeft']; |
|
229 | + : $this->oProp->aFooterInfo[ 'sLeft' ]; |
|
230 | 230 | |
231 | 231 | return $this->addAndApplyFilters( |
232 | 232 | $this->oProp->_getCallerObject(), |
233 | - 'footer_left_' . $this->oProp->sClassName, |
|
233 | + 'footer_left_'.$this->oProp->sClassName, |
|
234 | 234 | $sLinkHTML |
235 | 235 | ); |
236 | 236 | |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | * @callback filter admin_footer_text |
244 | 244 | * @internal |
245 | 245 | */ |
246 | - public function _replyToAddInfoInFooterRight( $sLinkHTML='' ) { |
|
246 | + public function _replyToAddInfoInFooterRight( $sLinkHTML = '' ) { |
|
247 | 247 | return $this->addAndApplyFilters( |
248 | 248 | $this->oProp->_getCallerObject(), |
249 | - 'footer_right_' . $this->oProp->sClassName, |
|
250 | - $this->oProp->aFooterInfo['sRight'] |
|
249 | + 'footer_right_'.$this->oProp->sClassName, |
|
250 | + $this->oProp->aFooterInfo[ 'sRight' ] |
|
251 | 251 | ); |
252 | 252 | } |
253 | 253 |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | |
37 | 37 | /* The system internal keys. */ |
38 | 38 | 'sSRC' => null, |
39 | - 'aPostTypes' => array(), // for meta box class |
|
39 | + 'aPostTypes' => array(), // for meta box class |
|
40 | 40 | 'sPageSlug' => null, |
41 | 41 | 'sTabSlug' => null, |
42 | - 'sType' => null, // script or style |
|
42 | + 'sType' => null, // script or style |
|
43 | 43 | |
44 | 44 | /* The below keys are for users. */ |
45 | 45 | 'handle_id' => null, |
46 | 46 | 'dependencies' => array(), |
47 | - 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
48 | - 'translation' => array(), // only for scripts |
|
49 | - 'in_footer' => false, // only for scripts |
|
50 | - 'media' => 'all', // only for styles |
|
51 | - 'attributes' => array(), // 3.3.0+ - the attribute array |
|
47 | + 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
48 | + 'translation' => array(), // only for scripts |
|
49 | + 'in_footer' => false, // only for scripts |
|
50 | + 'media' => 'all', // only for styles |
|
51 | + 'attributes' => array(), // 3.3.0+ - the attribute array |
|
52 | 52 | |
53 | 53 | ); |
54 | 54 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @remark This value should be overridden in an extended class. |
60 | 60 | * @internal |
61 | 61 | */ |
62 | - protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
62 | + protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Stores the class selector used to the class-specific script. |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @remark This value should be overridden in an extended class. |
69 | 69 | * @internal |
70 | 70 | */ |
71 | - protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
71 | + protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Stores hand IDs by resource url to look up handle id and add custom arguments. |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | * @internal |
143 | 143 | */ |
144 | 144 | |
145 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) {} |
|
146 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) {} |
|
145 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) {} |
|
146 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) {} |
|
147 | 147 | |
148 | 148 | /** |
149 | 149 | * A helper function for the _replyToEnqueueScripts() and the `_replyToEnqueueStyle()` methods. |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | $_sAttributes = $this->getAttributes( $_aAttributes ); |
207 | - $_sModifiedURL = $sSanitizedURL . "' " . rtrim( $_sAttributes, "'\"" ); // '" |
|
207 | + $_sModifiedURL = $sSanitizedURL."' ".rtrim( $_sAttributes, "'\"" ); // '" |
|
208 | 208 | |
209 | 209 | return $_sModifiedURL; |
210 | 210 | |
@@ -252,19 +252,19 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function _getStyleTag( $oCaller, $sIDPrefix ) { |
254 | 254 | |
255 | - $_sStyle = $this->addAndApplyFilters( |
|
255 | + $_sStyle = $this->addAndApplyFilters( |
|
256 | 256 | $oCaller, |
257 | 257 | array( |
258 | - "style_common_admin_page_framework", // 3.2.1+ |
|
258 | + "style_common_admin_page_framework", // 3.2.1+ |
|
259 | 259 | "style_common_{$this->oProp->sClassName}", |
260 | 260 | ), |
261 | 261 | AdminPageFramework_CSS::getDefaultCSS() |
262 | 262 | ); |
263 | - $_sStyle = $this->isDebugMode() |
|
263 | + $_sStyle = $this->isDebugMode() |
|
264 | 264 | ? trim( $_sStyle ) |
265 | 265 | : $this->minifyCSS( $_sStyle ); |
266 | 266 | if ( $_sStyle ) { |
267 | - echo "<style type='text/css' id='" . esc_attr( $sIDPrefix ) . "'>" |
|
267 | + echo "<style type='text/css' id='".esc_attr( $sIDPrefix )."'>" |
|
268 | 268 | . $_sStyle |
269 | 269 | . "</style>"; |
270 | 270 | } |
@@ -278,20 +278,20 @@ discard block |
||
278 | 278 | */ |
279 | 279 | private function _getIEStyleTag( $oCaller, $sIDPrefix ) { |
280 | 280 | |
281 | - $_sStyleIE = $this->addAndApplyFilters( |
|
281 | + $_sStyleIE = $this->addAndApplyFilters( |
|
282 | 282 | $oCaller, |
283 | 283 | array( |
284 | - "style_ie_common_admin_page_framework", // 3.2.1+ |
|
284 | + "style_ie_common_admin_page_framework", // 3.2.1+ |
|
285 | 285 | "style_ie_common_{$this->oProp->sClassName}", |
286 | 286 | ), |
287 | 287 | AdminPageFramework_CSS::getDefaultCSSIE() |
288 | 288 | ); |
289 | 289 | |
290 | - $_sStyleIE = $this->isDebugMode() |
|
290 | + $_sStyleIE = $this->isDebugMode() |
|
291 | 291 | ? trim( $_sStyleIE ) |
292 | 292 | : $this->minifyCSS( $_sStyleIE ); |
293 | 293 | return $_sStyleIE |
294 | - ? "<!--[if IE]><style type='text/css' id='" . esc_attr( $sIDPrefix . "-ie" ) . "'>" |
|
294 | + ? "<!--[if IE]><style type='text/css' id='".esc_attr( $sIDPrefix."-ie" )."'>" |
|
295 | 295 | . $_sStyleIE |
296 | 296 | . "</style><![endif]-->" |
297 | 297 | : ''; |
@@ -324,14 +324,14 @@ discard block |
||
324 | 324 | $_sScript = $this->addAndApplyFilters( |
325 | 325 | $this->oProp->_getCallerObject(), |
326 | 326 | array( |
327 | - "script_common_admin_page_framework", // 3.2.1+ |
|
327 | + "script_common_admin_page_framework", // 3.2.1+ |
|
328 | 328 | "script_common_{$this->oProp->sClassName}", |
329 | 329 | ), |
330 | 330 | AdminPageFramework_Property_Base::$_sDefaultScript |
331 | 331 | ); |
332 | 332 | $_sScript = trim( $_sScript ); |
333 | 333 | if ( $_sScript ) { |
334 | - echo "<script type='text/javascript' id='" . esc_attr( $sIDPrefix ) . "'>" |
|
334 | + echo "<script type='text/javascript' id='".esc_attr( $sIDPrefix )."'>" |
|
335 | 335 | . $_sScript |
336 | 336 | . "</script>"; |
337 | 337 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | */ |
349 | 349 | protected function _printClassSpecificStyles( $sIDPrefix ) { |
350 | 350 | |
351 | - $_oCaller = $this->oProp->_getCallerObject(); |
|
351 | + $_oCaller = $this->oProp->_getCallerObject(); |
|
352 | 352 | echo $this->_getClassSpecificStyleTag( $_oCaller, $sIDPrefix ); |
353 | 353 | echo $this->_getClassSpecificIEStyleTag( $_oCaller, $sIDPrefix ); |
354 | 354 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | ? trim( $_sStyle ) |
377 | 377 | : $this->minifyCSS( $_sStyle ); |
378 | 378 | if ( $_sStyle ) { |
379 | - return "<style type='text/css' id='" . esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ) . "'>" |
|
379 | + return "<style type='text/css' id='".esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" )."'>" |
|
380 | 380 | . $_sStyle |
381 | 381 | . "</style>"; |
382 | 382 | $_iCallCount++; |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | ? trim( $_sStyleIE ) |
403 | 403 | : $this->minifyCSS( $_sStyleIE ); |
404 | 404 | if ( $_sStyleIE ) { |
405 | - return "<!--[if IE]><style type='text/css' id='" . esc_attr( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ) . "'>" |
|
405 | + return "<!--[if IE]><style type='text/css' id='".esc_attr( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" )."'>" |
|
406 | 406 | . $_sStyleIE |
407 | 407 | . "</style><![endif]-->"; |
408 | 408 | $_iCallCountIE++; |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | ); |
431 | 431 | $_sScript = trim( $_sScript ); |
432 | 432 | if ( $_sScript ) { |
433 | - echo "<script type='text/javascript' id='" . esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ) . "'>" |
|
433 | + echo "<script type='text/javascript' id='".esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" )."'>" |
|
434 | 434 | . $_sScript |
435 | 435 | . "</script>"; |
436 | 436 | $_iCallCount++; |
@@ -454,12 +454,12 @@ discard block |
||
454 | 454 | public function _replyToAddStyle() { |
455 | 455 | |
456 | 456 | $_oCaller = $this->oProp->_getCallerObject(); |
457 | - if ( ! $_oCaller->_isInThePage() ) { |
|
457 | + if ( !$_oCaller->_isInThePage() ) { |
|
458 | 458 | return; |
459 | 459 | } |
460 | 460 | |
461 | 461 | $this->_printCommonStyles( 'admin-page-framework-style-common', get_class() ); |
462 | - $this->_printClassSpecificStyles( $this->_sClassSelector_Style . '-' . $this->oProp->sStructureType ); |
|
462 | + $this->_printClassSpecificStyles( $this->_sClassSelector_Style.'-'.$this->oProp->sStructureType ); |
|
463 | 463 | |
464 | 464 | } |
465 | 465 | /** |
@@ -474,12 +474,12 @@ discard block |
||
474 | 474 | public function _replyToAddScript() { |
475 | 475 | |
476 | 476 | $_oCaller = $this->oProp->_getCallerObject(); |
477 | - if ( ! $_oCaller->_isInThePage() ) { |
|
477 | + if ( !$_oCaller->_isInThePage() ) { |
|
478 | 478 | return; |
479 | 479 | } |
480 | 480 | |
481 | 481 | $this->_printCommonScripts( 'admin-page-framework-script-common', get_class() ); |
482 | - $this->_printClassSpecificScripts( $this->_sClassSelector_Script . '-' . $this->oProp->sStructureType ); |
|
482 | + $this->_printClassSpecificScripts( $this->_sClassSelector_Script.'-'.$this->oProp->sStructureType ); |
|
483 | 483 | |
484 | 484 | } |
485 | 485 | |
@@ -494,28 +494,28 @@ discard block |
||
494 | 494 | protected function _enqueueSRC( $aEnqueueItem ) { |
495 | 495 | |
496 | 496 | // For styles |
497 | - if ( 'style' === $aEnqueueItem['sType'] ) { |
|
497 | + if ( 'style' === $aEnqueueItem[ 'sType' ] ) { |
|
498 | 498 | wp_enqueue_style( |
499 | - $aEnqueueItem['handle_id'], |
|
500 | - $aEnqueueItem['sSRC'], |
|
501 | - $aEnqueueItem['dependencies'], |
|
502 | - $aEnqueueItem['version'], |
|
503 | - $aEnqueueItem['media'] |
|
499 | + $aEnqueueItem[ 'handle_id' ], |
|
500 | + $aEnqueueItem[ 'sSRC' ], |
|
501 | + $aEnqueueItem[ 'dependencies' ], |
|
502 | + $aEnqueueItem[ 'version' ], |
|
503 | + $aEnqueueItem[ 'media' ] |
|
504 | 504 | ); |
505 | 505 | return; |
506 | 506 | } |
507 | 507 | |
508 | 508 | // For scripts |
509 | 509 | wp_enqueue_script( |
510 | - $aEnqueueItem['handle_id'], |
|
511 | - $aEnqueueItem['sSRC'], |
|
512 | - $aEnqueueItem['dependencies'], |
|
513 | - $aEnqueueItem['version'], |
|
514 | - did_action( 'admin_body_class' ) ? true : $aEnqueueItem['in_footer'] |
|
510 | + $aEnqueueItem[ 'handle_id' ], |
|
511 | + $aEnqueueItem[ 'sSRC' ], |
|
512 | + $aEnqueueItem[ 'dependencies' ], |
|
513 | + $aEnqueueItem[ 'version' ], |
|
514 | + did_action( 'admin_body_class' ) ? true : $aEnqueueItem[ 'in_footer' ] |
|
515 | 515 | ); |
516 | 516 | |
517 | - if ( $aEnqueueItem['translation'] ) { |
|
518 | - wp_localize_script( $aEnqueueItem['handle_id'], $aEnqueueItem['handle_id'], $aEnqueueItem['translation'] ); |
|
517 | + if ( $aEnqueueItem[ 'translation' ] ) { |
|
518 | + wp_localize_script( $aEnqueueItem[ 'handle_id' ], $aEnqueueItem[ 'handle_id' ], $aEnqueueItem[ 'translation' ] ); |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | * @internal |
532 | 532 | */ |
533 | 533 | public function _replyToEnqueueStyles() { |
534 | - foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
534 | + foreach ( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
535 | 535 | $this->_enqueueSRCByCondition( $_aEnqueuingStyle ); |
536 | 536 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
537 | 537 | } |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | * @internal |
549 | 549 | */ |
550 | 550 | public function _replyToEnqueueScripts() { |
551 | - foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
551 | + foreach ( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
552 | 552 | $this->_enqueueSRCByCondition( $_aEnqueuingScript ); |
553 | 553 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
554 | 554 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $_aParameters = func_get_args() + array( |
36 | 36 | $this->aSubject, |
37 | 37 | ); |
38 | - $this->aSubject = $_aParameters[ 0 ]; |
|
38 | + $this->aSubject = $_aParameters[ 0 ]; |
|
39 | 39 | |
40 | 40 | } |
41 | 41 |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | 'confirm_perform_task' => 'Please confirm your action.', |
83 | 83 | 'specified_option_been_deleted' => 'The specified options have been deleted.', |
84 | 84 | 'nonce_verification_failed' => 'A problem occurred while processing the form data. Please try again.', |
85 | - 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | - 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | - 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
85 | + 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | + 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | + 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
88 | 88 | 'email_scheduled' => 'The email has been scheduled.', // 3.3.5+ |
89 | - 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
89 | + 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
90 | 90 | |
91 | 91 | // AdminPageFramework_PostType |
92 | 92 | 'title' => 'Title', |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | 'upload_file' => 'Upload File', |
113 | 113 | 'use_this_file' => 'Use This File', |
114 | 114 | 'select_file' => 'Select File', |
115 | - 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | - 'select_all' => 'Select All', // 3.3.0+ |
|
117 | - 'select_none' => 'Select None', // 3.3.0+ |
|
115 | + 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | + 'select_all' => 'Select All', // 3.3.0+ |
|
117 | + 'select_none' => 'Select None', // 3.3.0+ |
|
118 | 118 | 'no_term_found' => 'No term found.', // 3.3.2+ |
119 | 119 | |
120 | 120 | // AdminPageFramework_Form_View___Script_{...} |
121 | 121 | 'select' => 'Select', // 3.4.2+ |
122 | - 'insert' => 'Insert', // 3.4.2+ |
|
122 | + 'insert' => 'Insert', // 3.4.2+ |
|
123 | 123 | 'use_this' => 'Use This', // 3.4.2+ |
124 | 124 | 'return_to_library' => 'Return to Library', // 3.4.2+ |
125 | 125 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @since 3.2.0 Changed it to create an instance per text domain basis. |
191 | 191 | * @remark This class should be instantiated via this method. |
192 | 192 | */ |
193 | - public static function getInstance( $sTextDomain='admin-page-framework' ) { |
|
193 | + public static function getInstance( $sTextDomain = 'admin-page-framework' ) { |
|
194 | 194 | |
195 | 195 | $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message ) |
196 | 196 | ? self::$_aInstancesByTextDomain[ $sTextDomain ] |
@@ -203,21 +203,21 @@ discard block |
||
203 | 203 | * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) |
204 | 204 | * @deprecated 3.2.0 |
205 | 205 | */ |
206 | - public static function instantiate( $sTextDomain='admin-page-framework' ) { |
|
206 | + public static function instantiate( $sTextDomain = 'admin-page-framework' ) { |
|
207 | 207 | return self::getInstance( $sTextDomain ); |
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
211 | 211 | * Sets up properties. |
212 | 212 | */ |
213 | - public function __construct( $sTextDomain='admin-page-framework' ) { |
|
213 | + public function __construct( $sTextDomain = 'admin-page-framework' ) { |
|
214 | 214 | |
215 | 215 | $this->_sTextDomain = $sTextDomain; |
216 | 216 | |
217 | 217 | // Fill the $aMessages property with the keys extracted from the $aDefaults property |
218 | 218 | // with the value of null. The null is set to let it trigger the __get() method |
219 | 219 | // so that each translation item gets processed individually. |
220 | - $this->aMessages = array_fill_keys( |
|
220 | + $this->aMessages = array_fill_keys( |
|
221 | 221 | array_keys( $this->aDefaults ), |
222 | 222 | null |
223 | 223 | ); |