MDL-45758 tool_monitor: added help icon for subscriptions

Original issue - MDL-47152
This commit is contained in:
Mark Nelson 2014-09-19 19:51:11 -07:00 committed by Ankit Agarwal
parent d55f3e03b1
commit 4e18940f83
2 changed files with 15 additions and 1 deletions

View File

@ -48,6 +48,11 @@ class subs extends \table_sql implements \renderable {
*/
protected $context;
/**
* @var \tool_monitor\output\helpicon\renderer the help icon renderer.
*/
protected $helpiconrenderer;
/**
* Sets up the table_log parameters.
*
@ -57,6 +62,8 @@ class subs extends \table_sql implements \renderable {
* @param int $perpage Number of rules to display per page.
*/
public function __construct($uniqueid, \moodle_url $url, $courseid = 0, $perpage = 100) {
global $PAGE;
parent::__construct($uniqueid);
$this->set_attribute('class', 'toolmonitor subscriptions generaltable generalbox');
@ -76,6 +83,7 @@ class subs extends \table_sql implements \renderable {
$this->pageable(true);
$this->is_downloadable(false);
$this->define_baseurl($url);
$this->helpiconrenderer = $PAGE->get_renderer('tool_monitor', 'helpicon');
}
/**
@ -86,7 +94,11 @@ class subs extends \table_sql implements \renderable {
* @return string html used to display the column field.
*/
public function col_name(\tool_monitor\subscription $sub) {
return $sub->get_name($this->context);
$name = $sub->get_name($this->context);
$helpicon = new \tool_monitor\output\helpicon\renderable('subscription', $sub->id);
$helpicon = $this->helpiconrenderer->render($helpicon);
return $name . $helpicon;
}
/**

View File

@ -74,6 +74,8 @@ $string['selectplugin_help'] = "Select a plugin that you are interested in monit
$string['subareyousure'] = 'Are you sure you want to delete this subscription for the rule "{$a}"?';
$string['subcreatesuccess'] = "Subscription successfully created";
$string['subdeletesuccess'] = "Subscription successfully removed";
$string['subhelp'] = 'Subscription details';
$string['subhelp_help'] = 'This subscription listens for when the event \'{$a->eventname}\' has been triggered in \'{$a->moduleinstance}\' {$a->frequency} time(s) in {$a->minutes} minute(s).';
$string['title'] = '{$a->coursename} : {$a->reportname}';
$string['tool/monitor:managerules'] = 'Manage event monitor rules';
$string['tool/monitor:subscribe'] = 'Subscribe to event monitor rules';