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 / schedule / html / view / index.php

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

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