PluginProbe
ShiftController Employee Shift Scheduling / 4.9.92
ShiftController Employee Shift Scheduling v4.9.92
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 / api / html / admin.php

admin.php in ShiftController Employee Shift Scheduling 4.9.92, at sh4/api/html/admin.php

78 lines 1.5 KB
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 #[AllowDynamicProperties]
3 class SH4_Api_Html_Admin
4 {
5 public function __construct(
6 HC3_Hooks $hooks,
7
8 HC3_Ui $ui,
9 HC3_Ui_Layout1 $layout
10 )
11 {
12 $this->ui = $ui;
13 $this->layout = $layout;
14
15 $this->self = $hooks->wrap($this);
16 }
17
18 public function post()
19 {
20 $app = 'sh4-rest';
21
22 if( isset($_POST[$app . '_submit']) ){
23 if( isset($_POST[$app]) ){
24 foreach( (array)$_POST[$app] as $key => $value ){
25 $option_name = $app . '_' . $key;
26 $value = sanitize_text_field( $value );
27 update_option( $option_name, $value );
28 }
29 }
30
31 if( ! isset($_POST[$app]['enabled']) ){
32 $k = $app . '_enabled';
33 $value = 0;
34 update_option( $k, $value );
35 }
36 }
37
38 $ret = array( 'admin/api', '__Settings Updated__' );
39 return $ret;
40 }
41
42 public function render()
43 {
44 ob_start();
45 require( dirname(__FILE__) . '/view.html.php' );
46 $out = ob_get_contents();
47 ob_end_clean();
48
49 $this->layout
50 ->setContent( $out )
51 ->setBreadcrumb( $this->self->breadcrumb() )
52 ->setHeader( $this->self->header() )
53 // ->setMenu( $this->self->menu() )
54 ;
55
56 $out = $this->layout->render();
57 return $out;
58 }
59
60 public function menu()
61 {
62 $return = array();
63 return $return;
64 }
65
66 public function header()
67 {
68 $out = '__REST API__';
69 return $out;
70 }
71
72 public function breadcrumb()
73 {
74 $return = array();
75 $return['admin'] = array( 'admin', '__Administration__' );
76 return $return;
77 }
78 }