Skip to content

Commit 9a47a02

Browse files
author
r.tschu
committed
added mustache example content
1 parent 20de8ec commit 9a47a02

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

block_evasys_sync.php

+1-27
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function get_content() {
7878
if ($ismodeautomated) {
7979
$this->page->requires->js_call_amd('block_evasys_sync/invite_manager', 'init');
8080
} else {
81-
$hasstandardtime = self::getstandardtimemode($this->page->course->category);
81+
$hasstandardtime = \block_evasys_sync\evasys_synchronizer::getstandardtimemode($this->page->course->category);
8282
$this->page->requires->js_call_amd('block_evasys_sync/standardtime', 'init');
8383
}
8484
$evasyssynchronizer = new \block_evasys_sync\evasys_synchronizer($this->page->course->id);
@@ -272,31 +272,5 @@ public function applicable_formats() {
272272
public function has_config() {
273273
return true;
274274
}
275-
276-
public static function getstandardtimemode($category) {
277-
global $DB;
278-
$mode = $DB->get_record('block_evasys_sync_categories', array('course_category' => $category));
279-
if ($mode !== false) {
280-
if ($mode->standard_time_start != null) {
281-
return array('start' => $mode->standard_time_start, 'end' => $mode->standard_time_end);
282-
} else {
283-
return false;
284-
}
285-
} else {
286-
$parents = \core_course_category::get($category)->get_parents();
287-
for ($i = count($parents) - 1; $i >= 0; $i--) {
288-
$mode = $DB->get_record('block_evasys_sync_categories', array('course_category' => $parents[$i]));
289-
if ($mode !== false) {
290-
if ($mode->standard_time_start != null) {
291-
return array('start' => $mode->standard_time_start, 'end' => $mode->standard_time_end);
292-
} else {
293-
return false;
294-
}
295-
}
296-
}
297-
}
298-
$default = false;
299-
return $default;
300-
}
301275
}
302276

templates/edittime.mustache

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
{{!
2+
@template block_evasys_sync/datetimepicker
3+
Example context (json):
4+
{
5+
}
6+
}}
17
{{< block_evasys_sync/datetimepicker}}
28
{{$id}}start{{/id}}
39
{{/block_evasys_sync/datetimepicker}}

0 commit comments

Comments
 (0)