@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | * Stores the option values. |
29 | 29 | */ |
30 | 30 | public $aOptions = array( |
31 | - 'welcomed' => false, // if the welcome screen is displayed, this will be true. |
|
32 | - 'enable_admin_pages' => true, // whether or not to enable the admin pages of the loader plugin. |
|
31 | + 'welcomed' => false, // if the welcome screen is displayed, this will be true. |
|
32 | + 'enable_admin_pages' => true, // whether or not to enable the admin pages of the loader plugin. |
|
33 | 33 | 'enable_demo' => false, |
34 | - 'version_upgraded_from' => null, // the version number that the user has upgraded from |
|
35 | - 'version_saved' => null, // represents the option version. |
|
34 | + 'version_upgraded_from' => null, // the version number that the user has upgraded from |
|
35 | + 'version_saved' => null, // represents the option version. |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | /** |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @since 3.5.0 |
54 | 54 | */ |
55 | - static public function getInstance( $sOptionKey='' ) { |
|
55 | + static public function getInstance( $sOptionKey = '' ) { |
|
56 | 56 | |
57 | 57 | $sOptionKey = $sOptionKey |
58 | 58 | ? $sOptionKey |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function __construct( $sOptionKey ) { |
75 | 75 | |
76 | - $this->bIsNetworkAdmin = is_network_admin(); // must be done first |
|
76 | + $this->bIsNetworkAdmin = is_network_admin(); // must be done first |
|
77 | 77 | $this->sOptionKey = $sOptionKey; |
78 | 78 | $this->aOptions = $this->_getFormattedOptions( $sOptionKey ); |
79 | 79 | |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function hasUpgraded() { |
100 | 100 | |
101 | - $_sOptionVersion = $this->get( 'version_saved' ); |
|
102 | - if ( ! $_sOptionVersion ) { |
|
101 | + $_sOptionVersion = $this->get( 'version_saved' ); |
|
102 | + if ( !$_sOptionVersion ) { |
|
103 | 103 | return false; |
104 | 104 | } |
105 | 105 | $_sOptionVersion = $this->_getVersionByDepth( $_sOptionVersion ); |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * Returns a stating part of version by the given depth. |
112 | 112 | * @since 3.5.0 |
113 | 113 | */ |
114 | - private function _getVersionByDepth( $sVersion, $iDepth=2 ) { |
|
115 | - if ( ! $iDepth ) { |
|
114 | + private function _getVersionByDepth( $sVersion, $iDepth = 2 ) { |
|
115 | + if ( !$iDepth ) { |
|
116 | 116 | return $sVersion; |
117 | 117 | } |
118 | 118 | $_aParts = explode( '.', $sVersion ); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | /** |
124 | 124 | * Deletes the option from the database. |
125 | 125 | */ |
126 | - public function delete() { |
|
126 | + public function delete() { |
|
127 | 127 | return $this->bIsNetworkAdmin |
128 | 128 | ? delete_site_option( $this->sOptionKey ) |
129 | 129 | : delete_option( $this->sOptionKey ); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Saves the options. |
134 | 134 | */ |
135 | - public function save( $aOptions=null ) { |
|
135 | + public function save( $aOptions = null ) { |
|
136 | 136 | |
137 | 137 | $_aOptions = $aOptions ? $aOptions : $this->aOptions; |
138 | 138 | return $this->bIsNetworkAdmin |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function set( /* $asKeys, $mValue */ ) { |
153 | 153 | |
154 | - $_aParameters = func_get_args(); |
|
155 | - if ( ! isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
154 | + $_aParameters = func_get_args(); |
|
155 | + if ( !isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
156 | 156 | return; |
157 | 157 | } |
158 | 158 | $_asKeys = $_aParameters[ 0 ]; |
159 | 159 | $_mValue = $_aParameters[ 1 ]; |
160 | 160 | |
161 | 161 | // string, integer, float, boolean |
162 | - if ( ! is_array( $_asKeys ) ) { |
|
162 | + if ( !is_array( $_asKeys ) ) { |
|
163 | 163 | $this->aOptions[ $_asKeys ] = $_mValue; |
164 | 164 | return; |
165 | 165 | } |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function update( /* $asKeys, $mValue */ ) { |
176 | 176 | |
177 | - $_aParameters = func_get_args(); |
|
178 | - call_user_func_array( array( $this, 'set' ), $_aParameters ); |
|
177 | + $_aParameters = func_get_args(); |
|
178 | + call_user_func_array( array( $this, 'set' ), $_aParameters ); |
|
179 | 179 | $this->save(); |
180 | 180 | |
181 | 181 | } |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | |
190 | 190 | $_mDefault = null; |
191 | 191 | $_aKeys = func_get_args(); |
192 | - if ( ! isset( $_aKeys[ 0 ] ) ) { |
|
192 | + if ( !isset( $_aKeys[ 0 ] ) ) { |
|
193 | 193 | return null; |
194 | 194 | } |
195 | 195 | if ( is_array( $_aKeys[ 0 ] ) ) { |
196 | - $_aKeys = $_aKeys[ 0 ]; |
|
196 | + $_aKeys = $_aKeys[ 0 ]; |
|
197 | 197 | $_mDefault = isset( $_aKeys[ 1 ] ) |
198 | 198 | ? $_aKeys[ 1 ] |
199 | 199 | : null; |
@@ -123,7 +123,7 @@ |
||
123 | 123 | /** |
124 | 124 | * Deletes the option from the database. |
125 | 125 | */ |
126 | - public function delete() { |
|
126 | + public function delete() { |
|
127 | 127 | return $this->bIsNetworkAdmin |
128 | 128 | ? delete_site_option( $this->sOptionKey ) |
129 | 129 | : delete_option( $this->sOptionKey ); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $GLOBALS, |
47 | 47 | array( 'aAdminPageFramework', 'aPageClasses', $this->sClassName ) |
48 | 48 | ), |
49 | - 'options_' . $this->sClassName, // options_{instantiated class name} |
|
49 | + 'options_'.$this->sClassName, // options_{instantiated class name} |
|
50 | 50 | $this->sOptionKey |
51 | 51 | ? get_site_option( $this->sOptionKey, array() ) |
52 | 52 | : array() |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @since 3.1.1 Made it return a boolean value. |
65 | 65 | * @return boolean True if saved; otherwise, false. |
66 | 66 | */ |
67 | - public function updateOption( $aOptions=null ) { |
|
67 | + public function updateOption( $aOptions = null ) { |
|
68 | 68 | |
69 | 69 | if ( $this->_bDisableSavingOptions ) { |
70 | 70 | return; |
@@ -20,5 +20,5 @@ |
||
20 | 20 | * @extends AdminPageFramework_Resource_post_meta_box |
21 | 21 | * @internal |
22 | 22 | */ |
23 | -class AdminPageFramework_Resource_user_meta extends AdminPageFramework_Resource_post_meta_box { |
|
23 | +class AdminPageFramework_Resource_user_meta extends AdminPageFramework_Resource_post_meta_box { |
|
24 | 24 | } |
@@ -56,10 +56,10 @@ |
||
56 | 56 | */ |
57 | 57 | public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
58 | 58 | |
59 | - if ( ! $this->_isInstantiatable() ) { |
|
59 | + if ( ! $this->_isInstantiatable() ) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | - if ( empty( $asPostTypeOrScreenID ) ) { |
|
62 | + if ( empty( $asPostTypeOrScreenID ) ) { |
|
63 | 63 | return; |
64 | 64 | } |
65 | 65 |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | * @param string $sTextDomain (optional) The text domain applied to the displayed text messages. Default: `admin-page-framework`. |
55 | 55 | * @return void |
56 | 56 | */ |
57 | - public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
|
57 | + public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array( 'post' ), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework' ) { |
|
58 | 58 | |
59 | - if ( ! $this->_isInstantiatable() ) { |
|
59 | + if ( !$this->_isInstantiatable() ) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 | if ( empty( $asPostTypeOrScreenID ) ) { |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | // A property object needs to be done first. |
67 | 67 | $_sProprtyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
68 | 68 | ? $this->aSubClassNames[ 'oProp' ] |
69 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
70 | - $this->oProp = new $_sProprtyClassName( |
|
69 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
70 | + $this->oProp = new $_sProprtyClassName( |
|
71 | 71 | $this, |
72 | 72 | get_class( $this ), |
73 | 73 | $sCapability, |
74 | 74 | $sTextDomain, |
75 | 75 | $this->_sStructureType |
76 | 76 | ); |
77 | - $this->oProp->aPostTypes = is_string( $asPostTypeOrScreenID ) |
|
77 | + $this->oProp->aPostTypes = is_string( $asPostTypeOrScreenID ) |
|
78 | 78 | ? array( $asPostTypeOrScreenID ) |
79 | 79 | : $asPostTypeOrScreenID; |
80 | 80 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | return false; |
71 | 71 | } |
72 | 72 | |
73 | - if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
73 | + if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
74 | 74 | return false; |
75 | 75 | } |
76 | 76 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param string $sTextDomain (optional) The text domain applied to the displayed text messages. Default: `admin-page-framework`. |
34 | 34 | * @return void |
35 | 35 | */ |
36 | - public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
|
36 | + public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array( 'post' ), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework' ) { |
|
37 | 37 | |
38 | 38 | parent::__construct( $this->oProp ); |
39 | 39 | |
@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | ? $this->oUtil->sanitizeSlug( $sMetaBoxID ) |
42 | 42 | : strtolower( $this->oProp->sClassName ); |
43 | 43 | $this->oProp->sTitle = $sTitle; |
44 | - $this->oProp->sContext = $sContext; // 'normal', 'advanced', or 'side' |
|
45 | - $this->oProp->sPriority = $sPriority; // 'high', 'core', 'default' or 'low' |
|
44 | + $this->oProp->sContext = $sContext; // 'normal', 'advanced', or 'side' |
|
45 | + $this->oProp->sPriority = $sPriority; // 'high', 'core', 'default' or 'low' |
|
46 | 46 | |
47 | - if ( ! $this->oProp->bIsAdmin ) { |
|
47 | + if ( !$this->oProp->bIsAdmin ) { |
|
48 | 48 | return; |
49 | 49 | } |
50 | 50 | |
51 | 51 | // 3.8.14 |
52 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToCallLoadMethods' ), 100 ); |
|
52 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToCallLoadMethods' ), 100 ); |
|
53 | 53 | |
54 | 54 | $this->oUtil->registerAction( |
55 | 55 | $this->oProp->bIsAdminAjax |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | return true; |
87 | 87 | } |
88 | 88 | |
89 | - if ( ! in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
89 | + if ( !in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
90 | 90 | return false; |
91 | 91 | } |
92 | 92 | |
93 | - if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
93 | + if ( !in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
94 | 94 | return false; |
95 | 95 | } |
96 | 96 |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | * @since 2.1.5 |
31 | 31 | * @internal |
32 | 32 | */ |
33 | - public function _enqueueStyles( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
33 | + public function _enqueueStyles( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
34 | 34 | |
35 | 35 | $_aHandleIDs = array(); |
36 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
37 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
36 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
37 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
38 | 38 | } |
39 | 39 | return $_aHandleIDs; |
40 | 40 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
59 | 59 | * @internal |
60 | 60 | */ |
61 | - public function _enqueueStyle( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
61 | + public function _enqueueStyle( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
62 | 62 | |
63 | 63 | $sSRC = trim( $sSRC ); |
64 | 64 | if ( empty( $sSRC ) ) { return ''; } |
@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | 'sSRC' => $sSRC, |
75 | 75 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
76 | 76 | 'sType' => 'style', |
77 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
77 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
78 | 78 | ), |
79 | 79 | self::$_aStructure_EnqueuingResources |
80 | 80 | ); |
81 | 81 | |
82 | 82 | // Store the attributes in another container by url. |
83 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
83 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
84 | 84 | |
85 | 85 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
86 | 86 | |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | * @since 2.1.5 |
93 | 93 | * @internal |
94 | 94 | */ |
95 | - public function _enqueueScripts( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
95 | + public function _enqueueScripts( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
96 | 96 | |
97 | 97 | $_aHandleIDs = array(); |
98 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
99 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
98 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
99 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
100 | 100 | } |
101 | 101 | return $_aHandleIDs; |
102 | 102 | |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
122 | 122 | * @internal |
123 | 123 | */ |
124 | - public function _enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
124 | + public function _enqueueScript( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
125 | 125 | |
126 | - $sSRC = trim( $sSRC ); |
|
126 | + $sSRC = trim( $sSRC ); |
|
127 | 127 | if ( empty( $sSRC ) ) { |
128 | 128 | return ''; |
129 | 129 | } |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | 'sSRC' => $sSRC, |
142 | 142 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
143 | 143 | 'sType' => 'script', |
144 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
144 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
145 | 145 | ), |
146 | 146 | self::$_aStructure_EnqueuingResources |
147 | 147 | ); |
148 | 148 | |
149 | 149 | // Store the attributes in another container by url. |
150 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
150 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
151 | 151 | |
152 | 152 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
153 | 153 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @since 3.0.0 |
160 | 160 | * @internal |
161 | 161 | */ |
162 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
162 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
163 | 163 | return $this->_enqueueStyle( $sSRC, array(), $aCustomArgs ); |
164 | 164 | } |
165 | 165 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @since 3.0.0 |
169 | 169 | * @internal |
170 | 170 | */ |
171 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
171 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
172 | 172 | return $this->_enqueueScript( $sSRC, array(), $aCustomArgs ); |
173 | 173 | } |
174 | 174 | |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | */ |
182 | 182 | protected function _enqueueSRCByCondition( $aEnqueueItem ) { |
183 | 183 | |
184 | - $_sCurrentPostType = isset( $_GET['post_type'] ) ? $_GET['post_type'] : ( isset( $GLOBALS['typenow'] ) ? $GLOBALS['typenow'] : null ); |
|
185 | - if ( in_array( $_sCurrentPostType, $aEnqueueItem['aPostTypes'] ) ) { |
|
184 | + $_sCurrentPostType = isset( $_GET[ 'post_type' ] ) ? $_GET[ 'post_type' ] : ( isset( $GLOBALS[ 'typenow' ] ) ? $GLOBALS[ 'typenow' ] : null ); |
|
185 | + if ( in_array( $_sCurrentPostType, $aEnqueueItem[ 'aPostTypes' ] ) ) { |
|
186 | 186 | return $this->_enqueueSRC( $aEnqueueItem ); |
187 | 187 | } |
188 | 188 |
@@ -124,14 +124,14 @@ |
||
124 | 124 | public function _enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
125 | 125 | |
126 | 126 | $sSRC = trim( $sSRC ); |
127 | - if ( empty( $sSRC ) ) { |
|
127 | + if ( empty( $sSRC ) ) { |
|
128 | 128 | return ''; |
129 | 129 | } |
130 | 130 | $sSRC = $this->getResolvedSRC( $sSRC ); |
131 | 131 | |
132 | 132 | // Setting the key based on the url prevents duplicate items |
133 | 133 | $_sSRCHash = md5( $sSRC ); |
134 | - if ( isset( $this->oProp->aEnqueuingScripts[ $_sSRCHash ] ) ) { |
|
134 | + if ( isset( $this->oProp->aEnqueuingScripts[ $_sSRCHash ] ) ) { |
|
135 | 135 | return ''; |
136 | 136 | } |
137 | 137 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @since 2.1.0 Moved from the meta box class. |
36 | 36 | * @var string |
37 | 37 | */ |
38 | - public $sMetaBoxID =''; |
|
38 | + public $sMetaBoxID = ''; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Stores the post type slugs associated with the meta box. |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | /** |
139 | 139 | * Calls the parent constructor by formatting the parameter values. |
140 | 140 | */ |
141 | - public function __construct( $oCaller, $sClassName, $sCapability='edit_posts', $sTextDomain='admin-page-framework', $sStructureType='post_meta_box' ) { |
|
141 | + public function __construct( $oCaller, $sClassName, $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework', $sStructureType = 'post_meta_box' ) { |
|
142 | 142 | |
143 | 143 | parent::__construct( |
144 | - $oCaller, // caller object |
|
145 | - null, // caller script path - meta boxes don't need the caller script path. |
|
146 | - $sClassName, // class name |
|
147 | - $sCapability, // capability |
|
148 | - $sTextDomain, // text domain |
|
144 | + $oCaller, // caller object |
|
145 | + null, // caller script path - meta boxes don't need the caller script path. |
|
146 | + $sClassName, // class name |
|
147 | + $sCapability, // capability |
|
148 | + $sTextDomain, // text domain |
|
149 | 149 | $sStructureType // structure type |
150 | 150 | ); |
151 | 151 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @internal |
27 | 27 | */ |
28 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
28 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
29 | 29 | |
30 | 30 | parent::__construct( $sOptionKey, $sCallerPath, $sCapability, $sTextDomain ); |
31 | 31 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | // tab |
47 | 47 | if ( $_sPageSlug && $_sTabSlug ) { |
48 | - $this->oProp->sStyle = $this->addAndApplyFilters( |
|
48 | + $this->oProp->sStyle = $this->addAndApplyFilters( |
|
49 | 49 | $_oCaller, |
50 | 50 | "style_{$_sPageSlug}_{$_sTabSlug}", |
51 | 51 | $this->oProp->sStyle |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | // page |
56 | 56 | if ( $_sPageSlug ) { |
57 | - $this->oProp->sStyle = $this->addAndApplyFilters( |
|
57 | + $this->oProp->sStyle = $this->addAndApplyFilters( |
|
58 | 58 | $_oCaller, |
59 | 59 | "style_{$_sPageSlug}", |
60 | 60 | $this->oProp->sStyle |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return string The tab slug if the tab has been added. |
89 | 89 | */ |
90 | 90 | private function _getCurrentTabSlugForFilter( $sPageSlug ) { |
91 | - $_sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
|
91 | + $_sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
|
92 | 92 | return isset( $this->oProp->aInPageTabs[ $sPageSlug ][ $_sTabSlug ] ) |
93 | 93 | ? $_sTabSlug |
94 | 94 | : ''; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // tab |
118 | 118 | if ( $_sPageSlug && $_sTabSlug ) { |
119 | - $this->oProp->sScript = $this->addAndApplyFilters( |
|
119 | + $this->oProp->sScript = $this->addAndApplyFilters( |
|
120 | 120 | $_oCaller, |
121 | 121 | "script_{$_sPageSlug}_{$_sTabSlug}", |
122 | 122 | $this->oProp->sScript |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | // page |
127 | 127 | if ( $_sPageSlug ) { |
128 | - $this->oProp->sScript = $this->addAndApplyFilters( |
|
128 | + $this->oProp->sScript = $this->addAndApplyFilters( |
|
129 | 129 | $_oCaller, |
130 | 130 | "script_{$_sPageSlug}", |
131 | 131 | $this->oProp->sScript |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | * @since 2.1.5 |
144 | 144 | * @internal |
145 | 145 | */ |
146 | - public function _enqueueStyles( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
146 | + public function _enqueueStyles( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
147 | 147 | |
148 | 148 | $_aHandleIDs = array(); |
149 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
150 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
|
149 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
150 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
|
151 | 151 | } |
152 | 152 | return $_aHandleIDs; |
153 | 153 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
174 | 174 | * @internal |
175 | 175 | */ |
176 | - public function _enqueueStyle( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
176 | + public function _enqueueStyle( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
177 | 177 | return $this->_enqueueResourceByType( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs, 'style' ); |
178 | 178 | } |
179 | 179 | |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | * |
183 | 183 | * @since 2.1.5 |
184 | 184 | */ |
185 | - public function _enqueueScripts( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
185 | + public function _enqueueScripts( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
186 | 186 | |
187 | 187 | $_aHandleIDs = array(); |
188 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
189 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
|
188 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
189 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
|
190 | 190 | } |
191 | 191 | return $_aHandleIDs; |
192 | 192 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
214 | 214 | * @internal |
215 | 215 | */ |
216 | - public function _enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
216 | + public function _enqueueScript( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
217 | 217 | return $this->_enqueueResourceByType( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs, 'script' ); |
218 | 218 | } |
219 | 219 | /** |
@@ -226,20 +226,20 @@ discard block |
||
226 | 226 | * @param array $aCustomArgs A custom argument array. |
227 | 227 | * @param string $sType Accepts 'style' or 'script' |
228 | 228 | */ |
229 | - private function _enqueueResourceByType( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array(), $sType='style' ) { |
|
229 | + private function _enqueueResourceByType( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array(), $sType = 'style' ) { |
|
230 | 230 | |
231 | - $sSRC = trim( $sSRC ); |
|
231 | + $sSRC = trim( $sSRC ); |
|
232 | 232 | if ( empty( $sSRC ) ) { |
233 | 233 | return ''; |
234 | 234 | } |
235 | - $sSRC = $this->getResolvedSRC( $sSRC ); |
|
235 | + $sSRC = $this->getResolvedSRC( $sSRC ); |
|
236 | 236 | |
237 | 237 | // Get the property name for the type |
238 | 238 | $_sContainerPropertyName = $this->_getContainerPropertyNameByType( $sType ); |
239 | 239 | $_sEnqueuedIndexPropertyName = $this->_getEnqueuedIndexPropertyNameByType( $sType ); |
240 | 240 | |
241 | 241 | // setting the key based on the url prevents duplicate items |
242 | - $_sSRCHash = md5( $sSRC ); |
|
242 | + $_sSRCHash = md5( $sSRC ); |
|
243 | 243 | if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) { |
244 | 244 | return ''; |
245 | 245 | } |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | 'sTabSlug' => $sTabSlug, |
251 | 251 | 'sSRC' => $sSRC, |
252 | 252 | 'sType' => $sType, |
253 | - 'handle_id' => $sType . '_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ), |
|
253 | + 'handle_id' => $sType.'_'.$this->oProp->sClassName.'_'.( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ), |
|
254 | 254 | ) |
255 | 255 | + self::$_aStructure_EnqueuingResources |
256 | 256 | ; |
257 | 257 | |
258 | 258 | // Store the attributes in another container by url. |
259 | - $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ]['handle_id'] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ]['attributes']; |
|
259 | + $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'attributes' ]; |
|
260 | 260 | |
261 | 261 | return $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'handle_id' ]; |
262 | 262 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @since 3.0.0 |
297 | 297 | * @internal |
298 | 298 | */ |
299 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
299 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
300 | 300 | return $this->_enqueueStyle( $sSRC, '', '', $aCustomArgs ); |
301 | 301 | } |
302 | 302 | /** |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * @since 3.0.0 |
307 | 307 | * @internal |
308 | 308 | */ |
309 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
309 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
310 | 310 | return $this->_enqueueScript( $sSRC, '', '', $aCustomArgs ); |
311 | 311 | } |
312 | 312 | |
@@ -323,11 +323,11 @@ discard block |
||
323 | 323 | |
324 | 324 | $sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
325 | 325 | $sCurrentTabSlug = $this->oProp->getCurrentTabSlug( $sCurrentPageSlug ); |
326 | - $sPageSlug = $aEnqueueItem['sPageSlug']; |
|
327 | - $sTabSlug = $aEnqueueItem['sTabSlug']; |
|
326 | + $sPageSlug = $aEnqueueItem[ 'sPageSlug' ]; |
|
327 | + $sTabSlug = $aEnqueueItem[ 'sTabSlug' ]; |
|
328 | 328 | |
329 | 329 | // If the page slug is not specified and the currently loading page is one of the pages that is added by the framework, |
330 | - if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework) |
|
330 | + if ( !$sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework) |
|
331 | 331 | return $this->_enqueueSRC( $aEnqueueItem ); |
332 | 332 | } |
333 | 333 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | // If the tab slug is not specified and the page slug is specified, |
343 | 343 | // and if the current loading page slug and the specified one matches, |
344 | 344 | if ( |
345 | - ( $sPageSlug && ! $sTabSlug ) |
|
345 | + ( $sPageSlug && !$sTabSlug ) |
|
346 | 346 | && ( $sCurrentPageSlug == $sPageSlug ) |
347 | 347 | ) { |
348 | 348 | return $this->_enqueueSRC( $aEnqueueItem ); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | private function _enqueueResourceByType( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array(), $sType='style' ) { |
230 | 230 | |
231 | 231 | $sSRC = trim( $sSRC ); |
232 | - if ( empty( $sSRC ) ) { |
|
232 | + if ( empty( $sSRC ) ) { |
|
233 | 233 | return ''; |
234 | 234 | } |
235 | 235 | $sSRC = $this->getResolvedSRC( $sSRC ); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | // setting the key based on the url prevents duplicate items |
242 | 242 | $_sSRCHash = md5( $sSRC ); |
243 | - if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) { |
|
243 | + if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) { |
|
244 | 244 | return ''; |
245 | 245 | } |
246 | 246 | |
@@ -327,7 +327,8 @@ discard block |
||
327 | 327 | $sTabSlug = $aEnqueueItem['sTabSlug']; |
328 | 328 | |
329 | 329 | // If the page slug is not specified and the currently loading page is one of the pages that is added by the framework, |
330 | - if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework) |
|
330 | + if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { |
|
331 | +// means script-global(among pages added by the framework) |
|
331 | 332 | return $this->_enqueueSRC( $aEnqueueItem ); |
332 | 333 | } |
333 | 334 |