Permalink
Browse files

MDL-40438 migrate all collatorlib:: and textlib:: uses

  • Loading branch information...
1 parent e7c21ac commit 2f1e464a88c3783928470349a027a93c96c24442 @skodak skodak committed Aug 6, 2013
Showing with 423 additions and 425 deletions.
  1. +1 −1 admin/blocks.php
  2. +1 −1 admin/localplugins.php
  3. +1 −1 admin/mnet/access_control.php
  4. +3 −3 admin/registration/forms.php
  5. +1 −1 admin/reports.php
  6. +2 −2 admin/roles/classes/define_role_table_advanced.php
  7. +4 −4 admin/tool/uploadcourse/classes/helper.php
  8. +1 −1 admin/tool/uploadcourse/classes/step1_form.php
  9. +1 −1 admin/tool/uploadcourse/cli/uploadcourse.php
  10. +5 −5 admin/tool/uploaduser/locallib.php
  11. +1 −1 admin/tool/uploaduser/user_form.php
  12. +2 −2 admin/tool/xmldb/actions/check_oracle_semantics/check_oracle_semantics.class.php
  13. +1 −1 admin/tools.php
  14. +5 −5 auth/cas/auth.php
  15. +8 −8 auth/db/auth.php
  16. +32 −32 auth/ldap/auth.php
  17. +1 −1 backup/converter/moodle1/handlerlib.php
  18. +1 −1 backup/converter/moodle1/lib.php
  19. +3 −3 backup/util/dbops/backup_plan_dbops.class.php
  20. +1 −1 backup/util/helper/backup_cron_helper.class.php
  21. +1 −1 blocks/activity_modules/block_activity_modules.php
  22. +1 −1 blocks/community/forms.php
  23. +3 −3 blocks/completionstatus/details.php
  24. +10 −10 blocks/navigation/block_navigation.php
  25. +3 −3 blocks/rss_client/block_rss_client.php
  26. +3 −3 blog/lib.php
  27. +2 −2 course/dnduploadlib.php
  28. +5 −5 course/lib.php
  29. +1 −1 course/manage.php
  30. +1 −1 course/publish/forms.php
  31. +2 −2 course/renderer.php
  32. +2 −2 enrol/database/lib.php
  33. +4 −4 enrol/flatfile/lib.php
  34. +1 −1 enrol/flatfile/settings.php
  35. +1 −1 enrol/flatfile/tests/flatfile_test.php
  36. +1 −1 enrol/guest/locallib.php
  37. +2 −2 enrol/ldap/lib.php
  38. +2 −2 enrol/ldap/settingslib.php
  39. +1 −1 enrol/paypal/ipn.php
  40. +1 −1 enrol/self/locallib.php
  41. +1 −1 grade/edit/scale/edit_form.php
  42. +1 −1 grade/import/grade_import_form.php
  43. +1 −1 group/group_form.php
  44. +1 −1 group/grouping_form.php
  45. +5 −5 index.php
  46. +1 −1 iplookup/lib.php
  47. +29 −29 lib/adminlib.php
  48. +4 −4 lib/bennu/iCalendar_rfc2445.php
  49. +1 −1 lib/bennu/readme_moodle.txt
  50. +1 −1 lib/blocklib.php
  51. +24 −24 lib/classes/collator.php
  52. +9 −9 lib/coursecatlib.php
  53. +2 −2 lib/csvlib.class.php
  54. +4 −4 lib/datalib.php
  55. +5 −5 lib/deprecatedlib.php
  56. +1 −1 lib/editor/tinymce/adminlib.php
  57. +2 −2 lib/editor/tinymce/plugins/spellchecker/classes/GoogleSpell.php
  58. +1 −1 lib/excellib.class.php
  59. +2 −2 lib/filebrowser/file_info.php
  60. +1 −1 lib/filebrowser/file_info_context_course.php
  61. +3 −3 lib/filebrowser/file_info_stored.php
  62. +6 −6 lib/filestorage/file_archive.php
  63. +4 −4 lib/filestorage/file_storage.php
  64. +5 −5 lib/filestorage/zip_archive.php
  65. +5 −5 lib/filterlib.php
  66. +1 −1 lib/gradelib.php
  67. +2 −2 lib/graphlib.php
  68. +2 −2 lib/html2text.php
  69. +1 −1 lib/html2text_readme.txt
  70. +1 −1 lib/medialib.php
  71. +1 −1 lib/modinfolib.php
  72. +35 −36 lib/moodlelib.php
  73. +2 −2 lib/phpmailer/moodle_phpmailer.php
  74. +1 −1 lib/phpunit/classes/util.php
  75. +1 −1 lib/questionlib.php
  76. +1 −1 lib/simplepie/moodle_simplepie.php
  77. +2 −2 lib/tests/html2text_test.php
  78. +5 −5 lib/tests/moodlelib_test.php
  79. +7 −7 lib/tokeniserlib.php
  80. +3 −3 lib/upgradelib.php
  81. +12 −12 lib/weblib.php
  82. +1 −1 login/forgot_password.php
  83. +1 −1 login/index.php
  84. +1 −1 login/signup_form.php
  85. +1 −1 login/token.php
  86. +4 −4 message/lib.php
  87. +1 −2 mod/assign/adminlib.php
  88. +1 −1 mod/book/db/upgradelib.php
  89. +5 −5 mod/book/tool/importhtml/locallib.php
  90. +1 −1 mod/data/import_form.php
  91. +1 −1 mod/data/view.php
  92. +1 −1 mod/feedback/import.php
  93. +1 −1 mod/forum/mod_form.php
  94. +2 −2 mod/glossary/edit_form.php
  95. +1 −1 mod/glossary/editcategories.php
  96. +1 −1 mod/glossary/exportentry.php
  97. +1 −1 mod/glossary/import.php
  98. +3 −3 mod/glossary/lib.php
  99. +4 −4 mod/glossary/print.php
  100. +9 −9 mod/glossary/sql.php
  101. +4 −4 mod/glossary/view.php
  102. +2 −2 mod/label/lib.php
  103. +3 −3 mod/lesson/format.php
  104. +3 −3 mod/lti/locallib.php
  105. +2 −2 mod/quiz/settings.php
  106. +2 −2 mod/survey/download.php
  107. +1 −1 mod/upgrade.txt
  108. +2 −2 mod/wiki/locallib.php
  109. +2 −2 mod/wiki/pagelib.php
  110. +1 −1 question/engine/bank.php
  111. +2 −2 question/engine/datalib.php
  112. +2 −2 question/engine/upgrade/upgradelib.php
  113. +4 −4 question/format.php
  114. +4 −4 question/format/learnwise/format.php
  115. +2 −2 question/type/multianswer/renderer.php
  116. +1 −1 report/completion/index.php
  117. +4 −4 report/log/locallib.php
  118. +2 −2 report/progress/index.php
  119. +2 −2 repository/filesystem/lib.php
  120. +2 −2 repository/googledocs/lib.php
  121. +2 −2 repository/lib.php
  122. +1 −1 repository/local/lib.php
  123. +1 −1 tag/coursetagslib.php
  124. +9 −9 tag/lib.php
  125. +2 −2 tag/locallib.php
  126. +1 −1 user/editadvanced_form.php
  127. +2 −2 user/lib.php
View
@@ -115,7 +115,7 @@
$blocknames[$blockid] = $blockname;
}
}
- collatorlib::asort($blocknames);
+ core_collator::asort($blocknames);
foreach ($blocknames as $blockid=>$strblockname) {
$block = $blocks[$blockid];
@@ -55,7 +55,7 @@
}
$plugins[$plugin] = $strpluginname;
}
-collatorlib::asort($plugins);
+core_collator::asort($plugins);
foreach ($plugins as $plugin => $name) {
$uninstall = '';
@@ -103,7 +103,7 @@
$usernames = explode(',', $form->username);
foreach ($usernames as $username) {
- $username = trim(textlib::strtolower($username));
+ $username = trim(core_text::strtolower($username));
if (!empty($username)) {
if (mnet_update_sso_access_control($username, $form->mnet_host_id, $form->accessctrl)) {
if ($form->accessctrl == 'allow') {
@@ -137,8 +137,8 @@ public function definition() {
$options = array();
foreach ($hubs as $hub) {
//to not display a name longer than 100 character (too big)
- if (textlib::strlen($hub['name']) > 100) {
- $hubname = textlib::substr($hub['name'], 0, 100);
+ if (core_text::strlen($hub['name']) > 100) {
+ $hubname = core_text::substr($hub['name'], 0, 100);
$hubname = $hubname . "...";
} else {
$hubname = $hub['name'];
@@ -287,7 +287,7 @@ public function definition() {
$mform->addHelpButton('description', 'sitedesc', 'hub');
$languages = get_string_manager()->get_list_of_languages();
- collatorlib::asort($languages);
+ core_collator::asort($languages);
$mform->addElement('select', 'language', get_string('sitelang', 'hub'),
$languages);
$mform->setType('language', PARAM_ALPHANUMEXT);
View
@@ -57,7 +57,7 @@
}
$plugins[$plugin] = $strpluginname;
}
-collatorlib::asort($plugins);
+core_collator::asort($plugins);
$like = $DB->sql_like('plugin', '?', true, true, false, '|');
$params = array('report|_%');
@@ -99,8 +99,8 @@ public function read_submitted_permissions() {
$shortname = optional_param('shortname', null, PARAM_RAW);
if (!is_null($shortname)) {
$this->role->shortname = $shortname;
- $this->role->shortname = textlib::specialtoascii($this->role->shortname);
- $this->role->shortname = textlib::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
+ $this->role->shortname = core_text::specialtoascii($this->role->shortname);
+ $this->role->shortname = core_text::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
if (empty($this->role->shortname)) {
$this->errors['shortname'] = get_string('errorbadroleshortname', 'core_role');
}
@@ -117,18 +117,18 @@ public static function generate_shortname_callback($fullname, $idnumber, $block)
switch ($block[1]) {
case '+':
- $repl = textlib::strtoupper($repl);
+ $repl = core_text::strtoupper($repl);
break;
case '-':
- $repl = textlib::strtolower($repl);
+ $repl = core_text::strtolower($repl);
break;
case '~':
- $repl = textlib::strtotitle($repl);
+ $repl = core_text::strtotitle($repl);
break;
}
if (!empty($block[2])) {
- $repl = textlib::substr($repl, 0, $block[2]);
+ $repl = core_text::substr($repl, 0, $block[2]);
}
return $repl;
@@ -57,7 +57,7 @@ public function definition () {
$mform->setDefault('delimiter_name', 'comma');
}
- $choices = textlib::get_encodings();
+ $choices = core_text::get_encodings();
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploadcourse'), $choices);
$mform->setDefault('encoding', 'UTF-8');
@@ -145,7 +145,7 @@
}
// Encoding.
-$encodings = textlib::get_encodings();
+$encodings = core_text::get_encodings();
if (!isset($encodings[$options['encoding']])) {
echo get_string('invalidencoding', 'tool_uploadcourse')."\n";
echo $help;
@@ -183,7 +183,7 @@ function uu_validate_user_upload_columns(csv_import_reader $cir, $stdfields, $pr
$processed = array();
foreach ($columns as $key=>$unused) {
$field = $columns[$key];
- $lcfield = textlib::strtolower($field);
+ $lcfield = core_text::strtolower($field);
if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {
// standard fields are only lowercase
$newfield = $lcfield;
@@ -295,18 +295,18 @@ function uu_process_template_callback($username, $firstname, $lastname, $block)
switch ($block[1]) {
case '+':
- $repl = textlib::strtoupper($repl);
+ $repl = core_text::strtoupper($repl);
break;
case '-':
- $repl = textlib::strtolower($repl);
+ $repl = core_text::strtolower($repl);
break;
case '~':
- $repl = textlib::strtotitle($repl);
+ $repl = core_text::strtotitle($repl);
break;
}
if (!empty($block[2])) {
- $repl = textlib::substr($repl, 0 , $block[2]);
+ $repl = core_text::substr($repl, 0 , $block[2]);
}
return $repl;
@@ -53,7 +53,7 @@ function definition () {
$mform->setDefault('delimiter_name', 'comma');
}
- $choices = textlib::get_encodings();
+ $choices = core_text::get_encodings();
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
$mform->setDefault('encoding', 'UTF-8');
@@ -75,8 +75,8 @@ protected function check_table(xmldb_table $xmldb_table, array $metacolumns) {
// Get current semantic from dictionary, we only will process B (BYTE) ones
// suplying the SQL code to change them to C (CHAR) semantic
$params = array(
- 'table_name' => textlib::strtoupper($DB->get_prefix() . $xmldb_table->getName()),
- 'column_name' => textlib::strtoupper($xmldb_field->getName()),
+ 'table_name' => core_text::strtoupper($DB->get_prefix() . $xmldb_table->getName()),
+ 'column_name' => core_text::strtoupper($xmldb_field->getName()),
'data_type' => 'VARCHAR2');
$currentsemantic = $DB->get_field_sql('
SELECT char_used
View
@@ -57,7 +57,7 @@
}
$plugins[$plugin] = $strpluginname;
}
-collatorlib::asort($plugins);
+core_collator::asort($plugins);
$like = $DB->sql_like('plugin', '?', true, true, false, '|');
$params = array('tool|_%');
View
@@ -61,7 +61,7 @@ function prevent_local_passwords() {
*/
function user_login ($username, $password) {
$this->connectCAS();
- return phpCAS::isAuthenticated() && (trim(textlib::strtolower(phpCAS::getUser())) == $username);
+ return phpCAS::isAuthenticated() && (trim(core_text::strtolower(phpCAS::getUser())) == $username);
}
/**
@@ -381,15 +381,15 @@ function process_config($config) {
set_config('ldapencoding', trim($config->ldapencoding), $this->pluginconfig);
set_config('pagesize', (int)trim($config->pagesize), $this->pluginconfig);
set_config('contexts', trim($config->contexts), $this->pluginconfig);
- set_config('user_type', textlib::strtolower(trim($config->user_type)), $this->pluginconfig);
- set_config('user_attribute', textlib::strtolower(trim($config->user_attribute)), $this->pluginconfig);
+ set_config('user_type', core_text::strtolower(trim($config->user_type)), $this->pluginconfig);
+ set_config('user_attribute', core_text::strtolower(trim($config->user_attribute)), $this->pluginconfig);
set_config('search_sub', $config->search_sub, $this->pluginconfig);
set_config('opt_deref', $config->opt_deref, $this->pluginconfig);
set_config('bind_dn', trim($config->bind_dn), $this->pluginconfig);
set_config('bind_pw', $config->bind_pw, $this->pluginconfig);
set_config('ldap_version', $config->ldap_version, $this->pluginconfig);
set_config('objectclass', trim($config->objectclass), $this->pluginconfig);
- set_config('memberattribute', textlib::strtolower(trim($config->memberattribute)), $this->pluginconfig);
+ set_config('memberattribute', core_text::strtolower(trim($config->memberattribute)), $this->pluginconfig);
set_config('memberattribute_isdn', $config->memberattribute_isdn, $this->pluginconfig);
set_config('attrcreators', trim($config->attrcreators), $this->pluginconfig);
set_config('groupecreators', trim($config->groupecreators), $this->pluginconfig);
@@ -409,7 +409,7 @@ function iscreator($username) {
return false;
}
- $extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
+ $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
// Test for group creator
if (!empty($this->config->groupecreators)) {
View
@@ -58,8 +58,8 @@ function __construct() {
function user_login($username, $password) {
global $CFG, $DB;
- $extusername = textlib::convert($username, 'utf-8', $this->config->extencoding);
- $extpassword = textlib::convert($password, 'utf-8', $this->config->extencoding);
+ $extusername = core_text::convert($username, 'utf-8', $this->config->extencoding);
+ $extpassword = core_text::convert($password, 'utf-8', $this->config->extencoding);
if ($this->is_internal()) {
// Lookup username externally, but resolve
@@ -176,7 +176,7 @@ function db_attributes() {
function get_userinfo($username) {
global $CFG;
- $extusername = textlib::convert($username, 'utf-8', $this->config->extencoding);
+ $extusername = core_text::convert($username, 'utf-8', $this->config->extencoding);
$authdb = $this->db_init();
@@ -199,7 +199,7 @@ function get_userinfo($username) {
$fields_obj = $rs->FetchObj();
$fields_obj = (object)array_change_key_case((array)$fields_obj , CASE_LOWER);
foreach ($selectfields as $localname=>$externalname) {
- $result[$localname] = textlib::convert($fields_obj->{$localname}, $this->config->extencoding, 'utf-8');
+ $result[$localname] = core_text::convert($fields_obj->{$localname}, $this->config->extencoding, 'utf-8');
}
}
$rs->Close();
@@ -426,7 +426,7 @@ function user_exists($username) {
// Init result value.
$result = false;
- $extusername = textlib::convert($username, 'utf-8', $this->config->extencoding);
+ $extusername = core_text::convert($username, 'utf-8', $this->config->extencoding);
$authdb = $this->db_init();
@@ -501,7 +501,7 @@ function update_user_record($username, $updatekeys=false) {
global $CFG, $DB;
//just in case check text case
- $username = trim(textlib::strtolower($username));
+ $username = trim(core_text::strtolower($username));
// get the current user record
$user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id));
@@ -569,7 +569,7 @@ function user_update($olduser, $newuser) {
return false;
}
- $extusername = textlib::convert($olduser->username, 'utf-8', $this->config->extencoding);
+ $extusername = core_text::convert($olduser->username, 'utf-8', $this->config->extencoding);
$authdb = $this->db_init();
@@ -586,7 +586,7 @@ function user_update($olduser, $newuser) {
}
$nuvalue = $newuser->$key;
if ($nuvalue != $value) {
- $update[] = $this->config->{"field_map_$key"}."='".$this->ext_addslashes(textlib::convert($nuvalue, 'utf-8', $this->config->extencoding))."'";
+ $update[] = $this->config->{"field_map_$key"}."='".$this->ext_addslashes(core_text::convert($nuvalue, 'utf-8', $this->config->extencoding))."'";
}
}
if (!empty($update)) {
Oops, something went wrong.

0 comments on commit 2f1e464

Please sign in to comment.