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

This commit is contained in:
diml
2009-05-30 22:16:28 +00:00
parent 902ec3ccc2
commit 29dc93d1cd
14 changed files with 112 additions and 27 deletions
+10 -6
View File
@@ -6,6 +6,7 @@
* @category core
* @subpackage document_wrappers
* @author Valery Fremaux [[email protected]] > 1.8
* @contributor Tatsuva Shirai 20090530
* @date 2008/03/31
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*
@@ -48,7 +49,8 @@ class UserSearchDocument extends SearchDocument {
// module specific information; optional
// construct the parent class
parent::__construct($doc, $data, 0, 0, 0, PATH_FOR_SEARCH_TYPE_USER);
// Shirai : User pictures are not displayed in results of blogs (2009/05/29) MDL19341
parent::__construct($doc, $data, 0, 0, $user_id, PATH_FOR_SEARCH_TYPE_USER);;
}
}
@@ -71,18 +73,20 @@ class UserPostSearchDocument extends SearchDocument {
$user = get_record('user', 'id', $user_id);
// we cannot call userdate with relevant locale at indexing time.
$doc->title = get_string('post').': '.fullname($user);
// $doc->title = get_string('post').': '.fullname($user);
$doc->title = $post['subject'];
$doc->date = $post['created'];
//remove '(ip.ip.ip.ip)' from chat author list
$doc->author = fullname($user);
$doc->contents = $post['description'];
$doc->url = user_make_link($user_id, 'post');
// $doc->url = user_make_link($user_id, 'post');
$doc->url = user_make_link($post['id'], 'post');
// module specific information; optional
// construct the parent class
parent::__construct($doc, $data, 0, 0, 0, PATH_FOR_SEARCH_TYPE_USER);
parent::__construct($doc, $data, 0, 0, $user_id, PATH_FOR_SEARCH_TYPE_USER);
}
}
@@ -116,7 +120,7 @@ class UserBlogAttachmentSearchDocument extends SearchDocument {
// module specific information; optional
// construct the parent class
parent::__construct($doc, $data, 0, 0, 0, PATH_FOR_SEARCH_TYPE_USER);
parent::__construct($doc, $data, 0, 0, $post['userid'], PATH_FOR_SEARCH_TYPE_USER);
}
}
@@ -134,7 +138,7 @@ function user_make_link($itemid, $itemtype) {
if ($itemtype == 'user'){
return $CFG->wwwroot.'/user/view.php?id='.$itemid;
} elseif ($itemtype == 'post') {
return $CFG->wwwroot.'/blog/index.php?userid='.$itemid;
return $CFG->wwwroot.'/blog/index.php?postid='.$itemid;
} elseif ($itemtype == 'attachment') {
$post = get_record('post', 'id', $itemid);
if (!$CFG->slasharguments){