/var/www/(Del)hsihk.com/wp-content/plugins/backupbuddy/pluginbuddy/classes/core_controllers.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<?php




/*    class pb_backupbuddy_actions
 *    
 *    Handles actions. Currently just reports if actions were registered and called but the callback was missing.
 *    
 *    @return        null
 */
class pb_backupbuddy_actionscore {
    
    
    
/*    pluginbuddy_actionscore->__call()
     *    
     *    Magic method if a method is called that does not exist.
     *    
     *    @param        string        $name            Function name.
     *    @param        array        $arguments        Array of arguments passed to function.
     *    @return        null
     */
    
function __call$name$arguments ) {
        echo 
'{Missing actions method `' $name '`.}';
    } 
// End __call().
    
    
    
// End class pb_backupbuddy_actions.



/*    class pb_backupbuddy_ajaxcore
 *    
 *    Handles ajax. Currently just reports if ajax was registered and called but the callback was missing.
 *    
 *    @return        null
 */
class pb_backupbuddy_ajaxcore {
    
    
    
/*    pluginbuddy_shortcodes->__call()
     *    
     *    Magic method if a method is called that does not exist.
     *    
     *    @param        string        $name            Function name.
     *    @param        array        $arguments        Array of arguments passed to function.
     *    @return        null
     */
    
function __call$name$arguments ) {
        die( 
'{Missing ajax method `' $name '`.}' );
    } 
// End __call().
    
    
// End class pb_backupbuddy_ajax.



/*    class pb_backupbuddy_croncore
 *    
 *    Handles crons. Currently just reports if crons were registered and called but the callback was missing.
 *    
 *    @return        null
 */
class pb_backupbuddy_croncore {
    
    
    
/*    pluginbuddy_shortcodes->__call()
     *    
     *    Magic method if a method is called that does not exist.
     *    
     *    @param        string        $name            Function name.
     *    @param        array        $arguments        Array of arguments passed to function.
     *    @return        null
     */
    
function __call$name$arguments ) {
        die( 
'{Missing cron method `' $name '`.}' );
    } 
// End __call().
    
    
// End class pb_backupbuddy_cron.



/*    class pb_backupbuddy_dashboardcore
 *    
 *    Handles dashboard widgets (on main admin screen). Reports if admin dashboard widgets were registered and called but the callback was missing.
 *    Also handles the actual registering of the widgets.
 *    
 *    @return        null
 */
class pb_backupbuddy_dashboardcore {
    
    
    
/*    pluginbuddy_shortcodes->__call()
     *    
     *    Magic method if a method is called that does not exist.
     *    
     *    @param        string        $name            Function name.
     *    @param        array        $arguments        Array of arguments passed to function.
     *    @return        null
     */
    
function __call$name$arguments ) {
        die( 
'{Missing dashboard method `' $name '`.}' );
    } 
// End __call().
    
    
    /*    pluginbuddy_dashboard->register_widgets()
     *    
     *    Called back by WordPress to actually register the dashboard widget in the admin.
     *    
     *    @return        null
     */
    
function register_widgets() {
        
//wp_add_dashboard_widget( 'pb_' . self::settings( 'slug' ) . '_' . $tag, $title,  array( &self::$_dashboard, $tag ) );
        
foreach ( pb_backupbuddy::$_dashboard_widgets as $widget ) {
            
            if ( 
$widget['capability'] == 'godmode' ) { // godmode capabiltiy.
                
if ( is_multisite() && backupbuddy_core::is_network_activated() ) { // In a network installation.
                    
if ( !current_user_can'manage_network' ) ) {
                        continue; 
// Skip this widget. Access denied to it.
                    
}
                } else { 
// Standalone
                    
if ( !current_user_can'activate_plugins' ) ) {
                        continue; 
// Skip this widget. Access denied to it.
                    
}
                }
            } else { 
// WP capability.
                
if ( !current_user_can$widget['capability'] ) ) {
                    continue; 
// Skip this widget. Access denied to it.
                
}
            }
            
            
$widget_slug 'pb_' pb_backupbuddy::settings'slug' ) . '_' $widget['tag'];
            
wp_add_dashboard_widget$widget_slug$widget['title'],  array( &$this$widget['tag'] ) );

            
// If force top is enabled then we will attempt to force the widget to the top if possible.
            
if ( isset( $widget['force_top'] ) && ( $widget['force_top'] === true ) ) {
                
// Note: Only works if users have never re-arranged their dashboard widgets.
                
global $wp_meta_boxes;
                
$normal_dashboard $wp_meta_boxes['dashboard']['normal']['core'];
                
$widget_backup = array( $widget_slug => $normal_dashboard[$widget_slug] ); // Save copy of our widget.
                
unset( $normal_dashboard[$widget_slug] ); // Delete our widget.
                
$wp_meta_boxes['dashboard']['normal']['core'] = array_merge$widget_backup$normal_dashboard ); // Merge our widget into the top.
            
}
        }
    } 
// End register_widgets().
    
    
// End class pb_backupbuddy_dashboard.



/*    class pb_backupbuddy_filterscore
 *    
 *    Handles filters. Currently just reports if filters were registered and called but the callback was missing.
 *    
 *    @return        null
 */
class pb_backupbuddy_filterscore {
    
    
    
/*    pluginbuddy_shortcodes->__call()
     *    
     *    Magic method if a method is called that does not exist.
     *    
     *    @param        string        $name            Function name.
     *    @param        array        $arguments        Array of arguments passed to function.
     *    @return        null
     */
    
function __call$name$arguments ) {
        return 
'{Missing filters method `' $name '`.}';
    } 
// End __call().
    
    
// End class pb_backupbuddy_filters.



/*    class pb_backupbuddy_pagescore
 *    
 *    Handles admin pages. Reports if pages were registered and called but the callback was missing.
 *    Also provides load_controller() function for pages to call to load a controller while in the controller.
 *    
 *    @return        null
 */
class pb_backupbuddy_pagescore {
    
    
    
/*    pluginbuddy_pages->__call()
     *    
     *    Magic method if a method is called that does not exist.
     *    Attempts to load a controller page matching the method name if possible.
     *    
     *    @param        string        $name            Function name.
     *    @param        array        $arguments        Array of arguments passed to function.
     *    @return        null
     */
    
function __call$name$arguments ) {
        
$page_file pb_backupbuddy::plugin_path() . '/controllers/pages/' $name '.php';
        if ( 
$name == 'getting_started' ) {
            
$page_file pb_backupbuddy::plugin_path() . '/pluginbuddy/_' $name '.php';
        }
        
        if ( 
file_exists$page_file ) ) { // Load from /controllers/pages/PAGE.php if it exists.
            
            // Display page.
            
pb_backupbuddy::load_script'admin.js'true );
            
pb_backupbuddy::load_style'admin.css'true );
            
pb_backupbuddy::load_script'tooltip.js'true );
            echo 
'<div class="wrap">';
             require_once( 
$page_file );
            echo 
'</div>';
            
            
//echo '<div id="footer-thankyou" style="float: right; color: #777; margin-right: 21px; margin-top: 20px; margin-bottom: -34px;">Running BackupBuddy v' . pb_backupbuddy::settings( 'version' ) . '.</div>';
            
        
} else { // Not found
            
echo '{Missing pages method `' $name '`.}';
        }
    } 
// End __call().
    
    
    /*    pluginbuddy_pages->load_controller()
     *    
     *    Load a controller from within a page (which is loaded by a controller itself).
     *    
     *    @param        string        $page        Name of the page. Loads page from /controllers/pages/NAME.php.
     *    @return        
     */
    
public function load_controller$page ) {
        if ( 
file_existspb_backupbuddy::plugin_path() . '/controllers/pages/' $page '.php' ) ) {
            require_once( 
pb_backupbuddy::plugin_path() . '/controllers/pages/' $page '.php' );
        } else {
            echo 
'{Error: Unable to load page controller `' $page '`; file not found.}';
        }
    }
    
    
    
// End class pb_backupbuddy_pages.



/*    class pb_backupbuddy_shortcodescore
 *    
 *    Handles shortcodes. Currently just reports if shortcodes were registered and called but the callback was missing.
 *    
 *    @return        null
 */
class pb_backupbuddy_shortcodescore {
    
    
    
/*    pluginbuddy_shortcodes->__call()
     *    
     *    Magic method if a method is called that does not exist.
     *    
     *    @param        string        $name            Function name.
     *    @param        array        $arguments        Array of arguments passed to function.
     *    @return        null
     */
    
function __call$name$arguments ) {
        return 
'{Missing shortcodes method `' $name '`.}';
    } 
// End __call().
    
    
// End class pb_backupbuddy_shortcodes.


?>