Commit 24ba58ee authored by Penny Leach's avatar Penny Leach
Browse files

portfolio MDL-21079 be more selective about including libraries.

this involves moving all formslib includes to where they're actually needed.
it also moves the portfolio stuff from assignment,data,chat,forum and glossary
into a locallib.php which involved creating it for many of those modules.
parent a83ad307
......@@ -2,6 +2,7 @@
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir . '/portfoliolib.php');
require_once($CFG->libdir . '/portfolio/forms.php');
require_once($CFG->libdir . '/adminlib.php');
$edit = optional_param('edit', 0, PARAM_INT);
......
......@@ -3152,12 +3152,15 @@ class settings_navigation extends navigation_node {
}
// Portfolio
if (empty($userindexpage) && $currentuser && !empty($CFG->enableportfolios) && has_capability('moodle/portfolio:export', $systemcontext) && portfolio_instances(true, false)) {
$portfoliokey = $usersetting->add(get_string('portfolios', 'portfolio'), null, self::TYPE_SETTING);
$url = new moodle_url($CFG->wwwroot .'/user/portfolio.php');
$usersetting->get($portfoliokey)->add(get_string('configure', 'portfolio'), $url, self::TYPE_SETTING);
$url = new moodle_url($CFG->wwwroot .'/user/portfoliologs.php');
$usersetting->get($portfoliokey)->add(get_string('logs', 'portfolio'), $url, self::TYPE_SETTING);
if (empty($userindexpage) && $currentuser && !empty($CFG->enableportfolios) && has_capability('moodle/portfolio:export', $systemcontext)) {
require_once($CFG->libdir . '/portfoliolib.php');
if (portfolio_instances(true, false)) {
$portfoliokey = $usersetting->add(get_string('portfolios', 'portfolio'), null, self::TYPE_SETTING);
$url = new moodle_url($CFG->wwwroot .'/user/portfolio.php');
$usersetting->get($portfoliokey)->add(get_string('configure', 'portfolio'), $url, self::TYPE_SETTING);
$url = new moodle_url($CFG->wwwroot .'/user/portfoliologs.php');
$usersetting->get($portfoliokey)->add(get_string('logs', 'portfolio'), $url, self::TYPE_SETTING);
}
}
// Repository
......
......@@ -281,7 +281,7 @@ class portfolio_exporter {
* @return boolean whether or not to process the next stage. this is important as the control function is called recursively.
*/
public function process_stage_config() {
global $OUTPUT;
global $OUTPUT, $CFG;
$pluginobj = $callerobj = null;
if ($this->instance->has_export_config()) {
$pluginobj = $this->instance;
......@@ -306,6 +306,7 @@ class portfolio_exporter {
'formats' => $formats,
'expectedtime' => $expectedtime,
);
require_once($CFG->libdir . '/portfolio/forms.php');
$mform = new portfolio_export_form('', $customdata);
if ($mform->is_cancelled()){
$this->cancel_request();
......@@ -659,6 +660,9 @@ class portfolio_exporter {
public static function rewaken_object($id) {
global $DB, $CFG;
require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/portfolio/exporter.php');
require_once($CFG->libdir . '/portfolio/caller.php');
require_once($CFG->libdir . '/portfolio/plugin.php');
if (!$data = $DB->get_record('portfolio_tempdata', array('id' => $id))) {
// maybe it's been finished already by a pull plugin
// so look in the logs
......@@ -713,7 +717,7 @@ class portfolio_exporter {
throw new portfolio_exception('notyours', 'portfolio');
}
if (!$readonly && $this->get('instance') && !$this->get('instance')->allows_multiple_exports()
&& ($already = portfolio_exporter::existing_exports($this->get('user')->id, $this->get('instance')->get('plugin')))
&& ($already = portfolio_existing_exports($this->get('user')->id, $this->get('instance')->get('plugin')))
&& array_shift(array_keys($already)) != $this->get('id')
) {
$a = (object)array(
......@@ -848,40 +852,6 @@ class portfolio_exporter {
exit;
}
/**
* return a list of current exports for the given user
* this will not go through and call rewaken_object, because it's heavy
* it's really just used to figure out what exports are currently happening.
* this is useful for plugins that don't support multiple exports per session
*
* @param int $userid the user to check for
* @param string $type (optional) the portfolio plugin to filter by
*
* @return array
*/
public static function existing_exports($userid, $type=null) {
global $DB;
$sql = 'SELECT t.*,t.instance,i.plugin,i.name FROM {portfolio_tempdata} t JOIN {portfolio_instance} i ON t.instance = i.id WHERE t.userid = ? ';
$values = array($userid);
if ($type) {
$sql .= ' AND i.plugin = ?';
$values[] = $type;
}
return $DB->get_records_sql($sql, $values);
}
/**
* Return an array of existing exports by type for a given user.
* This is much more lightweight than {@see existing_exports} because it only returns the types, rather than the whole serialised data
* so can be used for checking availability of multiple plugins at the same time.
*/
public static function existing_exports_by_plugin($userid) {
global $DB;
$sql = 'SELECT t.id,i.plugin FROM {portfolio_tempdata} t JOIN {portfolio_instance} i ON t.instance = i.id WHERE t.userid = ? ';
$values = array($userid);
return $DB->get_records_sql_menu($sql, $values);
}
public static function print_cleaned_export($log, $instance=null) {
global $CFG, $OUTPUT, $PAGE;
if (empty($instance) || !$instance instanceof portfolio_plugin) {
......
......@@ -29,14 +29,25 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/** require all the sublibraries first. */
require_once($CFG->libdir . '/portfolio/constants.php'); // all the constants for time, export format etc.
// require some of the sublibraries first.
// this is not an exhaustive list, the others are pulled in as they're needed
// so we don't have to always include everything unnecessarily for performance
// very lightweight list of constants. always needed and no further dependencies
require_once($CFG->libdir . '/portfolio/constants.php');
// a couple of exception deinitions. always needed and no further dependencies
require_once($CFG->libdir . '/portfolio/exceptions.php'); // exception classes used by portfolio code
require_once($CFG->libdir . '/portfolio/formats.php'); // the export format hierarchy
require_once($CFG->libdir . '/portfolio/forms.php'); // the form classes that subclass moodleform
require_once($CFG->libdir . '/portfolio/exporter.php'); // the exporter class
require_once($CFG->libdir . '/portfolio/plugin.php'); // the base classes for plugins
require_once($CFG->libdir . '/portfolio/caller.php'); // the base classes for calling code
// The base class for the caller classes. We always need this because we're either drawing a button,
// in which case the button needs to know the calling class definition, which requires the base class,
// or we're exporting, in which case we need the caller class anyway.
require_once($CFG->libdir . '/portfolio/caller.php');
// the other dependencies are included on demand:
// libdir/portfolio/formats.php - the classes for the export formats
// libdir/portfolio/forms.php - all portfolio form classes (requires formslib)
// libdir/portfolio/plugin.php - the base class for the export plugins
// libdir/portfolio/exporter.php - the exporter class
/**
* use this to add a portfolio button or icon or form to a page
......@@ -127,6 +138,7 @@ class portfolio_add_button {
throw new portfolio_button_exception('nocallbackfile', 'portfolio', $file);
}
$this->callbackfile = $file;
require_once($CFG->libdir . '/portfolio/caller.php'); // require the base class first
require_once($CFG->dirroot . $file);
if (!class_exists($class)) {
throw new portfolio_button_exception('nocallbackclass', 'portfolio', $class);
......@@ -263,7 +275,7 @@ class portfolio_add_button {
debugging(get_string('instancemisconfigured', 'portfolio', get_string($error[$instance->get('id')], 'portfolio_' . $instance->get('plugin'))));
return;
}
if (!$instance->allows_multiple_exports() && $already = portfolio_exporter::existing_exports($USER->id, $instance->get('plugin'))) {
if (!$instance->allows_multiple_exports() && $already = portfolio_existing_exports($USER->id, $instance->get('plugin'))) {
debugging(get_string('singleinstancenomultiallowed', 'portfolio'));
return;
}
......@@ -390,7 +402,7 @@ function portfolio_instance_select($instances, $callerformats, $callbackclass, $
$count = 0;
$selectoutput = "\n" . '<select name="' . $selectname . '">' . "\n";
$existingexports = portfolio_exporter::existing_exports_by_plugin($USER->id);
$existingexports = portfolio_existing_exports_by_plugin($USER->id);
foreach ($instances as $instance) {
$formats = portfolio_supported_formats_intersect($callerformats, $instance->supported_formats());
if (count($formats) == 0) {
......@@ -512,6 +524,7 @@ function portfolio_supported_formats() {
* @return string the format constant (see PORTFOLIO_FORMAT_XXX constants)
*/
function portfolio_format_from_file(stored_file $file) {
global $CFG;
static $alreadymatched;
if (empty($alreadymatched)) {
$alreadymatched = array();
......@@ -524,6 +537,7 @@ function portfolio_format_from_file(stored_file $file) {
return $alreadymatched[$mimetype];
}
$allformats = portfolio_supported_formats();
require_once($CFG->libdir . '/portfolio/formats.php');
foreach ($allformats as $format => $classname) {
$supportedmimetypes = call_user_func(array($classname, 'mimetypes'));
if (!is_array($supportedmimetypes)) {
......@@ -550,6 +564,7 @@ function portfolio_format_from_file(stored_file $file) {
* @param array $pluginformats formats the portfolio plugin supports
*/
function portfolio_supported_formats_intersect($callerformats, $pluginformats) {
global $CFG;
$allformats = portfolio_supported_formats();
$intersection = array();
foreach ($callerformats as $cf) {
......@@ -559,6 +574,7 @@ function portfolio_supported_formats_intersect($callerformats, $pluginformats) {
}
continue;
}
require_once($CFG->libdir . '/portfolio/formats.php');
$cfobj = new $allformats[$cf]();
foreach ($pluginformats as $p => $pf) {
if (!array_key_exists($pf, $allformats)) {
......@@ -614,6 +630,7 @@ function portfolio_format_is_abstract($format) {
* @return array merged formats with dups removed
*/
function portfolio_most_specific_formats($specificformats, $generalformats) {
global $CFG;
$allformats = portfolio_supported_formats();
if (empty($specificformats)) {
return $generalformats;
......@@ -623,10 +640,11 @@ function portfolio_most_specific_formats($specificformats, $generalformats) {
foreach ($specificformats as $f) {
// look for something less specific and remove it, ie outside of the inheritance tree of the current formats.
if (!array_key_exists($f, $allformats)) {
if (!portfolio_format_is_abstract($pf)) {
if (!portfolio_format_is_abstract($f)) {
throw new portfolio_button_exception('invalidformat', 'portfolio', $f);
}
}
require_once($CFG->libdir . '/portfolio/formats.php');
$fobj = new $allformats[$f];
foreach ($generalformats as $key => $cf) {
$cfclass = $allformats[$cf];
......@@ -658,6 +676,8 @@ function portfolio_most_specific_formats($specificformats, $generalformats) {
* @return portfolio_format object
*/
function portfolio_format_object($name) {
global $CFG;
require_once($CFG->libdir . '/portfolio/formats.php');
$formats = portfolio_supported_formats();
return new $formats[$name];
}
......@@ -682,6 +702,7 @@ function portfolio_instance($instanceid, $record=null) {
throw new portfolio_exception('invalidinstance', 'portfolio');
}
}
require_once($CFG->libdir . '/portfolio/plugin.php');
require_once($CFG->dirroot . '/portfolio/'. $instance->plugin . '/lib.php');
$classname = 'portfolio_plugin_' . $instance->plugin;
return new $classname($instanceid, $instance);
......@@ -717,6 +738,7 @@ function portfolio_static_function($plugin, $function) {
array_shift($args);
}
require_once($CFG->libdir . '/portfolio/plugin.php');
require_once($CFG->dirroot . '/portfolio/' . $plugin . '/lib.php');
return call_user_func_array(array('portfolio_plugin_' . $plugin, $function), $args);
}
......@@ -873,6 +895,8 @@ function portfolio_fake_add_url($instanceid, $classname, $classfile, $callbackar
*/
function portfolio_handle_event($eventdata) {
global $CFG;
require_once($CFG->libdir . '/portfolio/exporter.php');
$exporter = portfolio_exporter::rewaken_object($eventdata);
$exporter->process_stage_package();
$exporter->process_stage_send();
......@@ -889,7 +913,7 @@ function portfolio_handle_event($eventdata) {
*/
function portfolio_cron() {
global $DB;
require_once($CFG->libdir . '/portfolio/exporter.php');
if ($expired = $DB->get_records_select('portfolio_tempdata', 'expirytime < ?', array(time()), '', 'id')) {
foreach ($expired as $d) {
try {
......@@ -1089,3 +1113,37 @@ function portfolio_export_type_to_id($type, $userid) {
$sql = 'SELECT t.id FROM {portfolio_tempdata} t JOIN {portfolio_instance} i ON t.instance = i.id WHERE t.userid = ? AND i.plugin = ?';
return $DB->get_field_sql($sql, array($userid, $type));
}
/**
* return a list of current exports for the given user
* this will not go through and call rewaken_object, because it's heavy
* it's really just used to figure out what exports are currently happening.
* this is useful for plugins that don't support multiple exports per session
*
* @param int $userid the user to check for
* @param string $type (optional) the portfolio plugin to filter by
*
* @return array
*/
function portfolio_existing_exports($userid, $type=null) {
global $DB;
$sql = 'SELECT t.*,t.instance,i.plugin,i.name FROM {portfolio_tempdata} t JOIN {portfolio_instance} i ON t.instance = i.id WHERE t.userid = ? ';
$values = array($userid);
if ($type) {
$sql .= ' AND i.plugin = ?';
$values[] = $type;
}
return $DB->get_records_sql($sql, $values);
}
/**
* Return an array of existing exports by type for a given user.
* This is much more lightweight than {@see existing_exports} because it only returns the types, rather than the whole serialised data
* so can be used for checking availability of multiple plugins at the same time.
*/
function portfolio_existing_exports_by_plugin($userid) {
global $DB;
$sql = 'SELECT t.id,i.plugin FROM {portfolio_tempdata} t JOIN {portfolio_instance} i ON t.instance = i.id WHERE t.userid = ? ';
$values = array($userid);
return $DB->get_records_sql_menu($sql, $values);
}
......@@ -29,8 +29,6 @@
require_once($CFG->libdir.'/eventslib.php');
/** Include formslib.php */
require_once($CFG->libdir.'/formslib.php');
/** Include portfoliolib.php */
require_once($CFG->libdir.'/portfoliolib.php');
/** Include calendar/lib.php */
require_once($CFG->dirroot.'/calendar/lib.php');
......@@ -1805,6 +1803,8 @@ class assignment_base {
$found = false;
if ($files = $fs->get_area_files($this->context->id, 'assignment_submission', $userid, "timemodified", false)) {
require_once($CFG->libdir.'/portfoliolib.php');
require_once($CFG->dirroot . '/mod/assignment/locallib.php');
$button = new portfolio_add_button();
foreach ($files as $file) {
$filename = $file->get_filename();
......@@ -1813,7 +1813,7 @@ class assignment_base {
$path = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/assignment_submission/'.$userid.'/'.$filename);
$output .= '<a href="'.$path.'" ><img src="'.$OUTPUT->old_icon_url(file_mimetype_icon($mimetype)).'" class="icon" alt="'.$mimetype.'" />'.s($filename).'</a>';
if ($this->portfolio_exportable() && has_capability('mod/assignment:exportownsubmission', $this->context)) {
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id, 'fileid' => $file->get_id()));
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id, 'fileid' => $file->get_id()), '/mod/assignment/locallib.php');
$button->set_format_by_file($file);
$output .= $button->to_html(PORTFOLIO_ADD_ICON_LINK);
}
......@@ -3344,125 +3344,6 @@ function assignment_get_extra_capabilities() {
return array('moodle/site:accessallgroups', 'moodle/site:viewfullnames');
}
/**
* @package mod-assignment
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class assignment_portfolio_caller extends portfolio_module_caller_base {
/**
* the assignment subclass
*/
private $assignment;
/**
* the file to include when waking up to load the assignment subclass def
*/
private $assignmentfile;
/**
* callback arg for a single file export
*/
protected $fileid;
public static function expected_callbackargs() {
return array(
'id' => true,
'fileid' => false,
);
}
public function load_data() {
global $DB, $CFG;
if (! $this->cm = get_coursemodule_from_id('assignment', $this->id)) {
throw new portfolio_caller_exception('invalidcoursemodule');
}
if (! $assignment = $DB->get_record("assignment", array("id"=>$this->cm->instance))) {
throw new portfolio_caller_exception('invalidid', 'assignment');
}
$this->assignmentfile = '/mod/assignment/type/' . $assignment->assignmenttype . '/assignment.class.php';
require_once($CFG->dirroot . $this->assignmentfile);
$assignmentclass = "assignment_$assignment->assignmenttype";
$this->assignment = new $assignmentclass($this->cm->id, $assignment, $this->cm);
if (!$this->assignment->portfolio_exportable()) {
throw new portfolio_caller_exception('notexportable', 'portfolio', $this->get_return_url());
}
$this->set_file_and_format_data($this->fileid, $this->assignment->context->id, 'assignment_submission', $this->user->id, 'timemodified', false);
}
public function prepare_package() {
global $CFG;
if (is_callable(array($this->assignment, 'portfolio_prepare_package'))) {
return $this->assignment->portfolio_prepare_package($this->exporter, $this->user->id);
}
if ($this->exporter->get('formatclass') == PORTFOLIO_FORMAT_LEAP2A) {
$leapwriter = $this->exporter->get('format')->leap2a_writer();
$files = array();
if ($this->singlefile) {
$files[] = $this->singlefile;
} elseif ($this->multifiles) {
$files = $this->multifiles;
} else {
throw new portfolio_caller_exception('invalidpreparepackagefile', 'portfolio', $this->get_return_url());
}
$baseid = 'assignment' . $this->assignment->assignment->assignmenttype . $this->assignment->assignment->id . 'submission';
foreach ($files as $file) {
$id = $baseid . $file->get_id();
$entry = new portfolio_format_leap2a_entry($id, $file->get_filename(), 'resource', $file);
$entry->add_category('offline', 'resource_type');
$leapwriter->add_entry($entry);
$this->exporter->copy_existing_file($file);
}
return $this->exporter->write_new_file($leapwriter->to_xml(), $this->exporter->get('format')->manifest_name(), true);
}
return $this->prepare_package_file();
}
public function get_sha1() {
global $CFG;
if (is_callable(array($this->assignment, 'portfolio_get_sha1'))) {
return $this->assignment->portfolio_get_sha1($this->user->id);
}
return $this->get_sha1_file();
}
public function expected_time() {
if (is_callable(array($this->assignment, 'portfolio_get_expected_time'))) {
return $this->assignment->portfolio_get_expected_time();
}
return $this->expected_time_file();
}
public function check_permissions() {
$context = get_context_instance(CONTEXT_MODULE, $this->assignment->cm->id);
return has_capability('mod/assignment:exportownsubmission', $context);
}
public function __wakeup() {
global $CFG;
if (empty($CFG)) {
return true; // too early yet
}
require_once($CFG->dirroot . $this->assignmentfile);
$this->assignment = unserialize(serialize($this->assignment));
}
public static function display_name() {
return get_string('modulename', 'assignment');
}
public static function base_supported_formats() {
return array(PORTFOLIO_FORMAT_FILE, PORTFOLIO_FORMAT_LEAP2A);
}
}
/**
* @param string $feature FEATURE_xx constant for requested feature
* @return mixed True if module supports feature, null if doesn't know
......
<?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/>.
//
// this file contains all the functions that aren't needed by core moodle
// but start becoming required once we're actually inside the assignment module.
require_once($CFG->libdir . '/portfolio/caller.php');
/**
* @package mod-assignment
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class assignment_portfolio_caller extends portfolio_module_caller_base {
/**
* the assignment subclass
*/
private $assignment;
/**
* the file to include when waking up to load the assignment subclass def
*/
private $assignmentfile;
/**
* callback arg for a single file export
*/
protected $fileid;
public static function expected_callbackargs() {
return array(
'id' => true,
'fileid' => false,
);
}
public function load_data() {
global $DB, $CFG;
if (! $this->cm = get_coursemodule_from_id('assignment', $this->id)) {
throw new portfolio_caller_exception('invalidcoursemodule');
}
if (! $assignment = $DB->get_record("assignment", array("id"=>$this->cm->instance))) {
throw new portfolio_caller_exception('invalidid', 'assignment');
}
$this->assignmentfile = '/mod/assignment/type/' . $assignment->assignmenttype . '/assignment.class.php';
require_once($CFG->dirroot . $this->assignmentfile);
$assignmentclass = "assignment_$assignment->assignmenttype";
$this->assignment = new $assignmentclass($this->cm->id, $assignment, $this->cm);
if (!$this->assignment->portfolio_exportable()) {
throw new portfolio_caller_exception('notexportable', 'portfolio', $this->get_return_url());
}
$this->set_file_and_format_data($this->fileid, $this->assignment->context->id, 'assignment_submission', $this->user->id, 'timemodified', false);
}
public function prepare_package() {
global $CFG;
if (is_callable(array($this->assignment, 'portfolio_prepare_package'))) {
return $this->assignment->portfolio_prepare_package($this->exporter, $this->user->id);
}
if ($this->exporter->get('formatclass') == PORTFOLIO_FORMAT_LEAP2A) {
$leapwriter = $this->exporter->get('format')->leap2a_writer();
$files = array();
if ($this->singlefile) {
$files[] = $this->singlefile;
} elseif ($this->multifiles) {
$files = $this->multifiles;
} else {
throw new portfolio_caller_exception('invalidpreparepackagefile', 'portfolio', $this->get_return_url());
}
$baseid = 'assignment' . $this->assignment->assignment->assignmenttype . $this->assignment->assignment->id . 'submission';
foreach ($files as $file) {
$id = $baseid . $file->get_id();
$entry = new portfolio_format_leap2a_entry($id, $file->get_filename(), 'resource', $file);
$entry->add_category('offline', 'resource_type');
$leapwriter->add_entry($entry);
$this->exporter->copy_existing_file($file);
}
return $this->exporter->write_new_file($leapwriter->to_xml(), $this->exporter->get('format')->manifest_name(), true);
}
return $this->prepare_package_file();
}
public function get_sha1() {
global $CFG;
if (is_callable(array($this->assignment, 'portfolio_get_sha1'))) {
return $this->assignment->portfolio_get_sha1($this->user->id);
}
return $this->get_sha1_file();
}
public function expected_time() {
if (is_callable(array($this->assignment, 'portfolio_get_expected_time'))) {
return $this->assignment->portfolio_get_expected_time();
}
return $this->expected_time_file();
}
public function check_permissions() {
$context = get_context_instance(CONTEXT_MODULE, $this->assignment->cm->id);
return has_capability('mod/assignment:exportownsubmission', $context);
}
public function __wakeup() {
global $CFG;
if (empty($CFG)) {
return true; // too early yet
}
require_once($CFG->dirroot . $this->assignmentfile);
$this->assignment = unserialize(serialize($this->assignment));
}
public static function display_name() {
return get_string('modulename', 'assignment');
}
public static function base_supported_formats() {
return array(PORTFOLIO_FORMAT_FILE, PORTFOLIO_FORMAT_LEAP2A);
}
}
......@@ -23,8 +23,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/** Include portfoliolib.php */
require_once($CFG->libdir.'/portfoliolib.php');
require_once($CFG->dirroot.'/calendar/lib.php');
// The HTML head for the message window to start with (<!-- nix --> is used to get some browsers starting with output
......@@ -1219,138 +1217,6 @@ function chat_get_extra_capabilities() {
return array('moodle/site:accessallgroups', 'moodle/site:viewfullnames');
}
/**
* @package mod-chat
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class chat_portfolio_caller extends portfolio_module_caller_base {
/** @var object */
private $chat;
/** @var int Timestamp */
protected $start;
/** @var int Timestamp */
protected $end;