Merge branch 'MDL-34650' of git://github.com/rwijaya/moodle

This commit is contained in:
Aparup Banerjee 2012-07-31 13:19:47 +08:00
commit 87c12fec13
8 changed files with 39 additions and 9 deletions

View File

@ -937,6 +937,7 @@ $string['liketologin'] = 'Would you like to log in now with a full user account?
$string['list'] = 'List';
$string['listfiles'] = 'List of files in {$a}';
$string['listofallpeople'] = 'List of all people';
$string['listofcourses'] = 'List of courses';
$string['local'] = 'Local';
$string['localplugindeleteconfirm'] = 'You are about to completely delete the local plugin \'{$a}\'. This will completely delete everything in the database associated with this plugin. Are you SURE you want to continue?';
$string['localplugins'] = 'Local plugins';
@ -1032,6 +1033,7 @@ $string['messageselectadd'] = 'Send a message';
$string['migratinggrades'] = 'Migrating grades';
$string['min'] = 'min';
$string['mins'] = 'mins';
$string['minute'] = 'minute';
$string['minutes'] = 'minutes';
$string['miscellaneous'] = 'Miscellaneous';
$string['missingcategory'] = 'You need to choose a category';
@ -1059,6 +1061,8 @@ $string['missingteacher'] = 'Must choose something';
$string['missingurl'] = 'Missing URL';
$string['missingusername'] = 'Missing username';
$string['moddoesnotsupporttype'] = 'Module {$a->modname} does not support uploads of type {$a->type}';
$string['month'] = 'Month';
$string['months'] = 'Months';
$string['modified'] = 'Modified';
$string['modchooserenable'] = 'Activity chooser on';
$string['modchooserdisable'] = 'Activity chooser off';
@ -1247,6 +1251,7 @@ $string['oldpassword'] = 'Current password';
$string['olduserdirectory'] = 'This is the OLD users directory, and is no longer needed. You may safely delete it. The files it contains have been copied to the NEW user directory.';
$string['opentoguests'] = 'Guest access';
$string['optional'] = 'optional';
$string['options'] = 'options';
$string['order'] = 'Order';
$string['originalpath'] = 'Original path';
$string['orphanedactivities'] = 'Orphaned activities';
@ -1493,9 +1498,15 @@ $string['sectionusedefaultname'] = 'Use default section name';
$string['seealsostats'] = 'See also: stats';
$string['select'] = 'Select';
$string['selectacountry'] = 'Select a country';
$string['selectacourse'] = 'Select a course';
$string['selectacoursesite'] = 'Select a course or site';
$string['selectanaction'] = 'Select an action';
$string['selectagroup'] = 'Select a group';
$string['selectaregion'] = 'Select a region';
$string['selctauser'] = 'Select a user';
$string['selectall'] = 'Select all';
$string['selectamodule'] = 'Please select an activity module';
$string['selectanoptions'] = 'Select an options';
$string['selectdefault'] = 'Select default';
$string['selectedfile'] = 'Selected file';
$string['selectednowmove'] = '{$a} files selected for moving. Now go into the destination folder and press \'Move files to here\'';

View File

@ -27,5 +27,6 @@ $string['downloadas'] = 'Download table data as';
$string['downloadcsv'] = 'a comma separated values text file';
$string['downloadexcel'] = 'a Microsoft Excel spreadsheet';
$string['downloadods'] = 'an OpenDocument Spreadsheet (ODS)';
$string['downloadoptions'] = 'Select download options';
$string['downloadtsv'] = 'a tab separated values text file';
$string['downloadxhtml'] = 'an unpaged XHTML document';

View File

@ -361,10 +361,11 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
$str .= '<div>';
if (count($formats)>1) {
$str.= html_writer::select($formats, $elname.'[format]', $format, false);
$str .= html_writer::label(get_string('format'), 'menu'. $elname. 'format', false, array('class' => 'accesshide'));
$str .= html_writer::select($formats, $elname.'[format]', $format, false, array('id' => 'menu'. $elname. 'format'));
} else {
$keys = array_keys($formats);
$str.= html_writer::empty_tag('input',
$str .= html_writer::empty_tag('input',
array('name'=>$elname.'[format]', 'type'=> 'hidden', 'value' => array_pop($keys)));
}
$str .= '</div>';

View File

@ -714,6 +714,11 @@ class single_select implements renderable {
*/
var $label = '';
/**
* @var array Button label's
*/
var $labelattributes = array();
/**
* @var string Form submit method post or get
*/
@ -806,9 +811,12 @@ class single_select implements renderable {
* Sets select's label
*
* @param string $label
* @param array $attributes (optional)
*/
public function set_label($label) {
public function set_label($label, $attributes = array()) {
$this->label = $label;
$this->labelattributes = $attributes;
}
}
@ -850,6 +858,11 @@ class url_select implements renderable {
*/
var $label = '';
/**
* @var array Button label's attributes
*/
var $labelattributes = array();
/**
* @var string Wrapping div class
*/
@ -922,9 +935,11 @@ class url_select implements renderable {
* Sets select's label
*
* @param string $label
* @param array $attributes (optional)
*/
public function set_label($label) {
public function set_label($label, $attributes = array()) {
$this->label = $label;
$this->labelattributes = $attributes;
}
}

View File

@ -1332,7 +1332,7 @@ class core_renderer extends renderer_base {
}
if ($select->label) {
$output .= html_writer::label($select->label, $select->attributes['id']);
$output .= html_writer::label($select->label, $select->attributes['id'], false, $select->labelattributes);
}
if ($select->helpicon instanceof help_icon) {
@ -1340,7 +1340,6 @@ class core_renderer extends renderer_base {
} else if ($select->helpicon instanceof old_help_icon) {
$output .= $this->render($select->helpicon);
}
$output .= html_writer::select($select->options, $select->name, $select->selected, $select->nothing, $select->attributes);
$go = html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('go')));
@ -1410,7 +1409,7 @@ class core_renderer extends renderer_base {
$output = '';
if ($select->label) {
$output .= html_writer::label($select->label, $select->attributes['id']);
$output .= html_writer::label($select->label, $select->attributes['id'], false, $select->labelattributes);
}
if ($select->helpicon instanceof help_icon) {
@ -1627,6 +1626,7 @@ class core_renderer extends renderer_base {
$scalearray = array(RATING_UNSET_RATING => $strrate.'...') + $rating->settings->scale->scaleitems;
$scaleattrs = array('class'=>'postratingmenu ratinginput','id'=>'menurating'.$rating->itemid);
$ratinghtml .= html_writer::label($rating->rating, 'menurating'.$rating->itemid, false, array('class' => 'accesshide'));
$ratinghtml .= html_writer::select($scalearray, 'rating', $rating->rating, false, $scaleattrs);
//output submit button

View File

@ -462,7 +462,8 @@ function portfolio_instance_select($instances, $callerformats, $callbackclass, $
$pinsane = portfolio_plugin_sanity_check();
$count = 0;
$selectoutput = "\n" . '<select name="' . $selectname . '">' . "\n";
$selectoutput = "\n" . '<label class="accesshide" for="instanceid">' . get_string('plugin', 'portfolio') . '</label>';
$selectoutput .= "\n" . '<select id="instanceid" name="' . $selectname . '">' . "\n";
$existingexports = portfolio_existing_exports_by_plugin($USER->id);
foreach ($instances as $instance) {
$formats = portfolio_supported_formats_intersect($callerformats, $instance->supported_formats());

View File

@ -992,7 +992,7 @@ function question_category_select_menu($contexts, $top = false, $currentcat = 0,
foreach ($categoriesarray as $group => $opts) {
$options[] = array($group => $opts);
}
echo html_writer::label($selected, 'menucategory', false, array('class' => 'accesshide'));
echo html_writer::select($options, 'category', $selected, $choose);
}

View File

@ -918,6 +918,7 @@ class flexible_table {
$html = '<form action="'. $this->baseurl .'" method="post">';
$html .= '<div class="mdl-align">';
$html .= '<input type="submit" value="'.get_string('downloadas', 'table').'"/>';
$html .= html_writer::label(get_string('downloadoptions', 'table'), 'menudownload', false, array('class' => 'accesshide'));
$html .= html_writer::select($downloadoptions, 'download', $this->defaultdownloadformat, false);
$html .= '</div></form>';