MDL-30617 modchoser: minor tweaks
authorDan Poltawski <dan@moodle.com>
Thu, 17 May 2012 15:35:14 +0000 (23:35 +0800)
committerDan Poltawski <dan@moodle.com>
Thu, 17 May 2012 16:27:42 +0000 (00:27 +0800)
* Change markup way from 'activity module style' to its own markup
* Remove 'a new' from the 'add an activity' string
* Remove the 'personalisation' from the nohelp lang string

course/lib.php
course/yui/modchooser/modchooser.js
lang/en/moodle.php

index 9499824..bb70802 100644 (file)
@@ -1854,11 +1854,13 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
     if (course_ajax_enabled($course)) {
         $straddeither = get_string('addresourceoractivity');
         // The module chooser link
-        $modchooser = '<div class="sectionaddmodule">';
-        $modchooser .= '<div class="section_add_menus"><a class="sectionmodchooserlink" href="#">';
-        $modchooser .= '<img alt="'.$straddeither.'" src="'.$OUTPUT->pix_url('t/add').'" class="activityicon">&nbsp;';
-        $modchooser .= '<span class="instancename">'.$straddeither.'</span>';
-        $modchooser .= '</a></div></div>';
+        $modchooser = html_writer::start_tag('div', array('class' => 'mdl-right'));
+        $modchooser.= html_writer::start_tag('div', array('class' => 'section-modchooser'));
+        $icon = $OUTPUT->pix_icon('t/add', $straddeither);
+        $span = html_writer::tag('span', $straddeither, array('class' => 'section-modchooser-text'));
+        $modchooser.= html_writer::link('#', $icon.$span, array('class' => 'section-modchooser-link'));
+        $modchooser.= html_writer::end_tag('div');
+        $modchooser.= html_writer::end_tag('div');
 
         // Wrap the normal output in a noscript div
         $usemodchooser = get_user_preferences('usemodchooser', 1);
index 3105afd..3cd0817 100644 (file)
@@ -2,7 +2,7 @@ YUI.add('moodle-course-modchooser', function(Y) {
     var CSS = {
         PAGECONTENT : 'div#page-content',
         SECTION : 'li.section',
-        SECTIONMODCHOOSER : 'a.sectionmodchooserlink',
+        SECTIONMODCHOOSER : 'a.section-modchooser-link',
         SITEMENU : 'div.block_site_main_menu',
         SITETOPIC : 'div.sitetopic'
     };
index 72f70a7..bb68f7c 100644 (file)
@@ -66,7 +66,7 @@ $string['addnewuser'] = 'Add a new user';
 $string['addnousersrecip'] = 'Add users who haven\'t accessed this {$a} to recipient list';
 $string['addpagehere'] = 'Add page here';
 $string['addresource'] = 'Add a resource...';
-$string['addresourceoractivity'] = 'Add a new resource or activity';
+$string['addresourceoractivity'] = 'Add a resource or activity';
 $string['address'] = 'Address';
 $string['addstudent'] = 'Add student';
 $string['addsubcategory'] = 'Add a sub-category';
@@ -1171,7 +1171,7 @@ $string['nodstpresets'] = 'The administrator has not enabled Daylight Savings Ti
 $string['nofilesselected'] = 'No files have been selected to restore';
 $string['nofilesyet'] = 'No files have been uploaded to your course yet';
 $string['nograde'] = 'No grade';
-$string['nohelpforactivityorresource'] = 'I\'m sorry, but there is currently no help associated with this resource or activity';
+$string['nohelpforactivityorresource'] = 'There is currently no help associated with this resource or activity';
 $string['nochange'] = 'No change';
 $string['noimagesyet'] = 'No images have been uploaded to your course yet';
 $string['nologsfound'] = 'No logs have been found';