From 4e18940f83b8beb835e9ecb41b007f41b19ae89d Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Fri, 19 Sep 2014 19:51:11 -0700 Subject: [PATCH] MDL-45758 tool_monitor: added help icon for subscriptions Original issue - MDL-47152 --- .../monitor/classes/output/managesubs/subs.php | 14 +++++++++++++- admin/tool/monitor/lang/en/tool_monitor.php | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/admin/tool/monitor/classes/output/managesubs/subs.php b/admin/tool/monitor/classes/output/managesubs/subs.php index 1195894724d..773f1be74bb 100644 --- a/admin/tool/monitor/classes/output/managesubs/subs.php +++ b/admin/tool/monitor/classes/output/managesubs/subs.php @@ -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; } /** diff --git a/admin/tool/monitor/lang/en/tool_monitor.php b/admin/tool/monitor/lang/en/tool_monitor.php index b1529b57bee..0e2bffc4bac 100644 --- a/admin/tool/monitor/lang/en/tool_monitor.php +++ b/admin/tool/monitor/lang/en/tool_monitor.php @@ -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';