Пример #1
1
 function show_header()
 {
     global $CFG, $USER;
     $swwwroot = htmlspecialchars($CFG->wwwroot);
     $navtail = get_string('summary_title', ANNOTATION_STRINGS);
     $navmiddle = "";
     require_js(ANNOTATION_PATH . '/marginalia/3rd-party.js');
     require_js(ANNOTATION_PATH . '/marginalia/log.js');
     require_js(ANNOTATION_PATH . '/marginalia-config.js');
     require_js(ANNOTATION_PATH . '/marginalia/domutil.js');
     require_js(ANNOTATION_PATH . '/marginalia/prefs.js');
     require_js(ANNOTATION_PATH . '/marginalia/rest-prefs.js');
     require_js(ANNOTATION_PATH . '/marginalia/annotation.js');
     require_js(ANNOTATION_PATH . '/marginalia/rest-annotate.js');
     require_js(ANNOTATION_PATH . '/smartquote.js');
     require_js(ANNOTATION_PATH . '/summary.js');
     $meta = "<link rel='stylesheet' type='text/css' href='" . s(ANNOTATION_PATH) . "/summary-styles.php'/>\n";
     if (null != $this->course && $this->course->category) {
         print_header($this->course->shortname . ': ' . get_string('summary_title', ANNOTATION_STRINGS), $this->course->fullname, '<a href=' . $CFG->wwwroot . '/course/view.php?id=' . $this->course->id . '>' . $this->course->shortname . '</a> -> ' . $navtail, "", $meta, true, "", navmenu($this->course));
     } elseif (null != $this->course) {
         print_header($this->course->shortname . ': ' . get_string('summary_title', ANNOTATION_STRINGS), $this->course->fullname, $navtail, "", $meta, true, "", navmenu($this->course));
     } else {
         print_header(get_string('summary_title', ANNOTATION_STRINGS), null, "{$navtail}", "", $meta, true, "", null);
     }
     //		echo $tagsHtml;
     if (isloggedin()) {
         $sannotationpath = s(ANNOTATION_PATH);
         echo "<script language='JavaScript' type='text/javascript'>\n" . "var annotationService = new RestAnnotationService('{$sannotationpath}/annotate.php', { csrfCookie: 'MoodleSessionTest' } );\n" . "window.annotationSummary = new AnnotationSummary(annotationService" . ", '{$swwwroot}'" . ", '" . s($USER->username) . "');\n" . "window.preferences = new Preferences( new RestPreferenceService('{$sannotationpath}/user-preference.php' ) );\n" . "</script>\n";
     }
 }
Пример #2
1
 /**
  * Constructor for the base resource class
  *
  * Constructor for the base resource class.
  * If cmid is set create the cm, course, resource objects.
  * and do some checks to make sure people can be here, and so on.
  *
  * @param cmid   integer, the current course module id - not set for new resources
  */
 function resource_base($cmid = 0)
 {
     global $CFG, $COURSE;
     $this->navlinks = array();
     if ($cmid) {
         if (!($this->cm = get_coursemodule_from_id('resource', $cmid))) {
             error("Course Module ID was incorrect");
         }
         if (!($this->course = get_record("course", "id", $this->cm->course))) {
             error("Course is misconfigured");
         }
         if (!($this->resource = get_record("resource", "id", $this->cm->instance))) {
             error("Resource ID was incorrect");
         }
         $this->strresource = get_string("modulename", "resource");
         $this->strresources = get_string("modulenameplural", "resource");
         if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
             $pagetitle = strip_tags($this->course->shortname . ': ' . $this->strresource);
             $navigation = build_navigation($this->navlinks, $this->cm);
             print_header($pagetitle, $this->course->fullname, $navigation, "", "", true, '', navmenu($this->course, $this->cm));
             notice(get_string("activityiscurrentlyhidden"), "{$CFG->wwwroot}/course/view.php?id={$this->course->id}");
         }
     } else {
         $this->course = $COURSE;
     }
 }
 function print_header($title, $morenavlinks = NULL, $bodytags = '', $meta = '', $extrabuttons = '')
 {
     global $USER, $CFG;
     $this->init_full();
     $replacements = array('%fullname%' => format_string($this->activityrecord->name));
     foreach ($replacements as $search => $replace) {
         $title = str_replace($search, $replace, $title);
     }
     if (empty($morenavlinks) && $this->user_allowed_editing()) {
         // mmmm, tables
         $buttons = '<table><tr>';
         $buttons .= '<td>' . $extrabuttons . '</td>';
         $buttons .= '<td>' . update_module_button(optional_param('clone', $this->modulerecord->id, PARAM_INT), $this->courserecord->id, get_string('modulename', $this->activityname)) . '</td>';
         if (!empty($CFG->showblocksonmodpages)) {
             $clonething = optional_param('clone', 0, PARAM_INT);
             $clonething = $clonething ? '<input type="hidden" name="clone" value="' . $clonething . '" />' : '';
             $buttons .= '<td><form ' . $CFG->frametarget . ' method="get" action="view.php"><div>' . '<input type="hidden" name="id" value="' . $this->modulerecord->id . '" />' . $clonething . '<input type="hidden" name="edit" value="' . ($this->user_is_editing() ? 'off' : 'on') . '" />' . '<input type="submit" value="' . get_string($this->user_is_editing() ? 'blockseditoff' : 'blocksediton') . '" /></div></form></td>';
         }
         $buttons .= '</tr></table>';
     } else {
         $buttons = $extrabuttons ? $extrabuttons : '&nbsp;';
     }
     if (empty($morenavlinks)) {
         $morenavlinks = array();
     }
     $navigation = build_navigation($morenavlinks, $this->modulerecord);
     print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord), false, $bodytags);
 }
Пример #4
0
/**
 * Print url header.
 * @param object $url
 * @param object $cm
 * @param object $course
 * @return void
 */
function url_print_header($url, $cm, $course)
{
    global $PAGE, $OUTPUT;
    $PAGE->set_title($course->shortname . ': ' . $url->name);
    $PAGE->set_heading($course->fullname);
    $PAGE->set_activity_record($url);
    $PAGE->set_button(update_module_button($cm->id, '', get_string('modulename', 'url')));
    echo $OUTPUT->header(build_navigation('', $cm), navmenu($course, $cm));
}
 function display()
 {
     global $CFG;
     $formatoptions = new object();
     $formatoptions->noclean = true;
     /// Are we displaying the course blocks?
     if ($this->resource->options == 'showblocks') {
         parent::display_course_blocks_start();
         $entry = get_record('kaltura_entries', 'context', "R_" . "{$this->resource}->id");
         if (trim(strip_tags($this->resource->alltext))) {
             echo $entry->title;
             $context = get_context_instance(CONTEXT_COURSE, $this->course->id);
             $formatoptions = new object();
             $formatoptions->noclean = true;
             print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center");
             if (has_capability('moodle/course:manageactivities', $context)) {
                 echo embed_kaltura($resource->alltext, get_width($entry), get_height($entry), $entry->entry_type, $entry->design, true);
             } else {
                 echo embed_kaltura($resource->alltext, get_width($entry), get_height($entry), KalturaEntryType::MEDIA_CLIP, $entry->design, true);
             }
         }
         parent::display_course_blocks_end();
     } else {
         /// Set up generic stuff first, including checking for access
         parent::display();
         /// Set up some shorthand variables
         $cm = $this->cm;
         $course = $this->course;
         $resource = $this->resource;
         $entry = get_record('kaltura_entries', 'context', "R_" . "{$resource->id}");
         $pagetitle = strip_tags($course->shortname . ': ' . format_string($resource->name));
         $inpopup = optional_param('inpopup', '', PARAM_BOOL);
         add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
         $navigation = build_navigation($this->navlinks, $cm);
         print_header($pagetitle, $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
         if (trim(strip_tags($this->resource->alltext))) {
             echo $entry->title;
             $context = get_context_instance(CONTEXT_COURSE, $this->course->id);
             $formatoptions = new object();
             $formatoptions->noclean = true;
             print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center");
             if (has_capability('moodle/course:manageactivities', $context)) {
                 echo embed_kaltura($resource->alltext, get_width($entry), get_height($entry), $entry->entry_type, $entry->design, true);
             } else {
                 echo embed_kaltura($resource->alltext, get_width($entry), get_height($entry), KalturaEntryType::MEDIA_CLIP, $entry->design, true);
             }
         }
         /*       print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id),
                         "center", "", "", "20");
         */
         $strlastmodified = get_string("lastmodified");
         echo "<div class=\"modified\">{$strlastmodified}: " . userdate($resource->timemodified) . "</div>";
         print_footer($course);
     }
 }
 function display()
 {
     global $CFG;
     $formatoptions = new object();
     $formatoptions->noclean = true;
     /// Are we displaying the course blocks?
     if ($this->resource->options == 'showblocks') {
         parent::display_course_blocks_start();
         $entry = get_record('kaltura_entries', 'context', "R_" . "{$this->resource}->id");
         if (trim(strip_tags($this->resource->alltext))) {
             echo $entry->title;
             $player_url = $CFG->wwwroot . '/mod/kaltura/kswfdoc.php?context=' . $this->course->id . '&entry_id=' . $resource->alltext;
             $formatoptions = new object();
             $formatoptions->noclean = true;
             print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center");
             if ($resource->alltext) {
                 echo '<input style="margin-top:20px;" type="button" value="View video presentation" onclick="kalturaInitModalBox(\'' . $player_url . '\', {width:780, height:400});">';
             }
             //            echo embed_kaltura($resource->alltext,get_width($entry),get_height($entry),$entry->entry_type);
         }
         parent::display_course_blocks_end();
     } else {
         /// Set up generic stuff first, including checking for access
         parent::display();
         /// Set up some shorthand variables
         $cm = $this->cm;
         $course = $this->course;
         $resource = $this->resource;
         $entry = get_record('kaltura_entries', 'context', "R_" . "{$resource->id}");
         $pagetitle = strip_tags($course->shortname . ': ' . format_string($resource->name));
         $inpopup = optional_param('inpopup', '', PARAM_BOOL);
         add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
         $navigation = build_navigation($this->navlinks, $cm);
         print_header($pagetitle, $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
         if (trim(strip_tags($this->resource->alltext))) {
             echo $entry->title;
         }
         $formatoptions = new object();
         $formatoptions->noclean = true;
         print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center");
         if (trim(strip_tags($this->resource->alltext))) {
             $player_url = $CFG->wwwroot . '/mod/kaltura/kswfdoc.php?context=' . $this->course->id . '&entry_id=' . $resource->alltext;
             if ($resource->alltext) {
                 echo '<input type="button" style="margin-top:20px;"  value="View video presentation" onclick="kalturaInitModalBox(\'' . $player_url . '\', {width:780, height:400});">';
             }
             //          echo embed_kaltura($resource->alltext,get_width($entry),get_height($entry),$entry->entry_type);
         }
         /*       print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id),
                         "center", "", "", "20");
         */
         $strlastmodified = get_string("lastmodified");
         echo "<div class=\"modified\">{$strlastmodified}: " . userdate($resource->timemodified) . "</div>";
         print_footer($course);
     }
 }
/**
 * Prints the page headers, breadcrumb trail, page heading, (optional) dropdown navigation menu and
 * (optional) navigation tabs for any gradebook page. All gradebook pages MUST use these functions
 * in favour of the usual print_header(), print_header_simple(), print_heading() etc.
 * !IMPORTANT! Use of tabs.php file in gradebook pages is forbidden unless tabs are switched off at
 * the site level for the gradebook ($CFG->grade_navmethod = GRADE_NAVMETHOD_DROPDOWN).
 *
 * @param int $courseid
 * @param string $active_type The type of the current page (report, settings, import, export, scales, outcomes, letters)
 * @param string $active_plugin The plugin of the current page (grader, fullview etc...)
 * @param string $heading The heading of the page. Tries to guess if none is given
 * @param boolean $return Whether to return (true) or echo (false) the HTML generated by this function
 * @param string $bodytags Additional attributes that will be added to the <body> tag
 * @param string $buttons Additional buttons to display on the page
 *
 * @return string HTML code or nothing if $return == false
 */
function print_grade_page_head_local($courseid, $active_type, $active_plugin = null, $heading = false, $return = false, $bodytags = '', $buttons = false, $extracss = array())
{
    global $CFG, $COURSE;
    $strgrades = get_string('grades');
    $plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
    // Determine the string of the active plugin
    $stractive_plugin = $active_plugin ? $plugin_info['strings']['active_plugin_str'] : $heading;
    $stractive_type = $plugin_info['strings'][$active_type];
    $navlinks = array();
    $first_link = '';
    if ($active_type == 'settings' && $active_plugin != 'coursesettings') {
        $first_link = $plugin_info['report'][$active_plugin]['link'];
    } elseif ($active_type != 'report') {
        $first_link = $CFG->wwwroot . '/grade/index.php?id=' . $COURSE->id;
    }
    if ($active_type == 'preferences') {
        $CFG->stylesheets[] = $CFG->wwwroot . '/grade/report/styles.css';
    }
    foreach ($extracss as $css_url) {
        $CFG->stylesheets[] = $css_url;
    }
    $navlinks[] = array('name' => $strgrades, 'link' => $first_link, 'type' => 'misc');
    $active_type_link = '';
    if (!empty($plugin_info[$active_type]['link']) && $plugin_info[$active_type]['link'] != qualified_me()) {
        $active_type_link = $plugin_info[$active_type]['link'];
    }
    if (!empty($plugin_info[$active_type]['parent']['link'])) {
        $active_type_link = $plugin_info[$active_type]['parent']['link'];
        $navlinks[] = array('name' => $stractive_type, 'link' => $active_type_link, 'type' => 'misc');
    }
    if (empty($plugin_info[$active_type]['id'])) {
        $navlinks[] = array('name' => $stractive_type, 'link' => $active_type_link, 'type' => 'misc');
    }
    $navlinks[] = array('name' => $stractive_plugin, 'link' => null, 'type' => 'misc');
    $navigation = build_navigation($navlinks);
    $title = ': ' . $stractive_plugin;
    if (empty($plugin_info[$active_type]['id']) || !empty($plugin_info[$active_type]['parent'])) {
        $title = ': ' . $stractive_type . ': ' . $stractive_plugin;
    }
    $returnval = print_header_simple($strgrades . ': ' . $stractive_type, $title, $navigation, '', $bodytags, true, $buttons, navmenu($COURSE), false, '', $return);
    // Guess heading if not given explicitly
    if (!$heading) {
        $heading = $stractive_plugin;
    }
    if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN) {
        $returnval .= print_grade_plugin_selector($plugin_info, $return);
    }
    $returnval .= print_heading($heading);
    if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_TABS) {
        $returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return);
    }
    if ($return) {
        return $returnval;
    }
}
 /**
  * Constructor for the webquestscorm class
  *
  * Constructor for the base assignment class.
  * If cmid is set create the cm, course, assignment objects.
  * If the assignment is hidden and the user is not a teacher then
  * this prints a page header and notice.
  *
  * @param cmid   integer, the current course module id - not set for new assignments
  * @param assignment   object, usually null, but if we have it we pass it to save db access
  * @param cm   object, usually null, but if we have it we pass it to save db access
  * @param course   object, usually null, but if we have it we pass it to save db access
  */
 function webquestscorm($cmid = 0, $webquestscorm = NULL, $cm = NULL, $course = NULL)
 {
     global $CFG;
     if ($cmid) {
         if ($cm) {
             $this->cm = $cm;
         } else {
             if (!($this->cm = get_coursemodule_from_id('webquestscorm', $cmid))) {
                 error('Course Module ID was incorrect');
             }
         }
         $this->context = get_context_instance(CONTEXT_MODULE, $this->cm->id);
         if ($course) {
             $this->course = $course;
         } else {
             if (!($this->course = get_record('course', 'id', $this->cm->course))) {
                 error('Course is misconfigured');
             }
         }
         if ($webquestscorm) {
             $this->webquestscorm = $webquestscorm;
         } else {
             if (!($this->webquestscorm = get_record('webquestscorm', 'id', $this->cm->instance))) {
                 error('webquestscorm ID was incorrect');
             }
         }
         $this->strwebquestscorm = get_string('modulename', 'webquestscorm');
         $this->strwebquestscorms = get_string('modulenameplural', 'webquestscorm');
         $this->strsubmissions = get_string('submissions', 'webquestscorm');
         $this->strlastmodified = get_string('lastmodified');
         if ($this->course->category) {
             $this->navigation = "<a target=\"{$CFG->framename}\" href=\"{$CFG->wwwroot}/course/view.php?id={$this->course->id}\">{$this->course->shortname}</a> -> " . "<a target=\"{$CFG->framename}\" href=\"index.php?id={$this->course->id}\">{$this->strwebquestscorms}</a> ->";
         } else {
             $this->navigation = "<a target=\"{$CFG->framename}\" href=\"index.php?id={$this->course->id}\">{$this->strwebquestscorms}</a> ->";
         }
         $this->pagetitle = strip_tags($this->course->shortname . ': ' . $this->strwebquestscorm . ': ' . format_string($this->webquestscorm->name, true));
         // visibility
         $this->context = get_context_instance(CONTEXT_MODULE, $this->cm->id);
         if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', $this->context)) {
             $this->pagetitle = strip_tags($this->course->shortname . ': ' . $this->strwebquestscorm);
             print_header($this->pagetitle, $this->course->fullname, "{$this->navigation} {$this->strwebquestscorm}", "", "", true, '', navmenu($this->course, $this->cm));
             notice(get_string("activityiscurrentlyhidden"), "{$CFG->wwwroot}/course/view.php?id={$this->course->id}");
         }
         $this->currentgroup = get_current_group($this->course->id);
         $this->path = $CFG->dataroot . '/' . $this->cm->course . '/moddata/webquestscorm' . '/' . $this->cm->id;
     }
     if ($this->usehtmleditor = can_use_html_editor()) {
         $this->defaultformat = FORMAT_HTML;
     } else {
         $this->defaultformat = FORMAT_MOODLE;
     }
 }
Пример #9
0
 function print_header_and_tabs($cm, $course, $quiz, $reportmode = "overview", $meta = "")
 {
     global $CFG;
     /// Define some strings
     $strquizzes = get_string("modulenameplural", "quiz");
     $strquiz = get_string("modulename", "quiz");
     /// Print the page header
     print_header_simple(format_string($quiz->name), "", "<a href=\"index.php?id={$course->id}\">{$strquizzes}</a>\n                      -> " . format_string($quiz->name), '', $meta, true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
     /// Print the tabs
     $currenttab = 'reports';
     $mode = $reportmode;
     require $CFG->dirroot . '/mod/quiz/tabs.php';
 }
Пример #10
0
 function print_header_and_tabs($cm, $course, $quiz, $reportmode = "overview", $meta = "")
 {
     global $CFG;
     /// Define some strings
     $strquizzes = get_string("modulenameplural", "quiz");
     $strquiz = get_string("modulename", "quiz");
     /// Print the page header
     $navigation = build_navigation('', $cm);
     print_header_simple(format_string($quiz->name), "", $navigation, '', $meta, true, update_module_button($cm->id, $course->id, $strquiz), user_login_string($course) . '<hr style="width:95%">' . navmenu($course, $cm));
     /// Print the tabs
     $currenttab = 'reports';
     $mode = $reportmode;
     require $CFG->dirroot . '/mod/quiz/tabs.php';
 }
Пример #11
0
 function print_header_and_tabs($cm, $course, $quiz, $reportmode = "overview", $meta = "")
 {
     global $CFG;
     /// Define some strings
     $strquizzes = get_string("modulenameplural", "quiz");
     $strquiz = get_string("modulename", "quiz");
     /// Print the page header
     $navlinks = array();
     $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
     $navlinks[] = array('name' => format_string($quiz->name), 'link' => '', 'type' => 'activityinstance');
     $navigation = build_navigation($navlinks);
     print_header_simple(format_string($quiz->name), "", $navigation, '', $meta, true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
     /// Print the tabs
     $currenttab = 'reports';
     $mode = $reportmode;
     require $CFG->dirroot . '/mod/quiz/tabs.php';
 }
function webquestscorm_print_header($name, $currenttab = '', $course = NULL, $cm = NULL, $cmid = 0)
{
    global $CFG;
    if ($cmid) {
        if (!isset($cm)) {
            if (!($cm = get_coursemodule_from_id('webquestscorm', $cmid))) {
                error('Course Module ID was incorrect');
            }
        }
        if (!isset($course)) {
            if (!($course = get_record('course', 'id', $this->cm->course))) {
                error('Course is misconfigured');
            }
        }
        if (!isset($name)) {
            if (!($webquestscorm = get_record('webquestscorm', 'id', $this->cm->instance))) {
                error('webquestscorm ID was incorrect');
            }
            $name = $webquestscorm->name;
        }
    } else {
        if (!isset($cm)) {
            error('Course Module ID was incorrect');
        }
        if (!isset($course)) {
            error('Course is misconfigured');
        }
        if (!isset($name)) {
            error('webquestscorm name was incorrect');
        }
    }
    $strwebquestscorms = get_string('modulenameplural', 'webquestscorm');
    $strwebquestscorm = get_string('modulename', 'webquestscorm');
    $strname = format_string($name);
    $button = update_module_button($cm->id, $course->id, $strwebquestscorm);
    $meta = '';
    if ($CFG->version < 2007101500) {
        print_header_simple(format_string($strname), "", "<a href=\"index.php?id={$course->id}\">{$strwebquestscorms}</a> -> " . format_string($name), "", "", true, update_module_button($cm->id, $course->id, $strwebquestscorm), navmenu($course, $cm));
    } else {
        $navigation = build_navigation('', $cm);
        print_header($course->shortname . ':' . $strname, $course->fullname, $navigation, '', $meta, true, $button, navmenu($course, $cm));
    }
    print_heading(format_string($name, true));
    require_once "tabs.php";
}
 function print_header_and_tabs($cm, $course, $game, $reportmode = "overview", $meta = "")
 {
     global $CFG;
     /// Define some strings
     $strgames = get_string("modulenameplural", "game");
     $strgame = get_string("modulename", "game");
     /// Print the page header
     if (function_exists('build_navigation')) {
         $navigation = build_navigation('', $cm);
         print_header($course->shortname, $course->shortname, $navigation);
     } else {
         print_header_simple(format_string($game->name), "", "<a href=\"index.php?id={$course->id}\">{$strgames}</a>\n                      -> " . format_string($game->name), '', $meta, true, update_module_button($cm->id, $course->id, $strgame), navmenu($course, $cm));
     }
     /// Print the tabs
     $currenttab = 'reports';
     $mode = $reportmode;
     include 'tabs.php';
 }
Пример #14
0
 function print_header_and_tabs($cm, $course, $quiz, $reportmode = "overview")
 {
     global $CFG;
     /// Define some strings
     $strquizzes = get_string("modulenameplural", "quiz");
     $strquiz = get_string("modulename", "quiz");
     /// Print the page header
     $navigation = build_navigation('', $cm);
     print_header_simple(format_string($quiz->name), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
     /// Print the tabs
     $currenttab = 'reports';
     $mode = $reportmode;
     require $CFG->dirroot . '/mod/quiz/tabs.php';
     $course_context = get_context_instance(CONTEXT_COURSE, $course->id);
     if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
         echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">' . get_string('seeallcoursegrades', 'grades') . '</a></div>';
     }
 }
 function print_header($title, $morebreadcrumbs = NULL)
 {
     global $USER, $CFG, $WS;
     $this->init_full();
     if ($this->user_allowed_editing()) {
         $buttons = wiki_table_start('', true);
         $buttons .= update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', 'wiki'));
         if (!empty($CFG->showblocksonmodpages)) {
             $buttons .= wiki_change_column('', true);
             $prop = null;
             $prop->method = "get";
             $prop->action = "view.php";
             $prop->events = 'onsubmit="this.target=\'_top\'; return true"';
             $buttons .= wiki_form_start($prop, true);
             $buttons .= wiki_div_start('', true);
             $prop = null;
             $prop->name = "id";
             $prop->value = $this->modulerecord->id;
             $buttons .= wiki_input_hidden($prop, true);
             $prop = null;
             $prop->name = "edit";
             $prop->value = $this->user_is_editing() ? 'off' : 'on';
             $buttons .= wiki_input_hidden($prop, true);
             $prop = null;
             $prop->value = get_string($this->user_is_editing() ? 'blockseditoff' : 'blocksediton');
             $buttons .= wiki_input_submit($prop, true);
             $buttons .= wiki_div_end(true);
             $buttons .= wiki_form_end(true);
         }
         $buttons .= wiki_table_end('', true);
     } else {
         $buttons = '&nbsp;';
     }
     //        print_header($title, $this->courserecord->fullname, $crumbtext, '', '', true, $buttons, navmenu($this->courserecord, $this->modulerecord));
     /// Print header.
     $navlinks = array();
     $navlinks[] = array('name' => get_string('modulenameplural', 'wiki'), 'link' => $CFG->wwwroot . '/mod/wiki/index.php?id=' . $this->courserecord->id, 'type' => 'activity');
     $navlinks[] = array('name' => format_string($this->activityrecord->name), 'link' => "view.php", 'type' => 'activityinstance');
     $navigation = build_navigation($navlinks);
     print_header_simple(format_string($this->activityrecord->name), "", $navigation, "", "", true, $buttons, navmenu($this->courserecord, $WS->cm));
 }
Пример #16
0
 function print_header($title, $morebreadcrumbs = NULL)
 {
     global $USER, $CFG;
     $this->init_full();
     $replacements = array('%fullname%' => format_string($this->activityrecord->name));
     foreach ($replacements as $search => $replace) {
         $title = str_replace($search, $replace, $title);
     }
     if ($this->courserecord->id == SITEID) {
         $breadcrumbs = array();
     } else {
         $breadcrumbs = array($this->courserecord->shortname => $CFG->wwwroot . '/course/view.php?id=' . $this->courserecord->id);
     }
     $breadcrumbs[get_string('modulenameplural', "bigbluebutton")] = $CFG->wwwroot . '/mod/bigbluebutton/index.php?id=' . $this->courserecord->id;
     $breadcrumbs[format_string($this->activityrecord->name)] = $CFG->wwwroot . '/mod/bigbluebutton/view.php?id=' . $this->modulerecord->id;
     if (!empty($morebreadcrumbs)) {
         $breadcrumbs = array_merge($breadcrumbs, $morebreadcrumbs);
     }
     $total = count($breadcrumbs);
     $current = 1;
     $crumbtext = '';
     foreach ($breadcrumbs as $text => $href) {
         if ($current++ == $total) {
             $crumbtext .= ' ' . $text;
         } else {
             $crumbtext .= ' <a href="' . $href . '">' . $text . '</a> ->';
         }
     }
     if (empty($morebreadcrumbs) && $this->user_allowed_editing()) {
         $buttons = '<table><tr><td>' . update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', 'bigbluebutton')) . '</td>';
         if (!empty($CFG->showblocksonmodpages)) {
             $buttons .= '<td><form target="' . $CFG->framename . '" method="get" action="view.php">' . '<input type="hidden" name="id" value="' . $this->modulerecord->id . '" />' . '<input type="hidden" name="edit" value="' . ($this->user_is_editing() ? 'off' : 'on') . '" />' . '<input type="submit" value="' . get_string($this->user_is_editing() ? 'blockseditoff' : 'blocksediton') . '" /></form></td>';
         }
         $buttons .= '</tr></table>';
     } else {
         $buttons = '&nbsp;';
     }
     print_header($title, $this->courserecord->fullname, $crumbtext, '', '', true, $buttons, navmenu($this->courserecord, $this->modulerecord));
 }
Пример #17
0
            $cm->visible = 1;
            $cm->course = $course->id;
            $buttontext = "";
        }
    } else {
        error('Must specify a course module or a forum ID');
    }
}
if (!$buttontext) {
    $buttontext = forum_search_form($course, $search);
}
require_course_login($course, true, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
/// Print header.
$navigation = build_navigation('', $cm);
print_header_simple(format_string($forum->name), "", $navigation, "", "", true, $buttontext, user_login_string($course) . '<hr style="width:95%">' . navmenu($course, $cm));
/// Some capability checks.
if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities', $context)) {
    notice(get_string("activityiscurrentlyhidden"));
}
if (!has_capability('mod/forum:viewdiscussion', $context)) {
    notice(get_string('noviewdiscussionspermission', 'forum'));
}
/// find out current groups mode
groups_print_activity_menu($cm, 'view.php?id=' . $cm->id);
$currentgroup = groups_get_activity_group($cm);
$groupmode = groups_get_activity_groupmode($cm);
/// Okay, we can show the discussions. Log the forum view.
if ($cm->id) {
    add_to_log($course->id, "forum", "view forum", "view.php?id={$cm->id}", "{$forum->id}", $cm->id);
} else {
Пример #18
0
    /// course header
    $navlinks = array();
    if ($courseid != SITEID) {
        if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $course->id))) {
            $navlinks[] = array('name' => $strparticipants, 'link' => "{$CFG->wwwroot}/user/index.php?id={$course->id}", 'type' => 'misc');
        }
        $navlinks[] = array('name' => $fullname, 'link' => "{$CFG->wwwroot}/user/view.php?id={$userid}&amp;course={$courseid}", 'type' => 'misc');
        $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
        $navigation = build_navigation($navlinks);
        print_header("{$fullname}", "{$fullname}", $navigation, "", "", true, "&nbsp;", navmenu($course));
        /// site header
    } else {
        $navlinks[] = array('name' => $fullname, 'link' => "{$CFG->wwwroot}/user/view.php?id={$userid}&amp;course={$courseid}", 'type' => 'misc');
        $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
        $navigation = build_navigation($navlinks);
        print_header("{$course->fullname}: {$fullname}", $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
    }
    $showroles = 1;
    $currenttab = 'assign';
    include_once $CFG->dirroot . '/user/tabs.php';
} else {
    if ($context->contextlevel == CONTEXT_SYSTEM) {
        admin_externalpage_setup('assignroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
        admin_externalpage_print_header('');
    } else {
        if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID) {
            admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
            admin_externalpage_print_header('');
            $currenttab = 'assign';
            include_once 'tabs.php';
        } else {
Пример #19
0
        $firstscorm = current($scorms);
        if (!($course->format == 'scorm' && $firstscorm->id == $scorm->id)) {
            $navlinks[] = array('name' => $strscorms, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
        }
    }
}
$pagetitle = strip_tags($course->shortname . ': ' . format_string($scorm->name));
add_to_log($course->id, 'scorm', 'pre-view', 'view.php?id=' . $cm->id, "{$scorm->id}");
if (has_capability('mod/scorm:skipview', get_context_instance(CONTEXT_MODULE, $cm->id)) && scorm_simple_play($scorm, $USER)) {
    exit;
}
//
// Print the page header
//
$navlinks = array();
$navlinks[] = array('name' => format_string($scorm->name, true), 'link' => "view.php?id={$cm->id}", 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm));
if (has_capability('mod/scorm:viewreport', $context)) {
    $trackedusers = scorm_get_count_users($scorm->id, $cm->groupingid);
    if ($trackedusers > 0) {
        echo "<div class=\"reportlink\"><a {$CFG->frametarget} href=\"report.php?id={$cm->id}\"> " . get_string('viewalluserreports', 'scorm', $trackedusers) . '</a></div>';
    } else {
        echo '<div class="reportlink">' . get_string('noreports', 'scorm') . '</div>';
    }
}
// Print the main part of the page
print_heading(format_string($scorm->name));
print_box(format_text($scorm->summary), 'generalbox', 'intro');
scorm_view_display($USER, $scorm, 'view.php?id=' . $cm->id, $cm);
print_footer($course);
Пример #20
0
     // I would eleminate this, but I don't really know how Moodle security works. #geof#
     if ($course->category) {
         require_login($course->id);
     }
 }
 // Keep for debugging:
 //echo "<h2>Query</h2><pre>".$query->sql( 'a.id' )."</pre>";
 // Show header
 $sWwwroot = htmlspecialchars($CFG->wwwroot);
 $navtail = get_string('summary_title', ANNOTATION_STRINGS);
 $navmiddle = "";
 $meta = "<script language='JavaScript' type='text/javascript' src='marginalia/log.js'></script>\n" . "<script language='JavaScript' type='text/javascript' src='marginalia-config.js'></script>\n" . "<script language='JavaScript' type='text/javascript' src='marginalia/domutil.js'></script>\n" . "<script language='JavaScript' type='text/javascript' src='marginalia/prefs.js'></script>\n" . "<script language='JavaScript' type='text/javascript' src='marginalia/rest-prefs.js'></script>\n" . "<script language='JavaScript' type='text/javascript' src='marginalia/annotation.js'></script>\n" . "<script language='JavaScript' type='text/javascript' src='marginalia/rest-annotate.js'></script>\n" . "<script language='JavaScript' type='text/javascript' src='{$sWwwroot}/annotation/rest-prefs.js'></script>\n" . "<script language='JavaScript' type='text/javascript' src='summary.js'></script>\n" . "<script language='JavaScript' type='text/javascript'>\n" . "var annotationService = new RestAnnotationService('{$sWwwroot}/annotation/annotate.php');\n" . "window.annotationSummary = new AnnotationSummary(annotationService" . ", '{$sWwwroot}'" . ", '" . htmlspecialchars($USER->username) . "');\n" . "window.preferences = new Preferences( new RestPreferenceService('{$sWwwroot}/annotation/user-preference.php' ) );\n" . "</script>\n" . "<link rel='stylesheet' type='text/css' href='{$sWwwroot}/annotation/summary-styles.php'/>\n";
 if (null != $course && $course->category) {
     print_header("{$course->shortname}: " . get_string('summary_title', ANNOTATION_STRINGS), "{$course->fullname}", "<A HREF={$CFG->wwwroot}/course/view.php?id={$course->id}>{$course->shortname}</A> -> {$navtail}", "", $meta, true, "", navmenu($course));
 } elseif (null != $course) {
     print_header("{$course->shortname}: " . get_string('summary_title', ANNOTATION_STRINGS), "{$course->fullname}", "{$navtail}", "", $meta, true, "", navmenu($course));
 } else {
     print_header(get_string('summary_title', ANNOTATION_STRINGS), null, "{$navtail}", "", $meta, true, "", null);
 }
 // print search header
 //  * my annotations
 //  * shared annotations
 //  * instructor annotations
 //  * annotations of my work
 echo "<form id='annotation-search' method='get' action='summary.php'>\n";
 echo "<fieldset>\n";
 echo "<label for='search-of'>" . get_string('prompt_find', ANNOTATION_STRINGS) . "</label>\n";
 if (isguest()) {
     echo "<input type='hidden' name='search_of' id='search_of' value='' />\n";
     echo get_string('search_of_all', ANNOTATION_STRINGS) . ' ';
 } else {
Пример #21
0
    } else {
        print_error('nofieldindatabase', 'data');
    }
}
// populate objets for this databases fields
$fields = array();
foreach ($fieldrecords as $fieldrecord) {
    $fields[] = data_get_field($fieldrecord, $data);
}
$mform = new mod_data_export_form('export.php?d=' . $data->id, $fields, $cm);
if ($mform->is_cancelled()) {
    redirect('view.php?d=' . $data->id);
} elseif (!($formdata = (array) $mform->get_data())) {
    // build header to match the rest of the UI
    $nav = build_navigation('', $cm);
    print_header_simple($data->name, '', $nav, '', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')), navmenu($course, $cm), '', '');
    echo $OUTPUT->heading(format_string($data->name));
    // these are for the tab display
    $currentgroup = groups_get_activity_group($cm);
    $groupmode = groups_get_activity_groupmode($cm);
    $currenttab = 'export';
    include 'tabs.php';
    $mform->display();
    echo $OUTPUT->footer();
    die;
}
if (array_key_exists('portfolio', $formdata) && !empty($formdata['portfolio'])) {
    // fake  portfolio callback stuff and redirect
    $formdata['id'] = $cm->id;
    $formdata['exporttype'] = 'csv';
    // force for now
Пример #22
0
} elseif ($data = $editform->get_data()) {
    if ($data->id) {
        if (!groups_update_group($data, $editform->_upload_manager)) {
            error('Error updating group');
        }
    } else {
        if (!($id = groups_create_group($data, $editform->_upload_manager))) {
            error('Error creating group');
        }
        $returnurl = $CFG->wwwroot . '/group/index.php?id=' . $course->id . '&amp;group=' . $id;
    }
    redirect($returnurl);
}
$strgroups = get_string('groups');
$strparticipants = get_string('participants');
if ($id) {
    $strheading = get_string('editgroupsettings', 'group');
} else {
    $strheading = get_string('creategroup', 'group');
}
$navlinks = array(array('name' => $strparticipants, 'link' => $CFG->wwwroot . '/user/index.php?id=' . $courseid, 'type' => 'misc'), array('name' => $strgroups, 'link' => $CFG->wwwroot . '/group/index.php?id=' . $courseid, 'type' => 'misc'), array('name' => $strheading, 'link' => '', 'type' => 'misc'));
$navigation = build_navigation($navlinks);
/// Print header
print_header_simple($strgroups, ': ' . $strgroups, $navigation, '', '', true, '', user_login_string($course) . '<hr style="width:95%">' . navmenu($course));
echo '<div id="grouppicture">';
if ($id) {
    print_group_picture($group, $course->id);
}
echo '</div>';
$editform->display();
print_footer($course);
/**
 * Print the standard header for pagemenu module
 *
 * @uses $CFG
 * @uses $USER tabs.php requires it
 * @param object $cm Course module record object
 * @param object $course Couse record object
 * @param object $pagemenu pagemenu module record object
 * @param string $currenttab File location and tab to be selected
 * @param string $focus Focus
 * @param boolean $showtabs Display tabs yes/no
 * @return void
 **/
function pagemenu_print_header($cm, $course, $pagemenu, $currenttab = 'view', $focus = '', $showtabs = true)
{
    global $CFG, $USER;
    $strpagemenus = get_string('modulenameplural', 'pagemenu');
    $strpagemenu = get_string('modulename', 'pagemenu');
    $strname = format_string($pagemenu->name);
    /// Log it!
    add_to_log($course->id, 'pagemenu', $currenttab, "{$currenttab}.php?id={$cm->id}", $strname, $cm->id);
    /// Print header, heading, tabs and messages
    print_header_simple($strname, $strname, build_navigation('', $cm), $focus, '', true, update_module_button($cm->id, $course->id, $strpagemenu), navmenu($course, $cm));
    print_heading($strname);
    if ($showtabs) {
        pagemenu_print_tabs($cm, $currenttab);
    }
    pagemenu_print_messages();
}
Пример #24
0
        if (!$ineditperiod || $USER->id != $fromdb->userid and !has_capability('mod/glossary:manageentries', $context)) {
            if ($USER->id != $fromdb->userid) {
                print_error('errcannoteditothers', 'glossary');
            } elseif (!$ineditperiod) {
                print_error('erredittimeexpired', 'glossary');
            }
            die;
        }
        if ($aliases = get_records_menu("glossary_alias", "entryid", $e, '', 'id, alias')) {
            $toform->aliases = implode("\n", $aliases) . "\n";
        }
        $mform->set_data($toform);
    }
}
$stredit = empty($e) ? get_string('addentry', 'glossary') : get_string("edit");
$navigation = build_navigation($stredit, $cm);
print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, "", navmenu($course, $cm));
print_heading(format_string($glossary->name));
/// Info box
///if ( $glossary->intro ) {
///    print_simple_box(format_text($glossary->intro), 'center', '70%', '', 5, 'generalbox', 'intro');
///}
/// Tabbed browsing sections
///$tab = GLOSSARY_ADDENTRY_VIEW;
///include("tabs.php");
if (!$e) {
    require_capability('mod/glossary:write', $context);
}
$mform->display();
///glossary_print_tabbed_table_end();
print_footer($course);
$currentgroup = groups_get_activity_group($cm, true);
if (empty($currentgroup)) {
    $currentgroup = 0;
}
if (empty($elluminate->meetingid) && $elluminate->groupmode != 0) {
    elluminate_group_instance_check($elluminate, $cm->id);
}
$baseurl = $CFG->wwwroot . '/mod/elluminate/preload.php?id=' . $elluminate->id;
/// Print the page header
$strelluminates = get_string('modulenameplural', 'elluminate');
$strelluminate = get_string('modulename', 'elluminate');
$straddpreload = get_string('addpreload', 'elluminate');
$strdelpreload = get_string('deletewhiteboardpreload', 'elluminate');
$buttontext = update_module_button($cm->id, $course->id, $strelluminate);
$navigation = build_navigation(empty($delete) ? $straddpreload : $strdelpreload, $cm);
print_header_simple(format_string($elluminate->name), '', $navigation, '', '', true, $buttontext, navmenu($course, $cm));
/// Delete a preload file for this meeting.
if (!empty($delete)) {
    if (!empty($elluminate->meetingid)) {
        if ($preload = elluminate_list_meeting_preloads($elluminate->meetingid)) {
            if ($preload->presentationid == $delete) {
                /// Delete the preload from the meeting.
                if (!elluminate_delete_preload($preload->presentationid, $elluminate->meetingid)) {
                    error(get_string('preloaddeleteerror', 'elluminate'));
                }
                redirect($CFG->wwwroot . '/mod/elluminate/view.php?id=' . $cm->id, get_string('preloaddeletesuccess', 'elluminate'), 5);
            }
        }
    }
}
if (($data = data_submitted($CFG->wwwroot . '/mod/elluminate/preload.php')) && confirm_sesskey()) {
Пример #26
0
            continue;
        }
        $note->id = 0;
        $note->userid = $v;
        if (note_save($note)) {
            add_to_log($note->courseid, 'notes', 'add', 'index.php?course=' . $note->courseid . '&amp;user='******'#note-' . $note->id, 'add note');
        }
    }
    redirect("{$CFG->wwwroot}/user/index.php?id={$id}");
}
/// Print headers
$straddnote = get_string('groupaddnewnote', 'notes');
$navlinks = array();
$navlinks[] = array('name' => $straddnote, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("{$course->shortname}: " . get_string('extendenrol'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
// this will contain all available the based On select options, but we'll disable some on them on a per user basis
print_heading($straddnote);
echo '<form method="post" action="groupaddnote.php" >';
echo '<div style="width:100%;text-align:center;">';
echo '<input type="hidden" name="id" value="' . $course->id . '" />';
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
$state_names = note_get_state_names();
// the first time list hack
if (empty($users)) {
    foreach ($_POST as $k => $v) {
        if (preg_match('/^user(\\d+)$/', $k, $m)) {
            $users[] = $m[1];
        }
    }
}
Пример #27
0
}
/// First create the form
$editform = new key_form();
$editform->set_data($key);
if ($editform->is_cancelled()) {
    redirect($returnurl);
} elseif ($data = $editform->get_data()) {
    if ($data->id) {
        $record = new object();
        $record->id = $data->id;
        $record->iprestriction = $data->iprestriction;
        $record->validuntil = $data->validuntil;
        update_record('user_private_key', $record);
    } else {
        create_user_key('grade/export', $USER->id, $course->id, $data->iprestriction, $data->validuntil);
    }
    redirect($returnurl);
}
$strkeys = get_string('userkeys', 'userkey');
$strgrades = get_string('grades');
if ($id) {
    $strheading = get_string('edituserkey', 'userkey');
} else {
    $strheading = get_string('createuserkey', 'userkey');
}
$navlinks = array(array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id=' . $courseid, 'type' => 'misc'), array('name' => $strkeys, 'link' => $CFG->wwwroot . '/grade/export/keymanager.php?id=' . $courseid, 'type' => 'misc'), array('name' => $strheading, 'link' => '', 'type' => 'misc'));
$navigation = build_navigation($navlinks);
/// Print header
print_header_simple($strkeys, ': ' . $strkeys, $navigation, '', '', true, '', navmenu($course));
$editform->display();
print_footer($course);
Пример #28
0
/// processing posted grades & feedback here
if ($data = data_submitted() and confirm_sesskey() and has_capability('moodle/grade:edit', $context)) {
    $warnings = $report->process_data($data);
} else {
    $warnings = array();
}
// Override perpage if set in URL
if ($perpageurl) {
    $report->user_prefs['studentsperpage'] = $perpageurl;
}
// final grades MUST be loaded after the processing
$report->load_users();
$numusers = $report->get_numusers();
$report->load_final_grades();
/// Print header
print_header_simple($strgrades . ': ' . $reportname, ': ' . $strgrades, $navigation, '', '', true, $buttons, navmenu($course));
/// Print the plugin selector at the top
print_grade_plugin_selector($courseid, 'report', 'grader');
// Add tabs
$currenttab = 'graderreport';
require 'tabs.php';
echo $report->group_selector;
echo '<div class="clearer"></div>';
echo $report->get_toggles_html();
//show warnings if any
foreach ($warnings as $warning) {
    notify($warning);
}
$studentsperpage = $report->get_pref('studentsperpage');
// Don't use paging if studentsperpage is empty or 0 at course AND site levels
if (!empty($studentsperpage)) {
Пример #29
0
            //delete responses.
            redirect("view.php?id={$cm->id}");
        }
    }
    $answer = optional_param('answer', '', PARAM_INT);
    if (empty($answer)) {
        redirect("view.php?id={$cm->id}", get_string('mustchooseone', 'choice'));
    } else {
        choice_user_submit_response($answer, $choice, $USER->id, $course->id, $cm);
    }
    redirect("view.php?id={$cm->id}");
    exit;
}
/// Display the choice and possibly results
$navigation = build_navigation('', $cm);
print_header_simple(format_string($choice->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
add_to_log($course->id, "choice", "view", "view.php?id={$cm->id}", $choice->id, $cm->id);
/// Check to see if groups are being used in this choice
$groupmode = groups_get_activity_groupmode($cm);
groups_get_activity_group($cm, true);
groups_print_activity_menu($cm, 'view.php?id=' . $id);
if (has_capability('mod/choice:readresponses', $context)) {
    choice_show_reportlink($choice, $course->id, $cm, $groupmode);
}
echo '<div class="clearer"></div>';
if ($choice->text) {
    print_box(format_text($choice->text, $choice->format), 'generalbox', 'intro');
}
//if user has already made a selection, and they are not allowed to update it, show their selected answer.
if (!empty($USER->id) && ($current = get_record('choice_answers', 'choiceid', $choice->id, 'userid', $USER->id)) && empty($choice->allowupdate)) {
    print_simple_box(get_string("yourselection", "choice", userdate($choice->timeopen)) . ": " . format_string(choice_get_option_text($choice, $current->optionid)), "center");
Пример #30
0
    } else {
        error("courseid is not correct");
    }
}
if (!$capabilities->complete) {
    error(get_string('error'));
}
/// Print the page header
$strfeedbacks = get_string("modulenameplural", "feedback");
$strfeedback = get_string("modulename", "feedback");
$buttontext = update_module_button($cm->id, $course->id, $strfeedback);
$navlinks = array();
$navlinks[] = array('name' => $strfeedbacks, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
$navlinks[] = array('name' => format_string($feedback->name), 'link' => "", 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($feedback->name), "", $navigation, "", "", true, $buttontext, navmenu($course, $cm));
//ishidden check.
//feedback in courses
if (empty($cm->visible) and !$capabilities->viewhiddenactivities and $course->id != SITEID) {
    notice(get_string("activityiscurrentlyhidden"));
}
//ishidden check.
//feedback on mainsite
if (empty($cm->visible) and !$capabilities->viewhiddenactivities and $courseid == SITEID) {
    notice(get_string("activityiscurrentlyhidden"));
}
feedback_print_errors();
//check, if the feedback is open (timeopen, timeclose)
$checktime = time();
if ($feedback->timeopen > $checktime or $feedback->timeclose < $checktime and $feedback->timeclose > 0) {
    // print_simple_box_start('center');