Skip to content
Snippets Groups Projects
Select Git revision
  • 09da84a0f86517f7dd7e440d29c512c7305399b6
  • master default
  • fix-remote-url_v4.9.1
  • fix-remote-url_v4.8.3
  • fix-remote-url_v4.8.x
  • fix-remote-url_v4.7.x
  • fix-remote-url_v4.6.0
  • fix-remote-urls
8 results

renderer.php

Blame
  • controller.php 20.27 KiB
    <?php
    // This file is part of Moodle - http://moodle.org/
    //
    // Moodle is free software: you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    // the Free Software Foundation, either version 3 of the License, or
    // (at your option) any later version.
    //
    // Moodle is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
    //
    // You should have received a copy of the GNU General Public License
    // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
    
    /**
     * @package   mod_pdfannotator
     * @copyright 2018 RWTH Aachen (see README.md)
     * @authors   Anna Heynkes, Friederike Schwager
     * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     */
    defined('MOODLE_INTERNAL') || die();
    
    $action = optional_param('action', 'view', PARAM_ALPHA); // The default action is 'view'.
    
    $taburl = new moodle_url('/mod/pdfannotator/view.php', array('id' => $id));
    
    $myrenderer = $PAGE->get_renderer('mod_pdfannotator');
    
    /* *********************************************** Display overview page *********************************************** */
    
    if ($action === 'overview') {
        // Go to question-overview by default.
        $action = 'overviewquestions';
    }
    /*
     * This section prints a subpage of overview called 'unsolved questions'.
     */
    if ($action === 'overviewquestions') {
    
        global $OUTPUT, $CFG;
    
        require_once($CFG->libdir . '/tablelib.php');
        require_once($CFG->dirroot . '/mod/pdfannotator/locallib.php');
    
    
        $currentpage = optional_param('page', 0, PARAM_INT);
        $itemsperpage = optional_param('itemsperpage', 5, PARAM_INT);
        $questionfilter = optional_param('questionfilter', 0, PARAM_INT); // Default 0 means: Display only unsolved/open questions.
    
        $thisannotator = $pdfannotator->id;
        $thiscourse = $pdfannotator->course;
        $cmid = get_coursemodule_from_instance('pdfannotator', $thisannotator, $thiscourse, false, MUST_EXIST)->id;
    
        pdfannotator_prepare_overviewpage($id, $myrenderer, $taburl, ['tab' => 'overview', 'action' => $action], $pdfannotator, $context);
        echo $OUTPUT->heading(get_string('questionstab', 'pdfannotator') . ' ' . $OUTPUT->help_icon('questionstabicon', 'mod_pdfannotator')) . " <span id='pdfannotator-filter'></span>";
    
        $questions = pdfannotator_get_questions($thiscourse, $context, $questionfilter);
    
        if (empty($questions)) {
            if ($questionfilter == 1) {
                $info = get_string('noquestionsclosed_overview', 'pdfannotator');
            } else if ($questionfilter == 2) {
                $info = get_string('noquestions_overview', 'pdfannotator');
            } else {
                $info = get_string('noquestionsopen_overview', 'pdfannotator');
            }
            echo "<span class='notification'><div class='alert alert-info alert-block fade in' role='alert'>$info</div></span>";
        } else {