first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,56 @@
<?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/>.
/**
* The mod_wiki comment created event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki comment created event class.
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class comment_created extends \core\event\comment_created {
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/comments.php', array('pageid' => $this->other['itemid']));
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' added a comment with id '$this->objectid' on the page with id " .
"'{$this->other['itemid']}' for the wiki with course module id '$this->contextinstanceid'.";
}
}
@@ -0,0 +1,56 @@
<?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/>.
/**
* The mod_wiki comment deleted event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki comment deleted event class.
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class comment_deleted extends \core\event\comment_deleted {
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/comments.php', array('pageid' => $this->other['itemid']));
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' deleted a comment with id '$this->objectid' on the page with id " .
"'{$this->other['itemid']}' for the wiki with course module id '$this->contextinstanceid'.";
}
}
@@ -0,0 +1,70 @@
<?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/>.
/**
* The mod_wiki comments viewed event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki comments viewed event class.
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class comments_viewed extends \core\event\comments_viewed {
/**
* Init method.
*
* @return void
*/
protected function init() {
parent::init();
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed the comments for the page with id '$this->objectid' for the wiki " .
"with course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/comments.php', array('pageid' => $this->objectid));
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
}
@@ -0,0 +1,37 @@
<?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/>.
/**
* The mod_wiki instance list viewed event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki instance list viewed event class.
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed {
}
@@ -0,0 +1,52 @@
<?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/>.
/**
* The mod_wiki course module viewed event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki course module viewed event class.
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class course_module_viewed extends \core\event\course_module_viewed {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki';
}
public static function get_objectid_mapping() {
return array('db' => 'wiki', 'restore' => 'wiki');
}
}
+79
View File
@@ -0,0 +1,79 @@
<?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/>.
/**
* The mod_wiki page created event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki page created event class.
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_created extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventpagecreated', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' created the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/view.php', array('pageid' => $this->objectid));
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
}
+92
View File
@@ -0,0 +1,92 @@
<?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/>.
/**
* The mod_wiki page deleted event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki page deleted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int subwikiid: (optional) id subwiki.
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_deleted extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventpagedeleted', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' deleted the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/admin.php', array('pageid' => $this->objectid));
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['subwikiid'] = array('db' => 'wiki_subwikis', 'restore' => 'wiki_subwiki');
return $othermapped;
}
}
+111
View File
@@ -0,0 +1,111 @@
<?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/>.
/**
* The mod_wiki diff viewed event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki diff viewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int comparewith: version number to compare with.
* - int compare: version number to compare.
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_diff_viewed extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventdiffviewed', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed the diff for the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/diff.php', array(
'pageid' => $this->objectid,
'comparewith' => $this->other['comparewith'],
'compare' => $this->other['compare']
));
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['comparewith'])) {
throw new \coding_exception('The \'comparewith\' value must be set in other.');
}
if (!isset($this->other['compare'])) {
throw new \coding_exception('The \'compare\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}
@@ -0,0 +1,79 @@
<?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/>.
/**
* The mod_wiki history viewed event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki history viewed event class.
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_history_viewed extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventhistoryviewed', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed the history for the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/history.php', array('pageid' => $this->objectid));
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
}
@@ -0,0 +1,90 @@
<?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/>.
/**
* The mod_wiki page locks deleted (override locks) event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki page locks deleted (override locks) event class.
*
* @property-read array $other {
* Extra information about event.
*
* - string section: (optional) section name.
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_locks_deleted extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventpagelocksdeleted', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' deleted locks for the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/view.php', array('pageid' => $this->objectid));
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}
+103
View File
@@ -0,0 +1,103 @@
<?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/>.
/**
* The mod_wiki map viewed event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki map viewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int option: map option viewed.
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_map_viewed extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventmapviewed', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed the wiki map for the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/map.php', array('pageid' => $this->objectid));
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['option'])) {
throw new \coding_exception('The \'option\' value must be set in other, even if 0.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}
+90
View File
@@ -0,0 +1,90 @@
<?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/>.
/**
* The mod_wiki page updated event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki page updated event class.
*
* @property-read array $other {
* Extra information about event.
*
* - string newcontent: (optional) updated content.
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_updated extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventpageupdated', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' updated the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/view.php', array('pageid' => $this->objectid));
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}
@@ -0,0 +1,105 @@
<?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/>.
/**
* The mod_wiki page version deleted event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki page version deleted event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int pageid: id wiki page.
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_version_deleted extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_versions';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventpageversiondeleted', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' deleted version '$this->objectid' for the page with id '{$this->other['pageid']}' " .
"for the wiki with course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/admin.php', array('pageid' => $this->other['pageid']));
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['pageid'])) {
throw new \coding_exception('The \'pageid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_versions', 'restore' => 'wiki_version');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['pageid'] = array('db' => 'wiki_pages', 'restore' => 'wiki_page');
return $othermapped;
}
}
@@ -0,0 +1,106 @@
<?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/>.
/**
* The mod_wiki version restored event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki version restored event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int pageid: id wiki page.
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_version_restored extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_versions';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventversionrestored', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' restored version '$this->objectid' for the page with id '{$this->other['pageid']}' " .
"for the wiki with course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/viewversion.php', array('pageid' => $this->other['pageid'],
'versionid' => $this->objectid));
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['pageid'])) {
throw new \coding_exception('The pageid needs to be set in $other');
}
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_versions', 'restore' => 'wiki_version');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['pageid'] = array('db' => 'wiki_pages', 'restore' => 'wiki_page');
return $othermapped;
}
}
@@ -0,0 +1,106 @@
<?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/>.
/**
* The mod_wiki version viewed event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki version viewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - int versionid: id page version.
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_version_viewed extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventversionviewed', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed the version for the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/wiki/viewversion.php', array('pageid' => $this->objectid,
'versionid' => $this->other['versionid']));
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['versionid'])) {
throw new \coding_exception('The versionid need to be set in $other');
}
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['versionid'] = array('db' => 'wiki_versions', 'restore' => 'wiki_version');
return $othermapped;
}
}
+107
View File
@@ -0,0 +1,107 @@
<?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/>.
/**
* The mod_wiki page viewed event.
*
* @package mod_wiki
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_wiki\event;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_wiki page viewed event class.
*
* @property-read array $other {
* Extra information about the event.
*
* - string title: (optional) the wiki title
* - int wid: (optional) the wiki id
* - int group: (optional) the group id
* - string groupanduser: (optional) the groupid-userid
* }
*
* @package mod_wiki
* @since Moodle 2.7
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class page_viewed extends \core\event\base {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'wiki_pages';
}
/**
* Return localised event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventpageviewed', 'mod_wiki');
}
/**
* Returns description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed the page with id '$this->objectid' for the wiki with " .
"course module id '$this->contextinstanceid'.";
}
/**
* Get URL related to the action.
*
* @return \moodle_url
*/
public function get_url() {
if (!empty($this->data['other']['wid'])) {
return new \moodle_url('/mod/wiki/view.php', array('wid' => $this->data['other']['wid'],
'title' => $this->data['other']['title'],
'uid' => $this->relateduserid,
'groupanduser' => $this->data['other']['groupanduser'],
'group' => $this->data['other']['group']
));
} else if (!empty($this->other['prettyview'])) {
return new \moodle_url('/mod/wiki/prettyview.php', array('pageid' => $this->objectid));
} else {
return new \moodle_url('/mod/wiki/view.php', array('pageid' => $this->objectid));
}
}
public static function get_objectid_mapping() {
return array('db' => 'wiki_pages', 'restore' => 'wiki_page');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['wid'] = array('db' => 'wiki', 'restore' => 'wiki');
$othermapped['group'] = array('db' => 'groups', 'restore' => 'group');
return $othermapped;
}
}