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

This commit is contained in:
diml
2009-05-30 22:13:16 +00:00
parent 8f50e29c85
commit 902ec3ccc2
2 changed files with 9 additions and 10 deletions
+5 -9
View File
@@ -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'){
+4 -1
View File
@@ -276,6 +276,7 @@ class SearchQuery {
$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 @@ class SearchQuery {
*/
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');