@@ -80,7 +80,7 @@ |
||
80 | 80 | */ |
81 | 81 | public function _replyToSetUpHooks( $oFactory ) { |
82 | 82 | |
83 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
83 | + foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
84 | 84 | |
85 | 85 | // Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not. |
86 | 86 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | parent::__construct( $oProp ); |
28 | 28 | |
29 | - if ( ! $this->oProp->bIsAdmin ) { |
|
29 | + if ( !$this->oProp->bIsAdmin ) { |
|
30 | 30 | return; |
31 | 31 | } |
32 | 32 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ); |
38 | 38 | |
39 | 39 | add_action( |
40 | - 'set_up_' . $this->oProp->sClassName, |
|
40 | + 'set_up_'.$this->oProp->sClassName, |
|
41 | 41 | array( $this, '_replyToSetUpHooks' ) |
42 | 42 | ); |
43 | 43 | |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | return true; |
59 | 59 | } |
60 | 60 | |
61 | - if ( ! in_array( $this->oProp->sPageNow, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
61 | + if ( !in_array( $this->oProp->sPageNow, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
62 | 62 | return false; |
63 | 63 | } |
64 | 64 | |
65 | - if ( isset( $_GET[ 'taxonomy' ] ) && ! in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
65 | + if ( isset( $_GET[ 'taxonomy' ] ) && !in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function _replyToSetUpHooks( $oFactory ) { |
81 | 81 | |
82 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
82 | + foreach ( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
83 | 83 | |
84 | 84 | // Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not. |
85 | 85 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @param string The text domain of the caller script. |
105 | 105 | * @return void |
106 | 106 | */ |
107 | - public function __construct( $sPostType, $aArguments=array(), $sCallerPath=null, $sTextDomain='admin-page-framework' ) { |
|
107 | + public function __construct( $sPostType, $aArguments = array(), $sCallerPath = null, $sTextDomain = 'admin-page-framework' ) { |
|
108 | 108 | |
109 | 109 | if ( empty( $sPostType ) ) { |
110 | 110 | return; |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | |
113 | 113 | $_sProprtyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
114 | 114 | ? $this->aSubClassNames[ 'oProp' ] |
115 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
115 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
116 | 116 | $this->oProp = new $_sProprtyClassName( |
117 | 117 | $this, |
118 | 118 | $this->_getCallerScriptPath( $sCallerPath ), |
119 | - get_class( $this ), // class name |
|
120 | - 'publish_posts', // capability |
|
121 | - $sTextDomain, // text domain |
|
119 | + get_class( $this ), // class name |
|
120 | + 'publish_posts', // capability |
|
121 | + $sTextDomain, // text domain |
|
122 | 122 | $this->_sStructureType // structure type |
123 | 123 | ); |
124 | - $this->oProp->sPostType = AdminPageFramework_WPUtility::sanitizeSlug( $sPostType ); |
|
124 | + $this->oProp->sPostType = AdminPageFramework_WPUtility::sanitizeSlug( $sPostType ); |
|
125 | 125 | |
126 | 126 | // Post type argument array structure |
127 | 127 | // @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | return $sCallerPath; |
145 | 145 | } |
146 | 146 | |
147 | - if ( ! is_admin() ) { |
|
147 | + if ( !is_admin() ) { |
|
148 | 148 | return null; |
149 | 149 | } |
150 | 150 | $_sPageNow = AdminPageFramework_Utility::getElement( $GLOBALS, 'pagenow' ); |
@@ -25,84 +25,83 @@ |
||
25 | 25 | protected $_sStructureType = 'post_type'; |
26 | 26 | |
27 | 27 | /** |
28 | - * The constructor of the class object. |
|
29 | - * |
|
30 | - * Registers necessary hooks and sets up internal properties. |
|
31 | - * |
|
32 | - * <h4>Example</h4> |
|
33 | - * <code>new APF_PostType( |
|
34 | - * 'apf_posts', // post type slug |
|
35 | - * array( |
|
36 | - * 'labels' => array( |
|
37 | - * 'name' => 'Demo', |
|
38 | - * 'all_items' => __( 'Sample Posts', 'admin-page-framework-demo' ), |
|
39 | - * 'singular_name' => 'Demo', |
|
40 | - * 'add_new' => __( 'Add New', 'admin-page-framework-demo' ), |
|
41 | - * 'add_new_item' => __( 'Add New APF Post', 'admin-page-framework-demo' ), |
|
42 | - * 'edit' => __( 'Edit', 'admin-page-framework-demo' ), |
|
43 | - * 'edit_item' => __( 'Edit APF Post', 'admin-page-framework-demo' ), |
|
44 | - * 'new_item' => __( 'New APF Post', 'admin-page-framework-demo' ), |
|
45 | - * 'view' => __( 'View', 'admin-page-framework-demo' ), |
|
46 | - * 'view_item' => __( 'View APF Post', 'admin-page-framework-demo' ), |
|
47 | - * 'search_items' => __( 'Search APF Post', 'admin-page-framework-demo' ), |
|
48 | - * 'not_found' => __( 'No APF Post found', 'admin-page-framework-demo' ), |
|
49 | - * 'not_found_in_trash' => __( 'No APF Post found in Trash', 'admin-page-framework-demo' ), |
|
50 | - * 'parent' => __( 'Parent APF Post', 'admin-page-framework-demo' ), |
|
51 | - * |
|
52 | - * // (framework specific) |
|
53 | - * 'plugin_action_link' => __( 'APF Posts', 'admin-page-framework-demo' ), // framework specific key. [3.7.3+] |
|
54 | - * ), |
|
55 | - * 'public' => true, |
|
56 | - * 'menu_position' => 110, |
|
57 | - * 'supports' => array( 'title' ), // e.g. array( 'title', 'editor', 'comments', 'thumbnail', 'excerpt' ), |
|
58 | - * 'taxonomies' => array( '' ), |
|
59 | - * 'has_archive' => true, |
|
60 | - * 'show_admin_column' => true, // [3.5+ core] this is for custom taxonomies to automatically add the column in the listing table. |
|
61 | - * 'menu_icon' => $this->oProp->bIsAdmin |
|
62 | - * ? ( |
|
63 | - * version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) |
|
64 | - * ? 'dashicons-wordpress' |
|
65 | - * : plugins_url( 'asset/image/wp-logo_16x16.png', APFDEMO_FILE ) |
|
66 | - * ) |
|
67 | - * : null, // do not call the function in the front-end. |
|
68 | - * |
|
69 | - * // (framework specific) this sets the screen icon for the post type for WordPress v3.7.1 or below. |
|
70 | - * // a file path can be passed instead of a url, plugins_url( 'asset/image/wp-logo_32x32.png', APFDEMO_FILE ) |
|
71 | - * 'screen_icon' => dirname( APFDEMO_FILE ) . '/asset/image/wp-logo_32x32.png', |
|
72 | - * |
|
73 | - * // [3.5.10+] (framework specific) default: true |
|
74 | - * 'show_submenu_add_new' => true, |
|
75 | - * |
|
76 | - * // [3.7.4+] (framework specific) default: 10 |
|
77 | - * 'submenu_order_manage' => 20, |
|
78 | - * 'submenu_order_addnew' => 21, |
|
79 | - * |
|
80 | - * ) |
|
81 | - * );</code> |
|
82 | - * |
|
83 | - * <h4>Framework Specific Post Type Arguments</h4> |
|
84 | - * In addition to the post type argument structure defined by the WordPress core, there are arguments defined by the framework. |
|
85 | - * |
|
86 | - * - screen_icon - For WordPress 3.7.x or below, set an icon url or path for the 32x32 screen icon displayed in the post listing page. |
|
87 | - * - show_submenu_add_new - [3.5.10+] (boolean) Whether the sub-menu item of `Add New` should be displayed. |
|
88 | - * - submenu_order_manage - [3.7.4+] (numeric) The menu position of the `Manage` sub-menu item which gets automatically crated by the system when the admin ui is enabled. Default: `5` |
|
89 | - * - submenu_order_addnew - [3.7.4+] (numeric) The menu position of the `Manage` sub-menu item which gets automatically crated by the system when the admin ui is enabled. Default: `10` |
|
90 | - * |
|
91 | - * <h4>Framework Specific Post Type Label Arguments</h4> |
|
92 | - * - plugin_listing_table_title_cell_link' - [3.0.6+] Deprecated [3.7.3] use the `plugin_action_link` argument instead. |
|
93 | - * - plugin_action_link' - [3.7.3+] If the caller script is a plugin, this determines the label of the action link embedded in the plugin listing page (plugins.php). |
|
94 | - * To disable the action link, set an empty string `''`. |
|
95 | - |
|
96 | - * |
|
97 | - * @since 2.0.0 |
|
98 | - * @since 2.1.6 Added the $sTextDomain parameter. |
|
99 | - * @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
|
100 | - * @param string The post type slug. |
|
101 | - * @param array The <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Arguments">argument array</a> passed to register_post_type(). |
|
102 | - * @param string The path of the caller script. This is used to retrieve the script information to insert it into the footer. If not set, the framework tries to detect it. |
|
103 | - * @param string The text domain of the caller script. |
|
104 | - * @return void |
|
105 | - */ |
|
28 | + * The constructor of the class object. |
|
29 | + * |
|
30 | + * Registers necessary hooks and sets up internal properties. |
|
31 | + * |
|
32 | + * <h4>Example</h4> |
|
33 | + * <code>new APF_PostType( |
|
34 | + * 'apf_posts', // post type slug |
|
35 | + * array( |
|
36 | + * 'labels' => array( |
|
37 | + * 'name' => 'Demo', |
|
38 | + * 'all_items' => __( 'Sample Posts', 'admin-page-framework-demo' ), |
|
39 | + * 'singular_name' => 'Demo', |
|
40 | + * 'add_new' => __( 'Add New', 'admin-page-framework-demo' ), |
|
41 | + * 'add_new_item' => __( 'Add New APF Post', 'admin-page-framework-demo' ), |
|
42 | + * 'edit' => __( 'Edit', 'admin-page-framework-demo' ), |
|
43 | + * 'edit_item' => __( 'Edit APF Post', 'admin-page-framework-demo' ), |
|
44 | + * 'new_item' => __( 'New APF Post', 'admin-page-framework-demo' ), |
|
45 | + * 'view' => __( 'View', 'admin-page-framework-demo' ), |
|
46 | + * 'view_item' => __( 'View APF Post', 'admin-page-framework-demo' ), |
|
47 | + * 'search_items' => __( 'Search APF Post', 'admin-page-framework-demo' ), |
|
48 | + * 'not_found' => __( 'No APF Post found', 'admin-page-framework-demo' ), |
|
49 | + * 'not_found_in_trash' => __( 'No APF Post found in Trash', 'admin-page-framework-demo' ), |
|
50 | + * 'parent' => __( 'Parent APF Post', 'admin-page-framework-demo' ), |
|
51 | + * |
|
52 | + * // (framework specific) |
|
53 | + * 'plugin_action_link' => __( 'APF Posts', 'admin-page-framework-demo' ), // framework specific key. [3.7.3+] |
|
54 | + * ), |
|
55 | + * 'public' => true, |
|
56 | + * 'menu_position' => 110, |
|
57 | + * 'supports' => array( 'title' ), // e.g. array( 'title', 'editor', 'comments', 'thumbnail', 'excerpt' ), |
|
58 | + * 'taxonomies' => array( '' ), |
|
59 | + * 'has_archive' => true, |
|
60 | + * 'show_admin_column' => true, // [3.5+ core] this is for custom taxonomies to automatically add the column in the listing table. |
|
61 | + * 'menu_icon' => $this->oProp->bIsAdmin |
|
62 | + * ? ( |
|
63 | + * version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) |
|
64 | + * ? 'dashicons-wordpress' |
|
65 | + * : plugins_url( 'asset/image/wp-logo_16x16.png', APFDEMO_FILE ) |
|
66 | + * ) |
|
67 | + * : null, // do not call the function in the front-end. |
|
68 | + * |
|
69 | + * // (framework specific) this sets the screen icon for the post type for WordPress v3.7.1 or below. |
|
70 | + * // a file path can be passed instead of a url, plugins_url( 'asset/image/wp-logo_32x32.png', APFDEMO_FILE ) |
|
71 | + * 'screen_icon' => dirname( APFDEMO_FILE ) . '/asset/image/wp-logo_32x32.png', |
|
72 | + * |
|
73 | + * // [3.5.10+] (framework specific) default: true |
|
74 | + * 'show_submenu_add_new' => true, |
|
75 | + * |
|
76 | + * // [3.7.4+] (framework specific) default: 10 |
|
77 | + * 'submenu_order_manage' => 20, |
|
78 | + * 'submenu_order_addnew' => 21, |
|
79 | + * |
|
80 | + * ) |
|
81 | + * );</code> |
|
82 | + * |
|
83 | + * <h4>Framework Specific Post Type Arguments</h4> |
|
84 | + * In addition to the post type argument structure defined by the WordPress core, there are arguments defined by the framework. |
|
85 | + * |
|
86 | + * - screen_icon - For WordPress 3.7.x or below, set an icon url or path for the 32x32 screen icon displayed in the post listing page. |
|
87 | + * - show_submenu_add_new - [3.5.10+] (boolean) Whether the sub-menu item of `Add New` should be displayed. |
|
88 | + * - submenu_order_manage - [3.7.4+] (numeric) The menu position of the `Manage` sub-menu item which gets automatically crated by the system when the admin ui is enabled. Default: `5` |
|
89 | + * - submenu_order_addnew - [3.7.4+] (numeric) The menu position of the `Manage` sub-menu item which gets automatically crated by the system when the admin ui is enabled. Default: `10` |
|
90 | + * |
|
91 | + * <h4>Framework Specific Post Type Label Arguments</h4> |
|
92 | + * - plugin_listing_table_title_cell_link' - [3.0.6+] Deprecated [3.7.3] use the `plugin_action_link` argument instead. |
|
93 | + * - plugin_action_link' - [3.7.3+] If the caller script is a plugin, this determines the label of the action link embedded in the plugin listing page (plugins.php). |
|
94 | + * To disable the action link, set an empty string `''`. |
|
95 | + * |
|
96 | + * @since 2.0.0 |
|
97 | + * @since 2.1.6 Added the $sTextDomain parameter. |
|
98 | + * @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
|
99 | + * @param string The post type slug. |
|
100 | + * @param array The <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Arguments">argument array</a> passed to register_post_type(). |
|
101 | + * @param string The path of the caller script. This is used to retrieve the script information to insert it into the footer. If not set, the framework tries to detect it. |
|
102 | + * @param string The text domain of the caller script. |
|
103 | + * @return void |
|
104 | + */ |
|
106 | 105 | public function __construct( $sPostType, $aArguments=array(), $sCallerPath=null, $sTextDomain='admin-page-framework' ) { |
107 | 106 | |
108 | 107 | if ( empty( $sPostType ) ) { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * @since 2.0.0 |
15 | 15 | * @package AdminPageFramework/Factory/PostType |
16 | 16 | */ |
17 | -abstract class AdminPageFramework_PostType extends AdminPageFramework_PostType_Controller { |
|
17 | +abstract class AdminPageFramework_PostType extends AdminPageFramework_PostType_Controller { |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Defines the class object structure type. |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function __construct( $sPostType, $aArguments=array(), $sCallerPath=null, $sTextDomain='admin-page-framework' ) { |
107 | 107 | |
108 | - if ( empty( $sPostType ) ) { |
|
108 | + if ( empty( $sPostType ) ) { |
|
109 | 109 | return; |
110 | 110 | } |
111 | 111 |
@@ -84,12 +84,6 @@ discard block |
||
84 | 84 | * Returns the specified option value. |
85 | 85 | * |
86 | 86 | * @since 3.6.0 |
87 | - * @param string|array $sKey1|$aKeys The dimensional key or keys of an array of the element to extract its value. |
|
88 | - * If a string is set to the first parameter, the second parameter is also expected to be a string serving as a second dimensional key. |
|
89 | - * For example, there is a multi-dimensional array, `array( 'a' => array( 'b' => 'bbb' ) )` to extract the value of the 'b' element in the second depth, |
|
90 | - * set the parameter as follows. `get( 'a', 'b' )` or `get( array( 'a', 'b' ) );` |
|
91 | - * @param string|variant $sKey2|$vDefault The second dimensional key or the default value in case the value is not set. |
|
92 | - * @param string $sKey3 The third dimensional key and so on. |
|
93 | 87 | */ |
94 | 88 | public function get( /* $sKey1, $sKey2, $sKey3, ... OR $aKeys, $vDefault */ ) { |
95 | 89 | |
@@ -139,10 +133,6 @@ discard block |
||
139 | 133 | * |
140 | 134 | * @since 3.6.0 |
141 | 135 | * @return void |
142 | - * @param string|array $asKeys The key or keys of an array of the element to set its value. |
|
143 | - * If a string is passed, it specifies the element with the set key. If an array is passed, it specifies the element with the dimensional keys. |
|
144 | - * For example, `set( 'a', 'aaa' )` will set a value, `array( 'a' => 'aaa' )` and `set( array( 'a', 'b' ), 'bbb' )` will set `array( 'a' => array( 'b' => 'bbb' ) )`. |
|
145 | - * @param variant $mValue The value to be set. |
|
146 | 136 | */ |
147 | 137 | public function set( /* $asKeys, $mValue */ ) { |
148 | 138 | |
@@ -168,10 +158,6 @@ discard block |
||
168 | 158 | * Removes an element by dimensional keys. |
169 | 159 | * @since 3.6.0 |
170 | 160 | * @return void |
171 | - * @param string|array $asKeys The key or keys of an array of the element to set its value. |
|
172 | - * If a string is passed, it specifies the element with the set key. If an array is passed, it specifies the element with the dimensional keys. |
|
173 | - * For example, `delete( 'a' )` will unset an element of `a` in `array( 'a' => 'some value' )` so it becomes `array()`. |
|
174 | - * `delete( array( 'a', 'b' ) )` will unset the element of `b` in `array( 'a' => array( 'b' => 'bbb' ) )`. |
|
175 | 161 | */ |
176 | 162 | public function delete( /* $sKey1, $sKey2, $sKey3 ... OR $aKeys */ ) { |
177 | 163 |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | * @since 3.6.0 |
52 | 52 | * @var array |
53 | 53 | */ |
54 | - public $aData = array(); |
|
54 | + public $aData = array(); |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Stores the default values. |
58 | 58 | * @since 3.6.0 |
59 | 59 | * @var array |
60 | 60 | */ |
61 | - public $aDefault = array(); |
|
61 | + public $aDefault = array(); |
|
62 | 62 | /**#@-*/ |
63 | 63 | |
64 | 64 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $_aKeys = func_get_args() + array( null ); |
97 | 97 | |
98 | 98 | // If no key is specified, return the whole array. |
99 | - if ( ! isset( $_aKeys[ 0 ] ) ) { |
|
99 | + if ( !isset( $_aKeys[ 0 ] ) ) { |
|
100 | 100 | return $this->uniteArrays( |
101 | 101 | $this->aData, |
102 | 102 | $this->aDefault |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | |
112 | 112 | // Now either the section ID or field ID is given. |
113 | 113 | return $this->getArrayValueByArrayKeys( |
114 | - $this->aData, // subject array |
|
115 | - $_aKeys, // dimensional keys |
|
114 | + $this->aData, // subject array |
|
115 | + $_aKeys, // dimensional keys |
|
116 | 116 | $this->_getDefaultValue( // default value |
117 | 117 | $_mDefault, |
118 | 118 | $_aKeys |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function set( /* $asKeys, $mValue */ ) { |
147 | 147 | |
148 | - $_aParameters = func_get_args(); |
|
149 | - if ( ! isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
148 | + $_aParameters = func_get_args(); |
|
149 | + if ( !isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
150 | 150 | return; |
151 | 151 | } |
152 | 152 | $_asKeys = $_aParameters[ 0 ]; |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function delete( /* $sKey1, $sKey2, $sKey3 ... OR $aKeys */ ) { |
176 | 176 | |
177 | - $_aParameters = func_get_args(); |
|
178 | - if ( ! isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
177 | + $_aParameters = func_get_args(); |
|
178 | + if ( !isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
179 | 179 | return; |
180 | 180 | } |
181 | 181 | $_asKeys = $_aParameters[ 0 ]; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * Sets up properties and performs registering classes. |
76 | 76 | * |
77 | 77 | * |
78 | - * @param array|string $asScanDirPath the target directory path to scan |
|
78 | + * @param array|string $asScanDirPaths the target directory path to scan |
|
79 | 79 | * @param array $aOptions The recursive settings. |
80 | 80 | * <ul> |
81 | 81 | * <li><code>is_recursive</code> - (boolean) determines whether the scan should be performed recursively.</li> |
@@ -217,6 +217,7 @@ discard block |
||
217 | 217 | /** |
218 | 218 | * The recursive version of the glob() function. |
219 | 219 | * @internal |
220 | + * @param string $sPathPatten |
|
220 | 221 | */ |
221 | 222 | protected function doRecursiveGlob( $sPathPatten, $nFlags=0, array $aExcludeDirs=array(), array $aExcludeDirNames=array() ) { |
222 | 223 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'is_recursive' => true, |
67 | 67 | 'exclude_dir_paths' => array(), |
68 | 68 | 'exclude_dir_names' => array( 'asset', 'assets', 'css', 'js', 'image', 'images', 'license', 'document', 'documents' ), |
69 | - 'allowed_extensions' => array( 'php', ), // 'inc' |
|
69 | + 'allowed_extensions' => array( 'php',), // 'inc' |
|
70 | 70 | 'include_function' => 'include', |
71 | 71 | 'exclude_class_names' => array( /* 'SomeClass', 'SomeOtherClass' */ ), |
72 | 72 | ); |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | * |
106 | 106 | * @remark The directory paths set for the 'exclude_dir_paths' option should use the system directory separator. |
107 | 107 | */ |
108 | - public function __construct( $asScanDirPaths, array $aOptions=array(), array $aClasses=array() ) { |
|
108 | + public function __construct( $asScanDirPaths, array $aOptions = array(), array $aClasses = array() ) { |
|
109 | 109 | |
110 | 110 | $_aOptions = $aOptions + self::$_aStructure_Options; |
111 | - $this->_aClasses = $aClasses + $this->_getClassArray( $asScanDirPaths, $_aOptions ); |
|
111 | + $this->_aClasses = $aClasses + $this->_getClassArray( $asScanDirPaths, $_aOptions ); |
|
112 | 112 | $this->_registerClasses( $_aOptions[ 'include_function' ] ); |
113 | 113 | |
114 | 114 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | return array(); |
135 | 135 | } |
136 | 136 | $_aFilePaths = array(); |
137 | - foreach( ( array ) $asScanDirPaths as $_sClassDirPath ) { |
|
137 | + foreach ( ( array ) $asScanDirPaths as $_sClassDirPath ) { |
|
138 | 138 | if ( realpath( $_sClassDirPath ) ) { |
139 | 139 | $_aFilePaths = array_merge( $this->getFilePaths( $_sClassDirPath, $aSearchOptions ), $_aFilePaths ); |
140 | 140 | } |
@@ -142,11 +142,11 @@ discard block |
||
142 | 142 | |
143 | 143 | // Store classes in an array. |
144 | 144 | $_aClasses = array(); |
145 | - foreach( $_aFilePaths as $_sFilePath ) { |
|
145 | + foreach ( $_aFilePaths as $_sFilePath ) { |
|
146 | 146 | |
147 | 147 | // Class name without a file extension. |
148 | 148 | $_sClassNameWOExt = pathinfo( $_sFilePath, PATHINFO_FILENAME ); |
149 | - if ( in_array( $_sClassNameWOExt, $aSearchOptions['exclude_class_names'] ) ) { |
|
149 | + if ( in_array( $_sClassNameWOExt, $aSearchOptions[ 'exclude_class_names' ] ) ) { |
|
150 | 150 | continue; |
151 | 151 | } |
152 | 152 | $_aClasses[ $_sClassNameWOExt ] = $_sFilePath; |
@@ -176,26 +176,26 @@ discard block |
||
176 | 176 | */ |
177 | 177 | protected function getFilePaths( $sClassDirPath, array $aSearchOptions ) { |
178 | 178 | |
179 | - $sClassDirPath = rtrim( $sClassDirPath, '\\/' ) . DIRECTORY_SEPARATOR; // ensures the trailing (back/)slash exists. |
|
180 | - $_aAllowedExtensions = $aSearchOptions['allowed_extensions']; |
|
181 | - $_aExcludeDirPaths = ( array ) $aSearchOptions['exclude_dir_paths']; |
|
182 | - $_aExcludeDirNames = ( array ) $aSearchOptions['exclude_dir_names']; |
|
179 | + $sClassDirPath = rtrim( $sClassDirPath, '\\/' ).DIRECTORY_SEPARATOR; // ensures the trailing (back/)slash exists. |
|
180 | + $_aAllowedExtensions = $aSearchOptions[ 'allowed_extensions' ]; |
|
181 | + $_aExcludeDirPaths = ( array ) $aSearchOptions[ 'exclude_dir_paths' ]; |
|
182 | + $_aExcludeDirNames = ( array ) $aSearchOptions[ 'exclude_dir_names' ]; |
|
183 | 183 | $_bIsRecursive = $aSearchOptions[ 'is_recursive' ]; |
184 | 184 | |
185 | 185 | if ( defined( 'GLOB_BRACE' ) ) { // in some OSes this flag constant is not available. |
186 | 186 | $_aFilePaths = $_bIsRecursive |
187 | - ? $this->doRecursiveGlob( $sClassDirPath . '*.' . $this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE, $_aExcludeDirPaths, $_aExcludeDirNames ) |
|
188 | - : ( array ) glob( $sClassDirPath . '*.' . $this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE ); |
|
187 | + ? $this->doRecursiveGlob( $sClassDirPath.'*.'.$this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE, $_aExcludeDirPaths, $_aExcludeDirNames ) |
|
188 | + : ( array ) glob( $sClassDirPath.'*.'.$this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE ); |
|
189 | 189 | return array_filter( $_aFilePaths ); // drop non-value elements. |
190 | 190 | } |
191 | 191 | |
192 | 192 | // For the Solaris operation system. |
193 | 193 | $_aFilePaths = array(); |
194 | - foreach( $_aAllowedExtensions as $__sAllowedExtension ) { |
|
194 | + foreach ( $_aAllowedExtensions as $__sAllowedExtension ) { |
|
195 | 195 | |
196 | 196 | $__aFilePaths = $_bIsRecursive |
197 | - ? $this->doRecursiveGlob( $sClassDirPath . '*.' . $__sAllowedExtension, 0, $_aExcludeDirPaths, $_aExcludeDirNames ) |
|
198 | - : ( array ) glob( $sClassDirPath . '*.' . $__sAllowedExtension ); |
|
197 | + ? $this->doRecursiveGlob( $sClassDirPath.'*.'.$__sAllowedExtension, 0, $_aExcludeDirPaths, $_aExcludeDirNames ) |
|
198 | + : ( array ) glob( $sClassDirPath.'*.'.$__sAllowedExtension ); |
|
199 | 199 | |
200 | 200 | $_aFilePaths = array_merge( $__aFilePaths, $_aFilePaths ); |
201 | 201 | |
@@ -208,28 +208,28 @@ discard block |
||
208 | 208 | * Constructs the file pattern of the file extension part used for the glob() function with the given file extensions. |
209 | 209 | * @internal |
210 | 210 | */ |
211 | - protected function _getGlobPatternExtensionPart( array $aExtensions=array( 'php', 'inc' ) ) { |
|
211 | + protected function _getGlobPatternExtensionPart( array $aExtensions = array( 'php', 'inc' ) ) { |
|
212 | 212 | return empty( $aExtensions ) |
213 | 213 | ? '*' |
214 | - : '{' . implode( ',', $aExtensions ) . '}'; |
|
214 | + : '{'.implode( ',', $aExtensions ).'}'; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
218 | 218 | * The recursive version of the glob() function. |
219 | 219 | * @internal |
220 | 220 | */ |
221 | - protected function doRecursiveGlob( $sPathPatten, $nFlags=0, array $aExcludeDirs=array(), array $aExcludeDirNames=array() ) { |
|
221 | + protected function doRecursiveGlob( $sPathPatten, $nFlags = 0, array $aExcludeDirs = array(), array $aExcludeDirNames = array() ) { |
|
222 | 222 | |
223 | 223 | $_aFiles = glob( $sPathPatten, $nFlags ); |
224 | 224 | $_aFiles = is_array( $_aFiles ) ? $_aFiles : array(); // glob() can return false. |
225 | - $_aDirs = glob( dirname( $sPathPatten ) . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR|GLOB_NOSORT ); |
|
225 | + $_aDirs = glob( dirname( $sPathPatten ).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR | GLOB_NOSORT ); |
|
226 | 226 | $_aDirs = is_array( $_aDirs ) ? $_aDirs : array(); |
227 | 227 | foreach ( $_aDirs as $_sDirPath ) { |
228 | 228 | |
229 | 229 | if ( in_array( $_sDirPath, $aExcludeDirs ) ) { continue; } |
230 | 230 | if ( in_array( pathinfo( $_sDirPath, PATHINFO_DIRNAME ), $aExcludeDirNames ) ) { continue; } |
231 | 231 | |
232 | - $_aFiles = array_merge( $_aFiles, $this->doRecursiveGlob( $_sDirPath . DIRECTORY_SEPARATOR . basename( $sPathPatten ), $nFlags, $aExcludeDirs ) ); |
|
232 | + $_aFiles = array_merge( $_aFiles, $this->doRecursiveGlob( $_sDirPath.DIRECTORY_SEPARATOR.basename( $sPathPatten ), $nFlags, $aExcludeDirs ) ); |
|
233 | 233 | |
234 | 234 | } |
235 | 235 | return $_aFiles; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @return void |
245 | 245 | */ |
246 | 246 | protected function _registerClasses( $sIncludeFunction ) { |
247 | - spl_autoload_register( array( $this, '_replyToAutoLoad_' . $sIncludeFunction ) ); |
|
247 | + spl_autoload_register( array( $this, '_replyToAutoLoad_'.$sIncludeFunction ) ); |
|
248 | 248 | } |
249 | 249 | /**#@+ |
250 | 250 | * Responds to the PHP auto-loader and includes the passed class based on the previously stored path associated with the class name in the constructor. |
@@ -252,25 +252,25 @@ discard block |
||
252 | 252 | * @return void |
253 | 253 | */ |
254 | 254 | public function _replyToAutoLoad_include( $sCalledUnknownClassName ) { |
255 | - if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
255 | + if ( !isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
256 | 256 | return; |
257 | 257 | } |
258 | 258 | include( $this->_aClasses[ $sCalledUnknownClassName ] ); |
259 | 259 | } |
260 | 260 | public function _replyToAutoLoad_include_once( $sCalledUnknownClassName ) { |
261 | - if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
261 | + if ( !isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
262 | 262 | return; |
263 | 263 | } |
264 | 264 | include_once( $this->_aClasses[ $sCalledUnknownClassName ] ); |
265 | 265 | } |
266 | 266 | public function _replyToAutoLoad_require( $sCalledUnknownClassName ) { |
267 | - if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
267 | + if ( !isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
268 | 268 | return; |
269 | 269 | } |
270 | 270 | require( $this->_aClasses[ $sCalledUnknownClassName ] ); |
271 | 271 | } |
272 | 272 | public function _replyToAutoLoad_require_once( $sCalledUnknownClassName ) { |
273 | - if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
273 | + if ( !isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
274 | 274 | return; |
275 | 275 | } |
276 | 276 | require_once( $this->_aClasses[ $sCalledUnknownClassName ] ); |
@@ -181,7 +181,8 @@ discard block |
||
181 | 181 | $_aExcludeDirNames = ( array ) $aSearchOptions['exclude_dir_names']; |
182 | 182 | $_bIsRecursive = $aSearchOptions[ 'is_recursive' ]; |
183 | 183 | |
184 | - if ( defined( 'GLOB_BRACE' ) ) { // in some OSes this flag constant is not available. |
|
184 | + if ( defined( 'GLOB_BRACE' ) ) { |
|
185 | +// in some OSes this flag constant is not available. |
|
185 | 186 | $_aFilePaths = $_bIsRecursive |
186 | 187 | ? $this->doRecursiveGlob( $sClassDirPath . '*.' . $this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE, $_aExcludeDirPaths, $_aExcludeDirNames ) |
187 | 188 | : ( array ) glob( $sClassDirPath . '*.' . $this->_getGlobPatternExtensionPart( $_aAllowedExtensions ), GLOB_BRACE ); |
@@ -250,26 +251,26 @@ discard block |
||
250 | 251 | * @internal |
251 | 252 | * @return void |
252 | 253 | */ |
253 | - public function _replyToAutoLoad_include( $sCalledUnknownClassName ) { |
|
254 | - if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
254 | + public function _replyToAutoLoad_include( $sCalledUnknownClassName ) { |
|
255 | + if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
255 | 256 | return; |
256 | 257 | } |
257 | 258 | include( $this->_aClasses[ $sCalledUnknownClassName ] ); |
258 | 259 | } |
259 | - public function _replyToAutoLoad_include_once( $sCalledUnknownClassName ) { |
|
260 | - if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
260 | + public function _replyToAutoLoad_include_once( $sCalledUnknownClassName ) { |
|
261 | + if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
261 | 262 | return; |
262 | 263 | } |
263 | 264 | include_once( $this->_aClasses[ $sCalledUnknownClassName ] ); |
264 | 265 | } |
265 | - public function _replyToAutoLoad_require( $sCalledUnknownClassName ) { |
|
266 | - if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
266 | + public function _replyToAutoLoad_require( $sCalledUnknownClassName ) { |
|
267 | + if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
267 | 268 | return; |
268 | 269 | } |
269 | 270 | require( $this->_aClasses[ $sCalledUnknownClassName ] ); |
270 | 271 | } |
271 | - public function _replyToAutoLoad_require_once( $sCalledUnknownClassName ) { |
|
272 | - if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
272 | + public function _replyToAutoLoad_require_once( $sCalledUnknownClassName ) { |
|
273 | + if ( ! isset( $this->_aClasses[ $sCalledUnknownClassName ] ) ) { |
|
273 | 274 | return; |
274 | 275 | } |
275 | 276 | require_once( $this->_aClasses[ $sCalledUnknownClassName ] ); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * Creates an object instance with dynamic parameters. |
46 | 46 | * |
47 | 47 | * @since 3.7.10 |
48 | - * @param string $sCalssName The class name for testing. |
|
48 | + * @param string $sClassName The class name for testing. |
|
49 | 49 | * @param array $aParameters The parameters to pass to the constructor of the class set in the first parameter. |
50 | 50 | * @return object An object instance of the class specified in the first parameter. |
51 | 51 | */ |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * |
62 | 62 | * @since 3.7.10 |
63 | 63 | * @param object $oClass The subject class object. |
64 | - * @param string $sMathodName The subject method name. |
|
64 | + * @param string $sMethodName The subject method name. |
|
65 | 65 | * @param array $aParameters The parameters to pass to the method set in the second parameter. |
66 | 66 | * @remark This supports private methods to be executed. |
67 | 67 | */ |
@@ -87,6 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | /** |
89 | 89 | * @since 3.7.10 |
90 | + * @param string $sClassName |
|
90 | 91 | * @return object |
91 | 92 | * @internal |
92 | 93 | */ |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param array $aParameters The parameters to pass to the constructor of the class set in the first parameter. |
49 | 49 | * @return object An object instance of the class specified in the first parameter. |
50 | 50 | */ |
51 | - static public function getInstance( $sClassName, array $aParameters=array() ) { |
|
51 | + static public function getInstance( $sClassName, array $aParameters = array() ) { |
|
52 | 52 | |
53 | 53 | $_oReflection = new ReflectionClass( $sClassName ); |
54 | 54 | return $_oReflection->newInstanceArgs( $aParameters ); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | // For PHP 5.2.x or below |
70 | 70 | if ( version_compare( phpversion(), '<', '5.3.0' ) ) { |
71 | 71 | trigger_error( |
72 | - 'Program Name' . ': ' |
|
72 | + 'Program Name'.': ' |
|
73 | 73 | . sprintf( |
74 | 74 | 'The method cannot run with your PHP version: %1$s', |
75 | 75 | phpversion() |
@@ -196,7 +196,6 @@ |
||
196 | 196 | * For common hooks throughout the other factory components, see [Base Factory](./package-AdminPageFramework.Common.Factory.html). |
197 | 197 | * |
198 | 198 | * <h3>Factory Specific Hooks</h3> |
199 | - |
|
200 | 199 | * <h4> Action Hooks</h4> |
201 | 200 | * <ul> |
202 | 201 | * <li>**load_{page slug}** – [2.1.0+] triggered when the framework's page is loaded before the header gets sent. This will not be triggered in the admin pages that are not registered by the framework. The first parameter: class object [3.1.2+].</li> |
@@ -21,6 +21,6 @@ |
||
21 | 21 | /** |
22 | 22 | * The callback function name or the callable object to retrieve meta data. |
23 | 23 | */ |
24 | - protected $osCallable = 'get_user_meta'; |
|
24 | + protected $osCallable = 'get_user_meta'; |
|
25 | 25 | |
26 | 26 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @return string the input id attribute |
42 | 42 | */ |
43 | 43 | public function _replyToGetSectionName( /* $sSectionName, $aSectionset */ ) { |
44 | - $_aParams = func_get_args() + array( null, null, ); |
|
44 | + $_aParams = func_get_args() + array( null, null,); |
|
45 | 45 | return $_aParams[ 0 ]; |
46 | 46 | } |
47 | 47 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | * @since 3.6.0 |
70 | 70 | * @return string |
71 | 71 | */ |
72 | - public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
73 | - $_aParams = func_get_args() + array( null, null, ); |
|
72 | + public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
73 | + $_aParams = func_get_args() + array( null, null,); |
|
74 | 74 | return $_aParams[ 0 ]; |
75 | 75 | } |
76 | 76 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @return string |
81 | 81 | */ |
82 | 82 | public function _replyToGetFlatFieldName( /* $sFieldName, $aFieldset */ ) { |
83 | - $_aParams = func_get_args() + array( null, null, ); |
|
83 | + $_aParams = func_get_args() + array( null, null,); |
|
84 | 84 | return $_aParams[ 0 ]; |
85 | 85 | } |
86 | 86 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @return string the flat input name attribute |
103 | 103 | */ |
104 | 104 | public function _replyToGetFlatInputName( /* $sFlatNameAttribute, $aField, $sKey */ ) { |
105 | - $_aParams = func_get_args() + array( null, null, null ); |
|
105 | + $_aParams = func_get_args() + array( null, null, null ); |
|
106 | 106 | return $_aParams[ 0 ]; |
107 | 107 | } |
108 | 108 | |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | 'if' => true, |
145 | 145 | 'capability' => '', |
146 | 146 | ); |
147 | - if ( ! $aElementDefinition[ 'if' ] ) { |
|
147 | + if ( !$aElementDefinition[ 'if' ] ) { |
|
148 | 148 | return false; |
149 | 149 | } |
150 | 150 | // For front-end forms that allow guests, the capability level can be empty. In that case, return true. |
151 | - if ( ! $aElementDefinition[ 'capability' ] ) { |
|
151 | + if ( !$aElementDefinition[ 'capability' ] ) { |
|
152 | 152 | return true; |
153 | 153 | } |
154 | - if ( ! current_user_can( $aElementDefinition[ 'capability' ] ) ) { |
|
154 | + if ( !current_user_can( $aElementDefinition[ 'capability' ] ) ) { |
|
155 | 155 | return false; |
156 | 156 | } |
157 | 157 | return $bDefault; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this, |
188 | 188 | array( |
189 | 189 | // section_{instantiated class name}_{section id} |
190 | - 'section_head_' . $this->oProp->sClassName . '_' . $aSectionset[ 'section_id' ] |
|
190 | + 'section_head_'.$this->oProp->sClassName.'_'.$aSectionset[ 'section_id' ] |
|
191 | 191 | ), |
192 | 192 | $sSectionDescription |
193 | 193 | ); |
@@ -204,15 +204,15 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function _replyToGetFieldOutput( $sFieldOutput, $aFieldset ) { |
206 | 206 | |
207 | - $_sSectionPart = $this->oUtil->getAOrB( |
|
207 | + $_sSectionPart = $this->oUtil->getAOrB( |
|
208 | 208 | isset( $aFieldset[ 'section_id' ] ) && '_default' !== $aFieldset[ 'section_id' ], |
209 | - '_' . $aFieldset[ 'section_id' ], |
|
209 | + '_'.$aFieldset[ 'section_id' ], |
|
210 | 210 | '' |
211 | 211 | ); |
212 | 212 | return $this->oUtil->addAndApplyFilters( |
213 | 213 | $this, |
214 | 214 | array( |
215 | - 'field_' . $this->oProp->sClassName . $_sSectionPart . '_' . $aFieldset[ 'field_id' ] |
|
215 | + 'field_'.$this->oProp->sClassName.$_sSectionPart.'_'.$aFieldset[ 'field_id' ] |
|
216 | 216 | ), |
217 | 217 | $sFieldOutput, |
218 | 218 | $aFieldset // the field array |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @since 3.6.0 |
70 | 70 | * @return string |
71 | 71 | */ |
72 | - public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
72 | + public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
73 | 73 | $_aParams = func_get_args() + array( null, null, ); |
74 | 74 | return $_aParams[ 0 ]; |
75 | 75 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @since 3.6.0 |
80 | 80 | * @return string |
81 | 81 | */ |
82 | - public function _replyToGetFlatFieldName( /* $sFieldName, $aFieldset */ ) { |
|
82 | + public function _replyToGetFlatFieldName( /* $sFieldName, $aFieldset */ ) { |
|
83 | 83 | $_aParams = func_get_args() + array( null, null, ); |
84 | 84 | return $_aParams[ 0 ]; |
85 | 85 | } |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Sets up hooks and properties. |
28 | 28 | */ |
29 | - public function __construct( $oProp, $oMsg=null ) { |
|
29 | + public function __construct( $oProp, $oMsg = null ) { |
|
30 | 30 | |
31 | - if ( ! $this->_isLoadable( $oProp ) ) { |
|
31 | + if ( !$this->_isLoadable( $oProp ) ) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // Add an action link in the plugin listing page |
41 | 41 | if ( $this->_shouldSetPluginActionLinks() ) { |
42 | 42 | add_filter( |
43 | - 'plugin_action_links_' . plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
|
43 | + 'plugin_action_links_'.plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
|
44 | 44 | array( $this, '_replyToAddSettingsLinkInPluginListingPage' ), |
45 | 45 | 20 // set a lower priority so that the link will be embedded at the beginning ( the most left hand side ). |
46 | 46 | ); |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | * @return boolean |
56 | 56 | */ |
57 | 57 | private function _isLoadable( $oProp ) { |
58 | - if ( ! $oProp->bIsAdmin ) { |
|
58 | + if ( !$oProp->bIsAdmin ) { |
|
59 | 59 | return false; |
60 | 60 | } |
61 | 61 | if ( $oProp->bIsAdminAjax ) { |
62 | 62 | return false; |
63 | 63 | } |
64 | - return ! $this->hasBeenCalled( 'links_' . $oProp->sClassName ); |
|
64 | + return !$this->hasBeenCalled( 'links_'.$oProp->sClassName ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | protected function _shouldSetPluginActionLinks() { |
73 | 73 | |
74 | 74 | // It is possible that the sub-objects are not set when the class is considered not loadable. |
75 | - if ( ! isset( $this->oProp ) ) { |
|
75 | + if ( !isset( $this->oProp ) ) { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
79 | - if ( ! in_array( $this->oProp->sPageNow, array( 'plugins.php' ) ) ) { |
|
79 | + if ( !in_array( $this->oProp->sPageNow, array( 'plugins.php' ) ) ) { |
|
80 | 80 | return false; |
81 | 81 | } |
82 | 82 | return 'plugin' === $this->oProp->aScriptInfo[ 'sType' ]; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | array( |
144 | 144 | 'href' => $aScriptInfo[ 'sURI' ], |
145 | 145 | 'target' => '_blank', |
146 | - 'title' => $aScriptInfo[ 'sName' ] . $_sVersion . $_sDescription |
|
146 | + 'title' => $aScriptInfo[ 'sName' ].$_sVersion.$_sDescription |
|
147 | 147 | ), |
148 | 148 | $aScriptInfo[ 'sName' ] |
149 | 149 | ) |
@@ -165,13 +165,13 @@ discard block |
||
165 | 165 | $_sAuthorInfo = $this->getAOrB( |
166 | 166 | empty( $aScriptInfo[ 'sAuthor' ] ), |
167 | 167 | $_sAuthorInfo, |
168 | - ' by ' . $_sAuthorInfo |
|
168 | + ' by '.$_sAuthorInfo |
|
169 | 169 | ); |
170 | 170 | |
171 | 171 | // Enclosing the output in a span tag as the outer element is a '<p>' tag. So this cannot be div. |
172 | 172 | // 3.5.7+ Added the class attribute for acceptance testing |
173 | 173 | return "<span class='apf-script-info'>" |
174 | - . $_sPluginInfo . $_sAuthorInfo |
|
174 | + . $_sPluginInfo.$_sAuthorInfo |
|
175 | 175 | . "</span>"; |
176 | 176 | |
177 | 177 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | array( |
203 | 203 | 'href' => $aScriptInfo[ 'sURI' ], |
204 | 204 | 'target' => '_blank', |
205 | - 'title' => $aScriptInfo[ 'sName' ] . $_sVersion . $_sDescription, |
|
205 | + 'title' => $aScriptInfo[ 'sName' ].$_sVersion.$_sDescription, |
|
206 | 206 | ), |
207 | 207 | $aScriptInfo[ 'sName' ] |
208 | 208 | ) |
@@ -212,16 +212,16 @@ discard block |
||
212 | 212 | // 3.5.7+ added the 'apf-credit' class attribute for acceptance testing |
213 | 213 | // 3.7.0+ added the footer-thankyou id attribute. |
214 | 214 | return "<span class='apf-credit' id='footer-thankyou'>" |
215 | - . $this->oMsg->get( 'powered_by' ) . ' ' |
|
215 | + . $this->oMsg->get( 'powered_by' ).' ' |
|
216 | 216 | . $_sLibraryInfo |
217 | 217 | . ", " |
218 | - . $this->oMsg->get( 'and' ) . ' ' |
|
218 | + . $this->oMsg->get( 'and' ).' ' |
|
219 | 219 | . $this->getHTMLTag( |
220 | 220 | 'a', |
221 | 221 | array( |
222 | 222 | 'href' => 'https://wordpress.org', |
223 | 223 | 'target' => '_blank', |
224 | - 'title' => 'WordPress ' . $GLOBALS[ 'wp_version' ] |
|
224 | + 'title' => 'WordPress '.$GLOBALS[ 'wp_version' ] |
|
225 | 225 | ), |
226 | 226 | 'WordPress' |
227 | 227 | ) |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | protected function _setFooterHooks() { |
239 | 239 | |
240 | - add_filter( 'admin_footer_text' , array( $this, '_replyToAddInfoInFooterLeft' ) ); |
|
240 | + add_filter( 'admin_footer_text', array( $this, '_replyToAddInfoInFooterLeft' ) ); |
|
241 | 241 | add_filter( 'update_footer', array( $this, '_replyToAddInfoInFooterRight' ), 11 ); |
242 | 242 | |
243 | 243 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * @callback filter admin_footer_text |
250 | 250 | * @internal |
251 | 251 | */ |
252 | - public function _replyToAddInfoInFooterLeft( $sLinkHTML='' ) { |
|
252 | + public function _replyToAddInfoInFooterLeft( $sLinkHTML = '' ) { |
|
253 | 253 | |
254 | 254 | $sLinkHTML = empty( $this->oProp->aScriptInfo[ 'sName' ] ) |
255 | 255 | ? $sLinkHTML |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | return $this->addAndApplyFilters( |
259 | 259 | $this->oProp->oCaller, |
260 | - 'footer_left_' . $this->oProp->sClassName, |
|
260 | + 'footer_left_'.$this->oProp->sClassName, |
|
261 | 261 | $sLinkHTML |
262 | 262 | ); |
263 | 263 | |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | * @callback filter admin_footer_text |
271 | 271 | * @internal |
272 | 272 | */ |
273 | - public function _replyToAddInfoInFooterRight( $sLinkHTML='' ) { |
|
273 | + public function _replyToAddInfoInFooterRight( $sLinkHTML = '' ) { |
|
274 | 274 | return $this->addAndApplyFilters( |
275 | 275 | $this->oProp->oCaller, |
276 | - 'footer_right_' . $this->oProp->sClassName, |
|
276 | + 'footer_right_'.$this->oProp->sClassName, |
|
277 | 277 | $this->oProp->aFooterInfo[ 'sRight' ] |
278 | 278 | ); |
279 | 279 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | add_action( 'in_admin_footer', array( $this, '_replyToSetFooterInfo' ) ); |
39 | 39 | |
40 | 40 | // Add an action link in the plugin listing page |
41 | - if ( $this->_shouldSetPluginActionLinks() ) { |
|
41 | + if ( $this->_shouldSetPluginActionLinks() ) { |
|
42 | 42 | add_filter( |
43 | 43 | 'plugin_action_links_' . plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
44 | 44 | array( $this, '_replyToAddSettingsLinkInPluginListingPage' ), |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @return boolean |
56 | 56 | */ |
57 | 57 | private function _isLoadable( $oProp ) { |
58 | - if ( ! $oProp->bIsAdmin ) { |
|
58 | + if ( ! $oProp->bIsAdmin ) { |
|
59 | 59 | return false; |
60 | 60 | } |
61 | 61 | if ( $oProp->bIsAdminAjax ) { |