forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-43293 Events: Added comments event in modules supporting comments
- Loading branch information
Rajesh Taneja
committed
Dec 23, 2013
1 parent
edd9bb4
commit a55eaf0
Showing
18 changed files
with
550 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* @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 <[email protected]> | ||
* @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. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* @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 <[email protected]> | ||
* @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. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* @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 <[email protected]> | ||
* @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']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* @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 <[email protected]> | ||
* @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']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
mod/assign/submission/comments/classes/event/comment_created.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* @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 <[email protected]> | ||
* @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']; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
mod/assign/submission/comments/classes/event/comment_deleted.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* @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 <[email protected]> | ||
* @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']; | ||
} | ||
} |
Oops, something went wrong.