45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
namespace common\modules\event\widgets\timetable;
|
|
use common\modules\event\models\timetable\TimeTableMonthDay;
|
|
use common\modules\event\models\timetable\TimeTableMonthWeek;
|
|
use common\modules\event\widgets\day\TimeTableMonthDayView;
|
|
use yii\bootstrap\Widget;
|
|
|
|
/**
|
|
* Class TimeTableMonthDayView
|
|
* @package common\modules\event\widgets
|
|
*
|
|
* @property TimeTableMonthDay $day
|
|
*/
|
|
class TimeTableMonthView extends Widget
|
|
{
|
|
public $timeTable;
|
|
public $actionsColumn;
|
|
public $copyWeekContext;
|
|
|
|
public function run() {
|
|
return $this->render('_timetable', [
|
|
'timeTable' => $this->timeTable,
|
|
'actionsColumn' => ( isset($this->actionsColumn) ? $this->actionsColumn : null),
|
|
'copyWeekContext' => $this->copyWeekContext
|
|
]);
|
|
}
|
|
|
|
|
|
public static function renderDay($weekDay , $copyWeekContext = null){
|
|
|
|
/**
|
|
* @param TimeTableMonthWeek $week
|
|
* @return string
|
|
*/
|
|
return static function ($week) use ($weekDay, $copyWeekContext) {
|
|
return TimeTableMonthDayView::widget([
|
|
'day' => $week->getWeekDay($weekDay),
|
|
'copyWeekContext' => $copyWeekContext
|
|
]);
|
|
};
|
|
|
|
}
|
|
|
|
}
|