Merge branch 'MDL-42919-master' of git://github.com/damyon/moodle

This commit is contained in:
Sam Hemelryk 2013-12-04 09:43:43 +13:00
commit db9c8f4c7d
11 changed files with 102 additions and 57 deletions

View File

@ -2592,15 +2592,15 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
// switch next two lines for ol li containers for form items.
// $this->_elementTemplates=array('default'=>"\n\t\t".'<li class="fitem"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class="qfelement<!-- BEGIN error --> error<!-- END error --> {type}"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></li>');
$this->_elementTemplates = array(
'default'=>"\n\t\t".'<div id="{id}" class="fitem {advanced}<!-- BEGIN required --> required<!-- END required --> fitem_{type}" {aria-live}><div class="fitemtitle"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div><div class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></div>',
'default'=>"\n\t\t".'<div id="{id}" class="fitem {advanced}<!-- BEGIN required --> required<!-- END required --> fitem_{type} {emptylabel}" {aria-live}><div class="fitemtitle"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div><div class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></div>',
'actionbuttons'=>"\n\t\t".'<div id="{id}" class="fitem fitem_actionbuttons fitem_{type}"><div class="felement {type}">{element}</div></div>',
'fieldset'=>"\n\t\t".'<div id="{id}" class="fitem {advanced}<!-- BEGIN required --> required<!-- END required --> fitem_{type}"><div class="fitemtitle"><div class="fgrouplabel"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div></div><fieldset class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</fieldset></div>',
'fieldset'=>"\n\t\t".'<div id="{id}" class="fitem {advanced}<!-- BEGIN required --> required<!-- END required --> fitem_{type} {emptylabel}"><div class="fitemtitle"><div class="fgrouplabel"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div></div><fieldset class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</fieldset></div>',
'static'=>"\n\t\t".'<div class="fitem {advanced}"><div class="fitemtitle"><div class="fstaticlabel"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div></div><div class="felement fstatic <!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}&nbsp;</div></div>',
'static'=>"\n\t\t".'<div class="fitem {advanced} {emptylabel}"><div class="fitemtitle"><div class="fstaticlabel"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div></div><div class="felement fstatic <!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></div>',
'warning'=>"\n\t\t".'<div class="fitem {advanced}">{element}</div>',
'warning'=>"\n\t\t".'<div class="fitem {advanced} {emptylabel}">{element}</div>',
'nodisplay'=>'');
@ -2701,6 +2701,11 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
$html =str_replace('{id}', 'fgroup_' . $group->getAttribute('id'), $html);
$html =str_replace('{name}', $group->getName(), $html);
$html =str_replace('{type}', 'fgroup', $html);
$emptylabel = '';
if ($group->getLabel() == '') {
$emptylabel = 'femptylabel';
}
$html = str_replace('{emptylabel}', $emptylabel, $html);
$this->_templates[$group->getName()]=$html;
// Fix for bug in tableless quickforms that didn't allow you to stop a
@ -2752,6 +2757,11 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
$html =str_replace('{id}', 'fitem_' . $element->getAttribute('id'), $html);
$html =str_replace('{type}', 'f'.$element->getType(), $html);
$html =str_replace('{name}', $element->getName(), $html);
$emptylabel = '';
if ($element->getLabel() == '') {
$emptylabel = 'femptylabel';
}
$html = str_replace('{emptylabel}', $emptylabel, $html);
if (method_exists($element, 'getHelpButton')){
$html = str_replace('{help}', $element->getHelpButton(), $html);
}else{

View File

@ -203,8 +203,7 @@ class assign_feedback_comments extends assign_feedback_plugin {
}
}
$mform->addElement('editor', 'assignfeedbackcomments_editor', html_writer::tag('span', $this->get_name(),
array('class' => 'accesshide')), null, null);
$mform->addElement('editor', 'assignfeedbackcomments_editor', $this->get_name(), null, null);
return true;
}

View File

@ -143,8 +143,7 @@ class assign_feedback_file extends assign_feedback_plugin {
'assignfeedback_file',
ASSIGNFEEDBACK_FILE_FILEAREA,
$gradeid);
$mform->addElement('filemanager', $elementname . '_filemanager', html_writer::tag('span', $this->get_name(),
array('class' => 'accesshide')), null, $fileoptions);
$mform->addElement('filemanager', $elementname . '_filemanager', $this->get_name(), null, $fileoptions);
return true;
}

View File

@ -944,11 +944,7 @@ class assign {
protected function add_plugin_grade_elements($grade, MoodleQuickForm $mform, stdClass $data, $userid) {
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
$mform->addElement('header', 'header_' . $plugin->get_type(), $plugin->get_name());
$mform->setExpanded('header_' . $plugin->get_type());
if (!$plugin->get_form_elements_for_user($grade, $mform, $data, $userid)) {
$mform->removeElement('header_' . $plugin->get_type());
}
$plugin->get_form_elements_for_user($grade, $mform, $data, $userid);
}
}
}
@ -5720,10 +5716,7 @@ class assign {
$userid) {
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible() && $plugin->allow_submissions()) {
$mform->addElement('header', 'header_' . $plugin->get_type(), $plugin->get_name());
if (!$plugin->get_form_elements_for_user($submission, $mform, $data, $userid)) {
$mform->removeElement('header_' . $plugin->get_type());
}
$plugin->get_form_elements_for_user($submission, $mform, $data, $userid);
}
}
}

View File

@ -158,8 +158,7 @@ class assign_submission_file extends assign_submission_plugin {
'assignsubmission_file',
ASSIGNSUBMISSION_FILE_FILEAREA,
$submissionid);
$mform->addElement('filemanager', 'files_filemanager', html_writer::tag('span', $this->get_name(),
array('class' => 'accesshide')), null, $fileoptions);
$mform->addElement('filemanager', 'files_filemanager', $this->get_name(), null, $fileoptions);
return true;
}

View File

@ -95,8 +95,7 @@ class assign_submission_onlinetext extends assign_submission_plugin {
'assignsubmission_onlinetext',
ASSIGNSUBMISSION_ONLINETEXT_FILEAREA,
$submissionid);
$mform->addElement('editor', 'onlinetext_editor', html_writer::tag('span', $this->get_name(),
array('class' => 'accesshide')), null, $editoroptions);
$mform->addElement('editor', 'onlinetext_editor', $this->get_name(), null, $editoroptions);
return true;
}

View File

@ -51,7 +51,7 @@ class question_export_form extends moodleform {
foreach ($fileformatnames as $shortname => $fileformatname) {
$currentgrp1 = array();
$currentgrp1[] = $mform->createElement('radio', 'format', '', $fileformatname, $shortname);
$mform->addGroup($currentgrp1, "formathelp[$i]", '&#160;', array('<br />'), false);
$mform->addGroup($currentgrp1, "formathelp[$i]", '', array('<br />'), false);
if (get_string_manager()->string_exists('pluginname_help', 'qformat_' . $shortname)) {
$mform->addHelpButton("formathelp[$i]", 'pluginname', 'qformat_' . $shortname);

View File

@ -53,7 +53,7 @@ class question_import_form extends moodleform {
foreach ($fileformatnames as $shortname => $fileformatname) {
$currentgrp1 = array();
$currentgrp1[] = $mform->createElement('radio', 'format', '', $fileformatname, $shortname);
$mform->addGroup($currentgrp1, "formathelp[$i]", '&#160;', array('<br />'), false);
$mform->addGroup($currentgrp1, "formathelp[$i]", '', array('<br />'), false);
if (get_string_manager()->string_exists('pluginname_help', 'qformat_' . $shortname)) {
$mform->addHelpButton("formathelp[$i]", 'pluginname', 'qformat_' . $shortname);

View File

@ -342,6 +342,15 @@ input#id_externalurl {direction:ltr;}
text-align: left;
width: 100%;
}
#region-main .mform .femptylabel .fitemtitle {
display: inline-block;
width: auto;
margin-right: 8px;
}
.dir-rtl #region-main .mform .femptylabel .fitemtitle {
margin-right: 0px;
margin-left: 8px;
}
.dir-rtl #region-main .mform .fitem .fitemtitle {
text-align: right;
}
@ -354,6 +363,14 @@ input#id_externalurl {direction:ltr;}
padding-left: 0;
padding-right: 0;
}
#region-main .mform .fitem .fstatic:empty {
display: none;
}
#region-main .mform .femptylabel .felement {
display: inline-block;
margin-top: 4px;
width: auto;
}
.dir-rtl #region-main .mform .fitem .felement {
margin-right: 0;
float: right;

View File

@ -390,39 +390,68 @@ fieldset.coursesearchbox label {
font-weight: bold;
}
@media (max-width: 1199px) {
#region-main .mform .fitem .fitemtitle {
display: block;
margin-top: 4px;
margin-bottom: 4px;
text-align: left;
width: 100%;
#region-main .mform {
.fitem {
.fitemtitle {
display: block;
margin-top: 4px;
margin-bottom: 4px;
text-align: left;
width: 100%;
}
.felement {
margin-left: 0;
width: 100%;
float: left;
padding-left: 0;
padding-right: 0;
}
.fstatic:empty {
display: none;
}
}
.femptylabel {
.fitemtitle {
display: inline-block;
width: auto;
margin-right: 8px;
}
.felement {
display: inline-block;
margin-top: 4px;
padding-top: 5px;
width: auto;
}
}
.fitem_fcheckbox{
.fitemtitle,
.felement {
display: inline-block;
width: auto;
}
.felement {
padding: 6px;
}
}
}
.dir-rtl #region-main .mform .fitem .fitemtitle {
text-align: right;
}
#region-main .mform .fitem .felement {
margin-left: 0;
width: 100%;
float: left;
padding-left: 0;
padding-right: 0;
}
.dir-rtl #region-main .mform .fitem .felement {
margin-right: 0;
float: right;
padding-right: 0;
padding-left: 0;
}
#region-main .mform .fitem_fcheckbox .fitemtitle,
#region-main .mform .fitem_fcheckbox .felement {
display: inline-block;
width: auto;
}
.dir-rtl #region-main .mform .fitem_fcheckbox .felement {
float: right;
}
#region-main .mform .fitem_fcheckbox .felement {
padding: 6px;
.dir-rtl #region-main .mform {
.femptylabel .fitemtitle {
margin-right: 0px;
margin-left: 8px;
}
.fitem {
.fitemtitle {
text-align: right;
}
.felement {
margin-right: 0;
float: right;
padding-right: 0;
padding-left: 0;
}
}
.fitem_fcheckbox .felement {
float: right;
}
}
}

File diff suppressed because one or more lines are too long