Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-7220

Replace hardcoded error message display with a theme class

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.1, 1.6.2, 1.6.3, 1.7, 1.8
    • Fix Version/s: 1.8, 1.9
    • Component/s: Accessibility
    • Labels:
      None
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      In moodle/lib/weblib.php around line 1050 (Moodle 1.6.3) we have the following lines:
      /**

      • Prints some red text
        *
      • @param string $error The text to be displayed in red
        */
        function formerr($error) {

      if (!empty($error))

      { echo '<font color="#ff0000">'. $error .'</font>'; }

      }
      I suggest we remove this hard-coded color and replace the above with the following:
      /**

      • Formats error text with notifyproblem class
        *
      • @param string $error The text to be displayed in notifyproblem class style
        */
        function formerr($error) {

      if (!empty($error))

      { echo '<span class="notifyproblem">'. $error .'</span>'; }

      }
      Joseph

      By the way, I thought that it was in Moodle's roadmap to totally remove all hard-coded formatting and do all the formatting in the themes. Has anyone ever tried to check Moodle code for all those deprecated <font></font> tags? There are still an awful lot of them!

        Attachments

          Activity

            People

            Assignee:
            nfreear Nick Freear
            Reporter:
            rezeau Joseph Rézeau
            Tester:
            Urs Hunkler
            Participants:
            Component watchers:
            Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              31/Mar/07