Commit b8484d8c authored by Nigel McNie's avatar Nigel McNie
Browse files

Hide the subject box when there is no subject to display, with a link you click to activate it.

parent 6d9b66f7
......@@ -155,6 +155,27 @@ if (isset($postid)) {
);
}
// Javascript to hide the subject box if it has nothing in it, with a link you
// click to expand it.
$clicksetsubject = json_encode(get_string('clicksetsubject', 'interaction.forum'));
$inlinejs = <<<EOF
addLoadEvent(function() {
var subjectInput = $('editpost_subject');
if (subjectInput.value == '') {
hideElement(subjectInput);
var expandLink = A({'href': ''}, {$clicksetsubject});
connect(expandLink, 'onclick', function(e) {
showElement(subjectInput);
subjectInput.focus();
e.stop();
removeElement(expandLink);
});
insertSiblingNodesBefore(subjectInput, expandLink);
}
tinyMCE.execCommand('mceFocus',false,'mce_editor_0');
});
EOF;
require_once('pieforms/pieform.php');
$editform = pieform(array(
......@@ -249,6 +270,9 @@ $smarty->assign('topicsubject', $topicsubject);
$smarty->assign('heading', TITLE);
$smarty->assign('topic', $topicsubject);
$smarty->assign('editform', $editform);
if (isset($inlinejs)) {
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
}
$smarty->display('interaction:forum:editpost.tpl');
?>
......@@ -14,6 +14,7 @@ $string['cantfindpost'] = 'Couldn\'t find post with id %s';
$string['cantfindtopic'] = 'Couldn\'t find topic with id %s';
$string['cantviewforums'] = 'You are not allowed to view forums in this group';
$string['cantviewtopic'] = 'You are not allowed to view topics in this forum';
$string['clicksetsubject'] = 'Click to set a subject';
$string['closed'] = 'Closed';
$string['count'] = 'Count';
$string['currentmoderators'] = 'Current Moderators';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment