@@ -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. |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @return array |
53 | 53 | * @callback filter validation_{factory class name} |
54 | 54 | */ |
55 | - public function _replyToSortInputs( $aSubmittedFormData, $aStoredFormData, $oFactory ) { |
|
55 | + public function _replyToSortInputs( $aSubmittedFormData, $aStoredFormData, $oFactory ) { |
|
56 | 56 | // @todo examine whether stripslashes_deep() is necessary or not. |
57 | 57 | return $this->oForm->getSortedInputs( $aSubmittedFormData ); |
58 | 58 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | public function _replyToRegisterWidget() { |
111 | 111 | |
112 | 112 | global $wp_widget_factory; |
113 | - if ( ! is_object( $wp_widget_factory ) ) { |
|
113 | + if ( ! is_object( $wp_widget_factory ) ) { |
|
114 | 114 | return; |
115 | 115 | } |
116 | 116 |
@@ -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. |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @package AdminPageFramework |
18 | 18 | * @subpackage Widget |
19 | 19 | */ |
20 | -abstract class AdminPageFramework_Widget_View extends AdminPageFramework_Widget_Model { |
|
20 | +abstract class AdminPageFramework_Widget_View extends AdminPageFramework_Widget_Model { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Filters the post type post content. |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @remark This class should be overridden in the extended class so that the user can display own contents. |
40 | 40 | * @since 3.2.0 |
41 | 41 | */ |
42 | - public function content( $sContent, $aArguments, $aFormData ) { |
|
42 | + public function content( $sContent, $aArguments, $aFormData ) { |
|
43 | 43 | return $sContent; |
44 | 44 | } |
45 | 45 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * @since DEVVER |
28 | 28 | * @return void |
29 | 29 | */ |
30 | - public function construct() { |
|
30 | + public function construct() { |
|
31 | 31 | $this->_addDefaultResources(); |
32 | 32 | } |
33 | 33 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @since DEVVER |
22 | 22 | * @return string |
23 | 23 | */ |
24 | - protected function _get() { |
|
24 | + protected function _get() { |
|
25 | 25 | return $this->_getWidgetRules(); |
26 | 26 | } |
27 | 27 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | } |
105 | 105 | // If the WordPress version is greater than equal to 3.8, add MP6(the admin style introduced in 3.8) specific CSS rules. |
106 | - if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
|
106 | + if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
|
107 | 107 | |
108 | 108 | $_sCSSRules .= <<<CSSRULES |
109 | 109 | /* Widget Forms */ |
@@ -41,7 +41,7 @@ |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | trigger_error( |
44 | - 'Admin Page Framework - Loader: ' . ' : ' . sprintf( |
|
44 | + 'Admin Page Framework - Loader: '.' : '.sprintf( |
|
45 | 45 | __( 'The method is not defined: %1$s', 'admin-page-framework-loader' ), |
46 | 46 | $sMethodName |
47 | 47 | ), |
@@ -24,12 +24,12 @@ |
||
24 | 24 | */ |
25 | 25 | public function content( $sContent ) { |
26 | 26 | |
27 | - $_aReplacements = array( |
|
27 | + $_aReplacements = array( |
|
28 | 28 | '%PLUGIN_DIR_URL%' => AdminPageFrameworkLoader_Registry::getPluginURL(), |
29 | 29 | '%WP_ADMIN_URL%' => admin_url(), |
30 | 30 | ); |
31 | 31 | $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( |
32 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt', |
|
32 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt', |
|
33 | 33 | $_aReplacements |
34 | 34 | ); |
35 | 35 | return '' |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | public function replyToDecideToLoad( $oScreen ) { |
29 | 29 | |
30 | - if ( ! $this->_isInThePage() ) { |
|
30 | + if ( !$this->_isInThePage() ) { |
|
31 | 31 | return; |
32 | 32 | } |
33 | 33 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | // Retrieve the development version. |
40 | 40 | $this->_sDevelopmentVersion = $this->oUtil->getTransient( |
41 | - AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX . 'devver' |
|
41 | + AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX.'devver' |
|
42 | 42 | ); |
43 | 43 | |
44 | 44 | // Disable the meta box if the development version is not above the running one. |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | private function _scheduleEvent() { |
59 | 59 | |
60 | - $_sActionName = AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_action_get_development_version'; |
|
60 | + $_sActionName = AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_action_get_development_version'; |
|
61 | 61 | $_aArguments = array(); |
62 | 62 | if ( wp_next_scheduled( $_sActionName, $_aArguments ) ) { |
63 | 63 | return false; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ) |
92 | 92 | . "</p>" |
93 | 93 | . "<div style='width:100%; display:inline-block;'>" |
94 | - . '<a href="' . esc_url( 'https://github.com/michaeluno/admin-page-framework/archive/dev.zip' ). '">' |
|
94 | + . '<a href="'.esc_url( 'https://github.com/michaeluno/admin-page-framework/archive/dev.zip' ).'">' |
|
95 | 95 | . "<div class='button button-primary float-right'>" |
96 | 96 | . __( 'Download', 'admin-page-framework-loader' ) |
97 | 97 | . "</div>" |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | . "</div>" |
100 | 100 | ; |
101 | 101 | |
102 | - return $_sInsert . $sContent; |
|
102 | + return $_sInsert.$sContent; |
|
103 | 103 | |
104 | 104 | } |
105 | 105 |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | // add_filter( 'wp_feed_cache_transient_lifetime', '__return_zero' ); |
34 | 34 | |
35 | 35 | // Styles |
36 | - $this->oFactory->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/column.css' ); |
|
37 | - $this->oFactory->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/feed-list.css' ); |
|
36 | + $this->oFactory->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/column.css' ); |
|
37 | + $this->oFactory->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/feed-list.css' ); |
|
38 | 38 | |
39 | 39 | // $this->oFactory->setPageTitleVisibility( false ); |
40 | 40 | $this->oFactory->setInPageTabsVisibility( false ); |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | public function replyToDoTab() { |
48 | 48 | |
49 | 49 | $_oFeedList = new AdminPageFrameworkLoader_FeedList( $this->sRSSURL ); |
50 | - $_aFeedItems = apply_filters( AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_add_ons', $this->_getDemo() + $_oFeedList->get() ); |
|
50 | + $_aFeedItems = apply_filters( AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_admin_add_ons', $this->_getDemo() + $_oFeedList->get() ); |
|
51 | 51 | if ( empty( $_aFeedItems ) ) { |
52 | - echo "<p>" . __( 'No add-on could be found.', 'admin-page-framework-loader' ) . "</p>"; |
|
52 | + echo "<p>".__( 'No add-on could be found.', 'admin-page-framework-loader' )."</p>"; |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | private function _getList( array $aFeedItems ) { |
68 | 68 | |
69 | 69 | $_aOutput = array(); |
70 | - $_aColumnInfo = array ( // this will be modified as the items get rendered |
|
70 | + $_aColumnInfo = array( // this will be modified as the items get rendered |
|
71 | 71 | 'bRowTagOpened' => false, |
72 | 72 | 'bRowTagClosed' => false, |
73 | 73 | 'iCurrRowPos' => 0, |
74 | 74 | 'iCurrColPos' => 0, |
75 | 75 | ); |
76 | - $_aColumnOption = array ( |
|
76 | + $_aColumnOption = array( |
|
77 | 77 | 'iMaxCols' => 3, |
78 | 78 | 'sClassAttr' => 'apfl_columns', |
79 | 79 | 'sClassAttrGroup' => 'apfl_columns_box', |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | 'sClassAttrFirstCol' => 'apfl_columns_first_col', |
83 | 83 | ); |
84 | 84 | |
85 | - $_sSiteURLWOQuery = preg_replace( '/\?.*/', '', get_bloginfo( 'url' ) ); |
|
86 | - foreach( $aFeedItems as $_aItem ) { |
|
87 | - $_aOutput[] = $this->_getFeedListItem( |
|
85 | + $_sSiteURLWOQuery = preg_replace( '/\?.*/', '', get_bloginfo( 'url' ) ); |
|
86 | + foreach ( $aFeedItems as $_aItem ) { |
|
87 | + $_aOutput[ ] = $this->_getFeedListItem( |
|
88 | 88 | ( array ) $_aItem, |
89 | 89 | $_aColumnInfo, |
90 | 90 | $_aColumnOption, |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | // If the section (row) tag is not closed, close it. |
96 | - if ( $_aColumnInfo[ 'bRowTagOpened' ] && ! $_aColumnInfo[ 'bRowTagClosed' ] ) { |
|
97 | - $_aOutput[] = '</div>'; |
|
96 | + if ( $_aColumnInfo[ 'bRowTagOpened' ] && !$_aColumnInfo[ 'bRowTagClosed' ] ) { |
|
97 | + $_aOutput[ ] = '</div>'; |
|
98 | 98 | } |
99 | 99 | $_aColumnInfo[ 'bRowTagClosed' ] = true; |
100 | 100 | |
101 | 101 | // Enclose the output in the group tag |
102 | 102 | return '<div class="apfl_addon_list_container">' |
103 | - . '<div class="' . $_aColumnOption[ 'sClassAttr' ] . ' ' . $_aColumnOption[ 'sClassAttrGroup' ] . '">' |
|
103 | + . '<div class="'.$_aColumnOption[ 'sClassAttr' ].' '.$_aColumnOption[ 'sClassAttrGroup' ].'">' |
|
104 | 104 | . implode( '', $_aOutput ) |
105 | 105 | . '</div>' |
106 | 106 | . '</div>'; |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | * Returns an HTML output from the given feed item array. |
111 | 111 | * @return string |
112 | 112 | */ |
113 | - private function _getFeedListItem( array $aItem, array &$aColumnInfo, array $aColumnOption, $sSiteURLWOQuery='' ) { |
|
113 | + private function _getFeedListItem( array $aItem, array &$aColumnInfo, array $aColumnOption, $sSiteURLWOQuery = '' ) { |
|
114 | 114 | |
115 | 115 | // Initial checks |
116 | - if ( ! isset( $aItem[ 'title' ] ) ) { |
|
116 | + if ( !isset( $aItem[ 'title' ] ) ) { |
|
117 | 117 | return ''; |
118 | 118 | } |
119 | 119 | |
@@ -139,20 +139,20 @@ discard block |
||
139 | 139 | $_sTarget = ''; |
140 | 140 | |
141 | 141 | // Enclose the item buffer into the item container |
142 | - $_sItem = '<div class="' . $aColumnOption['sClassAttrCol'] |
|
143 | - . ' apfl_col_element_of_' . $aColumnOption['iMaxCols'] . ' ' |
|
142 | + $_sItem = '<div class="'.$aColumnOption[ 'sClassAttrCol' ] |
|
143 | + . ' apfl_col_element_of_'.$aColumnOption[ 'iMaxCols' ].' ' |
|
144 | 144 | . ' apfl_extension ' |
145 | - . ( ( 1 == $aColumnInfo['iCurrColPos'] ) ? $aColumnOption['sClassAttrFirstCol'] : '' ) |
|
145 | + . ( ( 1 == $aColumnInfo[ 'iCurrColPos' ] ) ? $aColumnOption[ 'sClassAttrFirstCol' ] : '' ) |
|
146 | 146 | . '"' |
147 | 147 | . '>' |
148 | 148 | . '<div class="apfl_addon_item">' |
149 | - . "<h4 class='apfl_feed_item_title'>{$aItem['title']}</h4>" |
|
149 | + . "<h4 class='apfl_feed_item_title'>{$aItem[ 'title' ]}</h4>" |
|
150 | 150 | . "<div class='apfl_feed_item_description'>" |
151 | - . $aItem['description'] |
|
151 | + . $aItem[ 'description' ] |
|
152 | 152 | . "</div>" |
153 | 153 | . "<div class='get-now apfl_feed_item_link_button'>" |
154 | - . "<a href='" . esc_url( $aItem[ 'link' ] ) . "' target='{$_sTarget}' rel='nofollow' class='button button-secondary'>" |
|
155 | - . $aItem['label'] |
|
154 | + . "<a href='".esc_url( $aItem[ 'link' ] )."' target='{$_sTarget}' rel='nofollow' class='button button-secondary'>" |
|
155 | + . $aItem[ 'label' ] |
|
156 | 156 | . "</a>" |
157 | 157 | . "</div>" |
158 | 158 | . '</div>' |
@@ -160,18 +160,18 @@ discard block |
||
160 | 160 | |
161 | 161 | // If it's the first item in the row, add the class attribute. |
162 | 162 | // Be aware that at this point, the tag will be unclosed. Therefore, it must be closed later at some point. |
163 | - if ( 1 == $aColumnInfo['iCurrColPos'] ) { |
|
164 | - $aColumnInfo['bRowTagOpened'] = true; |
|
165 | - $_sItem = '<div class="' . $aColumnOption['sClassAttrRow'] . '">' |
|
163 | + if ( 1 == $aColumnInfo[ 'iCurrColPos' ] ) { |
|
164 | + $aColumnInfo[ 'bRowTagOpened' ] = true; |
|
165 | + $_sItem = '<div class="'.$aColumnOption[ 'sClassAttrRow' ].'">' |
|
166 | 166 | . $_sItem; |
167 | 167 | } |
168 | 168 | |
169 | 169 | // If the current column position reached the set max column, increment the current position of row |
170 | - if ( 0 === ( $aColumnInfo['iCurrColPos'] % $aColumnOption['iMaxCols'] ) ) { |
|
171 | - $aColumnInfo['iCurrRowPos']++; // increment the row number |
|
172 | - $aColumnInfo['iCurrColPos'] = 0; // reset the current column position |
|
173 | - $_sItem .= '</div>'; // close the section(row) div tag |
|
174 | - $aColumnInfo['bRowTagClosed'] = true; |
|
170 | + if ( 0 === ( $aColumnInfo[ 'iCurrColPos' ] % $aColumnOption[ 'iMaxCols' ] ) ) { |
|
171 | + $aColumnInfo[ 'iCurrRowPos' ]++; // increment the row number |
|
172 | + $aColumnInfo[ 'iCurrColPos' ] = 0; // reset the current column position |
|
173 | + $_sItem .= '</div>'; // close the section(row) div tag |
|
174 | + $aColumnInfo[ 'bRowTagClosed' ] = true; |
|
175 | 175 | } |
176 | 176 | return $_sItem; |
177 | 177 | |
@@ -183,14 +183,14 @@ discard block |
||
183 | 183 | */ |
184 | 184 | private function _getDemo() { |
185 | 185 | |
186 | - $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys['main'] ); |
|
186 | + $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] ); |
|
187 | 187 | $_bEnabled = $_oOption->get( 'enable_demo' ); |
188 | 188 | |
189 | 189 | $_sTitle = __( 'Demo', 'admin=page-framework-loader' ); |
190 | 190 | return array( |
191 | 191 | $_sTitle => array( |
192 | 192 | 'title' => $_sTitle, |
193 | - 'description' => '<div style="text-align: center;" class="aligncenter"><img class="aligncenter" src="' . AdminPageFrameworkLoader_Registry::getPluginURL( '/asset/image/icon-128x128.png' ) . '" alt="' . esc_attr( $_sTitle ) . '"/></div>' |
|
193 | + 'description' => '<div style="text-align: center;" class="aligncenter"><img class="aligncenter" src="'.AdminPageFrameworkLoader_Registry::getPluginURL( '/asset/image/icon-128x128.png' ).'" alt="'.esc_attr( $_sTitle ).'"/></div>' |
|
194 | 194 | . '<p>' |
195 | 195 | . __( 'Showcases the features of Admin Page Framework.', 'admin-page-framework-loader' ) |
196 | 196 | . '</p>', |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | ? 0 |
201 | 201 | : 1, |
202 | 202 | ) + $_GET, |
203 | - admin_url( $GLOBALS['pagenow'] ) |
|
203 | + admin_url( $GLOBALS[ 'pagenow' ] ) |
|
204 | 204 | ), |
205 | 205 | 'label' => $_bEnabled |
206 | 206 | ? __( 'Deactivate', 'admin-page-framework-loader' ) |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | // If the section (row) tag is not closed, close it. |
96 | - if ( $_aColumnInfo[ 'bRowTagOpened' ] && ! $_aColumnInfo[ 'bRowTagClosed' ] ) { |
|
96 | + if ( $_aColumnInfo[ 'bRowTagOpened' ] && ! $_aColumnInfo[ 'bRowTagClosed' ] ) { |
|
97 | 97 | $_aOutput[] = '</div>'; |
98 | 98 | } |
99 | 99 | $_aColumnInfo[ 'bRowTagClosed' ] = true; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | private function _getFeedListItem( array $aItem, array &$aColumnInfo, array $aColumnOption, $sSiteURLWOQuery='' ) { |
114 | 114 | |
115 | 115 | // Initial checks |
116 | - if ( ! isset( $aItem[ 'title' ] ) ) { |
|
116 | + if ( ! isset( $aItem[ 'title' ] ) ) { |
|
117 | 117 | return ''; |
118 | 118 | } |
119 | 119 |