PluginProbe
ShiftController Employee Shift Scheduling / 4.9.26
ShiftController Employee Shift Scheduling v4.9.26
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / sh4 / app / html / controller / admin / reinstall.php

reinstall.php in ShiftController Employee Shift Scheduling 4.9.26, at sh4/app/html/controller/admin/reinstall.php

38 lines 820 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 class SH4_App_Html_Controller_Admin_Reinstall
3 {
4 public function __construct(
5 HC3_Hooks $hooks,
6 HC3_Post $post,
7
8 SH4_Shifts_Command $shiftsCommand,
9 SH4_App_Command $appCommand
10 )
11 {
12 $this->shiftsCommand = $hooks->wrap( $shiftsCommand );
13 $this->appCommand = $hooks->wrap( $appCommand );
14 }
15
16 public function execute()
17 {
18 global $wpdb;
19 $dbPrefix = $wpdb->prefix;
20 $sql = 'DELETE FROM ' . $dbPrefix . 'posts WHERE post_type LIKE "sh4_%"';
21 $wpdb->query( $sql );
22
23 $this->appCommand->uninstall();
24
25 $to = '';
26 $return = array( $to, '__Reinstalled__' );
27 return $return;
28 }
29
30 public function executeShifts()
31 {
32 $this->shiftsCommand->deleteAll();
33
34 $to = '';
35 $return = array( $to, '__All Shifts Deleted__' );
36 return $return;
37 }
38 }