PluginProbe
ShiftController Employee Shift Scheduling / 4.9.85
ShiftController Employee Shift Scheduling v4.9.85
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 / shifts / view / delete.php

delete.php in ShiftController Employee Shift Scheduling 4.9.85, at sh4/shifts/view/delete.php

66 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_Shifts_View_Delete
4 {
5 public function __construct(
6 HC3_Hooks $hooks,
7
8 HC3_Ui $ui,
9 HC3_Ui_Layout1 $layout,
10
11 SH4_Shifts_View_Common $common,
12 SH4_Shifts_Query $query
13 )
14 {
15 $this->ui = $ui;
16 $this->layout = $layout;
17
18 $this->query = $hooks->wrap($query);
19 $this->common = $hooks->wrap($common);
20 $this->self = $hooks->wrap($this);
21 }
22
23 public function render( $id )
24 {
25 $model = $this->query->findById($id);
26
27 $out = $this->ui->makeList()
28 ->gutter(2)
29 ->add( $this->ui->makeInputSubmit( '__Confirm Delete__')->tag('danger') )
30 ;
31
32 // schedule link
33 $scheduleLink = HC3_Session::instance()->getUserdata( 'scheduleLink' );
34 if( ! $scheduleLink ){
35 $scheduleLink = array( 'schedule', array() );
36 }
37 $scheduleLinkValue = json_encode( $scheduleLink );
38 $inputBackHidden = $this->ui->makeInputHidden( 'back', $scheduleLinkValue );
39 $out = $this->ui->makeCollection( array($out, $inputBackHidden) );
40
41 $out = $this->ui->makeForm(
42 'shifts/' . $id . '/delete',
43 $out
44 );
45
46 $help = '__This operation cannot be undone.__';
47
48 $out = $this->ui->makeList( array($help, $out) );
49
50 $this->layout
51 ->setContent( $out )
52 ->setBreadcrumb( $this->common->breadcrumb($model) )
53 ->setHeader( $this->self->header($model) )
54 ;
55
56 $out = $this->layout->render();
57
58 return $out;
59 }
60
61 public function header( $model )
62 {
63 $out = '__Delete__';
64 return $out;
65 }
66 }