Commit e5c7527f authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1813242: Tidying up how we render the wall post form"

parents 2cd1e6dc 60041789
......@@ -142,15 +142,18 @@ class PluginBlocktypeWall extends MaharaCoreBlocktype {
}
return pieform(array(
'name' => 'wallpost_'.$instance->get('id'),
'renderer' => 'dev',
'renderer' => 'div',
'autofocus' => false,
'jsform' => true,
'template' => 'wallpost.php',
'templatedir' => pieform_template_dir('wallpost.php', 'blocktype/wall'),
'validatecallback' => array('PluginBlocktypeWall', 'wallpost_validate'),
'successcallback' => array('PluginBlocktypeWall', 'wallpost_submit'),
'jssuccesscallback' => 'wallpost_success',
'elements' => array(
'postsizelimit' => array(
'type' => 'html',
'class' => 'metadata',
'value' => get_string('maxcharacters', 'blocktype.wall', get_config_plugin('blocktype', 'wall', 'defaultpostsizelimit'))
),
'text' => array(
'type' => 'wysiwyg',
'title' => get_string('Post', 'blocktype.wall'),
......@@ -159,15 +162,12 @@ class PluginBlocktypeWall extends MaharaCoreBlocktype {
'cols' => 50,
'defaultvalue' => '',
'width' => '100%',
'class' => 'html',
'rules' => array(
'required' => true,
'maxlength' => get_config_plugin('blocktype', 'wall', 'defaultpostsizelimit'),
),
),
'postsizelimit' => array(
'type' => 'html',
'value' => get_string('maxcharacters', 'blocktype.wall', get_config_plugin('blocktype', 'wall', 'defaultpostsizelimit'))
),
'private' => array(
'type' => 'switchbox',
'title' => get_string('makeyourpostprivate', 'blocktype.wall'),
......
<?php
/**
*
* @package mahara
* @subpackage blocktype-wall
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
define('INTERNAL', 1);
require_once(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('wallpost', 'blocktype.wall'));
require_once(get_config('docroot') . 'blocktype/lib.php');
$wall = param_integer('instance');
$instance = new BlockInstance($wall);
safe_require('blocktype', 'wall');
PluginBlocktypeWall::wallpost_form($instance);
<?php
// Note: this template isn't echoing the description or error keys for each
// element, but there's no validation or descriptions on this form currently
$html = $form_tag;
$html .= $form_tag;
$html .= '<div id="wall-wrap" class="card-form">';
$html .= '<p class="metadata">' . $elements['postsizelimit']['html'] . '</p>';
$html .= '<div>' . $elements['text']['labelhtml'] . $elements['text']['html'] .'</div>';
if (isset($elements['text']['error'])) {
$html .= '<div class="errmsg">' . $elements['text']['error'] . '</div>';
}
$html .= '<div class="makeprivate checkbox form-group">' . $elements['private']['labelhtml'] . ' ' . $elements['private']['html'] . '</div>';
$html .= '<div class="form-group">' . $elements['submit']['html'] . '</div>';
$html .= '</div>';
$html .= $hidden_elements;
$html .= '</form>';
echo $html;
\ No newline at end of file
......@@ -14,7 +14,7 @@ The wall post must generate a notification (Bug 547333)
Given I log in as "UserB" with password "Kupuh1pa!"
And I choose "Find people" in "Engage" from main menu
And I follow "Angela User"
And I scroll to the base of id "wall-wrap"
And I scroll to the base of id "wall"
And I set the field "Post" to "Hello"
And I press "Post"
And I log out
......
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