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

Added descriptive help text for bbcode formatting for view feedback.

While I was doing that, internationalised the one for wall posts, and
refactored the generation of the help message to a function.
parent b1624356
......@@ -96,6 +96,7 @@ class PluginBlocktypeWall extends SystemBlocktype {
'elements' => array(
'text' => array(
'type' => 'textarea',
'description' => bbcode_format_post_message(),
'rows' => 3,
'cols' => 50,
'defaultvalue' => '',
......
......@@ -5,7 +5,7 @@
echo $form_tag;
echo '<div>' . $elements['text']['html'] .'</div>';
echo '<div>You can format your post using BBCode. <a href="" onclick="contextualHelp(\'\',\'\',\'core\',\'site\',null,\'bbcode\',this); return false;">Learn more</a></div>';
echo '<div class="description">' . $elements['text']['description'] . '</div>';
echo '<div>' . $elements['private']['labelhtml'] . ' ' . $elements['private']['html'] . '</div>';
echo '<div>' . $elements['submit']['html'] . '</div>';
echo $hidden_elements;
......
......@@ -783,6 +783,7 @@ $string['system'] = 'System';
$string['done'] = 'Done';
$string['back'] = 'Back';
$string['alphabet'] = 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
$string['formatpostbbcode'] = 'You can format your post using BBCode. %sLearn more%s';
// import related strings (maybe separated later)
$string['importedfrom'] = 'Imported from %s';
......
......@@ -2368,6 +2368,7 @@ function add_feedback_form($attachments=false) {
'title' => get_string('message'),
'rows' => 5,
'cols' => 80,
'description' => bbcode_format_post_message(),
);
$form['elements']['ispublic'] = array(
'type' => 'checkbox',
......
......@@ -2296,6 +2296,15 @@ function bbcode_img($action, $attributes, $content, $params, $node_object) {
return '<img src="' . hsc($content) . '" alt="">';
}
/**
* Returns a message that can be used as help text for BBCode
*
* @return string
*/
function bbcode_format_post_message() {
return get_string('formatpostbbcode', 'mahara', '<a href="" onclick="contextualHelp(\'\',\'\',\'core\',\'site\',null,\'bbcode\',this); return false;">', '</a>');
}
/**
* Displays purified html on a page with an explanatory message.
......
Supports Markdown
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