Commit 71935fe8 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add maxlength rule to wysiwyg fields (bug #758235)



Change-Id: I238b56d3030b830c835fc8393f180b79ddafcb63
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent eeb615aa
......@@ -67,6 +67,7 @@ $form = pieform(array(
'cols' => 100,
'title' => get_string('pagetext', 'admin'),
'rules' => array(
'maxlength' => 65536,
'required' => true
)
),
......
......@@ -58,6 +58,7 @@ $form = pieform(array(
'title' => get_string('blogdesc', 'artefact.blog'),
'description' => get_string('blogdescdesc', 'artefact.blog'),
'rules' => array(
'maxlength' => 65536,
'required' => false
),
),
......
......@@ -120,6 +120,7 @@ $form = pieform(array(
'title' => get_string('postbody', 'artefact.blog'),
'description' => get_string('postbodydesc', 'artefact.blog'),
'rules' => array(
'maxlength' => 65536,
'required' => true
),
'defaultvalue' => $description,
......
......@@ -71,6 +71,7 @@ $form = pieform(array(
'title' => get_string('blogdesc', 'artefact.blog'),
'description' => get_string('blogdescdesc', 'artefact.blog'),
'rules' => array(
'maxlength' => 65536,
'required' => false
),
'defaultvalue' => $blog->get('description')
......
......@@ -69,6 +69,7 @@ $elements['message'] = array(
'rows' => 5,
'cols' => 80,
'defaultvalue' => $comment->get('description'),
'rules' => array('maxlength' => 8192),
);
if (get_config_plugin('artefact', 'comment', 'commentratings')) {
$elements['rating'] = array(
......
......@@ -559,6 +559,7 @@ class ArtefactTypeComment extends ArtefactType {
'title' => get_string('message'),
'rows' => 5,
'cols' => 80,
'rules' => array('maxlength' => 8192),
);
if (get_config_plugin('artefact', 'comment', 'commentratings')) {
$form['elements']['rating'] = array(
......
......@@ -1131,6 +1131,7 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
'rows' => 10,
'cols' => 80,
'defaultvalue' => get_field('site_content', 'content', 'name', 'uploadcopyright'),
'rules' => array('maxlength' => 65536),
),
),
'collapsible' => true
......
......@@ -191,6 +191,7 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
'defaultvalue' => (isset($configdata['introtext'])) ? $configdata['introtext'] : '',
'width' => '100%',
'height' => '150px',
'rules' => array('maxlength' => 65536),
);
return $form;
......
......@@ -105,6 +105,7 @@ foreach ( $element_list as $element => $type ) {
if ($type == 'wysiwyg') {
$items[$element]['rows'] = 10;
$items[$element]['cols'] = 50;
$items[$element]['rules'] = array('maxlength' => 65536);
}
if ($type == 'textarea') {
$items[$element]['rows'] = 4;
......
......@@ -76,6 +76,7 @@ $gform = array(
'cols' => 80,
'defaultvalue' => $personal,
'title' => get_string('personalgoal', 'artefact.resume'),
'rules' => array('maxlength' => 65536),
),
'academicgoal' => array(
'type' => 'wysiwyg',
......@@ -83,6 +84,7 @@ $gform = array(
'cols' => 80,
'defaultvalue' => $academic,
'title' => get_string('academicgoal', 'artefact.resume'),
'rules' => array('maxlength' => 65536),
),
'careergoal' => array(
'type' => 'wysiwyg',
......@@ -90,6 +92,7 @@ $gform = array(
'cols' => 80,
'defaultvalue' => $career,
'title' => get_string('careergoal', 'artefact.resume'),
'rules' => array('maxlength' => 65536),
),
'submit' => array(
'type' => 'submit',
......
......@@ -65,6 +65,7 @@ $coverletterform = pieform(array(
'type' => 'wysiwyg',
'cols' => 100,
'rows' => 30,
'rules' => array('maxlength' => 65536),
'defaultvalue' => ((!empty($coverletter)) ? $coverletter->get('description') : null),
),
'save' => array(
......
......@@ -60,6 +60,7 @@ $interestsform = pieform(array(
'defaultvalue' => ((!empty($interest)) ? $interest->get('description') : null),
'cols' => 100,
'rows' => 30,
'rules' => array('maxlength' => 65536),
),
'save' => array(
'type' => 'submit',
......
......@@ -71,6 +71,7 @@ $sform = array(
'cols' => 80,
'defaultvalue' => ((!empty($personal)) ? $personal->get('description') : null),
'title' => get_string('personalskill', 'artefact.resume'),
'rules' => array('maxlength' => 65536),
),
'academicskill' => array(
'type' => 'wysiwyg',
......@@ -78,6 +79,7 @@ $sform = array(
'cols' => 80,
'defaultvalue' => ((!empty($academic)) ? $academic->get('description') : null),
'title' => get_string('academicskill', 'artefact.resume'),
'rules' => array('maxlength' => 65536),
),
'workskill' => array(
'type' => 'wysiwyg',
......@@ -85,6 +87,7 @@ $sform = array(
'cols' => 80,
'defaultvalue' => ((!empty($work)) ? $work->get('description') : null),
'title' => get_string('workskill', 'artefact.resume'),
'rules' => array('maxlength' => 65536),
),
'submit' => array(
'type' => 'submit',
......
......@@ -79,6 +79,7 @@ class PluginBlocktypeTextbox extends SystemBlocktype {
'width' => '100%',
'height' => '150px',
'defaultvalue' => isset($configdata['text']) ? $configdata['text'] : '',
'rules' => array('maxlength' => 65536),
),
);
}
......
......@@ -43,6 +43,7 @@ $elements['name'] = array(
$elements['description'] = array(
'type' => 'wysiwyg',
'title' => get_string('groupdescription', 'group'),
'rules' => array('maxlength' => 65536),
'rows' => 10,
'cols' => 55);
......
......@@ -54,6 +54,7 @@ $elements['name'] = array(
$elements['description'] = array(
'type' => 'wysiwyg',
'title' => get_string('groupdescription', 'group'),
'rules' => array('maxlength' => 65536),
'rows' => 10,
'cols' => 55,
'defaultvalue' => $group_data->description);
......
......@@ -160,7 +160,10 @@ $editform = pieform(array(
'rows' => 18,
'cols' => 70,
'defaultvalue' => isset($post) ? $post->body : null,
'rules' => array( 'required' => true )
'rules' => array(
'required' => true,
'maxlength' => 65536,
),
),
'submit' => array(
'type' => 'submitcancel',
......
......@@ -130,7 +130,10 @@ $editform = array(
'rows' => 18,
'cols' => 70,
'defaultvalue' => isset($topic) ? $topic->body : null,
'rules' => array( 'required' => true )
'rules' => array(
'required' => true,
'maxlength' => 65536,
),
),
'sticky' => array(
'type' => 'checkbox',
......
......@@ -89,6 +89,7 @@ abstract class PluginInteraction extends Plugin {
'defaultvalue' => (isset($instance) ? $instance->get('description') : ''),
'rules' => array(
'required' => true,
'maxlength' => 65536,
)
),
);
......
......@@ -107,6 +107,7 @@ $editview = array(
'rows' => 10,
'cols' => 70,
'defaultvalue' => $view->get('description'),
'rules' => array('maxlength' => 65536),
),
'tags' => array(
'type' => 'tags',
......
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