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

fix reverse display of hebrew (rtl) legend and title text in course user log report graph

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      php ImageTTFText() function does not seem to support unicode (properly)
      and when passing an hebrew (maybe other rtl language) text it is displayed in reverse.

      so i patched the moodle/course/report/log/graph.php as follows:

      replace the line:
      $graph->parameter['title'] = get_string("hitsoncourse", "", $a);

      with:
      if (right_to_left())

      { $graph->parameter['title'] = iconv("ISO-8859-8", "UTF-8", hebrev(iconv("UTF-8", "ISO-8859-8", get_string("hitsoncourse", "", $a)))); }

      else

      { $graph->parameter['title'] = get_string("hitsoncourse", "", $a); }

      replace the line:
      $graph->parameter['y_label_left'] = get_string("hits");

      with:
      if (right_to_left())

      { $graph->parameter['y_label_left'] = iconv("ISO-8859-8", "UTF-8", hebrev(iconv("UTF-8", "ISO-8859-8", get_string("hits") ) ) ); }

      else

      { $graph->parameter['y_label_left'] = get_string("hits"); }

      it appears two times in the file. (do not forget to change both!)

      btw, here is a link to a similar issue:
      http://tracker.moodle.org/browse/MDL-19270

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              nadavkav Nadav Kavalerchik
              Tester:
              Nobody Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: