Skip to content

Commit

Permalink
Merge branch 'VID-536' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
dthies committed Aug 15, 2023
2 parents d603e34 + 6cecee7 commit 0bfcba2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lang/en/videotime.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
$string['authenticate_vimeo_success'] = 'Vimeo authentication successful. You can now use features that rely on the Vimeo API.';
$string['averageviewtime'] = 'Average view time';
$string['browsevideos'] = 'Browse videos';
$string['calendarend'] = '{$a} closes';
$string['calendarstart'] = '{$a} opens';
$string['choose_video'] = 'Choose Video';
$string['choose_video_confirm'] = 'Are you sure you want to choose the video';
$string['cleanupalbumsandtags'] = 'Cleanup albums and tags';
Expand Down Expand Up @@ -322,3 +324,5 @@
$string['completiondetail:_on_view_time'] = 'View for time {$a}';
$string['completiondetail:_on_finish'] = 'Finish video';
$string['completiondetail:_on_percent'] = 'Finish watching {$a} percent';
$string['videoopen'] = 'Allow viewing from';
$string['videoclose'] = 'Allow viewing until';
25 changes: 25 additions & 0 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public function definition() {
}
}

// Add availability section.
//$this->availability_elements();

// Add standard elements.
$this->standard_coursemodule_elements();

Expand Down Expand Up @@ -190,6 +193,28 @@ protected function standard_intro_elements($customlabel=null) {
}
}

/**
* Add availability section
*
* @throws coding_exception
*/
protected function availability_elements() {

$mform = $this->_form;
$mform->addElement('header', 'availabilityhdr', get_string('availability'));
$mform->addElement(
'date_time_selector', 'timeopen', get_string("videoopen", "videotime"), ['optional' => true]
);

$mform->addElement(
'date_time_selector', 'timeclose', get_string("videoclose", "videotime"), ['optional' => true]
);

$mform->addElement('advcheckbox', 'showpreview', get_string('showpreview', 'choice'));
$mform->addHelpButton('showpreview', 'showpreview', 'choice');
$mform->disabledIf('showpreview', 'timeopen[enabled]');
}

/**
* Add custom completion rules.
*
Expand Down

0 comments on commit 0bfcba2

Please sign in to comment.