Skip to content

Commit 4be841f

Browse files
committed
fix helpicon
1 parent 97c7bb6 commit 4be841f

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

Diff for: classes/output/helpicon.php

+14-10
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,22 @@ class helpicon {
4242
*/
4343
public function __construct($htmlclass, $content) {
4444
global $CFG;
45-
$iconurl = $CFG->wwwroot . '/pix/a/help.png';
46-
$icon = \html_writer::img($iconurl, $content);
45+
$iconurl = $CFG->wwwroot . '/pix/a/help.svg';
46+
$iconstyle = ['style' =>
47+
'max-width: 20px; max-height: 20px; margin: 0; padding: 0; box-sizing: content-box; margin-right: .5rem;'];
48+
$icon = \html_writer::img($iconurl, $content, $iconstyle);
49+
// 'style' => 'display: inline-block; max-width: 100%; max-height: 100%;',
4750
$class = $htmlclass;
4851
$iconattributes = ['role' => 'button',
49-
'data-container' => 'body',
50-
'data-toggle' => 'popover',
51-
'data-placement' => 'right',
52-
'data-action' => 'showhelpicon',
53-
'data-html' => 'true',
54-
'data-trigger' => 'focus',
55-
'tabindex' => '0',
56-
'data-content' => '<div class=&quot;no-overflow&quot;><p>' . $content . '</p> </div>', ];
52+
'style' => 'display: inline;',
53+
'data-container' => 'body',
54+
'data-toggle' => 'popover',
55+
'data-placement' => 'right',
56+
'data-action' => 'showhelpicon',
57+
'data-html' => 'true',
58+
'data-trigger' => 'focus',
59+
'tabindex' => '0',
60+
'data-content' => '<div class=&quot;no-overflow&quot;><p>' . $content . '</p> </div>', ];
5761
$this->helpobject = \html_writer::span($icon, $class, $iconattributes);
5862
}
5963

Diff for: classes/tables/userstats_table.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ public function set_helpactivity() {
157157
$content = get_string('helpamountofactivity', 'moodleoverflow');
158158
$helpobject = new helpicon($htmlclass, $content);
159159
$this->helpactivity = new \stdClass();
160-
$this->helpactivity->iconurl = $CFG->wwwroot . '/pix/a/help.png';
160+
$this->helpactivity->object = $helpobject->get_helpicon();
161+
/*
162+
$this->helpactivity = new \stdClass();
163+
$this->helpactivity->iconurl = $CFG->wwwroot . '/pix/a/help.svg';
161164
$this->helpactivity->icon = \html_writer::img($this->helpactivity->iconurl,
162165
get_string('helpamountofactivity', 'moodleoverflow'));
163166
$this->helpactivity->class = 'helpactivityclass btn btn-link';
@@ -175,7 +178,7 @@ public function set_helpactivity() {
175178
176179
$this->helpactivity->object = \html_writer::span($this->helpactivity->icon,
177180
$this->helpactivity->class,
178-
$this->helpactivity->iconattributes);
181+
$this->helpactivity->iconattributes);*/
179182
}
180183

181184
// Functions that show the data.

Diff for: locallib.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
15271527
* @param stdClass $limitedanswersetting Two Unix timestamp wrapped in a stdClass, upper and lower label for answering.
15281528
* @return bool
15291529
*/
1530-
function is_currently_time_limited($limitedanswersetting) {
1530+
function is_currently_time_limited($limitedanswersetting) : bool {
15311531
return ($limitedanswersetting->la_starttime != 0 && $limitedanswersetting->la_starttime > time())
15321532
|| ($limitedanswersetting->la_endtime != 0 && $limitedanswersetting->la_endtime < time());
15331533
}
@@ -1559,6 +1559,7 @@ function render_limited_answer($htmlattributes, &$commands, $infolimited, $role,
15591559
'attributes' => $limitedanswerattributes,
15601560
'limitedanswer' => $role, ];
15611561
}
1562+
15621563
/**
15631564
* Prints all posts of the discussion in a nested form.
15641565
*

0 commit comments

Comments
 (0)