MDL-45758 tool_monitor: added help icon for rules

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

View File

@ -48,6 +48,11 @@ class rules 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 rules 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 subscriberules generaltable generalbox');
@ -76,6 +83,7 @@ class rules 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 rules extends \table_sql implements \renderable {
* @return string html used to display the column field.
*/
public function col_name(\tool_monitor\rule $rule) {
return $rule->get_name($this->context);
$name = $rule->get_name($this->context);
$helpicon = new \tool_monitor\output\helpicon\renderable('rule', $rule->id);
$helpicon = $this->helpiconrenderer->render($helpicon);
return $name . $helpicon;
}
/**

View File

@ -61,6 +61,8 @@ $string['processevents'] = 'Process events';
$string['ruleareyousure'] = 'Are you sure you want to delete rule "{$a}"?';
$string['rulecopysuccess'] = 'Rule successfully copied';
$string['ruledeletesuccess'] = 'Rule successfully deleted';
$string['rulehelp'] = 'Rule details';
$string['rulehelp_help'] = 'This rule listens for when the event \'{$a->eventname}\' in \'{$a->eventcomponent}\' has been triggered {$a->frequency} time(s) in {$a->minutes} minute(s).';
$string['rulenopermissions'] = 'You do not have permissions to "{$a} a rule"';
$string['rulescansubscribe'] = 'Rules you can subscribe to';
$string['selectcourse'] = 'Visit this report at course level to get a list of possible modules';