| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package ShiftController |
| 4 |
* @author HitCode |
| 5 |
*/ |
| 6 |
/* |
| 7 |
Plugin Name: ShiftController |
| 8 |
Plugin URI: http://www.shiftcontroller.com/ |
| 9 |
Description: Staff scheduling plugin. |
| 10 |
Author: HitCode |
| 11 |
Version: 3.2.4 |
| 12 |
Author URI: http://www.hitcode.com/ |
| 13 |
Text Domain: shiftcontroller |
| 14 |
*/ |
| 15 |
|
| 16 |
if( file_exists(dirname(__FILE__) . '/db.php') ) |
| 17 |
{ |
| 18 |
$nts_no_db = TRUE; |
| 19 |
include_once( dirname(__FILE__) . '/db.php' ); |
| 20 |
} |
| 21 |
|
| 22 |
if( defined('NTS_DEVELOPMENT') ) |
| 23 |
$happ_path = NTS_DEVELOPMENT; |
| 24 |
else |
| 25 |
$happ_path = dirname(__FILE__) . '/happ'; |
| 26 |
include_once( $happ_path . '/hclib/hcWpBase.php' ); |
| 27 |
|
| 28 |
register_uninstall_hook( __FILE__, array('ShiftController', 'uninstall') ); |
| 29 |
|
| 30 |
class ShiftController extends hcWpBase5 |
| 31 |
{ |
| 32 |
public function __construct() |
| 33 |
{ |
| 34 |
parent::__construct( |
| 35 |
strtolower(get_class()), |
| 36 |
__FILE__, |
| 37 |
'', |
| 38 |
'ci' |
| 39 |
); |
| 40 |
$this->query_prefix = '?/'; |
| 41 |
} |
| 42 |
|
| 43 |
public function admin_menu() |
| 44 |
{ |
| 45 |
parent::admin_menu(); |
| 46 |
|
| 47 |
$menu_title = ucfirst($this->app); |
| 48 |
$page = add_menu_page( |
| 49 |
$menu_title, |
| 50 |
$menu_title, |
| 51 |
'read', |
| 52 |
$this->slug, |
| 53 |
array( $this, 'admin_view' ), |
| 54 |
'dashicons-calendar' |
| 55 |
); |
| 56 |
} |
| 57 |
|
| 58 |
static function uninstall( $prefix = 'shiftcontroller', $watch_other = array() ) |
| 59 |
{ |
| 60 |
$prefix = 'shiftcontroller'; |
| 61 |
$watch_other = array('shiftcontroller-pro.php'); |
| 62 |
hcWpBase5::uninstall( $prefix, $watch_other ); |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
$sh = new ShiftController(); |
| 67 |
|
| 68 |
/* |
| 69 |
Can pass the following arguments for the shortcode: |
| 70 |
location: |
| 71 |
one, comma separated list |
| 72 |
|
| 73 |
staff: |
| 74 |
one, comma separated list, _current_user_id_ |
| 75 |
|
| 76 |
date: |
| 77 |
date like 20150712, or range like 20150712_20150719 |
| 78 |
|
| 79 |
range: |
| 80 |
week, month |
| 81 |
*/ |
| 82 |
|
| 83 |
?> |