mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-40052 events: Add get_url() api to various report content_viewed classes
This commit is contained in:
parent
bb0038074e
commit
b9e1f0997c
5 changed files with 60 additions and 0 deletions
|
@ -31,5 +31,17 @@ namespace report_log\event;
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
class content_viewed extends \core\event\content_viewed {
|
class content_viewed extends \core\event\content_viewed {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns relevant URL.
|
||||||
|
*
|
||||||
|
* @return \moodle_url
|
||||||
|
*/
|
||||||
|
public function get_url() {
|
||||||
|
if (!empty($this->other['url'])) {
|
||||||
|
return new \moodle_url($this->other['url']);
|
||||||
|
}
|
||||||
|
return new \moodle_url('report/log/index.php', array('id' => $this->courseid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,5 +31,17 @@ namespace report_loglive\event;
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
class content_viewed extends \core\event\content_viewed {
|
class content_viewed extends \core\event\content_viewed {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns relevant URL.
|
||||||
|
*
|
||||||
|
* @return \moodle_url
|
||||||
|
*/
|
||||||
|
public function get_url() {
|
||||||
|
if (!empty($this->other['url'])) {
|
||||||
|
return new \moodle_url($this->other['url']);
|
||||||
|
}
|
||||||
|
return new \moodle_url('report/loglive/index.php', array('id' => $this->courseid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,5 +31,17 @@ namespace report_outline\event;
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
class content_viewed extends \core\event\content_viewed {
|
class content_viewed extends \core\event\content_viewed {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns relevant URL.
|
||||||
|
*
|
||||||
|
* @return \moodle_url
|
||||||
|
*/
|
||||||
|
public function get_url() {
|
||||||
|
if (!empty($this->other['url'])) {
|
||||||
|
return new \moodle_url($this->other['url']);
|
||||||
|
}
|
||||||
|
return new \moodle_url('report/outline/index.php', array('id' => $this->courseid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,5 +31,17 @@ namespace report_participation\event;
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
class content_viewed extends \core\event\content_viewed {
|
class content_viewed extends \core\event\content_viewed {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns relevant URL.
|
||||||
|
*
|
||||||
|
* @return \moodle_url
|
||||||
|
*/
|
||||||
|
public function get_url() {
|
||||||
|
if (!empty($this->other['url'])) {
|
||||||
|
return new \moodle_url($this->other['url']);
|
||||||
|
}
|
||||||
|
return new \moodle_url('report/participation/index.php', array('id' => $this->courseid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,5 +31,17 @@ namespace report_stats\event;
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
class content_viewed extends \core\event\content_viewed {
|
class content_viewed extends \core\event\content_viewed {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns relevant URL.
|
||||||
|
*
|
||||||
|
* @return \moodle_url
|
||||||
|
*/
|
||||||
|
public function get_url() {
|
||||||
|
if (!empty($this->other['url'])) {
|
||||||
|
return new \moodle_url($this->other['url']);
|
||||||
|
}
|
||||||
|
return new \moodle_url('report/stats/index.php', array('id' => $this->courseid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue