MDL-22050 removing moodle/langconfig duplicates
authorPetr Skoda <skodak@moodle.org>
Sat, 10 Apr 2010 18:26:20 +0000 (18:26 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 10 Apr 2010 18:26:20 +0000 (18:26 +0000)
AMOS BEGIN
  MOV [thisdirection,core],[thisdirection,core_langconfig]
AMOS END

14 files changed:
lang/en/moodle.php
lib/editor/tinymce/lib.php
lib/pagelib.php
lib/pdflib.php
lib/weblib.php
mod/feedback/item/captcha/lib.php
mod/feedback/item/info/lib.php
mod/feedback/item/multichoice/lib.php
mod/feedback/item/multichoicerated/lib.php
mod/feedback/item/numeric/lib.php
mod/feedback/item/textarea/lib.php
mod/feedback/item/textfield/lib.php
mod/resource/locallib.php
mod/url/locallib.php

index 1870d37..c995731 100644 (file)
@@ -1643,7 +1643,6 @@ $string['themes'] = 'Themes';
 $string['themesaved'] = 'New theme saved';
 $string['thereareno'] = 'There are no {$a} in this course';
 $string['thiscategorycontains'] = 'This category contains';
-$string['thisdirection'] = 'ltr';
 $string['thislanguage'] = 'English';
 $string['time'] = 'Time';
 $string['timezone'] = 'Timezone';
index c999fb8..9e9d8e4 100644 (file)
@@ -71,7 +71,7 @@ class tinymce_texteditor extends texteditor {
         //TODO: reimplement rulesets, maybe it would be better to implement it some other way
         //$xmlruleset     = file_get_contents('extra/xhtml_ruleset.txt');
 
-        $directionality = get_string('thisdirection');
+        $directionality = get_string('thisdirection', 'langconfig');
         $strtime        = get_string('strftimetime');
         $strdate        = get_string('strftimedaydate');
         $lang           = current_language();
index fe41b89..333f14d 100644 (file)
@@ -1230,7 +1230,7 @@ class moodle_page {
         }
 
         $this->add_body_classes(get_browser_version_classes());
-        $this->add_body_class('dir-' . get_string('thisdirection'));
+        $this->add_body_class('dir-' . get_string('thisdirection', 'langconfig'));
         $this->add_body_class('lang-' . current_language());
         $this->add_body_class('yui-skin-sam'); // Make YUI happy, if it is used.
         $this->add_body_class($this->url_to_class_name($CFG->wwwroot));
index 708afe9..9f9f6a0 100644 (file)
@@ -120,7 +120,7 @@ class pdf extends TCPDF {
         $this->l['w_page']          = get_string('page');
         $this->l['a_meta_language'] = current_language();
         $this->l['a_meta_charset']  = 'UTF-8';
-        $this->l['a_meta_dir']      = get_string('thisdirection');
+        $this->l['a_meta_dir']      = get_string('thisdirection', 'langconfig');
     }
 
     /**
index b9f5f50..c84d951 100644 (file)
@@ -1928,7 +1928,7 @@ function highlightfast($needle, $haystack) {
 function get_html_lang($dir = false) {
     $direction = '';
     if ($dir) {
-        if (get_string('thisdirection') == 'rtl') {
+        if (right_to_left()) {
             $direction = ' dir="rtl"';
         } else {
             $direction = ' dir="ltr"';
@@ -3101,12 +3101,7 @@ function print_location_comment($file, $line, $return = false)
  * @return boolean true if the current language is right-to-left (Hebrew, Arabic etc)
  */
 function right_to_left() {
-    static $result;
-
-    if (!isset($result)) {
-        $result = get_string('thisdirection') == 'rtl';
-    }
-    return $result;
+    return (get_string('thisdirection', 'langconfig') === 'rtl');
 }
 
 
index fb74f8a..598a224 100644 (file)
@@ -61,7 +61,7 @@ class feedback_item_captcha extends feedback_item_base {
     function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false){
         global $SESSION, $CFG, $DB, $OUTPUT;
 
-        $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
+        $align = right_to_left() ? 'right' : 'left';
 
         $presentation = $item->presentation;
         $SESSION->feedback->item->captcha->charcount = $presentation;
index 968711b..5b34d49 100644 (file)
@@ -106,7 +106,7 @@ class feedback_item_info extends feedback_item_base {
 
     function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false){
         global $USER, $DB, $OUTPUT;
-        $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
+        $align = right_to_left() ? 'right' : 'left';
 
         $presentation = $item->presentation;
         if($highlightrequire AND $item->required AND strval($value) == '') {
index fcf596a..5d1c86e 100644 (file)
@@ -198,7 +198,7 @@ class feedback_item_multichoice extends feedback_item_base {
     function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false){
         global $OUTPUT;
         $info = $this->get_info($item);
-        $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
+        $align = right_to_left() ? 'right' : 'left';
 
         $presentation = explode (FEEDBACK_MULTICHOICE_LINE_SEP, $info->presentation);
 
index 85b1ed6..e7d75c2 100644 (file)
@@ -187,7 +187,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
 
     function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false){
         global $OUTPUT;
-        $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
+        $align = right_to_left() ? 'right' : 'left';
         $info = $this->get_info($item);
 
         $lines = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, $info->presentation);
index 049a977..3009c5e 100644 (file)
@@ -137,7 +137,7 @@ class feedback_item_numeric extends feedback_item_base {
 
     function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false){
         global $OUTPUT;
-        $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
+        $align = right_to_left() ? 'right' : 'left';
 
         //get the range
         $range_from_to = explode('|',$item->presentation);
index 5dbf421..b486482 100644 (file)
@@ -101,7 +101,7 @@ class feedback_item_textarea extends feedback_item_base {
 
     function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false){
         global $OUTPUT;
-        $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
+        $align = right_to_left() ? 'right' : 'left';
 
         $presentation = explode ("|", $item->presentation);
         if($highlightrequire AND $item->required AND strval($value) == '') {
index 6a01365..a9042c0 100644 (file)
@@ -98,7 +98,7 @@ class feedback_item_textfield extends feedback_item_base {
 
     function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false){
         global $OUTPUT;
-        $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
+        $align = right_to_left() ? 'right' : 'left';
 
         $presentation = explode ("|", $item->presentation);
         if($highlightrequire AND $item->required AND strval($value) == '') {
index 82907a5..fc05f02 100644 (file)
@@ -147,7 +147,7 @@ function resource_display_frame($resource, $cm, $course, $file) {
         $title = strip_tags(format_string($course->shortname.': '.$resource->name));
         $framesize = $config->framesize;
         $modulename = s(get_string('modulename','resource'));
-        $dir = get_string('thisdirection');
+        $dir = get_string('thisdirection', 'langconfig');
 
         $file = <<<EOF
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
index 501ba40..865ad5a 100644 (file)
@@ -153,7 +153,7 @@ function url_display_frame($url, $cm, $course) {
         $title = strip_tags(format_string($course->shortname.': '.$url->name));
         $framesize = $config->framesize;
         $modulename = s(get_string('modulename','url'));
-        $dir = get_string('thisdirection');
+        $dir = get_string('thisdirection', 'langconfig');
 
         $extframe = <<<EOF
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">