本文整理汇总了PHP中lesson::properties方法的典型用法代码示例。如果您正苦于以下问题:PHP lesson::properties方法的具体用法?PHP lesson::properties怎么用?PHP lesson::properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lesson
的用法示例。
在下文中一共展示了lesson::properties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
'context' => $context,
'courseid' => $course->id,
));
$event->trigger();
$lesson->add_message(get_string('postsuccess', 'lesson'), 'notifysuccess');
redirect("$CFG->wwwroot/mod/lesson/highscores.php?id=$cm->id&link=1");
} else {
print_error('invalidformdata');
}
break;
}
// Trigger highscore viewed event.
$event = \mod_lesson\event\highscores_viewed::create(array(
'objectid' => $lesson->properties()->id,
'context' => $context,
'courseid' => $course->id
));
$event->trigger();
$lessonoutput = $PAGE->get_renderer('mod_lesson');
echo $lessonoutput->header($lesson, $cm, 'highscores', false, null, get_string('viewhighscores', 'lesson'));
switch ($mode) {
case 'add':
echo $lessonoutput->add_highscores_form($lesson);
break;
default:
$params = array ("lessonid" => $lesson->id);
if (!$grades = $DB->get_records_select("lesson_grades", "lessonid = :lessonid", $params, "completed")) {
示例2: slideshow_start
/**
* Returns HTML to show the start of a slideshow
* @param lesson $lesson
*/
public function slideshow_start(lesson $lesson)
{
$attributes = array();
$attributes['class'] = 'slideshow';
$attributes['style'] = 'background-color:' . $lesson->properties()->bgcolor . ';height:' . $lesson->properties()->height . 'px;width:' . $lesson->properties()->width . 'px;';
$output = html_writer::start_tag('div', $attributes);
return $output;
}
示例3: array
$newhighscore->userid = $USER->id;
$newhighscore->gradeid = $newgrade->id;
$newhighscore->nickname = $name;
$newhighscore->id = $DB->insert_record('lesson_high_scores', $newhighscore);
// Trigger highscore updated event.
$event = \mod_lesson\event\highscore_added::create(array('objectid' => $newhighscore->id, 'context' => $context, 'courseid' => $course->id, 'other' => array('lessonid' => $lesson->id, 'nickname' => $newhighscore->nickname)));
$event->trigger();
$lesson->add_message(get_string('postsuccess', 'lesson'), 'notifysuccess');
redirect("{$CFG->wwwroot}/mod/lesson/highscores.php?id={$cm->id}&link=1");
} else {
print_error('invalidformdata');
}
break;
}
// Trigger highscore viewed event.
$event = \mod_lesson\event\highscores_viewed::create(array('objectid' => $lesson->properties()->id, 'context' => $context, 'courseid' => $course->id));
$event->trigger();
$lessonoutput = $PAGE->get_renderer('mod_lesson');
echo $lessonoutput->header($lesson, $cm, 'highscores', false, null, get_string('viewhighscores', 'lesson'));
switch ($mode) {
case 'add':
echo $lessonoutput->add_highscores_form($lesson);
break;
default:
$params = array("lessonid" => $lesson->id);
if (!($grades = $DB->get_records_select("lesson_grades", "lessonid = :lessonid", $params, "completed"))) {
$grades = array();
}
echo $OUTPUT->heading(get_string("topscorestitle", "lesson", $lesson->maxhighscores), 4);
if (!($highscores = $DB->get_records_select("lesson_high_scores", "lessonid = :lessonid", $params))) {
echo $OUTPUT->heading(get_string("nohighscores", "lesson"), 3);