当前位置: 首页>>代码示例>>PHP>>正文


PHP lesson::properties方法代码示例

本文整理汇总了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")) {
开发者ID:rwijaya,项目名称:moodle,代码行数:31,代码来源:highscores.php

示例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;
 }
开发者ID:mongo0se,项目名称:moodle,代码行数:12,代码来源:renderer.php

示例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);
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:31,代码来源:highscores.php


注:本文中的lesson::properties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。