Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
78106a24
Commit
78106a24
authored
Feb 18, 2011
by
Eloy Lafuente
Browse files
Merge branch 'em_MDL-25944_20_forummail' of
git://github.com/skodak/moodle
parents
395181f9
18ff4d42
Changes
1
Hide whitespace changes
Inline
Side-by-side
mod/forum/lib.php
View file @
78106a24
...
...
@@ -980,15 +980,15 @@ function forum_cron() {
function
forum_make_mail_text
(
$course
,
$cm
,
$forum
,
$discussion
,
$post
,
$userfrom
,
$userto
,
$bare
=
false
)
{
global
$CFG
,
$USER
;
$modcontext
=
get_context_instance
(
CONTEXT_MODULE
,
$cm
->
id
);
if
(
!
isset
(
$userto
->
viewfullnames
[
$forum
->
id
]))
{
$modcontext
=
get_context_instance
(
CONTEXT_MODULE
,
$cm
->
id
);
$viewfullnames
=
has_capability
(
'moodle/site:viewfullnames'
,
$modcontext
,
$userto
->
id
);
}
else
{
$viewfullnames
=
$userto
->
viewfullnames
[
$forum
->
id
];
}
if
(
!
isset
(
$userto
->
canpost
[
$discussion
->
id
]))
{
$modcontext
=
get_context_instance
(
CONTEXT_MODULE
,
$cm
->
id
);
$canreply
=
forum_user_can_post
(
$forum
,
$discussion
,
$userto
,
$cm
,
$course
,
$modcontext
);
}
else
{
$canreply
=
$userto
->
canpost
[
$discussion
->
id
];
...
...
@@ -1014,6 +1014,9 @@ function forum_make_mail_text($course, $cm, $forum, $discussion, $post, $userfro
}
}
// add absolute file links
$post
->
message
=
file_rewrite_pluginfile_urls
(
$post
->
message
,
'pluginfile.php'
,
$modcontext
->
id
,
'mod_forum'
,
'post'
,
$post
->
id
);
$posttext
.
=
"
\n
---------------------------------------------------------------------
\n
"
;
$posttext
.
=
format_string
(
$post
->
subject
,
true
);
if
(
$bare
)
{
...
...
@@ -2979,16 +2982,17 @@ function forum_make_mail_post($course, $cm, $forum, $discussion, $post, $userfro
global
$CFG
,
$OUTPUT
;
$modcontext
=
get_context_instance
(
CONTEXT_MODULE
,
$cm
->
id
);
if
(
!
isset
(
$userto
->
viewfullnames
[
$forum
->
id
]))
{
if
(
!
$cm
=
get_coursemodule_from_instance
(
'forum'
,
$forum
->
id
,
$course
->
id
))
{
print_error
(
'invalidcoursemodule'
);
}
$modcontext
=
get_context_instance
(
CONTEXT_MODULE
,
$cm
->
id
);
$viewfullnames
=
has_capability
(
'moodle/site:viewfullnames'
,
$modcontext
,
$userto
->
id
);
}
else
{
$viewfullnames
=
$userto
->
viewfullnames
[
$forum
->
id
];
}
// add absolute file links
$post
->
message
=
file_rewrite_pluginfile_urls
(
$post
->
message
,
'pluginfile.php'
,
$modcontext
->
id
,
'mod_forum'
,
'post'
,
$post
->
id
);
// format the post body
$options
=
new
stdClass
();
$options
->
para
=
true
;
...
...
@@ -3020,10 +3024,7 @@ function forum_make_mail_post($course, $cm, $forum, $discussion, $post, $userfro
if
(
isset
(
$userfrom
->
groups
))
{
$groups
=
$userfrom
->
groups
[
$forum
->
id
];
}
else
{
if
(
!
$cm
=
get_coursemodule_from_instance
(
'forum'
,
$forum
->
id
,
$course
->
id
))
{
print_error
(
'invalidcoursemodule'
);
}
$group
=
groups_get_all_groups
(
$course
->
id
,
$userfrom
->
id
,
$cm
->
groupingid
);
$groups
=
groups_get_all_groups
(
$course
->
id
,
$userfrom
->
id
,
$cm
->
groupingid
);
}
if
(
$groups
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment