PluginProbe
ShiftController Employee Shift Scheduling / 4.9.65
ShiftController Employee Shift Scheduling v4.9.65
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 / schedule / html / view / index.php

index.php in ShiftController Employee Shift Scheduling 4.9.65, at sh4/schedule/html/view/index.php

830 lines 20.3 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_Schedule_Html_View_Index
4 {
5 protected $linksInFooter = TRUE;
6
7 public function __construct(
8 HC3_Hooks $hooks,
9 HC3_Time $t,
10 HC3_Request $request,
11 HC3_Settings $settings,
12 HC3_Ui $ui,
13 HC3_Auth $auth,
14 HC3_Acl $acl,
15
16 HC3_Uri $uri,
17
18 HC3_Ui_Layout1 $layout,
19 HC3_Enqueuer $enqueuer,
20
21 SH4_App_Query $appQuery,
22
23 SH4_Calendars_Permissions $cp,
24 SH4_Schedule_Html_View_Common $common,
25
26 SH4_Schedule_Html_View_List $viewList,
27 SH4_Schedule_Html_View_Day $viewDay,
28 SH4_Schedule_Html_View_Week $viewWeek,
29 SH4_Schedule_Html_View_FourWeeks $viewFourWeeks,
30 SH4_Schedule_Html_View_TwoWeeks $viewTwoWeeks,
31 SH4_Schedule_Html_View_Month $viewMonth,
32 SH4_Schedule_Html_View_Report $viewReport,
33 SH4_Schedule_Html_View_Download $viewDownload,
34
35 SH4_Schedule_Html_View_ControlOptions $viewControlOptions,
36 SH4_Schedule_Html_View_MiscOptions $viewMiscOptions,
37 SH4_Schedule_Html_View_NewOptions $viewNewOptions,
38 SH4_Schedule_Html_View_ControlDates $viewControlDates
39 )
40 {
41 $this->cp = $hooks->wrap( $cp );
42 $this->common = $hooks->wrap( $common );
43
44 $this->self = $hooks->wrap( $this );
45 $this->layout = $layout;
46 $this->auth = $auth;
47 $this->acl = $acl;
48 $this->enqueuer = $enqueuer;
49
50 $this->appQuery = $hooks->wrap( $appQuery );
51 $this->settings = $hooks->wrap( $settings );
52
53 $this->ui = $ui;
54 $this->uri = $uri;
55 $this->t = $t;
56 $this->request = $request;
57
58 $this->viewList = $hooks->wrap( $viewList );
59 $this->viewDay = $hooks->wrap( $viewDay );
60 $this->viewWeek = $hooks->wrap( $viewWeek );
61 $this->viewMonth = $hooks->wrap( $viewMonth );
62 $this->viewFourWeeks = $hooks->wrap( $viewFourWeeks );
63 $this->viewTwoWeeks = $hooks->wrap( $viewTwoWeeks );
64 $this->viewReport = $hooks->wrap( $viewReport );
65 $this->viewDownload = $hooks->wrap( $viewDownload );
66
67 $this->viewControlOptions = $hooks->wrap( $viewControlOptions );
68 $this->viewControlDates = $hooks->wrap( $viewControlDates );
69 $this->viewMiscOptions = $hooks->wrap( $viewMiscOptions );
70 $this->viewNewOptions = $hooks->wrap( $viewNewOptions );
71
72 $this->linksInFooter = $this->settings->get( 'datetime_hide_bottom_date_navigation', false ) ? false : true;
73 }
74
75 public function renderMy()
76 {
77 $this->enqueuer->addScript('schedule', 'sh4/schedule/assets/js/calendar.js?hcver=' . SH4_VERSION);
78
79 $out = NULL;
80 $slug = $this->request->getSlug();
81
82 $currentUser = $this->auth->getCurrentUser();
83 $currentUserId = $currentUser->getId();
84 if( ! $currentUserId ){
85 return $out;
86 }
87
88 // as employee
89 $meEmployee = $this->appQuery->findEmployeeByUser( $currentUser );
90 if( ! $meEmployee ){
91 return $out;
92 }
93
94 $meEmployeeId = $meEmployee->getId();
95
96 $start = $this->t->setNow()->formatDateDb();
97 $end = $this->t->modify('+6 days')->formatDateDb();
98
99 $type = NULL;
100 $type = HC3_Session::instance()->getUserdata('scheduleViewType'); // week/list/report
101 if( ! $type ){
102 $type = $this->settings->get( 'default_schedule_view' );
103 }
104 if( ! $type ){
105 $type = 'week';
106 }
107
108 $groupby = NULL;
109 $groupby = HC3_Session::instance()->getUserdata('scheduleViewGroupby');
110 if( ! $groupby ){
111 $groupby = $this->settings->get( 'default_schedule_groupby' );
112 }
113 if( (! $groupby) OR ($groupby == 'employee') ){
114 $groupby = 'none';
115 }
116
117 $allowed = array();
118
119 $employee = array( $meEmployeeId );
120
121 $calendar = HC3_Session::instance()->getUserdata('scheduleViewCalendar');
122 if( ! $calendar ){
123 $calendar = array();
124 }
125
126 $hideui = array(
127 'filter-employee',
128 // 'filter-calendar',
129 // 'groupby',
130 // 'type-month', 'type-day', 'type-week',
131 );
132 // type
133 // type-month
134 // type-week
135 // type-day
136 // type-list
137 // type-report
138 // groupby
139 // print
140 // download
141 // filter-calendar
142 // filter-employee
143
144 $defaultParams = array(
145 'conflict' => 0,
146 'pickup' => 0,
147 'type' => $type,
148 'groupby' => $groupby,
149 'start' => $start,
150 'end' => $end,
151 'employee' => $employee,
152 'calendar' => $calendar,
153 'hideui' => $hideui
154 );
155
156 $params = $this->request->getParams();
157 $params = array_merge( $defaultParams, $params );
158
159 foreach( $params as $k => $v ){
160 $this->request
161 ->initParam( $k, $v )
162 ;
163 }
164
165 // $params['employee'] = HC3_Functions::removeFromArray( $params['employee'], 'x' );
166 $params['calendar'] = HC3_Functions::removeFromArray( $params['calendar'], 'x' );
167
168 $this->request
169 // ->setParam('employee', $params['employee'])
170 ->setParam('calendar', $params['calendar'])
171 ;
172
173 HC3_Session::instance()
174 ->setUserdata( 'scheduleViewType', $params['type'] )
175 ->setUserdata( 'scheduleViewGroupby', $params['groupby'] )
176 // ->setUserdata( 'scheduleViewEmployee', $params['employee'] )
177 ->setUserdata( 'scheduleViewCalendar', $params['calendar'] )
178 ;
179
180 $toParams = $this->request->getParams('withoutdefault');
181 $scheduleLink = array( $slug, $toParams );
182
183 HC3_Session::instance()
184 ->setUserdata( 'scheduleLink', $scheduleLink )
185 ;
186
187 // $scheduleLink2 = HC3_Session::instance()
188 // ->getUserdata( 'scheduleLink' )
189 // ;
190 // $to = $this->uri->makeUrl( $scheduleLink2 );
191 // echo "TO = '$to'<br>";
192 // exit;
193
194 $type = $params['type'];
195 $groupby = $params['groupby'];
196
197 $view = NULL;
198
199 if( array_key_exists('download', $params) && $params['download'] ){
200 $view = $this->viewDownload;
201 $groupby = NULL;
202 }
203 else {
204 switch( $type ){
205 case '4weeks':
206 $view = $this->viewFourWeeks;
207 break;
208 case '2weeks':
209 $view = $this->viewTwoWeeks;
210 break;
211 case 'month':
212 $view = $this->viewMonth;
213 break;
214 case 'week':
215 $view = $this->viewWeek;
216 break;
217 case 'day':
218 $view = $this->viewDay;
219 break;
220 case 'list':
221 $view = $this->viewList;
222 break;
223 case 'report':
224 $view = $this->viewReport;
225 break;
226 }
227 }
228
229 switch( $groupby ){
230 // case 'employee':
231 // $out = $view->renderByEmployee();
232 // break;
233 case 'calendar':
234 $out = $view->renderByCalendar();
235 break;
236 default:
237 $out = $view->render();
238 break;
239 }
240
241 if( ! in_array($type, array('report')) ){
242 $miscOptions = $this->viewMiscOptions->options();
243 if( $this->request->isPrintView() ){
244 $miscOptions[2] = NULL;
245 $miscOptions[3] = NULL;
246 }
247
248 if( $miscOptions ){
249 $misc = $this->ui->makeGrid();
250 $misc->add( isset($miscOptions[1]) ? $miscOptions[1] : NULL, 3, 12 );
251 $misc->add( isset($miscOptions[2]) ? $miscOptions[2] : NULL, 7, 12 );
252 $misc->add( isset($miscOptions[3]) ? $miscOptions[3] : NULL, 2, 12 );
253
254 $out = $this->ui->makeList( array($misc, $out) )
255 ->gutter(3)
256 ;
257 }
258 }
259
260 $src = $this->uri->currentUrl();
261 $this->uri->fromUrl( $src );
262
263 $uriParams = $this->uri->getParams();
264 $src = $this->uri
265 ->makeUrl( array('myschedule', $uriParams) )
266 ;
267
268 $out = $this->ui->makeBlock( $out )
269 ->addAttr( 'id', 'sh4-shifts-calendar' )
270 ->addAttr( 'data-src', $src )
271 ;
272
273 if( $this->request->isAjax() ){
274 return $out;
275 }
276
277 if( ! $this->request->isPrintView() ){
278 $headerControl = $this->viewControlOptions->render();
279 if( $headerControl ){
280 $out = $this->ui->makeList( array($headerControl, $out) );
281 }
282 }
283
284 if( ! in_array($type, array('report')) ){
285 if( ! $this->request->isPrintView() ){
286 $new = $this->viewNewOptions->render();
287 $out = $this->ui->makeList( array($new, $out) )
288 ->gutter(3)
289 ;
290 }
291 }
292
293 $headerDate = $this->viewControlDates->render();
294 if( $headerDate ){
295 $out = $this->ui->makeList( array($headerDate, $out) );
296 }
297
298 $modal = $this->_renderModal();
299 $out = $this->ui->makeCollection( array($out, $modal) );
300
301 $header = '__My Schedule__';
302 $header = $this->ui->makeBlock( $header )
303 ->tag('font-size', 5)
304 ;
305
306 $toCheck = 'schedule';
307 $everyoneScheduleDisabled = $this->checkEveryoneScheduleDisabled();
308
309 $out = $this->ui->makeList( array($header, $out) )
310 ->gutter(3)
311 ;
312
313 // is wp?
314 if( defined('WPINC') && (! is_admin()) ){
315 $tos = $this->self->toplinks();
316 // $tos = array(
317 // array( 'admin', '__Administration__' ),
318 // array( 'user/profile', '__Profile__' ),
319 // );
320
321 $headerLinks = array();
322 foreach( $tos as $to ){
323 $checkTo = is_array( $to[0] ) ? $to[0][0] : $to[0];
324 if( ! $this->acl->check('get:' . $checkTo) ){
325 continue;
326 }
327
328 $headerLinks[] = $this->ui->makeAhref( $to[0], $to[1] )
329 ->tag('secondary')
330 ;
331 }
332
333 if( $headerLinks ){
334 $headerLinks = $this->ui->makeListInline( $headerLinks )
335 ->gutter(2)
336 ;
337 $out = $this->ui->makeList( array($headerLinks, $out) )
338 ->gutter(3)
339 ;
340 }
341 }
342
343 // add links to footer
344 if( $this->linksInFooter && $headerDate ){
345 // rerender to change id for the form
346 $footerDate = $this->viewControlDates->render();
347 $out = $this->ui->makeList( array($out, $footerDate) )
348 ->gutter(3)
349 ;
350 }
351
352 $this->layout
353 ->setContent( $out )
354 // ->setHeader( $header )
355 ;
356
357 $out = $this->layout->render();
358
359 return $out;
360 }
361
362 public function checkEmployee()
363 {
364 $return = NULL;
365
366 // CHECK IF EVERYTHING IS DISABLED FOR EMPLOYEE THEN REDIRECT TO MYSCHEDULE
367 $somethingAllowed = FALSE;
368
369 $perms = array(
370 'employee_view_others_publish',
371 'employee_view_others_draft',
372 'employee_view_open_publish',
373 'employee_view_open_draft',
374 'employee_pickup_others'
375 );
376
377 $allCalendars = $this->common->findAllCalendars();
378 foreach( $allCalendars as $calendar ){
379 reset( $perms );
380 foreach( $perms as $perm ){
381 if( $this->cp->get($calendar, $perm) ){
382 $somethingAllowed = TRUE;
383 break;
384 }
385 }
386
387 if( $somethingAllowed ){
388 break;
389 }
390 }
391
392 if( ! $somethingAllowed ){
393 $return = array( 'myschedule', NULL );
394 }
395
396 return $return;
397 }
398
399 public function checkAnon()
400 {
401 $return = NULL;
402
403 if( $this->settings->get('users_login_required') ){
404 $return = array( 'login', NULL );
405 return $return;
406 }
407
408 // CHECK IF EVERYTHING IS DISABLED FOR VISITOR THEN REDIRECT TO LOGIN
409 $somethingAllowed = FALSE;
410
411 $perms = array(
412 'visitor_view_others_publish',
413 'visitor_view_others_draft',
414 'visitor_view_open_publish',
415 'visitor_view_open_draft'
416 );
417
418 $allCalendars = $this->common->findAllCalendars();
419 foreach( $allCalendars as $calendar ){
420 reset( $perms );
421 foreach( $perms as $perm ){
422 if( $this->cp->get($calendar, $perm) ){
423 $somethingAllowed = TRUE;
424 break;
425 }
426 }
427
428 if( $somethingAllowed ){
429 break;
430 }
431 }
432
433 if( ! $somethingAllowed ){
434 $return = array( 'login', NULL );
435 }
436
437 return $return;
438 }
439
440 public function checkEveryoneSchedule()
441 {
442 $ret = true;
443
444 if( ! is_admin() ){
445 return $ret;
446 }
447
448 $currentUserId = $this->auth->getCurrentUserId();
449 if( ! $currentUserId ){
450 return $ret;
451 }
452
453 $currentUser = $this->auth->getCurrentUser();
454 $managedCalendars = $this->appQuery->findCalendarsManagedByUser( $currentUser );
455 if( $managedCalendars ){
456 return $ret;
457 }
458
459 $viewedCalendars = $this->appQuery->findCalendarsViewedByUser( $currentUser );
460 if( $viewedCalendars ){
461 return $ret;
462 }
463
464 // CHECK IF EVERYTHING IS DISABLED FOR EMPLOYEE THEN REDIRECT TO MYSCHEDULE
465 $somethingAllowed = false;
466
467 $perms = array(
468 'employee_view_others_publish',
469 'employee_view_others_draft',
470 'employee_view_open_publish',
471 'employee_view_open_draft',
472 'employee_pickup_others'
473 );
474
475 $allCalendars = $this->common->findAllCalendars();
476 foreach( $allCalendars as $calendar ){
477 reset( $perms );
478 foreach( $perms as $perm ){
479 if( $this->cp->get($calendar, $perm) ){
480 $somethingAllowed = true;
481 break;
482 }
483 }
484 if( $somethingAllowed ){
485 break;
486 }
487 }
488
489 if( $somethingAllowed ){
490 return $ret;
491 }
492
493 $ret = false;
494 return $ret;
495 }
496
497 public function checkEveryoneScheduleDisabled()
498 {
499 $return = NULL;
500
501 $currentUserId = $this->auth->getCurrentUserId();
502 if( $currentUserId ){
503 $currentUser = $this->auth->getCurrentUser();
504 $managedCalendars = $this->appQuery->findCalendarsManagedByUser( $currentUser );
505 if( $managedCalendars ){
506 return $return;
507 }
508 $viewedCalendars = $this->appQuery->findCalendarsViewedByUser( $currentUser );
509 if( $viewedCalendars ){
510 return $return;
511 }
512
513 $return = $this->checkEmployee();
514 if( $return ){
515 return $return;
516 }
517 }
518
519 if( ! $currentUserId ){
520 $return = $this->checkAnon();
521 if( $return ){
522 return $return;
523 }
524 }
525
526 return $return;
527 }
528
529 public function render()
530 {
531 $this->enqueuer->addScript('schedule', 'sh4/schedule/assets/js/calendar.js?hcver=' . SH4_VERSION);
532
533 $return = $this->checkEveryoneScheduleDisabled();
534 if( $return ){
535 return $return;
536 }
537
538 $slug = $this->request->getSlug();
539
540 $start = $this->t->setNow()->formatDateDb();
541 $end = $this->t->modify('+6 days')->formatDateDb();
542
543 $type = NULL;
544 $type = HC3_Session::instance()->getUserdata('scheduleViewType'); // week/list/report
545 if( ! $type ){
546 $type = $this->settings->get( 'default_schedule_view' );
547 }
548 if( ! $type ){
549 $type = 'week';
550 }
551
552 $groupby = NULL;
553 $groupby = HC3_Session::instance()->getUserdata('scheduleViewGroupby');
554 if( ! $groupby ){
555 $groupby = $this->settings->get( 'default_schedule_groupby' );
556 }
557 if( ! $groupby ){
558 $groupby = 'employee';
559 }
560
561 // $employee = HC3_Session::instance()->getUserdata('scheduleViewEmployee');
562 // if( ! $employee ){
563 $employee = array();
564 // }
565
566 // $calendar = HC3_Session::instance()->getUserdata('scheduleViewCalendar');
567 // if( ! $calendar ){
568 $calendar = array();
569 // }
570
571 $hideui = array();
572
573 $defaultParams = array(
574 'conflict' => 0,
575 'pickup' => 0,
576 'type' => $type,
577 'groupby' => $groupby,
578 'start' => $start,
579 'end' => $end,
580 'employee' => $employee,
581 'calendar' => $calendar,
582 'hideui' => $hideui
583 );
584
585 $params = $this->request->getParams();
586 $params = array_merge( $defaultParams, $params );
587
588 foreach( $params as $k => $v ){
589 $this->request
590 ->initParam( $k, $v )
591 ;
592 }
593
594 $params['employee'] = HC3_Functions::removeFromArray( $params['employee'], 'x' );
595 $params['calendar'] = HC3_Functions::removeFromArray( $params['calendar'], 'x' );
596
597 $this->request
598 ->setParam('employee', $params['employee'])
599 ->setParam('calendar', $params['calendar'])
600 ;
601
602 HC3_Session::instance()
603 ->setUserdata( 'scheduleViewType', $params['type'] )
604 ->setUserdata( 'scheduleViewGroupby', $params['groupby'] )
605 ->setUserdata( 'scheduleViewEmployee', $params['employee'] )
606 ->setUserdata( 'scheduleViewCalendar', $params['calendar'] )
607 ;
608
609 $toParams = $this->request->getParams('withoutdefault');
610 $scheduleLink = array( $slug, $toParams );
611
612 HC3_Session::instance()
613 ->setUserdata( 'scheduleLink', $scheduleLink )
614 ;
615
616 $type = $params['type'];
617 $groupby = $params['groupby'];
618
619 $hideui = $params['hideui'];
620 if( ('employee' == $groupby) && in_array('groupby-employee', $hideui) ){
621 $groupby = NULL;
622 }
623 if( ('calendar' == $groupby) && in_array('groupby-calendar', $hideui) ){
624 $groupby = NULL;
625 }
626
627 $view = NULL;
628
629 if( array_key_exists('download', $params) && $params['download'] ){
630 $view = $this->viewDownload;
631 $groupby = NULL;
632 }
633 else {
634 switch( $type ){
635 case '4weeks':
636 $view = $this->viewFourWeeks;
637 break;
638 case '2weeks':
639 $view = $this->viewTwoWeeks;
640 break;
641 case 'month':
642 $view = $this->viewMonth;
643 break;
644 case 'day':
645 $view = $this->viewDay;
646 break;
647 case 'list':
648 $view = $this->viewList;
649 break;
650 case 'report':
651 $view = $this->viewReport;
652 break;
653 default:
654 $view = $this->viewWeek;
655 break;
656 }
657 }
658
659 switch( $groupby ){
660 case 'employee':
661 $out = $view->renderByEmployee();
662 break;
663 case 'calendar':
664 $out = $view->renderByCalendar();
665 break;
666 default:
667 $out = $view->render();
668 break;
669 }
670
671 if( ! in_array($type, array('report')) ){
672 $miscOptions = $this->viewMiscOptions->options();
673 if( $this->request->isPrintView() ){
674 $miscOptions[2] = NULL;
675 $miscOptions[3] = NULL;
676 }
677
678 if( $miscOptions ){
679 $misc = $this->ui->makeGrid();
680 $misc->add( isset($miscOptions[1]) ? $miscOptions[1] : NULL, 3, 12 );
681 $misc->add( isset($miscOptions[2]) ? $miscOptions[2] : NULL, 7, 12 );
682 $misc->add( isset($miscOptions[3]) ? $miscOptions[3] : NULL, 2, 12 );
683
684 $out = $this->ui->makeList( array($misc, $out) )
685 ->gutter(3)
686 ;
687 }
688 }
689
690 $src = $this->uri->currentUrl();
691 $out = $this->ui->makeBlock( $out )
692 ->addAttr( 'id', 'sh4-shifts-calendar' )
693 ->addAttr( 'data-src', $src )
694 ;
695
696 if( $this->request->isAjax() ){
697 return $out;
698 }
699
700 if( ! $this->request->isPrintView() ){
701 $headerControl = $this->viewControlOptions->render();
702 if( $headerControl ){
703 $out = $this->ui->makeList( array($headerControl, $out) );
704 }
705 }
706 else {
707 $header = $this->viewControlOptions->render();
708 if( $header ){
709 $out = $this->ui->makeList( array($header, $out) );
710 }
711 }
712
713 if( ! in_array($type, array('report')) ){
714 if( ! $this->request->isPrintView() ){
715 $new = $this->viewNewOptions->render();
716 $out = $this->ui->makeList( array($new, $out) )
717 ->gutter(3)
718 ;
719 }
720 }
721
722 $headerDate = $this->viewControlDates->render();
723 if( $headerDate ){
724 $out = $this->ui->makeList( array($headerDate, $out) );
725 }
726
727 $modal = $this->_renderModal();
728 $out = $this->ui->makeCollection( array($out, $modal) );
729
730 $toCheck = 'myschedule';
731 if( $this->acl->check('get:' . $toCheck) ){
732 $hideui = isset( $params['hideui'] ) ? $params['hideui'] : array();
733 if( ! array_intersect(array('pagetitle', 'all'), $hideui) ){
734 $header = "__Everyone's Schedule__";
735 $header = $this->ui->makeBlock( $header )
736 ->tag('font-size', 5)
737 ;
738
739 $out = $this->ui->makeList( array($header, $out) )
740 ->gutter(3)
741 ;
742 }
743 }
744
745 // is wp?
746 if( defined('WPINC') && (! is_admin()) ){
747 $tos = $this->self->toplinks();
748
749 $headerLinks = array();
750 foreach( $tos as $to ){
751 $checkTo = is_array( $to[0] ) ? $to[0][0] : $to[0];
752 if( ! $this->acl->check('get:' . $checkTo) ){
753 continue;
754 }
755
756 $headerLinks[] = $this->ui->makeAhref( $to[0], $to[1] )
757 ->tag('secondary')
758 ;
759 }
760
761 if( $headerLinks ){
762 $headerLinks = $this->ui->makeListInline( $headerLinks )
763 ->gutter(2)
764 ;
765 $out = $this->ui->makeList( array($headerLinks, $out) )
766 ->gutter(3)
767 ;
768 }
769 }
770
771 // add links to footer
772 if( $this->linksInFooter && $headerDate ){
773 // rerender to change id for the form
774 $footerDate = $this->viewControlDates->render();
775 $out = $this->ui->makeList( array($out, $footerDate) )
776 ->gutter(3)
777 ;
778 }
779
780 $this->layout
781 ->setContent( $out )
782 // ->setHeader( $this->self->header() )
783 ;
784
785 $out = $this->layout->render();
786 return $out;
787 }
788
789 public function toplinks()
790 {
791 $ret = array();
792
793 $params = $this->request->getParams();
794 $hideui = isset( $params['hideui'] ) ? $params['hideui'] : array();
795 if( array_intersect(array('pagemenu', 'all'), $hideui) ){
796 return $ret;
797 }
798
799 $ret['admin'] = array( 'admin', '__Administration__' );
800 $ret['user/profile'] = array( 'user/profile', '__Profile__' );
801
802 return $ret;
803 }
804
805 protected function _renderModal()
806 {
807 $modalContent = $this->ui->makeBlock( '' )
808 ->addAttr( 'id', 'sh4-shifts-details-content' )
809 ;
810 $modalCloser = $this->ui->makeAhref( '', '&times;' . ' ' . '__Close__' )
811 ->tag('padding', 2)
812 ->addAttr( 'id', 'sh4-shifts-details-closer' )
813 ->tag('border')
814 ->tag('color', 'red')
815 ->tag('font-size', 5)
816 ->addAttr('class', 'hc-closer')
817 ->addAttr('style', 'float: none; display: block; text-align: center; text-align: center;')
818 ;
819
820 $modal = $this->ui->makeBlock( $this->ui->makeCollection(array($modalCloser, $modalContent)) )
821 ->addAttr( 'style', 'position: relative; display: none;' )
822 ->addAttr( 'id', 'sh4-shifts-details' )
823 ->tag('border')
824 ->tag('border-color', 'gray')
825 ->tag('padding', 3)
826 ;
827
828 return $modal;
829 }
830 }