From 4bcc51185cf554a5beef08298b116d42fb5a5783 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 30 Dec 2009 15:19:55 +0000 Subject: [PATCH] MDL-21217, MDL-21198 simplified/improved outputlib help icon related apis + several fixed regresions --- admin/index.php | 2 +- admin/lang.php | 14 +- admin/mnet/mnet_review.html | 4 +- admin/roles/assign.php | 7 +- admin/roles/check.php | 5 +- admin/roles/define.php | 5 +- admin/roles/lib.php | 2 +- admin/roles/manage.php | 2 +- admin/roles/override.php | 5 +- admin/uploadpicture.php | 5 +- admin/uploaduser.php | 10 +- admin/user/user_bulk_forms.php | 4 +- backup/backup_form.html | 2 +- backup/restore_form.html | 8 +- blocks/search_forums/block_search_forums.php | 2 +- blocks/tags/block_tags.php | 2 +- course/editsection.php | 5 +- course/import/groups/mod.php | 5 +- course/lib.php | 2 +- course/modedit.php | 6 +- course/report/participation/index.php | 4 +- enrol/authorize/config_form.php | 8 +- enrol/authorize/uploadcsv.php | 6 +- enrol/imsenterprise/config.html | 18 +- filter/manage.php | 5 +- grade/edit/tree/lib.php | 20 +- lib/completionlib.php | 2 +- lib/deprecatedlib.php | 202 +++++++++++------- lib/form/advcheckbox.php | 13 +- lib/form/button.php | 13 +- lib/form/checkbox.php | 13 +- lib/form/file.php | 13 +- lib/form/filemanager.php | 13 +- lib/form/filepicker.php | 13 +- lib/form/format.php | 30 +-- lib/form/group.php | 16 +- lib/form/header.php | 13 +- lib/form/htmleditor.php | 13 +- lib/form/modgrade.php | 3 +- lib/form/password.php | 13 +- lib/form/radio.php | 13 +- lib/form/recaptcha.php | 14 +- lib/form/select.php | 16 +- lib/form/selectgroups.php | 13 +- lib/form/selectwithlink.php | 13 +- lib/form/static.php | 13 +- lib/form/text.php | 13 +- lib/form/textarea.php | 24 +-- lib/form/url.php | 13 +- lib/form/warning.php | 13 +- lib/formslib.php | 32 +-- lib/outputcomponents.php | 189 ++++++---------- lib/outputrenderers.php | 127 +++++------ lib/simpletest/testoutputlib.php | 2 +- lib/tablelib.php | 2 +- lib/weblib.php | 121 ----------- login/index_form.html | 2 +- message/edit.php | 4 +- mod/assignment/lib.php | 8 +- mod/chat/gui_header_js/chatinput.php | 4 +- mod/chat/gui_sockets/chatinput.php | 2 +- mod/data/edit.php | 2 +- mod/data/field.php | 2 +- mod/data/field/textarea/field.class.php | 2 +- mod/data/lib.php | 4 +- mod/data/preset.php | 8 +- mod/data/templates.php | 2 +- mod/feedback/analysis.php | 6 +- mod/feedback/edit.php | 2 +- mod/feedback/mapcourse.php | 6 +- mod/feedback/show_entries.php | 2 +- mod/feedback/view.php | 2 +- mod/forum/lib.php | 22 +- mod/forum/mod_form.php | 2 +- mod/glossary/editcategories.html | 2 +- mod/glossary/import.html | 6 +- mod/glossary/view.php | 2 +- mod/hotpot/report.php | 4 +- mod/hotpot/report/fullstat/report.php | 6 +- mod/lesson/import.php | 6 +- mod/lesson/importppt.php | 7 +- mod/lesson/locallib.php | 2 +- mod/lesson/renderer.php | 8 +- mod/quiz/edit.php | 4 +- mod/quiz/editlib.php | 4 +- mod/quiz/locallib.php | 11 +- mod/quiz/report/statistics/report.php | 3 +- .../report/statistics/statistics_table.php | 2 +- mod/wiki/admin.php | 6 +- mod/wiki/revertpages.html | 2 +- mod/wiki/view.php | 2 +- question/category_class.php | 6 +- question/editlib.php | 16 +- question/export.php | 6 +- question/export_form.php | 2 +- question/import.php | 6 +- question/type/calculated/questiontype.php | 12 +- question/type/questiontype.php | 6 +- question/type/random/questiontype.php | 6 +- tag/coursetags_edit.php | 4 +- tag/coursetags_more.php | 2 +- user/addnote.php | 4 +- user/extendenrol.php | 2 +- user/filters/courserole.php | 2 +- user/filters/date.php | 2 +- user/filters/globalrole.php | 2 +- user/filters/profilefield.php | 2 +- user/filters/select.php | 2 +- user/filters/text.php | 2 +- user/groupaddnote.php | 4 +- user/groupextendenrol.php | 2 +- user/index.php | 2 +- user/message.html | 13 +- 113 files changed, 441 insertions(+), 969 deletions(-) diff --git a/admin/index.php b/admin/index.php index 46c4bd4ab7..1fe7be1d1c 100644 --- a/admin/index.php +++ b/admin/index.php @@ -380,7 +380,7 @@ if (defined('WARN_DISPLAY_ERRORS_ENABLED')) { $lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}'); if (time() - $lastcron > 3600 * 24) { $strinstallation = get_string('installation', 'install'); - $helpbutton = $OUTPUT->help_icon(moodle_help_icon::make('install', $strinstallation)); + $helpbutton = $OUTPUT->help_icon('install', $strinstallation); echo $OUTPUT->box(get_string('cronwarning', 'admin').' '.$helpbutton, 'generalbox adminwarning'); } diff --git a/admin/lang.php b/admin/lang.php index b80df3dd60..f1d04684c1 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -496,7 +496,7 @@ $select->nothinglabel = $strchoosefiletoedit; $select->set_label($selectionlabel); echo $OUTPUT->select($select); - echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp)); + echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp); echo $OUTPUT->box_end(); if ($currentfile <> '') { @@ -763,7 +763,7 @@ $select->nothinglabel = $strchoosefiletoedit; $select->set_label($selectionlabel); echo $OUTPUT->select($select); - echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp)); + echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp); echo $OUTPUT->box_end(); if (!empty($currentfile)) { @@ -812,11 +812,11 @@ echo '
'; if ($uselocal) { - $strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage)); - $straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage)); + $strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon('langpackages', $strlanglocalpackage); + $straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon('langpackages', $strlangmasterpackage); } else { - $straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage)); - $strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage)); + $straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon('langpackages', $strlanglocalpackage); + $strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon('langpackages', $strlangmasterpackage); } @@ -876,7 +876,7 @@ } if (is_readable($ensrc)) { echo '
'.$strlangmasterenglish; - echo $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterenglish)); + echo $OUTPUT->help_icon('langpackages', $strlangmasterenglish); echo ''; echo "
\n

'; echo '

' . $strpublishstate; -echo $OUTPUT->help_icon(moodle_help_icon::make('status', $strpublishstate, 'notes')); +echo $OUTPUT->help_icon('status', $strpublishstate, 'notes'); echo $OUTPUT->select(html_select::make($state_names, 'state', empty($state) ? NOTES_STATE_PUBLIC : $state, false)); echo '

'; diff --git a/user/groupextendenrol.php b/user/groupextendenrol.php index dd11fe4a23..360526b7b4 100755 --- a/user/groupextendenrol.php +++ b/user/groupextendenrol.php @@ -134,7 +134,7 @@ if($course->enrollable == 2) { } $title = get_string('groupextendenrol'); -echo $OUTPUT->heading($title . $OUTPUT->help_icon(moodle_help_icon::make('groupextendenrol', $title))); +echo $OUTPUT->heading($title . $OUTPUT->help_icon('groupextendenrol', $title)); echo '
'; echo ''; echo ''; diff --git a/user/index.php b/user/index.php index e9f5a5557a..f4f5bd8993 100644 --- a/user/index.php +++ b/user/index.php @@ -988,7 +988,7 @@ $displaylist['groupextendenrol.php'] = get_string('groupextendenrol'); } - echo $OUTPUT->help_icon(moodle_help_icon::make("participantswithselectedusers", get_string("withselectedusers"))); + echo $OUTPUT->help_icon("participantswithselectedusers", get_string("withselectedusers")); $select = new html_select(); $select->options = $displaylist; $select->name = "formaction"; diff --git a/user/message.html b/user/message.html index 05ac9e5ed6..849a3b4edf 100644 --- a/user/message.html +++ b/user/message.html @@ -15,16 +15,17 @@ help_icon(moodle_help_icon::make("reading", get_string("helpreading"), "moodle", true)); + //TODO: replace by new editor stuff! + echo $OUTPUT->help_icon("reading", get_string("helpreading"), "moodle", true); echo "
"; - echo $OUTPUT->help_icon(moodle_help_icon::make("writing", get_string("helpwriting"), "moodle", true)); + echo $OUTPUT->help_icon("writing", get_string("helpwriting"), "moodle", true); echo "
"; - echo $OUTPUT->help_icon(moodle_help_icon::make("questions", get_string("helpquestions"), "moodle", true)); + echo $OUTPUT->help_icon("questions", get_string("helpquestions"), "moodle", true); echo "
"; if ($usehtmleditor) { - echo $OUTPUT->help_icon(moodle_help_icon::make("richtext2", get_string("helprichtext"), "moodle", true)); + echo $OUTPUT->help_icon("richtext2", get_string("helprichtext"), "moodle", true); } else { - emoticonhelpbutton("theform", "message"); + //emoticonhelpbutton("theform", "message"); to be replaced by new editor stuff } ?>
@@ -41,7 +42,7 @@ } else { choose_from_menu(format_text_menu(), "format", $format, ""); } - echo $OUTPUT->help_icon(moodle_help_icon::make("textformat", get_string("helpformatting"))); + echo $OUTPUT->help_icon("textformat", get_string("helpformatting")); ?> -- 2.39.5