mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-21217, MDL-21198 simplified/improved outputlib help icon related apis + several fixed regresions
This commit is contained in:
parent
48a67d9f01
commit
4bcc51185c
113 changed files with 442 additions and 970 deletions
|
@ -257,11 +257,7 @@ class question_category_object {
|
|||
public function output_edit_lists() {
|
||||
global $OUTPUT;
|
||||
|
||||
$helpicon = new moodle_help_icon();
|
||||
$helpicon->text = get_string('editcategories', 'quiz');
|
||||
$helpicon->page = 'categories';
|
||||
$helpicon->module = 'question';
|
||||
echo $OUTPUT->heading_with_help($helpicon);
|
||||
echo $OUTPUT->heading_with_help(get_string('editcategories', 'quiz'), 'categories', 'question');
|
||||
|
||||
foreach ($this->editlists as $context => $list){
|
||||
$listhtml = $list->to_html(0, array('str'=>$this->str));
|
||||
|
|
|
@ -625,16 +625,14 @@ class question_bank_preview_action_column extends question_bank_action_column_ba
|
|||
protected function display_content($question, $rowclasses) {
|
||||
global $OUTPUT;
|
||||
if (question_has_capability_on($question, 'use')) {
|
||||
parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
|
||||
$image = new html_image();
|
||||
$image->src = $OUTPUT->pix_url('t/preview');
|
||||
$image->add_class('iconsmall');
|
||||
$image->alt = $this->strpreview;
|
||||
// Build the icon.
|
||||
$image = $OUTPUT->image($OUTPUT->pix_url('t/preview'), array('class'=>'iconsmall', 'alt'=>$this->strpreview));
|
||||
|
||||
$link = html_link::make($this->qbank->preview_question_url($question->id), $this->strpreview);
|
||||
$link = new html_link($this->qbank->preview_question_url($question->id), $image, array('title' => $this->strpreview));
|
||||
parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
|
||||
$link->add_action(new popup_action('click', $link->url, 'questionpreview', $options));
|
||||
$link->title = $this->strpreview;
|
||||
echo $OUTPUT->link_to_popup($link, $image);
|
||||
|
||||
echo $OUTPUT->link($link);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1934,7 +1932,7 @@ function create_new_question_button($categoryid, $params, $caption, $tooltip = '
|
|||
$form->button->disabled = $disabled;
|
||||
echo $OUTPUT->button($form);
|
||||
|
||||
echo $OUTPUT->help_icon(moodle_help_icon::make('types', get_string('createnewquestion', 'question'), 'question'));
|
||||
echo $OUTPUT->help_icon('types', get_string('createnewquestion', 'question'), 'question');
|
||||
$PAGE->requires->yui2_lib('dragdrop');
|
||||
$PAGE->requires->yui2_lib('container');
|
||||
if (!$choiceformprinted) {
|
||||
|
|
|
@ -119,11 +119,7 @@
|
|||
}
|
||||
|
||||
/// Display export form
|
||||
$helpicon = new moodle_help_icon();
|
||||
$helpicon->text = $strexportquestions;
|
||||
$helpicon->page = 'export';
|
||||
$helpicon->module = 'quiz';
|
||||
echo $OUTPUT->heading_with_help($helpicon);
|
||||
echo $OUTPUT->heading_with_help($strexportquestions, 'export', 'quiz');
|
||||
|
||||
$export_form->display();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class question_export_form extends moodleform {
|
|||
$radioarray = array();
|
||||
foreach ($fileformatnames as $shortname => $fileformatname) {
|
||||
$radioelement = &MoodleQuickForm::createElement('radio','format','',$fileformatname,$shortname);
|
||||
$radioelement->setHelpButton(array("$shortname",$fileformatname,"qformat_$shortname"));
|
||||
$mform->setHelpButton('format', array("$shortname",$fileformatname,"qformat_$shortname"));
|
||||
$radioarray[] = $radioelement;
|
||||
}
|
||||
$mform->addGroup($radioarray,'format','',array('<br />'),false);
|
||||
|
|
|
@ -151,11 +151,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
$helpicon = new moodle_help_icon();
|
||||
$helpicon->text = $txt->importquestions;
|
||||
$helpicon->page = 'import';
|
||||
$helpicon->module = 'quiz';
|
||||
echo $OUTPUT->heading_with_help($helpicon);
|
||||
echo $OUTPUT->heading_with_help($txt->importquestions, 'import', 'quiz');
|
||||
|
||||
/// Print upload form
|
||||
$import_form->display();
|
||||
|
|
|
@ -573,18 +573,10 @@ class question_calculated_qtype extends default_questiontype {
|
|||
return;
|
||||
break;
|
||||
case 'datasetdefinitions':
|
||||
$helpicon = new moodle_help_icon();
|
||||
$helpicon->text = get_string("choosedatasetproperties", "quiz");
|
||||
$helpicon->page = 'questiondatasets';
|
||||
$helpicon->module = 'quiz';
|
||||
echo $OUTPUT->heading_with_help($helpicon);
|
||||
echo $OUTPUT->heading_with_help(get_string("choosedatasetproperties", "quiz"), 'questiondatasets', 'quiz');
|
||||
break;
|
||||
case 'datasetitems':
|
||||
$helpicon = new moodle_help_icon();
|
||||
$helpicon->text = get_string("editdatasets", "quiz");
|
||||
$helpicon->page = 'questiondatasets';
|
||||
$helpicon->module = 'quiz';
|
||||
echo $OUTPUT->heading_with_help($helpicon);
|
||||
echo $OUTPUT->heading_with_help(get_string("editdatasets", "quiz"), 'questiondatasets', 'quiz');
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -228,11 +228,7 @@ class default_questiontype {
|
|||
global $OUTPUT;
|
||||
$heading = $this->get_heading(empty($question->id));
|
||||
|
||||
$helpicon = new moodle_help_icon();
|
||||
$helpicon->text = $heading;
|
||||
$helpicon->page = $this->name();
|
||||
$helpicon->module = $this->plugin_name();
|
||||
echo $OUTPUT->heading_with_help($helpicon);
|
||||
echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
|
||||
|
||||
$permissionstrs = array();
|
||||
if (!empty($question->id)){
|
||||
|
|
|
@ -89,11 +89,7 @@ class random_qtype extends default_questiontype {
|
|||
|
||||
function display_question_editing_page(&$mform, $question, $wizardnow){
|
||||
$heading = $this->get_heading(empty($question->id));
|
||||
$helpicon = new moodle_help_icon();
|
||||
$helpicon->text = $heading;
|
||||
$helpicon->page = $this->name();
|
||||
$helpicon->module = $this->plugin_name();
|
||||
echo $OUTPUT->heading_with_help($helpicon);
|
||||
echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
|
||||
$mform->display();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue