MDL-21217, MDL-21198 simplified/improved outputlib help icon related apis + several fixed regresions

This commit is contained in:
Petr Skoda 2009-12-30 15:19:55 +00:00
parent 48a67d9f01
commit 4bcc51185c
113 changed files with 442 additions and 970 deletions

View file

@ -4212,7 +4212,7 @@ function forum_search_form($course, $search='') {
$output = '<div class="forumsearch">';
$output .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline">';
$output .= '<fieldset class="invisiblefieldset">';
$output .= $OUTPUT->help_icon(moodle_help_icon::make('search', get_string('search')));
$output .= $OUTPUT->help_icon('search', get_string('search'));
$output .= '<input name="search" type="text" size="18" value="'.s($search, true).'" alt="search" />';
$output .= '<input value="'.get_string('searchforums', 'forum').'" type="submit" />';
$output .= '<input name="id" type="hidden" value="'.$course->id.'" />';
@ -5890,7 +5890,7 @@ function forum_print_discussion($course, $cm, $forum, $discussion, $post, $mode,
}
if ($forum->scale < 0) {
if ($scale = $DB->get_record("scale", array("id" => abs($forum->scale)))) {
echo $OUTPUT->help_button(help_button::make_scale_menu($course->id, $scale));
echo $OUTPUT->help_icon_scale($course->id, $scale);
}
}
echo '</div>';
@ -8051,10 +8051,7 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
if (forum_is_forcesubscribed($forumobject)) {
$notekey = $forum->add(get_string("forcessubscribe", 'forum'));
$string = get_string('allowchoice', 'forum');
$helpbutton = new moodle_help_icon();
$helpbutton->page = "subscription";
$helpbutton->text = $string;
$helpbutton->module = "forum";
$helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
if (has_capability('mod/forum:managesubscriptions', $PAGE->cm->context)) {
$url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'force'=>'no'));
$forum->add($string, $url, navigation_node::TYPE_SETTING);
@ -8064,18 +8061,11 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
} else if ($forumobject->forcesubscribe == FORUM_DISALLOWSUBSCRIBE) {
$string = get_string('disallowsubscribe', 'forum');
$notekey = $forum->add($string);
$helpbutton = new moodle_help_icon();
$helpbutton->page = "subscription";
$helpbutton->text = $string;
$helpbutton->module = "forum";
$helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
} else {
$string = get_string("forcesubscribe", "forum");
$notekey = $forum->add(get_string("allowsallsubscribe", 'forum'));
$helpbutton = new moodle_help_icon();
$helpbutton->page = "subscription";
$helpbutton->text = $string;
$helpbutton->module = "forum";
$helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
if (has_capability('mod/forum:managesubscriptions', $PAGE->cm->context)) {
$url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'force'=>'yes'));
@ -8113,7 +8103,7 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
if ($notekey!==false) {
$forum->get($notekey)->add_class('note');
if ($helpbutton!==false) {
$forum->get($notekey)->helpbutton = $OUTPUT->help_icon($helpbutton);
$forum->get($notekey)->helpbutton = $helpbutton;
}
}
if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {

View file

@ -175,7 +175,7 @@ class mod_forum_mod_form extends moodleform_mod {
//we want the form to display them if they are set.
if ($typevalue[0]=='news') {
$type->addOption(get_string('namenews', 'forum'), 'news');
$type->setHelpButton(array('forumtypenews', get_string('forumtype', 'forum'), 'forum'));
$mform->setHelpButton('type', array('forumtypenews', get_string('forumtype', 'forum'), 'forum'));
$type->freeze();
$type->setPersistantFreeze(true);
}