Gå til hovedindhold
Whoops! There was an error.
Error
Undefined constant "FEATURE_COMPLETION_TRACKS_STATE" Error thrown with message "Undefined constant "FEATURE_COMPLETION_TRACKS_STATE"" Stacktrace: #21 Error in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/mod/coursebooking/lib.php:153 #20 coursebooking_supports in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/moodlelib.php:7651 #19 plugin_supports in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/modinfolib.php:2456 #18 cm_info:__construct in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/modinfolib.php:661 #17 course_modinfo:__construct in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/modinfolib.php:553 #16 course_modinfo:instance in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/modinfolib.php:2803 #15 get_fast_modinfo in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/activitynames/classes/text_filter.php:95 #14 filter_activitynames\text_filter:get_activity_list in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/activitynames/classes/text_filter.php:79 #13 filter_activitynames\text_filter:get_cached_activity_list in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/activitynames/classes/text_filter.php:43 #12 filter_activitynames\text_filter:filter in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/classes/text_filter.php:116 #11 core_filters\text_filter:filter_stage_post_clean in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/classes/filter_manager.php:185 #10 core_filters\filter_manager:apply_filter_chain in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/classes/filter_manager.php:231 #9 core_filters\filter_manager:filter_text in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/classes/formatting.php:277 #8 core\formatting:format_text in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/weblib.php:617 #7 format_text in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/course/renderer.php:2030 #6 coursecat_helper:get_course_formatted_summary in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/theme/space/classes/util/course.php:134 #5 theme_space\util\course:get_summary in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/theme/space/classes/output/core/course_renderer.php:374 #4 theme_space\output\core\course_renderer:coursecat_coursebox_content in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/theme/space/classes/output/core/course_renderer.php:424 #3 theme_space\output\core\course_renderer:coursecat_coursebox in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/theme/space/classes/output/core/course_renderer.php:202 #2 theme_space\output\core\course_renderer:coursecat_courses in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/course/renderer.php:1444 #1 core_course_renderer:frontpage_available_courses in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/course/renderer.php:1723 #0 core_course_renderer:frontpage in /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/index.php:141
Stack frames (22)
21
Error
/mod/coursebooking/lib.php153
20
coursebooking_supports
/lib/moodlelib.php7651
19
plugin_supports
/lib/modinfolib.php2456
18
cm_info __construct
/lib/modinfolib.php661
17
course_modinfo __construct
/lib/modinfolib.php553
16
course_modinfo instance
/lib/modinfolib.php2803
15
get_fast_modinfo
/filter/activitynames/classes/text_filter.php95
14
filter_activitynames\text_filter get_activity_list
/filter/activitynames/classes/text_filter.php79
13
filter_activitynames\text_filter get_cached_activity_list
/filter/activitynames/classes/text_filter.php43
12
filter_activitynames\text_filter filter
/filter/classes/text_filter.php116
11
core_filters\text_filter filter_stage_post_clean
/filter/classes/filter_manager.php185
10
core_filters\filter_manager apply_filter_chain
/filter/classes/filter_manager.php231
9
core_filters\filter_manager filter_text
/lib/classes/formatting.php277
8
core\formatting format_text
/lib/weblib.php617
7
format_text
/course/renderer.php2030
6
coursecat_helper get_course_formatted_summary
/theme/space/classes/util/course.php134
5
theme_space\util\course get_summary
/theme/space/classes/output/core/course_renderer.php374
4
theme_space\output\core\course_renderer coursecat_coursebox_content
/theme/space/classes/output/core/course_renderer.php424
3
theme_space\output\core\course_renderer coursecat_coursebox
/theme/space/classes/output/core/course_renderer.php202
2
theme_space\output\core\course_renderer coursecat_courses
/course/renderer.php1444
1
core_course_renderer frontpage_available_courses
/course/renderer.php1723
0
core_course_renderer frontpage
/index.php141
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/mod/coursebooking/lib.php
 
    // Delete the instance itself.
    $DB->delete_records('coursebooking', ['id' => $id]);
 
    return true;
}
 
/**
 * Supported features for this module.
 *
 * @param  string $feature  FEATURE_xx constant for requested feature.
 * @return mixed  True if supported, null if unknown.
 */
function coursebooking_supports(string $feature): ?bool {
    switch ($feature) {
        case FEATURE_MOD_INTRO:
            return true;
        case FEATURE_SHOW_DESCRIPTION:
            return true;
        case FEATURE_COMPLETION_TRACKS_STATE:
            return true;
        case FEATURE_COMPLETION_HAS_RULES:
            return true;
        case FEATURE_BACKUP_MOODLE2:
            return true;
        case FEATURE_GROUPS:
            return false;
        case FEATURE_GROUPINGS:
            return false;
        default:
            return null;
    }
}
 
// ============================================================================
// Navigation callbacks.
// ============================================================================
 
/**
 * Extend module navigation with secondary tabs.
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/moodlelib.php
            $function = $component.'_supports';
            if (!function_exists($function)) {
                // Legacy non-frankenstyle function name.
                $function = $name.'_supports';
            }
        }
 
    } else {
        if (!$path = core_component::get_plugin_directory($type, $name)) {
            // Non existent plugin type.
            return false;
        }
        if (file_exists("$path/lib.php")) {
            include_once("$path/lib.php");
            $function = $component.'_supports';
        }
    }
 
    if ($function and function_exists($function)) {
        $supports = $function($feature);
        if (is_null($supports)) {
            // Plugin does not know - use default.
            return $default;
        } else {
            return $supports;
        }
    }
 
    // Plugin does not care, so use default.
    return $default;
}
 
/**
 * Returns true if the current version of PHP is greater that the specified one.
 *
 * @todo Check PHP version being required here is it too low?
 *
 * @param string $version The version of php being tested.
 * @return bool
 */
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/modinfolib.php
        // are actually disabled
        $this->completion = isset($mod->completion) ? $mod->completion : 0;
        $this->completionpassgrade = isset($mod->completionpassgrade) ? $mod->completionpassgrade : 0;
        $this->completiongradeitemnumber = isset($mod->completiongradeitemnumber)
                ? $mod->completiongradeitemnumber : null;
        $this->completionview = isset($mod->completionview)
                ? $mod->completionview : 0;
        $this->completionexpected = isset($mod->completionexpected)
                ? $mod->completionexpected : 0;
        $this->availability = isset($mod->availability) ? $mod->availability : null;
        $this->conditionscompletion = isset($mod->conditionscompletion)
                ? $mod->conditionscompletion : array();
        $this->conditionsgrade = isset($mod->conditionsgrade)
                ? $mod->conditionsgrade : array();
        $this->conditionsfield = isset($mod->conditionsfield)
                ? $mod->conditionsfield : array();
 
        static $modviews = array();
        if (!isset($modviews[$this->modname])) {
            $modviews[$this->modname] = !plugin_supports('mod', $this->modname,
                    FEATURE_NO_VIEW_LINK);
        }
        $this->url = $modviews[$this->modname]
                ? new moodle_url('/mod/' . $this->modname . '/view.php', array('id'=>$this->id))
                : null;
    }
 
    /**
     * Creates a cm_info object from a database record (also accepts cm_info
     * in which case it is just returned unchanged).
     *
     * @param stdClass|cm_info|null|bool $cm Stdclass or cm_info (or null or false)
     * @param int $userid Optional userid (default to current)
     * @return cm_info|null Object as cm_info, or null if input was null/false
     */
    public static function create($cm, $userid = 0) {
        // Null, false, etc. gets passed through as null.
        if (!$cm) {
            return null;
        }
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/modinfolib.php
        }
 
        // Loop through each piece of module data, constructing it
        static $modexists = array();
        foreach ($coursemodinfo->modinfo as $mod) {
            if (!isset($mod->name) || strval($mod->name) === '') {
                // something is wrong here
                continue;
            }
 
            // Skip modules which don't exist
            if (!array_key_exists($mod->mod, $modexists)) {
                $modexists[$mod->mod] = file_exists("$CFG->dirroot/mod/$mod->mod/lib.php");
            }
            if (!$modexists[$mod->mod]) {
                continue;
            }
 
            // Construct info for this module
            $cm = new cm_info($this, null, $mod, null);
 
            // Store module in instances and cms array
            if (!isset($this->instances[$cm->modname])) {
                $this->instances[$cm->modname] = array();
            }
            $this->instances[$cm->modname][$cm->instance] = $cm;
            $this->cms[$cm->id] = $cm;
 
            // Reconstruct sections. This works because modules are stored in order
            if (!isset($this->sectionmodules[$cm->sectionnum])) {
                $this->sectionmodules[$cm->sectionnum] = [];
            }
            $this->sectionmodules[$cm->sectionnum][] = $cm->id;
        }
 
        // Expand section objects
        $this->sectioninfobynum = [];
        $this->sectioninfobyid = [];
        $this->delegatedsections = [];
        foreach ($coursemodinfo->sectioncache as $data) {
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/modinfolib.php
        } else {
            $course = (object)array('id' => $courseorid);
        }
        if (empty($userid)) {
            $userid = $USER->id;
        }
 
        if (!empty(self::$instancecache[$course->id])) {
            if (self::$instancecache[$course->id]->userid == $userid &&
                    (!isset($course->cacherev) ||
                    $course->cacherev == self::$instancecache[$course->id]->get_course()->cacherev)) {
                // This course's modinfo for the same user was recently retrieved, return cached.
                self::$cacheaccessed[$course->id] = microtime(true);
                return self::$instancecache[$course->id];
            } else {
                // Prevent potential reference problems when switching users.
                self::clear_instance_cache($course->id);
            }
        }
        $modinfo = new course_modinfo($course, $userid);
 
        // We have a limit of MAX_MODINFO_CACHE_SIZE entries to store in static variable.
        if (count(self::$instancecache) >= MAX_MODINFO_CACHE_SIZE) {
            // Find the course that was the least recently accessed.
            asort(self::$cacheaccessed, SORT_NUMERIC);
            $courseidtoremove = key(array_reverse(self::$cacheaccessed, true));
            self::clear_instance_cache($courseidtoremove);
        }
 
        // Add modinfo to the static cache.
        self::$instancecache[$course->id] = $modinfo;
        self::$cacheaccessed[$course->id] = microtime(true);
 
        return $modinfo;
    }
 
    /**
     * Constructs based on course.
     * Note: This constructor should not usually be called directly.
     * Use get_fast_modinfo($course) instead as this maintains a cache.
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/modinfolib.php
    // compartibility with syntax prior to 2.4:
    if ($courseorid === 'reset') {
        debugging("Using the string 'reset' as the first argument of get_fast_modinfo() is deprecated. Use get_fast_modinfo(0,0,true) instead.", DEBUG_DEVELOPER);
        $courseorid = 0;
        $resetonly = true;
    }
 
    // Function get_fast_modinfo() can never be called during upgrade unless it is used for clearing cache only.
    if (!$resetonly) {
        upgrade_ensure_not_running();
    }
 
    // Function is called with $reset = true
    if ($resetonly) {
        course_modinfo::clear_instance_cache($courseorid);
        return null;
    }
 
    // Function is called with $reset = false, retrieve modinfo
    return course_modinfo::instance($courseorid, $userid);
}
 
/**
 * Efficiently retrieves the $course (stdclass) and $cm (cm_info) objects, given
 * a cmid. If module name is also provided, it will ensure the cm is of that type.
 *
 * Usage:
 * list($course, $cm) = get_course_and_cm_from_cmid($cmid, 'forum');
 *
 * Using this method has a performance advantage because it works by loading
 * modinfo for the course - which will then be cached and it is needed later
 * in most requests. It also guarantees that the $cm object is a cm_info and
 * not a stdclass.
 *
 * The $course object can be supplied if already known and will speed
 * up this function - although it is more efficient to use this function to
 * get the course if you are starting from a cmid.
 *
 * To avoid security problems and obscure bugs, you should always specify
 * $modulename if the cmid value came from user input.
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/activitynames/classes/text_filter.php
        }
 
        // Not cached yet, get activity list and set cache.
        $activitylist = $this->get_activity_list($courseid);
        $cached->set('cacheuserid', $USER->id);
        $cached->set('cachecourseid', $courseid);
        $cached->set('activitylist', $activitylist);
        return $activitylist;
    }
 
    /**
     * Get all the activity list for a course
     *
     * @param int $courseid id of the course
     * @return filterobject[] the activities
     */
    protected function get_activity_list($courseid) {
        $activitylist = [];
 
        $modinfo = get_fast_modinfo($courseid);
        if (!empty($modinfo->cms)) {
            $activitylist = []; // We will store all the created filters here.
 
            // Create array of visible activities sorted by the name length (we are only interested in properties name and url).
            $sortedactivities = [];
            foreach ($modinfo->cms as $cm) {
                // Use normal access control and visibility, but exclude labels and hidden activities.
                if ($cm->visible && $cm->has_view() && $cm->uservisible) {
                    $sortedactivities[] = (object)[
                        'name' => $cm->name,
                        'url' => $cm->url,
                        'id' => $cm->id,
                        'namelen' => -strlen($cm->name), // Negative value for reverse sorting.
                    ];
                }
            }
            // Sort activities by the length of the activity name in reverse order.
            core_collator::asort_objects_by_property($sortedactivities, 'namelen', core_collator::SORT_NUMERIC);
 
            foreach ($sortedactivities as $cm) {
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/activitynames/classes/text_filter.php
        }
    }
 
    /**
     * Get all the cached activity list for a course
     *
     * @param int $courseid id of the course
     * @return filterobject[] the activities
     */
    protected function get_cached_activity_list($courseid) {
        global $USER;
        $cached = cache::make_from_params(cache_store::MODE_REQUEST, 'filter', 'activitynames');
 
        // Return cached activity list.
        if ($cached->get('cachecourseid') == $courseid && $cached->get('cacheuserid') == $USER->id) {
            return $cached->get('activitylist');
        }
 
        // Not cached yet, get activity list and set cache.
        $activitylist = $this->get_activity_list($courseid);
        $cached->set('cacheuserid', $USER->id);
        $cached->set('cachecourseid', $courseid);
        $cached->set('activitylist', $activitylist);
        return $activitylist;
    }
 
    /**
     * Get all the activity list for a course
     *
     * @param int $courseid id of the course
     * @return filterobject[] the activities
     */
    protected function get_activity_list($courseid) {
        $activitylist = [];
 
        $modinfo = get_fast_modinfo($courseid);
        if (!empty($modinfo->cms)) {
            $activitylist = []; // We will store all the created filters here.
 
            // Create array of visible activities sorted by the name length (we are only interested in properties name and url).
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/activitynames/classes/text_filter.php
 
/**
 * This filter provides automatic linking to
 * activities when its name (title) is found inside every Moodle text
 *
 * @package    filter_activitynames
 * @subpackage activitynames
 * @copyright  2004 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class text_filter extends \core_filters\text_filter {
    #[\Override]
    public function filter($text, array $options = []) {
        $coursectx = $this->context->get_course_context(false);
        if (!$coursectx) {
            return $text;
        }
        $courseid = $coursectx->instanceid;
 
        $activitylist = $this->get_cached_activity_list($courseid);
 
        $filterslist = [];
        if (!empty($activitylist)) {
            $cmid = $this->context->instanceid;
            if ($this->context->contextlevel == CONTEXT_MODULE && isset($activitylist[$cmid])) {
                // Remove filterobjects for the current module.
                $filterslist = array_values(array_diff_key($activitylist, [$cmid => 1, $cmid . '-e' => 1]));
            } else {
                $filterslist = array_values($activitylist);
            }
        }
 
        if ($filterslist) {
            return $text = filter_phrases($text, $filterslist);
        } else {
            return $text;
        }
    }
 
    /**
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/classes/text_filter.php
     * @param array $options
     * @return string
     */
    public function filter_stage_pre_clean(string $text, array $options): string {
        // NOTE: override if necessary.
        return $text;
    }
 
    /**
     * Filter HTML text at the very end after text is sanitised.
     *
     * NOTE: this is called even if $options['noclean'] is true and text is not cleaned.
     *
     * @param string $text
     * @param array $options
     * @return string
     */
    public function filter_stage_post_clean(string $text, array $options): string {
        // NOTE: override if necessary.
        return $this->filter($text, $options);
    }
 
    /**
     * Filter simple text coming from format_string().
     *
     * Note that unless $CFG->formatstringstriptags is disabled
     * HTML tags are not expected in returned value.
     *
     * @param string $text
     * @param array $options
     * @return string
     */
    public function filter_stage_string(string $text, array $options): string {
        // NOTE: override if necessary.
        return $this->filter($text, $options);
    }
}
 
// Alias this class to the old name.
// This file will be autoloaded by the legacyclasses autoload system.
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/classes/filter_manager.php
        array $options = [],
        ?array $skipfilters = null
    ) {
        if (!isset($options['stage'])) {
            $filtermethod = 'filter';
        } else if (in_array($options['stage'], ['pre_format', 'pre_clean', 'post_clean', 'string'], true)) {
            $filtermethod = 'filter_stage_' . $options['stage'];
        } else {
            $filtermethod = 'filter';
            debugging('Invalid filter stage specified in options: ' . $options['stage'], DEBUG_DEVELOPER);
        }
        if ($text === null || $text === '') {
            // Nothing to filter.
            return '';
        }
        foreach ($filterchain as $filtername => $filter) {
            if ($skipfilters !== null && in_array($filtername, $skipfilters)) {
                continue;
            }
            $text = $filter->$filtermethod($text, $options);
        }
        return $text;
    }
 
    /**
     * Get all the filters that apply to a given context for calls to format_text.
     *
     * @param context $context
     * @return moodle_text_filter[] A text filter
     */
    protected function get_text_filters($context) {
        if (!isset($this->textfilters[$context->id])) {
            $this->load_filters($context);
        }
        return $this->textfilters[$context->id];
    }
 
    /**
     * Get all the filters that apply to a given context for calls to format_string.
     *
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/filter/classes/filter_manager.php
        }
        return $this->stringfilters[$context->id];
    }
 
    /**
     * Filter some text
     *
     * @param string $text The text to filter
     * @param context $context the context.
     * @param array $options options passed to the filters
     * @param null|array $skipfilters of filter names. Any filters that should not be applied to this text.
     * @return string resulting text
     */
    public function filter_text(
        $text,
        $context,
        array $options = [],
        ?array $skipfilters = null
    ) {
        $text = $this->apply_filter_chain($text, $this->get_text_filters($context), $options, $skipfilters);
        if (!isset($options['stage']) || $options['stage'] === 'post_clean') {
            // Remove <nolink> tags for XHTML compatibility after the last filtering stage.
            $text = str_replace(['<nolink>', '</nolink>'], '', $text);
        }
        return $text;
    }
 
    /**
     * Filter a piece of string
     *
     * @param string $string The text to filter
     * @param context $context the context.
     * @return string resulting string
     */
    public function filter_string($string, $context) {
        return $this->apply_filter_chain($string, $this->get_string_filters($context), ['stage' => 'string']);
    }
 
    /**
     * Setup page with filters requirements and other prepare stuff.
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/classes/formatting.php
                        'allowid' => $allowid,
                    ]);
                }
                $filteroptions['stage'] = 'post_clean';
                $text = $filtermanager->filter_text($text, $context, $filteroptions);
                break;
 
            case FORMAT_MOODLE:
                $filteroptions['stage'] = 'pre_format';
                $text = $filtermanager->filter_text($text, $context, $filteroptions);
                $text = text_to_html($text, null, $para, $newlines);
                $filteroptions['stage'] = 'pre_clean';
                $text = $filtermanager->filter_text($text, $context, $filteroptions);
                if ($clean) {
                    $text = clean_text($text, FORMAT_HTML, [
                        'allowid' => $allowid,
                    ]);
                }
                $filteroptions['stage'] = 'post_clean';
                $text = $filtermanager->filter_text($text, $context, $filteroptions);
                break;
            default:  // FORMAT_MOODLE or anything else.
                throw new \coding_exception("Unknown format passed to format_text: {$format}");
        }
 
        if ($filter) {
            // At this point there should not be any draftfile links any more,
            // this happens when developers forget to post process the text.
            // The only potential problem is that somebody might try to format
            // the text before storing into database which would be itself big bug.
            $text = str_replace("\"$CFG->wwwroot/draftfile.php", "\"$CFG->wwwroot/brokenfile.php#", $text);
 
            if ($CFG->debugdeveloper) {
                if (strpos($text, '@@PLUGINFILE@@/') !== false) {
                    debugging(
                        'Before calling format_text(), the content must be processed with file_rewrite_pluginfile_urls()',
                        DEBUG_DEVELOPER
                    );
                }
            }
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/lib/weblib.php
                unset($options[$option]);
            }
        }
 
        foreach ($options as $option => $value) {
            $params[$option] = $value;
        }
 
        // The noclean option has been renamed to clean.
        if (array_key_exists('noclean', $params)) {
            $params['clean'] = !$params['noclean'];
            unset($params['noclean']);
        }
    }
 
    if ($format !== null) {
        $params['format'] = $format;
    }
 
    return \core\di::get(\core\formatting::class)->format_text(...$params);
}
 
/**
 * Resets some data related to filters, called during upgrade or when general filter settings change.
 *
 * @param bool $phpunitreset true means called from our PHPUnit integration test reset
 * @return void
 */
function reset_text_filters_cache($phpunitreset = false) {
    global $CFG, $DB;
 
    if ($phpunitreset) {
        // HTMLPurifier does not change, DB is already reset to defaults,
        // nothing to do here, the dataroot was cleared too.
        return;
    }
 
    // The purge_all_caches() deals with cachedir and localcachedir purging,
    // the individual filter caches are invalidated as necessary elsewhere.
 
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/course/renderer.php
    /**
     * Returns given course's summary with proper embedded files urls and formatted
     *
     * @param core_course_list_element $course
     * @param array|stdClass $options additional formatting options
     * @return string
     */
    public function get_course_formatted_summary($course, $options = array()) {
        global $CFG;
        require_once($CFG->libdir. '/filelib.php');
        if (!$course->has_summary()) {
            return '';
        }
        $options = (array)$options;
        $context = context_course::instance($course->id);
        if (!isset($options['context'])) {
            $options['context'] = $context;
        }
        $summary = file_rewrite_pluginfile_urls($course->summary, 'pluginfile.php', $context->id, 'course', 'summary', null);
        $summary = format_text($summary, $course->summaryformat, $options);
        if (!empty($this->searchcriteria['search'])) {
            $summary = highlight($this->searchcriteria['search'], $summary);
        }
        return $summary;
    }
 
    /**
     * Returns course name as it is configured to appear in courses lists formatted to course context
     *
     * @param core_course_list_element $course
     * @param array|stdClass $options additional formatting options
     * @return string
     */
    public function get_course_formatted_name($course, $options = array()) {
        $options = (array)$options;
        if (!isset($options['context'])) {
            $options['context'] = context_course::instance($course->id);
        }
        $name = format_string(get_course_display_name_for_list($course), true, $options);
        if (!empty($this->searchcriteria['search'])) {
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/theme/space/classes/util/course.php
     * @throws \moodle_exception
     */
    public function get_category(): string {
        $cat = core_course_category::get($this->course->category, IGNORE_MISSING);
 
        if (!$cat) {
            return '';
        }
 
        return $cat->get_formatted_name();
    }
 
    /**
     * Returns course summary.
     *
     * @param coursecat_helper $chelper
     */
    public function get_summary(coursecat_helper $chelper): string {
        if ($this->course->has_summary()) {
            return $chelper->get_course_formatted_summary(
                $this->course,
                ['overflowdiv' => true, 'noclean' => true, 'para' => false]
            );
        }
 
        return false;
    }
 
    /**
     * Returns course custom fields.
     *
     * @return string
     */
    public function get_custom_fields(): string {
        if ($this->course->has_custom_fields()) {
            $handler = \core_course\customfield\course_handler::create();
 
            return $handler->display_custom_fields_data($this->course->get_custom_fields());
        }
 
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/theme/space/classes/output/core/course_renderer.php
        if ($courseprogressbar == 1 && $hasprogress == true) {
            $cccfooter = false;
        }
 
        $forcedlanguage = ($theme->settings->courselangbadge == 1) ? strval($course->lang) : null;
        $showcustomfields = ($theme->settings->showcustomfields == 1) ? true : false;
 
        $stringaccess = format_text(theme_space_get_setting('stringaccess'), FORMAT_HTML, ['noclean' => true]);
 
        $courseimage = $courseutil->get_summary_image(false);
        if (empty($courseimage)) {
            $courseimage = $this->get_theme_core_renderer()->get_generated_image_for_id($course->id);
        }
 
        $data = [
            'id' => $course->id,
            'fullname' => $chelper->get_course_formatted_name($course),
            'visible' => $course->visible,
            'image' => $courseimage,
            'summary' => $courseutil->get_summary($chelper),
            'category' => $courseutil->get_category(),
            'customfields' => $courseutil->get_custom_fields(),
            'showcustomfields' => $showcustomfields,
            'hasprogress' => $hasprogress,
            'progress' => (int) $courseprogress,
            'hasenrolmenticons' => $courseenrolmenticons != false,
            'enrolmenticons' => $courseenrolmenticons,
            'hascontacts' => !empty($coursecontacts),
            'contacts' => $coursecontacts,
            'stringaccess' => $stringaccess,
            'cccteachers' => $cccteachers,
            'cccfooter' => $cccfooter,
            'cccsummary' => $cccsummary,
            'coursecarddesclimit' => $coursecarddesclimit,
            'forcedlanguage' => $forcedlanguage,
        ];
 
        if ($theme->settings->courselistview == 1) {
            return $this->render_from_template('theme_space/custom_courselist', $data);
        } else {
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/theme/space/classes/output/core/course_renderer.php
     * @param coursecat_helper $chelper various display options
     * @param core_course_list_element|stdClass $course
     * @param string $additionalclasses additional classes to add to the main <div> tag (usually
     *    depend on the course position in list - first/last/even/odd)
     * @return string
     */
    protected function coursecat_coursebox(coursecat_helper $chelper, $course, $additionalclasses = '') {
        if (!isset($this->strings->summary)) {
            $this->strings->summary = get_string('summary');
        }
 
        if ($chelper->get_show_courses() <= self::COURSECAT_SHOW_COURSES_COUNT) {
            return '';
        }
 
        if ($course instanceof stdClass) {
            $course = new core_course_list_element($course);
        }
 
        return $this->coursecat_coursebox_content($chelper, $course);
    }
 
    /**
     * Returns HTML to display a tree of subcategories and courses in the given category
     *
     * @param coursecat_helper $chelper various display options
     * @param core_course_category $coursecat top category (this category's name and description will NOT be added to the tree)
     * @return string
     */
    protected function coursecat_tree(coursecat_helper $chelper, $coursecat) {
        // Reset the category expanded flag for this course category tree first.
        $this->categoryexpandedonload = false;
        $categorycontent = $this->coursecat_category_content($chelper, $coursecat, 1);
        if (empty($categorycontent)) {
            return '';
        }
 
        // Start content generation.
        $content = '';
        $attributes = $chelper->get_and_erase_attributes('course_category_tree clearfix');
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/theme/space/classes/output/core/course_renderer.php
        }
 
        // Display list of courses.
        $attributes = $chelper->get_and_erase_attributes('courses');
        $content = html_writer::start_tag('div', $attributes);
 
        if (!empty($pagingbar)) {
            $content .= $pagingbar;
        }
 
        $coursecount = 1;
 
        if ($theme->settings->courselistview == 1) {
            $content .= html_writer::start_tag('div', ['class' => 'rui-course--list mt-2']);
        } else {
            $content .= html_writer::start_tag('div', ['class' => 'rui-course-card-deck mt-2', 'role' => 'list']);
        }
 
        foreach ($courses as $course) {
            $content .= $this->coursecat_coursebox($chelper, $course);
 
            $coursecount++;
        }
 
        $content .= html_writer::end_tag('div');
 
        if (!empty($pagingbar)) {
            $content .= $pagingbar;
        }
 
        if (!empty($morelink)) {
            $content .= $morelink;
        }
 
        $content .= html_writer::end_tag('div'); // End courses.
 
        return $content;
    }
 
    /**
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/course/renderer.php
     */
    public function frontpage_available_courses() {
        global $CFG;
 
        $chelper = new coursecat_helper();
        $chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED)->
                set_courses_display_options(array(
                    'recursive' => true,
                    'limit' => $CFG->frontpagecourselimit,
                    'viewmoreurl' => new moodle_url('/course/index.php'),
                    'viewmoretext' => new lang_string('fulllistofcourses')));
 
        $chelper->set_attributes(array('class' => 'frontpage-course-list-all'));
        $courses = core_course_category::top()->get_courses($chelper->get_courses_display_options());
        $totalcount = core_course_category::top()->get_courses_count($chelper->get_courses_display_options());
        if (!$totalcount && !$this->page->user_is_editing() && has_capability('moodle/course:create', context_system::instance())) {
            // Print link to create a new course, for the 1st available category.
            return $this->add_new_course_button();
        }
        return $this->coursecat_courses($chelper, $courses, $totalcount);
    }
 
    /**
     * Returns HTML to the "add new course" button for the page
     *
     * @return string
     */
    public function add_new_course_button() {
        global $CFG;
        // Print link to create a new course, for the 1st available category.
        $output = $this->container_start('buttons');
        $url = new moodle_url('/course/edit.php', array('category' => $CFG->defaultrequestcategory, 'returnto' => 'topcat'));
        $output .= $this->single_button($url, get_string('addnewcourse'), 'get');
        $output .= $this->container_end('buttons');
        return $output;
    }
 
    /**
     * Returns HTML to print tree with course categories and courses for the frontpage
     *
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/course/renderer.php
                        require_once($CFG->dirroot .'/mod/forum/lib.php');
                        if (($newsforum = forum_get_course_forum($SITE->id, 'news')) &&
                                ($forumcontents = $this->frontpage_news($newsforum))) {
                            $newsforumcm = get_fast_modinfo($SITE)->instances['forum'][$newsforum->id];
                            $output .= $this->frontpage_part('skipsitenews', 'site-news-forum',
                                $newsforumcm->get_formatted_name(), $forumcontents);
                        }
                    }
                    break;
 
                case FRONTPAGEENROLLEDCOURSELIST:
                    $mycourseshtml = $this->frontpage_my_courses();
                    if (!empty($mycourseshtml)) {
                        $output .= $this->frontpage_part('skipmycourses', 'frontpage-course-list',
                            get_string('mycourses'), $mycourseshtml);
                    }
                    break;
 
                case FRONTPAGEALLCOURSELIST:
                    $availablecourseshtml = $this->frontpage_available_courses();
                    $output .= $this->frontpage_part('skipavailablecourses', 'frontpage-available-course-list',
                        get_string('availablecourses'), $availablecourseshtml);
                    break;
 
                case FRONTPAGECATEGORYNAMES:
                    $output .= $this->frontpage_part('skipcategories', 'frontpage-category-names',
                        get_string('categories'), $this->frontpage_categories_list());
                    break;
 
                case FRONTPAGECATEGORYCOMBO:
                    $output .= $this->frontpage_part('skipcourses', 'frontpage-category-combo',
                        get_string('courses'), $this->frontpage_combo_list());
                    break;
 
                case FRONTPAGECOURSESEARCH:
                    $output .= $this->box($this->course_search_form(''), 'd-flex justify-content-center');
                    break;
 
            }
            $output .= '<br />';
/home/opkvalificer-45x/htdocs/45x.opkvalificer.com/index.php
$siteformatoptions = course_get_format($SITE)->get_format_options();
$modinfo = get_fast_modinfo($SITE);
$modnamesused = $modinfo->get_used_module_names();
 
// Print Section or custom info.
if (!empty($CFG->customfrontpageinclude)) {
    // Pre-fill some variables that custom front page might use.
    $modnames = get_module_types_names();
    $modnamesplural = get_module_types_names(true);
    $mods = $modinfo->get_cms();
 
    include($CFG->customfrontpageinclude);
 
} else if ($siteformatoptions['numsections'] > 0) {
    echo $courserenderer->frontpage_section1();
}
// Include course AJAX.
include_course_ajax($SITE, $modnamesused);
 
echo $courserenderer->frontpage();
 
if ($editing && has_capability('moodle/course:create', context_system::instance())) {
    echo $courserenderer->add_new_course_button();
}
echo $OUTPUT->footer();
 

Environment & details:

empty
empty
empty
Key Value
MoodleSession ofbq6omni9giet58o9hcaplpd2
Key Value
USER stdClass Object ( [id] => 1 [auth] => manual [confirmed] => 1 [policyagreed] => 0 [deleted] => 0 [suspended] => 0 [mnethostid] => 1 [username] => guest [idnumber] => [firstname] => Gæst [lastname] => [email] => root@localhost [emailstop] => 0 [phone1] => [phone2] => [institution] => [department] => [address] => [city] => [country] => [lang] => da [calendartype] => gregorian [theme] => [timezone] => 99 [firstaccess] => 0 [lastaccess] => 0 [lastlogin] => 0 [currentlogin] => 0 [lastip] => [secret] => [picture] => 0 [descriptionformat] => 1 [mailformat] => 1 [maildigest] => 0 [maildisplay] => 2 [autosubscribe] => 1 [trackforums] => 0 [timecreated] => 0 [timemodified] => 1772482531 [trustbitmask] => 0 [imagealt] => [lastnamephonetic] => [firstnamephonetic] => [middlename] => [alternatename] => [moodlenetprofile] => [lastcourseaccess] => Array ( ) [currentcourseaccess] => Array ( ) [profile] => Array ( ) [sesskey] => 993TaZefyc [preference] => Array ( ) [autologinguest] => 1 [access] => Array ( [ra] => Array ( [/1] => Array ( [6] => 6 ) ) [time] => 1779914805 [rsw] => Array ( ) ) [enrol] => Array ( [enrolled] => Array ( ) [tempguest] => Array ( ) ) )
SESSION stdClass Object ( [isnewsessioncookie] => 1 [justloggedin] => 1 [lang] => da [cachestore_session] => Array ( [default_session-core/navigation_cache] => Array ( [__lastaccess__u1_ofbq6omni9giet58o9hcaplpd2] => Array ( [0] => 1779914805 [1] => 1779914805 ) ) [default_session-core/coursecat] => Array ( [u1_ofbq6omni9giet58o9hcaplpd2_a1eb530ebc7014678e691708db825df552bac9ab] => Array ( [0] => 1779914805.0156-6a17583503cd22.83999350 [1] => 1779914805 ) [u1_ofbq6omni9giet58o9hcaplpd2_a777ccc9041fa05bb5b5d610ddc841149c79b99c] => Array ( [0] => Array ( ) [1] => 1779914805 ) [u1_ofbq6omni9giet58o9hcaplpd2_9c7c3e6b6bed05961590ec77cfc3f6ccb0c064e7] => Array ( [0] => Array ( [0] => 1 ) [1] => 1779914805 ) [u1_ofbq6omni9giet58o9hcaplpd2_9c17c33e3835b67b886d2ceb655d206203b300d6] => Array ( [0] => Array ( [0] => 5 [1] => 4 [2] => 3 [3] => 2 ) [1] => 1779914805 ) [u1_ofbq6omni9giet58o9hcaplpd2_1851c710a42f394720e9f49e5418a70e4b954de3] => Array ( [0] => 4 [1] => 1779914805 ) [__lastaccess__u1_ofbq6omni9giet58o9hcaplpd2] => Array ( [0] => 1779914805 [1] => 1779914805 ) ) ) )
Key Value
USER opkvalificer-45x
HOME /home/opkvalificer-45x
HTTP_COOKIE MoodleSession=ofbq6omni9giet58o9hcaplpd2
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 216.73.216.7
HTTP_X_REAL_IP 216.73.216.7
HTTP_X_FORWARDED_HOST 45x.opkvalificer.com
HTTP_HOST 45x.opkvalificer.com
PHP_VALUE error_log=/home/opkvalificer-45x/logs/php/error.log; memory_limit=2G; max_execution_time=3600; max_input_time=3600; max_input_vars=10000; post_max_size=1G; upload_max_filesize=5G; date.timezone=UTC; display_errors=off;
HTTPS on
PATH_TRANSLATED /home/opkvalificer-45x/htdocs/45x.opkvalificer.com
PATH_INFO
MGT 1
GEOIP_LONGITUDE -119.1091
GEOIP_LATITUDE 34.1453
GEOIP_CITY_CONTINENT_CODE NA
GEOIP_POSTAL_CODE 93033
GEOIP_CITY Oxnard
GEOIP_REGION CA
GEOIP_CITY_COUNTRY_NAME United States
GEOIP_CITY_COUNTRY_CODE3 USA
GEOIP_CITY_COUNTRY_CODE US
GEOIP_COUNTRY_NAME United States
GEOIP_COUNTRY_CODE3 USA
GEOIP_COUNTRY_CODE US
REDIRECT_STATUS 200
SERVER_NAME 45x.opkvalificer.com
SERVER_PORT 443
SERVER_ADDR 127.0.0.1
REMOTE_PORT
REMOTE_ADDR 216.73.216.7
SERVER_SOFTWARE nginx/1.21.4
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.0
DOCUMENT_ROOT /home/opkvalificer-45x/htdocs/45x.opkvalificer.com
DOCUMENT_URI /index.php
REQUEST_URI /sitemap.xml
SCRIPT_NAME /index.php
SCRIPT_FILENAME /home/opkvalificer-45x/htdocs/45x.opkvalificer.com/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1779914805.579
REQUEST_TIME 1779914805
empty
0. Whoops\Handler\PrettyPageHandler
1. Whoops\Handler\CallbackHandler