]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11298 use textlib_get_instance() instead of new textlib()
authorskodak <skodak>
Sun, 16 Sep 2007 18:49:41 +0000 (18:49 +0000)
committerskodak <skodak>
Sun, 16 Sep 2007 18:49:41 +0000 (18:49 +0000)
grade/import/csv/index.php
grade/import/grade_import_form.php
grade/import/xml/index.php
lib/moodlelib.php
lib/textlib.class.php
mod/data/view.php
tag/lib.php

index 552193af3da6fce6a8c173234cb4ac3204498b5b..0616a7c2c2303800b1b63b54e560aacfaa917770 100755 (executable)
@@ -333,7 +333,7 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
 
     $text = my_file_get_contents($filename);
     // trim utf-8 bom
-    $textlib = new textlib();
+    $textlib = textlib_get_instance();
     /// normalize line endings and do the encoding conversion
     $text = $textlib->convert($text, $formdata->encoding);
     $text = $textlib->trim_utf8_bom($text);
index e0018e1ad6d21f55309fd36de4d7364adabacda0..df29572e631b292bf95b8f36b62340ee58d533e1 100755 (executable)
@@ -13,7 +13,7 @@ class grade_import_form extends moodleform {
         $mform->addElement('file', 'userfile', get_string('file'));
         $mform->setType('userfile', PARAM_FILE);
         $mform->addRule('userfile', null, 'required');
-        $textlib = new textlib();
+        $textlib = textlib_get_instance();
         $encodings = $textlib->get_encodings();
         $mform->addElement('select', 'encoding', get_string('encoding', 'grades'), $encodings);
 
index ef7cb9a5e7f0fef937f8f3218b28cc526b40f297..73e081a49acc33a6635b7ead6a367f063c5bbe29 100755 (executable)
@@ -49,7 +49,7 @@ if ( $formdata = $mform->get_data()) {
     $text = my_file_get_contents($filename);
 
     // trim utf-8 bom
-    $textlib = new textlib();
+    $textlib = textlib_get_instance();
     // converts to propert unicode
     $text = $textlib->convert($text, $formdata->encoding);
     $text = $textlib->trim_utf8_bom($text);
index d29c2c9f552c02c2aa143663dfe2780e7727f8c3..7164564022167db1f1992ffb47f2ded1267caabc 100644 (file)
@@ -561,7 +561,7 @@ function clean_param($param, $type) {
             //cleanup the spaces
             $param = preg_replace('/ +/', ' ', $param);
             $param = trim($param);
-            $textlib = new textlib();
+            $textlib = textlib_get_instance();
             return $textlib->substr($param, 0, TAG_MAX_LENGTH);
             
 
@@ -3081,7 +3081,7 @@ function check_password_policy($password, &$errmsg) {
         return true;
     }
 
-    $textlib = new textlib();
+    $textlib = textlib_get_instance();
     $errmsg = '';
     if ($textlib->strlen($password) < $CFG->minpasswordlength) {
         $errmsg = get_string('errorminpasswordlength', 'auth', $CFG->minpasswordlength);
index 08e5de3a4b21f811f2b211f0d37583e014244868..d67c5d0e4d2bc026c450c8174b4892d6ab3b68fd 100644 (file)
@@ -70,7 +70,7 @@
 ///                 its capabilities so, don't forget to make the conversion
 ///                 from every wrapper function!
 
-function textlib_get_instance () {
+function textlib_get_instance() {
     static $instance;
     if (!is_object($instance)) {
         $instance = new textlib();
index 60602e3742e46c1f10d48313083af218027fc0f2..e17e53b9ce4dad480b174d71c896febc9965633c 100755 (executable)
         $paging = NULL;
     }
 
-    $textlib = new textlib();
+    $textlib = textlib_get_instance();
     if ($textlib->strlen($search) < 2) {
         $search = '';
     }
index b973ed0642e6b337617168097d5b7e8e0976dc57..e15f2061b088cdb644a3bdc30f23fdf0072e41ec 100644 (file)
@@ -220,7 +220,7 @@ function tag_display_name($tag_object){
 
     if( empty($CFG->keeptagnamecase) ) {
         //this is the normalized tag name
-        $textlib = new textlib();
+        $textlib = textlib_get_instance();
         return $textlib->strtotitle($tag_object->name);
     }
     else {