From: moodler Date: Wed, 16 May 2007 08:03:37 +0000 (+0000) Subject: Merged MDL-9826 from stable X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b6b354e36e0acfc14769ffe53d18894f79081ade;p=moodle.git Merged MDL-9826 from stable --- diff --git a/lib/weblib.php b/lib/weblib.php index d32f3ff992..1948206be1 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1047,7 +1047,8 @@ function print_textfield ($name, $value, $alt = '',$size=50,$maxlength=0, $retur * @return string If $return is true then the entire form is returned as a string. * @todo Finish documenting this function
*/ -function popup_form($common, $options, $formid, $selected='', $nothing='choose', $help='', $helptext='', $return=false, $targetwindow='self', $selectlabel='') { +function popup_form($common, $options, $formid, $selected='', $nothing='choose', $help='', $helptext='', $return=false, +$targetwindow='self', $selectlabel='', $optionsextra=NULL) { global $CFG; static $go, $choose; /// Locally cached, in case there's lots on a page @@ -1135,6 +1136,10 @@ function popup_form($common, $options, $formid, $selected='', $nothing='choose', $optstr .= ' selected="selected"'; } + if (!empty($optionsextra[$value])) { + $optstr .= ' '.$optionsextra[$value]; + } + if ($label) { $optstr .= '>'. $label .'' . "\n"; } else { @@ -4568,21 +4573,28 @@ function update_groups_button($courseid) { function print_group_menu($groups, $groupmode, $currentgroup, $urlroot, $showall=1, $return=false) { $output = ''; + $groupsmenu = array(); /// Add an "All groups" to the start of the menu if ($showall){ $groupsmenu[0] = get_string('allparticipants'); } - foreach ($groups as $key => $groupname) { - $groupsmenu[$key] = $groupname; + foreach ($groups as $key => $group) { + $groupsmenu[$key] = format_string($group->name); } if ($groupmode == VISIBLEGROUPS) { - $grouplabel = get_string('groupsvisible').':'; + $grouplabel = get_string('groupsvisible'); } else { - $grouplabel = get_string('groupsseparate').':'; + $grouplabel = get_string('groupsseparate'); + } + + if (count($groupsmenu) == 1) { + $groupname = reset($groupsmenu); + $output .= $grouplabel.': '.$groupname; + } else { + $output .= popup_form($urlroot.'&group=', $groupsmenu, 'selectgroup', $currentgroup, '', '', '', true, 'self', $grouplabel); } - $output .= popup_form($urlroot.'&group=', $groupsmenu, 'selectgroup', $currentgroup, '', '', '', true, 'self', $grouplabel); if ($return) { return $output; @@ -4642,6 +4654,7 @@ function navmenu($course, $cm=NULL, $targetwindow='self') { $logslink = NULL; $flag = false; $menu = array(); + $menustyle = array(); $sections = get_records('course_sections','course',$course->id,'section','section,visible,summary'); @@ -4703,6 +4716,9 @@ function navmenu($course, $cm=NULL, $targetwindow='self') { } } $menu[$url] = $mod->name; + if (empty($THEME->navmenuiconshide)) { + $menustyle[$url] = 'style="background-image: url('.$CFG->modpixpath.'/'.$mod->mod.'/icon.gif);"'; // Unfortunately necessary to do this here + } $previousmod = $mod; } } @@ -4733,7 +4749,7 @@ function navmenu($course, $cm=NULL, $targetwindow='self') { return ''; } @@ -5419,8 +5435,8 @@ function redirect($url, $message='', $delay=-1) { $delay += 3; // double redirect prevention, it was sometimes breaking upgrades before 1.7 } echo '
'; - echo '

'. $message .'

'; - echo '

( '. get_string('continue') .' )

'; + echo '
'. $message .'
'; + echo '
( '. get_string('continue') .' )
'; echo '
'; if (!$errorprinted) { diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 4d9a472706..7194d5fe82 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -120,6 +120,12 @@ img.grouppicture { text-align: center; } +div.groupselector { + float: left; + margin-top: 3px; + margin-bottom: 3px; +} + #addmembersform table { margin-left: auto; margin-right: auto; @@ -705,6 +711,13 @@ table.navbar { padding:0px; } +#navmenupopup option { + padding: 2px 0 2px 20px; + background-repeat: no-repeat; + background-position: 1px 2px; + vertical-align: middle; +} + /*** *** Footer ***/ @@ -2647,6 +2660,13 @@ body#user-index .rolesform { vertical-align: middle; } +#mod-chat-view #enterlink { + text-align: center; + margin-left: auto; + margin-right: auto; + width: 50%; +} + .chat-event .picture, .chat-message .picture { width:40px;