Permalink
Browse files

MDL-19342 - small fixes from Tatsuva Shirai + UTF-8 global straighten up

  • Loading branch information...
diml
diml committed May 30, 2009
1 parent 8f50e29 commit 902ec3ccc2179bd69f6679aeca73cd8b050773e9
Showing with 9 additions and 10 deletions.
  1. +5 −9 search/query.php
  2. +4 −1 search/querylib.php
View
@@ -119,9 +119,9 @@
}
// add module restriction
- $doctypestr = get_string('doctype', 'search');
- $titlestr = get_string('title', 'search');
- $authorstr = get_string('author', 'search');
+ $doctypestr = 'doctype';
+ $titlestr = 'title';
+ $authorstr = 'author';
if ($adv->module != 'all') {
$query_string .= " +{$doctypestr}:".$adv->module;
}
@@ -340,9 +340,8 @@
foreach ($hits as $listing) {
- if ($listing->doctype == 'user'){ // A special handle for users
-
- $icon = print_user_picture ($listing->author, 0, true, 0, true, false) ;
+ if ($listing->doctype == 'user'){ // A special handle for users
+ $icon = print_user_picture ($listing->userid, 0, true, 0, true, false) ;
} else {
$iconpath = $CFG->modpixpath.'/'.$listing->doctype.'/icon.gif';
$icon = "<img align=\"top\" src=\"".$iconpath."\" class=\"activityicon\" alt=\"\"/>";
@@ -351,9 +350,6 @@
$courseword = mb_convert_case(get_string('course', 'moodle'), MB_CASE_LOWER, 'UTF-8');
$course = ($listing->doctype != 'user') ? '<strong> ('.$courseword.': \''.$coursename.'\')</strong>' : '' ;
- //if ($CFG->unicodedb) {
- //$listing->title = mb_convert_encoding($listing->title, 'auto', 'UTF8');
- //}
$title_post_processing_function = $listing->doctype.'_link_post_processing';
$searchable_instance = $searchables[$listing->doctype];
if ($searchable_instance->location == 'internal'){
View
@@ -276,6 +276,7 @@ private function process_results($all=false) {
$resultdoc->doctype = $hit->doctype;
$resultdoc->author = $hit->author;
$resultdoc->courseid = $hit->course_id;
+ $resultdoc->userid = $hit->user_id;
//and store it
$resultdocs[] = clone($resultdoc);
@@ -324,7 +325,9 @@ private function get_results() {
*/
public function page_numbers() {
$pages = $this->total_pages();
- $query = htmlentities($this->term);
+ // $query = htmlentities($this->term);
+ // http://moodle.org/mod/forum/discuss.php?d=115788
+ $query = htmlentities($this->term,ENT_NOQUOTES,'utf-8');
$page = $this->pagenumber;
$next = get_string('next', 'search');
$back = get_string('back', 'search');

0 comments on commit 902ec3c

Please sign in to comment.