Skip to content
Snippets Groups Projects
Select Git revision
  • c0aa632e166f1637177238b26dda3ef46dbc2c93
  • master default protected
  • pymilter-1.0.4
  • pymilter-1.0.3
  • pymilter-1.0.2
  • pymilter-1.0.1
  • pymilter-1_0
  • milter-0_8_18
  • pymilter-0_9_8
  • pymilter-0_9_7
  • pymilter-0_9_6
  • pymilter-0_9_5
  • pymilter-0_9_4
  • pymilter-0_9_2
  • pymilter-0_9_1
  • pymilter-0_9_0
  • pymilter-0_8_12
  • pymilter-0_8_11
  • pymilter-0_8_10
  • pymilter-0_8_9
  • milter-0_8_8
  • milter-0_8_7
22 results

strike3.txt

Blame
  • locallib.php 73.92 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)
     * @author    Rabea de Groot, Anna Heynkes, Friederike Schwager
     * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     */
    
    use mod_pdfannotator\output\answermenu;
    use mod_pdfannotator\output\questionmenu;
    use mod_pdfannotator\output\reportmenu;
    use mod_pdfannotator\output\index;
    
    defined('MOODLE_INTERNAL') || die;
    
    require_once("$CFG->libdir/filelib.php");
    require_once("$CFG->libdir/resourcelib.php");
    require_once("$CFG->dirroot/mod/pdfannotator/lib.php");
    
    /**
     * Display embedded pdfannotator file.
     * @param object $pdfannotator
     * @param object $cm
     * @param object $course
     * @param stored_file $file main file
     * @return does not return
     */
    function pdfannotator_display_embed($pdfannotator, $cm, $course, $file, $page = 1, $annoid = null, $commid = null) {
        global $CFG, $PAGE, $OUTPUT, $USER;
    
        // The revision attribute's existance is demanded by moodle for versioning and could be saved in the pdfannotator table in the future.
        // Note, however, that we forbid file replacement in order to prevent a change of meaning in other people's comments.
        $pdfannotator->revision = 1;
    
        $context = context_module::instance($cm->id);
        $path = '/' . $context->id . '/mod_pdfannotator/content/' . $pdfannotator->revision . $file->get_filepath() . $file->get_filename();
        $fullurl = file_encode_url($CFG->wwwroot . '/pluginfile.php', $path, false);
    
        $documentobject = new stdClass();
        $documentobject->annotatorid = $pdfannotator->id;
        $documentobject->fullurl = $fullurl;
    
        $stringman = get_string_manager();
        // With this method you get the strings of the language-Files.
        $strings = $stringman->load_component_strings('pdfannotator', 'en');
        // Method to use the language-strings in javascript.
        $PAGE->requires->strings_for_js(array_keys($strings), 'pdfannotator');
        // Load and execute the javascript files.
        $PAGE->requires->js(new moodle_url("/mod/pdfannotator/shared/pdf.js?ver=00002"));
        $PAGE->requires->js(new moodle_url("/mod/pdfannotator/shared/textclipper.js"));
        $PAGE->requires->js(new moodle_url("/mod/pdfannotator/shared/index.js?ver=00020"));
        $PAGE->requires->js(new moodle_url("/mod/pdfannotator/shared/locallib.js?ver=00004"));
    
        // Pass parameters from PHP to JavaScript.
    
        // 1. Toolbar settings.