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
mahara
mahara
Commits
9aa65999
Commit
9aa65999
authored
Oct 05, 2018
by
Robert Lyon
Committed by
Gerrit Code Review
Oct 05, 2018
Browse files
Merge "Bug 1794189: Fixing edit post/topic time remaining message"
parents
18fd4fbc
3772eb16
Changes
5
Hide whitespace changes
Inline
Side-by-side
htdocs/interaction/forum/editpost.php
View file @
9aa65999
...
...
@@ -100,7 +100,7 @@ else { // edit post
// no record for edits to own posts with 30 minutes
if
(
user_can_edit_post
(
$post
->
poster
,
$post
->
ctime
))
{
$post
->
editrecord
=
false
;
$timeleft
=
(
int
)
get_config_plugin
(
'interaction'
,
'forum'
,
'postdelay'
)
-
round
(
(
time
()
-
$post
->
ctime
)
/
60
);
$timeleft
=
ceil
(
get_config_plugin
(
'interaction'
,
'forum'
,
'postdelay'
)
-
(
time
()
-
$post
->
ctime
)
/
60
);
}
else
if
(
$moderator
)
{
$post
->
editrecord
=
true
;
...
...
@@ -280,6 +280,7 @@ $smarty = smarty();
$smarty
->
assign
(
'deleteduser'
,
$poster
->
get
(
'deleted'
));
$smarty
->
assign
(
'poster'
,
$poster
);
$smarty
->
assign
(
'editform'
,
$editform
);
$smarty
->
assign
(
'moderator'
,
$moderator
);
$smarty
->
assign
(
'parent'
,
$parent
);
$smarty
->
assign
(
'action'
,
$action
);
$smarty
->
assign
(
'groupadmins'
,
group_get_admin_ids
(
$parent
->
group
));
...
...
htdocs/interaction/forum/edittopic.php
View file @
9aa65999
...
...
@@ -88,7 +88,7 @@ else { // edit topic
// no record for edits to own posts with 30 minutes
if
(
user_can_edit_post
(
$topic
->
poster
,
$topic
->
ctime
))
{
$topic
->
editrecord
=
false
;
$timeleft
=
(
int
)
get_config_plugin
(
'interaction'
,
'forum'
,
'postdelay'
)
-
round
(
(
time
()
-
$topic
->
ctime
)
/
60
);
$timeleft
=
ceil
(
get_config_plugin
(
'interaction'
,
'forum'
,
'postdelay'
)
-
(
time
()
-
$topic
->
ctime
)
/
60
);
}
else
if
(
$moderator
)
{
$topic
->
editrecord
=
true
;
...
...
@@ -302,6 +302,7 @@ function edittopic_submit(Pieform $form, $values) {
$smarty
=
smarty
();
$smarty
->
assign
(
'heading'
,
$forum
->
groupname
);
$smarty
->
assign
(
'subheading'
,
$topictype
);
$smarty
->
assign
(
'moderator'
,
$moderator
);
$smarty
->
assign
(
'editform'
,
$editform
);
if
(
isset
(
$timeleft
))
{
$smarty
->
assign
(
'timeleft'
,
$timeleft
);
...
...
htdocs/interaction/forum/lang/en.utf8/interaction.forum.php
View file @
9aa65999
...
...
@@ -117,7 +117,7 @@ $string['Open'] = 'Open';
$string
[
'Order'
]
=
'Order'
;
$string
[
'orderdescription'
]
=
'Choose at which position this forum shall appear in the list of forums'
;
$string
[
'Post'
]
=
'Post'
;
$string
[
'postaftertimeout'
]
=
'You have submitted your change after timeout of %s minutes. Your change has not been applied.'
;
$string
[
'postaftertimeout'
]
=
'You have submitted your change after
the
timeout of %s minutes. Your change has not been applied.'
;
$string
[
'postbyuserwasdeleted'
]
=
'A post by %s was deleted'
;
$string
[
'postsbyuserweredeleted'
]
=
'%s posts by %s were deleted'
;
$string
[
'postdelay'
]
=
'Post delay'
;
...
...
@@ -203,7 +203,9 @@ $string['closetopicsdescription1'] = 'Close all new topics by default. Only mode
$string
[
'activetopicsdescription'
]
=
'Recently updated topics in your groups.'
;
$string
[
'timeleftnotice'
]
=
'You have %s minutes left to finish editing.'
;
$string
[
'timeleftnotice1'
]
=
'You have <span class="num">%s</span> minutes left to finish editing.'
;
$string
[
'timeleftnoticeexpired'
]
=
'The edit time is over. Your changes will not be saved.'
;
$string
[
'timeleftnoticeexpiredmoderator'
]
=
'Your changes will now be saved with an edit notice.'
;
$string
[
'objectionablecontentpost'
]
=
'Objectionable content on forum topic "%s" reported by %s'
;
$string
[
'objectionablecontentposthtml'
]
=
'<div style="padding: 0.5em 0; border-bottom: 1px solid #999;">Objectionable content on forum topic "%s" reported by %s
...
...
htdocs/theme/raw/plugintype/interaction/forum/templates/editpost.tpl
View file @
9aa65999
{
include
file
=
"header.tpl"
}
{
if
$timeleft
}
<div
class=
"fr timeleftnotice"
>
{
str
tag
=
"timeleftnotice"
section
=
"interaction.forum"
args
=
$timeleft
}
</div>
{/
if
}
{
if
$timeleft
}
<div
class=
"alert alert-warning"
id=
"timeleft"
>
{
str
tag
=
"timeleftnotice1"
section
=
"interaction.forum"
args
=
$timeleft
}
</div>
<div
class=
"timeexpired hidden"
>
{
if
$moderator
}{
str
tag
=
"timeleftnoticeexpiredmoderator"
section
=
"interaction.forum"
}{
else
}{
str
tag
=
"timeleftnoticeexpired"
section
=
"interaction.forum"
}{/
if
}
</div>
{/
if
}
<h2><a
href=
"
{
$WWWROOT
}
interaction/forum/topic.php?id=
{
$parent
->
topic
}
"
>
{
$parent
->
topicsubject
}
</a>
-
{
$action
}
</h2>
<script
type=
'application/javascript'
>
// Set the number we're counting down from
var
countfrom
=
{
$timeleft
}
;
// Update the count down every 1 minute
var
x
=
setInterval
(
function
()
{
countfrom
=
countfrom
-
1
;
jQuery
(
'
#timeleft .num
'
).
html
(
countfrom
);
// If the count down is finished, write some text
if
(
countfrom
<=
0
)
{
clearInterval
(
x
);
jQuery
(
'
#timeleft
'
).
html
(
jQuery
(
'
.timeexpired
'
).
html
());
}
},
60000
);
</script>
{
$editform
|
safe
}
<div
class=
"replyto"
><h4>
{
str
tag
=
"replyto"
section
=
"interaction.forum"
}
</h4>
...
...
htdocs/theme/raw/plugintype/interaction/forum/templates/edittopic.tpl
View file @
9aa65999
{
include
file
=
"header.tpl"
}
{
if
$timeleft
}
<div
class=
"fr timeleftnotice"
>
{
str
tag
=
"timeleftnotice"
section
=
"interaction.forum"
args
=
$timeleft
}
</div>
{/
if
}
{
if
$timeleft
}
<div
class=
"alert alert-warning"
id=
"timeleft"
>
{
str
tag
=
"timeleftnotice1"
section
=
"interaction.forum"
args
=
$timeleft
}
</div>
<div
class=
"timeexpired hidden"
>
{
if
$moderator
}{
str
tag
=
"timeleftnoticeexpiredmoderator"
section
=
"interaction.forum"
}{
else
}{
str
tag
=
"timeleftnoticeexpired"
section
=
"interaction.forum"
}{/
if
}
</div>
{/
if
}
<h2>
{
$subheading
}
</h2>
<script
type=
'application/javascript'
>
// Set the number we're counting down from
var
countfrom
=
{
$timeleft
}
;
// Update the count down every 1 minute
var
x
=
setInterval
(
function
()
{
countfrom
=
countfrom
-
1
;
jQuery
(
'
#timeleft .num
'
).
html
(
countfrom
);
// If the count down is finished, write some text
if
(
countfrom
<=
0
)
{
clearInterval
(
x
);
jQuery
(
'
#timeleft
'
).
html
(
jQuery
(
'
.timeexpired
'
).
html
());
}
},
60000
);
</script>
{
$editform
|
safe
}
{
include
file
=
"footer.tpl"
}
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