Compare commits
32 Commits
40-behatfi
...
MOODLE_31_
Author | SHA1 | Date |
---|---|---|
Dan Marsden | 47003a429a | 6 years ago |
Dan Marsden | 75b4cefed5 | 7 years ago |
Dan Marsden | 7271ee999f | 7 years ago |
Dan Marsden | 927d8cef30 | 7 years ago |
Dan Marsden | dba744a401 | 7 years ago |
Dan Marsden | 5081c982e7 | 8 years ago |
Dan Marsden | c3bb0fc306 | 7 years ago |
Nick Phillips | 96cc800e60 | 7 years ago |
Dan Marsden | 5ad7089021 | 7 years ago |
Dan Marsden | 5d8cb7cd06 | 7 years ago |
Dan Marsden | c16b8c3dc3 | 7 years ago |
Dan Marsden | 20538135a9 | 7 years ago |
Dan Marsden | 3e708daf74 | 7 years ago |
Dan Marsden | 23951d245e | 7 years ago |
Dan Marsden | 1c1f335a75 | 7 years ago |
Dan Marsden | 0f9053e26d | 7 years ago |
Dan Marsden | ef2097167c | 8 years ago |
Dan Marsden | 3b88a4441c | 8 years ago |
Dan Marsden | 50addfda9d | 8 years ago |
Dan Marsden | f84d4f78b3 | 8 years ago |
Dan Marsden | b484162c72 | 8 years ago |
Daniel Thee Roperto | 15792f7646 | 8 years ago |
Marty Gilbert | e3411c05ec | 8 years ago |
Dan Marsden | b053e129ca | 8 years ago |
Dan Marsden | 2b116a43b9 | 8 years ago |
Dan Marsden | 3a70ad5e3b | 8 years ago |
Dan Marsden | f92ef4b921 | 8 years ago |
Dan Marsden | 5735e04fa6 | 8 years ago |
Dan Marsden | c4fa8a6a85 | 8 years ago |
Dan Marsden | 0cfc155d91 | 8 years ago |
Dan Marsden | 90e336920c | 8 years ago |
Dan Marsden | 5ddb37b124 | 8 years ago |
29 changed files with 254 additions and 123 deletions
@ -0,0 +1,80 @@ |
|||
<?php |
|||
// This file is part of Moodle - http://moodle.org/ |
|||
// |
|||
// Moodle is free software: you can redistribute it and/or modify |
|||
// it under the terms of the GNU General Public License as published by |
|||
// the Free Software Foundation, either version 3 of the License, or |
|||
// (at your option) any later version. |
|||
// |
|||
// Moodle is distributed in the hope that it will be useful, |
|||
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
// GNU General Public License for more details. |
|||
// |
|||
// You should have received a copy of the GNU General Public License |
|||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. |
|||
|
|||
/** |
|||
* Class definition for mod_attendance_header |
|||
* |
|||
* @package mod_attendance |
|||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net> |
|||
* @copyright 2017 Catalyst IT Australia {@link http://www.catalyst-au.net} |
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
|||
*/ |
|||
|
|||
defined('MOODLE_INTERNAL') || die(); |
|||
|
|||
/** |
|||
* Used to render the page header. |
|||
* |
|||
* @package mod_attendance |
|||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net> |
|||
* @copyright 2017 Catalyst IT Australia {@link http://www.catalyst-au.net} |
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
|||
*/ |
|||
class mod_attendance_header implements renderable { |
|||
/** @var mod_attendance_structure */ |
|||
private $attendance; |
|||
|
|||
/** @var string */ |
|||
private $title; |
|||
|
|||
/** |
|||
* mod_attendance_header constructor. |
|||
* |
|||
* @param mod_attendance_structure $attendance |
|||
* @param null $title |
|||
*/ |
|||
public function __construct(mod_attendance_structure $attendance, $title = null) { |
|||
$this->attendance = $attendance; |
|||
$this->title = $title; |
|||
} |
|||
|
|||
/** |
|||
* Gets the attendance data. |
|||
* |
|||
* @return mod_attendance_structure |
|||
*/ |
|||
public function get_attendance() { |
|||
return $this->attendance; |
|||
} |
|||
|
|||
/** |
|||
* Gets the title. If title was not provided, use the module name. |
|||
* |
|||
* @return string |
|||
*/ |
|||
public function get_title() { |
|||
return is_null($this->title) ? $this->attendance->name : $this->title; |
|||
} |
|||
|
|||
/** |
|||
* Checks if the header should be rendered. |
|||
* |
|||
* @return bool |
|||
*/ |
|||
public function should_render() { |
|||
return !is_null($this->title) || !empty($this->attendance->intro); |
|||
} |
|||
} |
Loading…
Reference in new issue