Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
b57c222b
Commit
b57c222b
authored
Jan 18, 2013
by
Hugh Davenport
Committed by
Gerrit Code Review
Jan 18, 2013
Browse files
Merge "Bug#1050655 Changed forum notification subject"
parents
2b8ccd00
9f4fa2b0
Changes
2
Show whitespace changes
Inline
Side-by-side
htdocs/interaction/forum/lib.php
View file @
b57c222b
...
...
@@ -867,7 +867,7 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
$this
->
strings
->
subject
=
(
object
)
array
(
'key'
=>
'newforumpostnotificationsubjectline'
,
'section'
=>
'interaction.forum'
,
'args'
=>
array
(
$post
->
paren
t
?
get_string
(
'Re:'
,
'interaction.forum'
)
.
$post
->
topicsubject
:
$post
->
subject
),
'args'
=>
array
(
$post
->
subject
?
$post
->
subjec
t
:
get_string
(
'Re:'
,
'interaction.forum'
)
.
(
$post
->
parent
?
get_ancestorpostsubject
(
$post
->
parent
,
true
)
:
$post
->
topic
subject
)
)
,
);
foreach
(
$this
->
users
as
&
$user
)
{
...
...
@@ -1059,3 +1059,34 @@ function subscribe_forum_submit(Pieform $form, $values) {
redirect
(
'/interaction/forum/view.php?id='
.
$values
[
'forum'
]
.
'&offset='
.
$values
[
'offset'
]);
}
}
/*
* Return the subject for the topic
*
* @param int $postid the ID of the post
*
* @return string the subject
*/
function
get_ancestorpostsubject
(
$postid
,
$isparent
=
false
)
{
if
(
$isparent
)
{
$record
=
get_record_sql
(
'SELECT p.subject
FROM {interaction_forum_post} p
WHERE p.id = ?'
,
array
(
$postid
));
if
(
$record
&&
!
empty
(
$record
->
subject
))
{
return
$record
->
subject
;
}
}
while
(
$ppost
=
get_record_sql
(
'SELECT p1.id, p1.subject
FROM {interaction_forum_post} p1
INNER JOIN {interaction_forum_post} p2 ON (p1.id = p2.parent)
WHERE p2.id = ?'
,
array
(
$postid
)))
{
if
(
!
empty
(
$ppost
->
subject
))
{
return
$ppost
->
subject
;
}
$postid
=
$ppost
->
id
;
}
return
null
;
}
htdocs/interaction/forum/topic.php
View file @
b57c222b
...
...
@@ -238,28 +238,6 @@ function renderpost($post, $indent) {
return
$smarty
->
fetch
(
'interaction:forum:post.tpl'
);
}
/*
* Return the subject for the topic
*
* @param int $postid the ID of the post
*
* @return string the subject
*/
function
get_ancestorpostsubject
(
$postid
)
{
while
(
$ppost
=
get_record_sql
(
'SELECT p1.id, p1.subject
FROM {interaction_forum_post} p1
INNER JOIN {interaction_forum_post} p2 ON (p1.id = p2.parent)
WHERE p2.id = ?'
,
array
(
$postid
)))
{
if
(
!
empty
(
$ppost
->
subject
))
{
return
$ppost
->
subject
;
}
$postid
=
$ppost
->
id
;
}
return
null
;
}
function
subscribe_topic_validate
(
Pieform
$form
,
$values
)
{
if
(
!
is_logged_in
())
{
// This page is public, so the access denied exception will cause a
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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