@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @since 3.5.0 |
68 | 68 | */ |
69 | - public function enqueueStyles( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
69 | + public function enqueueStyles( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
70 | 70 | return $this->oResource->_enqueueStyles( $aSRCs, $aPostTypes, $aCustomArgs ); |
71 | 71 | } |
72 | 72 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param array (optional) The argument array for more advanced parameters. |
90 | 90 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
91 | 91 | */ |
92 | - public function enqueueStyle( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
92 | + public function enqueueStyle( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
93 | 93 | return $this->oResource->_enqueueStyle( $sSRC, $aPostTypes, $aCustomArgs ); |
94 | 94 | } |
95 | 95 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 3.5.0 |
99 | 99 | */ |
100 | - public function enqueueScripts( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
100 | + public function enqueueScripts( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
101 | 101 | return $this->oResource->_enqueueScripts( $aSRCs, $aPostTypes, $aCustomArgs ); |
102 | 102 | } |
103 | 103 | /** |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @param array (optional) The argument array for more advanced parameters. |
133 | 133 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
134 | 134 | */ |
135 | - public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
135 | + public function enqueueScript( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
136 | 136 | return $this->oResource->_enqueueScript( $sSRC, $aPostTypes, $aCustomArgs ); |
137 | 137 | } |
138 | 138 |
@@ -132,7 +132,7 @@ |
||
132 | 132 | * @param array (optional) The argument array for more advanced parameters. |
133 | 133 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
134 | 134 | */ |
135 | - public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
135 | + public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
136 | 136 | return $this->oResource->_enqueueScript( $sSRC, $aPostTypes, $aCustomArgs ); |
137 | 137 | } |
138 | 138 |
@@ -63,21 +63,21 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function _replyToSaveFieldValues( $iUserID ) { |
65 | 65 | |
66 | - if ( ! current_user_can( 'edit_user', $iUserID ) ) { |
|
66 | + if ( !current_user_can( 'edit_user', $iUserID ) ) { |
|
67 | 67 | return; |
68 | 68 | } |
69 | 69 | |
70 | 70 | // Extract the fields data from $_POST |
71 | 71 | // Retrieve the submitted data. |
72 | - $_aInputs = $this->oForm->getSubmittedData( |
|
73 | - $_POST, // subject data to be parsed |
|
74 | - true, // extract data with the fieldset structure |
|
72 | + $_aInputs = $this->oForm->getSubmittedData( |
|
73 | + $_POST, // subject data to be parsed |
|
74 | + true, // extract data with the fieldset structure |
|
75 | 75 | false // strip slashes |
76 | 76 | ); |
77 | - $_aInputsRaw = $_aInputs; // store one for the last input array. |
|
77 | + $_aInputsRaw = $_aInputs; // store one for the last input array. |
|
78 | 78 | |
79 | 79 | // Prepare the saved data. For a new post, the id is set to 0. |
80 | - $_aSavedMeta = $this->oUtil->getSavedUserMetaArray( $iUserID, array_keys( $_aInputs ) ); |
|
80 | + $_aSavedMeta = $this->oUtil->getSavedUserMetaArray( $iUserID, array_keys( $_aInputs ) ); |
|
81 | 81 | |
82 | 82 | // Apply filters to the array of the submitted values. |
83 | 83 | $_aInputs = $this->oUtil->addAndApplyFilters( |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $this->oForm->updateMetaDataByType( |
100 | - $iUserID, // object id |
|
101 | - $_aInputs, // user submit form data |
|
100 | + $iUserID, // object id |
|
101 | + $_aInputs, // user submit form data |
|
102 | 102 | $this->oForm->dropRepeatableElements( $_aSavedMeta ), // Drop repeatable section elements from the saved meta array. |
103 | 103 | $this->oForm->sStructureType // fields type |
104 | 104 | ); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function _isInThePage() { |
47 | 47 | |
48 | - if ( ! $this->oProp->bIsAdmin ) { |
|
48 | + if ( !$this->oProp->bIsAdmin ) { |
|
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function _replyToDetermineToLoad( /* $oScreen */ ) { |
68 | 68 | |
69 | - if ( ! $this->_isInThePage() ) { |
|
69 | + if ( !$this->_isInThePage() ) { |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 | |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | $this->oUtil->addAndDoAction( $this, "set_up_{$this->oProp->sClassName}", $this ); |
77 | 77 | |
78 | 78 | // Hooks to display fields. |
79 | - add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
80 | - add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
81 | - add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
79 | + add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
80 | + add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
81 | + add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
82 | 82 | |
83 | 83 | // Hooks to save field values. |
84 | 84 | add_action( 'personal_options_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
85 | - add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
86 | - add_action('user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
85 | + add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
86 | + add_action( 'user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
87 | 87 | |
88 | 88 | } |
89 | 89 |
@@ -66,7 +66,7 @@ |
||
66 | 66 | */ |
67 | 67 | public function _replyToDetermineToLoad( /* $oScreen */ ) { |
68 | 68 | |
69 | - if ( ! $this->_isInThePage() ) { |
|
69 | + if ( ! $this->_isInThePage() ) { |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 |
@@ -45,17 +45,17 @@ |
||
45 | 45 | $_aOutput = array(); |
46 | 46 | |
47 | 47 | // Get the field outputs |
48 | - $_aOutput[] = $this->oForm->get(); |
|
48 | + $_aOutput[ ] = $this->oForm->get(); |
|
49 | 49 | |
50 | 50 | // Filter the output |
51 | 51 | $_sOutput = $this->oUtil->addAndApplyFilters( |
52 | 52 | $this, |
53 | - 'content_' . $this->oProp->sClassName, |
|
53 | + 'content_'.$this->oProp->sClassName, |
|
54 | 54 | $this->content( implode( PHP_EOL, $_aOutput ) ) |
55 | 55 | ); |
56 | 56 | |
57 | 57 | // Do action |
58 | - $this->oUtil->addAndDoActions( $this, 'do_' . $this->oProp->sClassName, $this ); |
|
58 | + $this->oUtil->addAndDoActions( $this, 'do_'.$this->oProp->sClassName, $this ); |
|
59 | 59 | |
60 | 60 | // Output |
61 | 61 | echo $_sOutput; |
@@ -20,5 +20,5 @@ |
||
20 | 20 | * @extends AdminPageFramework_Resource_MetaBox |
21 | 21 | * @internal |
22 | 22 | */ |
23 | -class AdminPageFramework_Resource_UserMeta extends AdminPageFramework_Resource_MetaBox { |
|
23 | +class AdminPageFramework_Resource_UserMeta extends AdminPageFramework_Resource_MetaBox { |
|
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function get() { |
46 | 46 | |
47 | - if ( ! $this->iUserID ) { |
|
47 | + if ( !$this->iUserID ) { |
|
48 | 48 | return array(); |
49 | 49 | } |
50 | 50 | return $this->_getSavedDataFromFieldsets( |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | |
64 | 64 | $_aMetaKeys = array_keys( get_user_meta( $iUserID ) ); |
65 | 65 | $_aMetaData = array(); |
66 | - foreach( $aFieldsets as $_sSectionID => $_aFieldsets ) { |
|
66 | + foreach ( $aFieldsets as $_sSectionID => $_aFieldsets ) { |
|
67 | 67 | |
68 | - if ( '_default' == $_sSectionID ) { |
|
69 | - foreach( $_aFieldsets as $_aFieldset ) { |
|
70 | - if ( ! in_array( $_aFieldset[ 'field_id' ], $_aMetaKeys ) ) { |
|
68 | + if ( '_default' == $_sSectionID ) { |
|
69 | + foreach ( $_aFieldsets as $_aFieldset ) { |
|
70 | + if ( !in_array( $_aFieldset[ 'field_id' ], $_aMetaKeys ) ) { |
|
71 | 71 | continue; |
72 | 72 | } |
73 | 73 | $_aMetaData[ $_aFieldset[ 'field_id' ] ] = get_user_meta( |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ); |
78 | 78 | } |
79 | 79 | } |
80 | - if ( ! in_array( $_sSectionID, $_aMetaKeys ) ) { |
|
80 | + if ( !in_array( $_sSectionID, $_aMetaKeys ) ) { |
|
81 | 81 | continue; |
82 | 82 | } |
83 | 83 | $_aMetaData[ $_sSectionID ] = get_user_meta( |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods for creating widgets. |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | static protected $_sStructureType = 'widget'; |
30 | 30 | |
31 | 31 | /** |
32 | - * The constructor of the class object. |
|
33 | - * |
|
34 | - * Registers necessary hooks and sets up internal properties. |
|
35 | - * |
|
36 | - * <h4>Example</h4> |
|
37 | - * <code> |
|
38 | - * new APF_Widget( __( 'Admin Page Framework', 'admin-page-framework-demo' ) ); // the widget title |
|
39 | - * new APF_Widget_CustomFieldTypes( __( 'APF - Advanced', 'admin-page-framework-demo' ) ); |
|
40 | - * new APF_Widget_Example( __( 'APF - GitHub Button', 'admin-page-framework-demo' ) ); |
|
41 | - * </code> |
|
42 | - * |
|
43 | - * @return void |
|
44 | - */ |
|
32 | + * The constructor of the class object. |
|
33 | + * |
|
34 | + * Registers necessary hooks and sets up internal properties. |
|
35 | + * |
|
36 | + * <h4>Example</h4> |
|
37 | + * <code> |
|
38 | + * new APF_Widget( __( 'Admin Page Framework', 'admin-page-framework-demo' ) ); // the widget title |
|
39 | + * new APF_Widget_CustomFieldTypes( __( 'APF - Advanced', 'admin-page-framework-demo' ) ); |
|
40 | + * new APF_Widget_Example( __( 'APF - GitHub Button', 'admin-page-framework-demo' ) ); |
|
41 | + * </code> |
|
42 | + * |
|
43 | + * @return void |
|
44 | + */ |
|
45 | 45 | public function __construct( $sWidgetTitle, $aWidgetArguments=array(), $sCapability='edit_theme_options', $sTextDomain='admin-page-framework' ) { |
46 | 46 | |
47 | 47 | if ( empty( $sWidgetTitle ) ) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return void |
44 | 44 | */ |
45 | - public function __construct( $sWidgetTitle, $aWidgetArguments=array(), $sCapability='edit_theme_options', $sTextDomain='admin-page-framework' ) { |
|
45 | + public function __construct( $sWidgetTitle, $aWidgetArguments = array(), $sCapability = 'edit_theme_options', $sTextDomain = 'admin-page-framework' ) { |
|
46 | 46 | |
47 | 47 | if ( empty( $sWidgetTitle ) ) { |
48 | 48 | return; |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | |
51 | 51 | // Properties |
52 | 52 | $this->oProp = new AdminPageFramework_Property_Widget( |
53 | - $this, // caller object |
|
54 | - null, // the caller script path |
|
55 | - get_class( $this ), // class name |
|
56 | - $sCapability, // capability |
|
57 | - $sTextDomain, // text domain |
|
53 | + $this, // caller object |
|
54 | + null, // the caller script path |
|
55 | + get_class( $this ), // class name |
|
56 | + $sCapability, // capability |
|
57 | + $sTextDomain, // text domain |
|
58 | 58 | self::$_sStructureType // fields type |
59 | 59 | ); |
60 | 60 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @package AdminPageFramework |
16 | 16 | * @subpackage Widget |
17 | 17 | */ |
18 | -abstract class AdminPageFramework_Widget extends AdminPageFramework_Widget_Controller { |
|
18 | +abstract class AdminPageFramework_Widget extends AdminPageFramework_Widget_Controller { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Defines the class object structure type. |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function __construct( $sWidgetTitle, $aWidgetArguments=array(), $sCapability='edit_theme_options', $sTextDomain='admin-page-framework' ) { |
46 | 46 | |
47 | - if ( empty( $sWidgetTitle ) ) { |
|
47 | + if ( empty( $sWidgetTitle ) ) { |
|
48 | 48 | return; |
49 | 49 | } |
50 | 50 |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | if ( $this->oProp->bIsAdmin ) { |
41 | 41 | add_filter( |
42 | - 'validation_' . $this->oProp->sClassName, |
|
42 | + 'validation_'.$this->oProp->sClassName, |
|
43 | 43 | array( $this, '_replyToSortInputs' ), |
44 | - 1, // set a high priority |
|
44 | + 1, // set a high priority |
|
45 | 45 | 3 // number of parameters |
46 | 46 | ); |
47 | 47 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function _replyToRegisterWidget() { |
112 | 112 | |
113 | 113 | global $wp_widget_factory; |
114 | - if ( ! is_object( $wp_widget_factory ) ) { |
|
114 | + if ( !is_object( $wp_widget_factory ) ) { |
|
115 | 115 | return; |
116 | 116 | } |
117 | 117 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @subpackage Widget |
19 | 19 | * @internal |
20 | 20 | */ |
21 | -abstract class AdminPageFramework_Widget_Model extends AdminPageFramework_Widget_Router { |
|
21 | +abstract class AdminPageFramework_Widget_Model extends AdminPageFramework_Widget_Router { |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Sets up hooks and properties. |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | parent::__construct( $oProp ); |
32 | 32 | |
33 | - if ( did_action( 'widgets_init' ) ) { |
|
33 | + if ( did_action( 'widgets_init' ) ) { |
|
34 | 34 | add_action( "set_up_{$this->oProp->sClassName}", array( $this, '_replyToRegisterWidget' ), 20 ); |
35 | 35 | } else { |
36 | 36 | // set a lower priority to let the setUp method gets processed earlier. |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return array |
55 | 55 | * @callback filter validation_{factory class name} |
56 | 56 | */ |
57 | - public function _replyToSortInputs( $aSubmittedFormData, $aStoredFormData, $oFactory ) { |
|
57 | + public function _replyToSortInputs( $aSubmittedFormData, $aStoredFormData, $oFactory ) { |
|
58 | 58 | // @todo examine whether stripslashes_deep() is necceary or not. |
59 | 59 | return $this->oForm->getSortedInputs( $aSubmittedFormData ); |
60 | 60 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function _replyToRegisterWidget() { |
112 | 112 | |
113 | 113 | global $wp_widget_factory; |
114 | - if ( ! is_object( $wp_widget_factory ) ) { |
|
114 | + if ( ! is_object( $wp_widget_factory ) ) { |
|
115 | 115 | return; |
116 | 116 | } |
117 | 117 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @subpackage Widget |
17 | 17 | * @internal |
18 | 18 | */ |
19 | -abstract class AdminPageFramework_Widget_Router extends AdminPageFramework_Factory { |
|
19 | +abstract class AdminPageFramework_Widget_Router extends AdminPageFramework_Factory { |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Determines whether the currently loaded page is of the post type page. |