Skip to content

Commit

Permalink
fixed text field widths in new forms
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 11, 2007
1 parent 0ac1cfc commit 26de8d3
Show file tree
Hide file tree
Showing 19 changed files with 633 additions and 699 deletions.
2 changes: 1 addition & 1 deletion lib/form/choosecoursefile.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function _createElements() {
global $COURSE;
$this->_elements = array();

$this->_elements[0] =& MoodleQuickForm::createElement('text', 'value', '');
$this->_elements[0] =& MoodleQuickForm::createElement('text', 'value', '', array('size'=>'48'));
$this->_elements[1] =& MoodleQuickForm::createElement('button', 'popup', get_string('chooseafile', 'resource') .' ...');

$button =& $this->_elements[1];
Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function definition() {

// $mform->addElement('static', 'statictype', get_string('assignmenttype', 'assignment'), get_string('type'.$type,'assignment'));

$mform->addElement('text', 'name', get_string('assignmentname', 'assignment'));
$mform->addElement('text', 'name', get_string('assignmentname', 'assignment'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
2 changes: 1 addition & 1 deletion mod/chat/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('chatname', 'chat'));
$mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
2 changes: 1 addition & 1 deletion mod/choice/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('choicename', 'choice'));
$mform->addElement('text', 'name', get_string('choicename', 'choice'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
2 changes: 1 addition & 1 deletion mod/data/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('name'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
2 changes: 1 addition & 1 deletion mod/exercise/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('title', 'exercise'));
$mform->addElement('text', 'name', get_string('title', 'exercise'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
2 changes: 1 addition & 1 deletion mod/forum/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('forumname', 'forum'));
$mform->addElement('text', 'name', get_string('forumname', 'forum'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
4 changes: 2 additions & 2 deletions mod/forum/post_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ function definition() {

$mform->addElement('header', 'general', '');//fill in the data depending on page params
//later using set_defaults
$mform->addElement('text', 'subject', get_string('subject', 'forum'), 'size="60"');
$mform->addElement('text', 'subject', get_string('subject', 'forum'), 'size="64"');
$mform->setType('subject', PARAM_TEXT);
$mform->addRule('subject', get_string('required'), 'required', null, 'client');

$mform->addElement('htmleditor', 'message', get_string('message', 'forum'));
$mform->addElement('htmleditor', 'message', get_string('message', 'forum'), array('cols'=>85, 'rows'=>30));
$mform->setType('message', PARAM_RAW);
$mform->addRule('message', get_string('required'), 'required', null, 'client');
$mform->setHelpButton('message', array('reading', 'writing', 'questions', 'richtext'), false, 'editorhelpbutton');
Expand Down
2 changes: 1 addition & 1 deletion mod/glossary/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('name'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
2 changes: 1 addition & 1 deletion mod/journal/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('journalname', 'journal'));
$mform->addElement('text', 'name', get_string('journalname', 'journal'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
2 changes: 1 addition & 1 deletion mod/label/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function definition() {

$mform =& $this->_form;

$mform->addElement('htmleditor', 'content', get_string('labeltext', 'label'));
$mform->addElement('htmleditor', 'content', get_string('labeltext', 'label'), array('size'=>'64'));
$mform->setType('content', PARAM_RAW);
$mform->addRule('content', get_string('required'), 'required', null, 'client');
$mform->setHelpButton('content', array('questions', 'richtext'), false, 'editorhelpbutton');
Expand Down
2 changes: 1 addition & 1 deletion mod/lesson/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('name'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function definition() {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

$mform->addElement('text', 'name', get_string('name'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);

$mform->addElement('htmleditor', 'intro', get_string("introduction", "quiz"));
Expand Down
55 changes: 55 additions & 0 deletions mod/resource/mod_form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
require_once ('moodleform_mod.php');

class mod_resource_mod_form extends moodleform_mod {
var $_resinstance;

function definition() {
global $CFG;
$mform =& $this->_form;

// this hack is needed for different settings of each subtype
if (!empty($this->_instance)) {
if($res = get_record('resource', 'id', (int)$this->_instance)) {
$type = $res->type;
} else {
error('incorrect assignment');
}
} else {
$type = required_param('type', PARAM_ALPHA);
}
$mform->addElement('hidden', 'type', $type);
$mform->setDefault('type', $type);

require($CFG->dirroot.'/mod/resource/type/'.$type.'/resource.class.php');
$resclass = 'resource_'.$type;
$this->_resinstance = new $resclass();

//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));

// $mform->addElement('static', 'statictype', get_string('assignmenttype', 'assignment'), get_string('type'.$type,'assignment'));

$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');

$mform->addElement('htmleditor', 'summary', get_string('summary'));
$mform->setType('summary', PARAM_RAW);
$mform->setHelpButton('summary', array('summary', get_string('summary'), 'resource'));
$mform->addRule('summary', get_string('required'), 'required', null, 'client');

$mform->addElement('header', 'typedesc', get_string('resourcetype'.$type,'resource'));
$this->_resinstance->setup_elements($mform);

$this->standard_coursemodule_elements();

$this->add_action_buttons();
}

function defaults_preprocessing(&$default_values){
$this->_resinstance->setup_preprocessing($default_values);
}

}
?>
Loading

0 comments on commit 26de8d3

Please sign in to comment.