mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-43293 Events: Added comments event in modules supporting comments
This commit is contained in:
parent
edd9bb451c
commit
a55eaf0351
37
blocks/comments/classes/event/comment_created.php
Normal file
37
blocks/comments/classes/event/comment_created.php
Normal file
@ -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/>.
|
||||
|
||||
/**
|
||||
* block_comments comment created event.
|
||||
*
|
||||
* @package block_comments
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace block_comments\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* block_comments comment created event.
|
||||
*
|
||||
* @package block_comments
|
||||
* @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 {
|
||||
// No need to override any method.
|
||||
}
|
37
blocks/comments/classes/event/comment_deleted.php
Normal file
37
blocks/comments/classes/event/comment_deleted.php
Normal file
@ -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/>.
|
||||
|
||||
/**
|
||||
* block_comments comment deleted event.
|
||||
*
|
||||
* @package block_comments
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace block_comments\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* block_comments comment deleted event.
|
||||
*
|
||||
* @package block_comments
|
||||
* @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 {
|
||||
// No need to override any method.
|
||||
}
|
@ -652,7 +652,11 @@ class comment {
|
||||
$newcmt->time = userdate($newcmt->timecreated, $newcmt->strftimeformat);
|
||||
|
||||
// Trigger comment created event.
|
||||
$eventclassname = '\\' . $this->component . '\\event\comment_created';
|
||||
if (core_component::is_core_subsystem($this->component)) {
|
||||
$eventclassname = '\\core\\event\\' . $this->component . '_comment_created';
|
||||
} else {
|
||||
$eventclassname = '\\' . $this->component . '\\event\comment_created';
|
||||
}
|
||||
if (class_exists($eventclassname)) {
|
||||
$event = $eventclassname::create(
|
||||
array(
|
||||
@ -724,7 +728,11 @@ class comment {
|
||||
}
|
||||
$DB->delete_records('comments', array('id'=>$commentid));
|
||||
// Trigger comment delete event.
|
||||
$eventclassname = '\\' . $this->component . '\\event\comment_deleted';
|
||||
if (core_component::is_core_subsystem($this->component)) {
|
||||
$eventclassname = '\\core\\event\\' . $this->component . '_comment_deleted';
|
||||
} else {
|
||||
$eventclassname = '\\' . $this->component . '\\event\comment_deleted';
|
||||
}
|
||||
if (class_exists($eventclassname)) {
|
||||
$event = $eventclassname::create(
|
||||
array(
|
||||
|
@ -1013,4 +1013,14 @@ $cache = '.var_export($cache, true).';
|
||||
opcache_invalidate($file, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if subsystemname is core subsystem.
|
||||
*
|
||||
* @param string $subsystemname name of the subsystem.
|
||||
* @return bool true if core subsystem.
|
||||
*/
|
||||
public static function is_core_subsystem($subsystemname) {
|
||||
return isset(self::$subsystems[$subsystemname]);
|
||||
}
|
||||
}
|
||||
|
53
lib/classes/event/blog_comment_created.php
Normal file
53
lib/classes/event/blog_comment_created.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* blog comment created event.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* blog comment created event.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class blog_comment_created extends \core\event\comment_created {
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/blog/index.php', array('entryid' => $this->other['itemid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id ' . $this->userid . ' added comment for blog with id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
53
lib/classes/event/blog_comment_deleted.php
Normal file
53
lib/classes/event/blog_comment_deleted.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* blog comment deleted event.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* blog comment deleted event.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class blog_comment_deleted extends \core\event\comment_deleted {
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/blog/index.php', array('entryid' => $this->other['itemid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id ' . $this->userid . ' deleted comment for blog with id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
@ -63,10 +63,19 @@ abstract class comment_created extends \core\event\base {
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id '. $this->userid . ' added comment for ' . $this->component . ' with instance id ' .
|
||||
return 'User with id ' . $this->userid . ' added comment for ' . $this->component . ' with instance id ' .
|
||||
$this->contextinstanceid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return $this->context->get_url();
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom validation.
|
||||
*
|
||||
|
@ -63,10 +63,19 @@ abstract class comment_deleted extends \core\event\base {
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id '. $this->userid . ' deleted comment for ' . $this->component . ' with instance id ' .
|
||||
return 'User with id ' . $this->userid . ' deleted comment for ' . $this->component . ' with instance id ' .
|
||||
$this->contextinstanceid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return $this->context->get_url();
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom validation.
|
||||
*
|
||||
|
@ -65,4 +65,13 @@ abstract class comments_viewed extends \core\event\base {
|
||||
return 'User with id '. $this->userid . ' viewed comments for ' . $this->component . ' with instance id ' .
|
||||
$this->objectid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return $this->context->get_url();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* assignsubmission_comments comment created event.
|
||||
*
|
||||
* @package assignsubmission_comments
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace assignsubmission_comments\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* assignsubmission_comments comment created event.
|
||||
*
|
||||
* @package assignsubmission_comments
|
||||
* @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/assign/view.php', array('id' => $this->contextinstanceid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id ' . $this->userid . ' added comment for assignment submission with id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* assignsubmission_comments comment deleted event.
|
||||
*
|
||||
* @package assignsubmission_comments
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace assignsubmission_comments\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* assignsubmission_comments comment deleted event.
|
||||
*
|
||||
* @package assignsubmission_comments
|
||||
* @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/assign/view.php', array('id' => $this->contextinstanceid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id ' . $this->userid . ' deleted comment for assignment submission with id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
53
mod/data/classes/event/comment_created.php
Normal file
53
mod/data/classes/event/comment_created.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* mod_data comment created event.
|
||||
*
|
||||
* @package mod_data
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_data\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* mod_data comment created event.
|
||||
*
|
||||
* @package mod_data
|
||||
* @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/data/view.php', array('id' => $this->other['itemid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id ' . $this->userid . ' added comment for database activity with id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
53
mod/data/classes/event/comment_deleted.php
Normal file
53
mod/data/classes/event/comment_deleted.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* mod_data comment deleted event.
|
||||
*
|
||||
* @package mod_data
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_data\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* mod_data comment deleted event.
|
||||
*
|
||||
* @package mod_data
|
||||
* @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/data/view.php', array('id' => $this->other['itemid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id ' . $this->userid . ' deleted comment for database activity with id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
53
mod/glossary/classes/event/comment_created.php
Normal file
53
mod/glossary/classes/event/comment_created.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* mod_glossary comment created event.
|
||||
*
|
||||
* @package mod_glossary
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_glossary\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* mod_glossary comment created event.
|
||||
*
|
||||
* @package mod_glossary
|
||||
* @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/glossary/view.php', array('id' => $this->other['itemid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id ' . $this->userid . ' added comment for glossary activity with id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
53
mod/glossary/classes/event/comment_deleted.php
Normal file
53
mod/glossary/classes/event/comment_deleted.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* mod_glossary comment deleted event.
|
||||
*
|
||||
* @package mod_glossary
|
||||
* @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_glossary\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* mod_glossary comment deleted event.
|
||||
*
|
||||
* @package mod_glossary
|
||||
* @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/glossary/view.php', array('id' => $this->other['itemid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id ' . $this->userid . ' deleted comment for glossary activity with id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
@ -49,7 +49,6 @@ class comment_created extends \core\event\comment_created {
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id '. $this->userid . ' added comment for ' . $this->component . ' with page id ' .
|
||||
$this->other['itemid'];
|
||||
return 'User with id ' . $this->userid . ' added comment for wiki with page id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ class comment_deleted extends \core\event\comment_deleted {
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id '. $this->userid . ' deleted comment for ' . $this->component . ' with page id ' .
|
||||
$this->other['itemid'];
|
||||
return 'User with id ' . $this->userid . ' deleted comment for wiki with page id ' . $this->other['itemid'];
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class comments_viewed extends \core\event\comments_viewed {
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
return 'User with id '. $this->userid . ' viewed comments for wiki page id ' .
|
||||
return 'User with id ' . $this->userid . ' viewed comments for wiki page id ' .
|
||||
$this->objectid;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user