Skip to content

Commit

Permalink
MDL-32294 course: Add resource/activity dropdown have labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Oct 15, 2012
1 parent 61bfc2c commit 4c897a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions course/lib.php
Expand Up @@ -1834,6 +1834,9 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,

$straddactivity = get_string('addactivity');
$straddresource = get_string('addresource');
$sectionname = get_section_name($course, $section);
$strresourcelabel = get_string('addresourcetosection', null, $sectionname);
$stractivitylabel = get_string('addactivitytosection', null, $sectionname);

$output = html_writer::start_tag('div', array('class' => 'section_add_menus', 'id' => 'add_menus-section-' . $section));

Expand All @@ -1844,12 +1847,14 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
if (!empty($resources)) {
$select = new url_select($resources, '', array(''=>$straddresource), "ressection$section");
$select->set_help_icon('resources');
$select->set_label($strresourcelabel, array('class' => 'accesshide'));
$output .= $OUTPUT->render($select);
}

if (!empty($activities)) {
$select = new url_select($activities, '', array(''=>$straddactivity), "section$section");
$select->set_help_icon('activities');
$select->set_label($stractivitylabel, array('class' => 'accesshide'));
$output .= $OUTPUT->render($select);
}

Expand Down
2 changes: 2 additions & 0 deletions lang/en/moodle.php
Expand Up @@ -43,6 +43,7 @@
$string['activityweighted'] = 'Activity per user';
$string['add'] = 'Add';
$string['addactivity'] = 'Add an activity...';
$string['addactivitytosection'] = 'Add an activity to section \'{$a}\'';
$string['addadmin'] = 'Add admin';
$string['addblock'] = 'Add a block';
$string['addcomment'] = 'Add a comment...';
Expand All @@ -67,6 +68,7 @@
$string['addpagehere'] = 'Add page here';
$string['addresource'] = 'Add a resource...';
$string['addresourceoractivity'] = 'Add an activity or resource';
$string['addresourcetosection'] = 'Add a resource to section \'{$a}\'';
$string['address'] = 'Address';
$string['addstudent'] = 'Add student';
$string['addsubcategory'] = 'Add a sub-category';
Expand Down

0 comments on commit 4c897a8

Please sign in to comment.