From: nicolasconnault Date: Fri, 17 Aug 2007 07:25:47 +0000 (+0000) Subject: MDL-10870 All files updated to new build_navigation() method. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f1af7aaaf5913855c8aa688941183924d1b532b3;p=moodle.git MDL-10870 All files updated to new build_navigation() method. --- diff --git a/admin/dbperformance.php b/admin/dbperformance.php index 77316aca5d..e3080608ce 100644 --- a/admin/dbperformance.php +++ b/admin/dbperformance.php @@ -18,9 +18,11 @@ $stradministration = get_string("administration"); $site = get_site(); + $navigation = build_navigation(array( + array('name'=>$stradministration, 'link'=>'index.php', 'type'=>'misc'), + array('name'=>$strdatabaseperformance, 'link'=>null, 'type'=>'misc'))); if (!empty($topframe)) { - print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", - "frametarget href=\"index.php\">$stradministration -> Database performance"); + print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", $navigation); exit; } diff --git a/admin/index.php b/admin/index.php index b5a4b1d919..5c5ca29505 100644 --- a/admin/index.php +++ b/admin/index.php @@ -129,7 +129,8 @@ error_reporting($CFG->debug); if (empty($agreelicense)) { $strlicense = get_string('license'); - print_header($strlicense, $strlicense, $strlicense, "", "", false, " ", " "); + $navigation = build_navigation(array(array('name'=>$strlicense, 'link'=>null, 'type'=>'misc'))); + print_header($strlicense, $strlicense, $navigation, "", "", false, " ", " "); print_heading("Moodle - Modular Object-Oriented Dynamic Learning Environment"); print_heading(get_string('copyrightnotice')); print_box(text_to_html(get_string('gpl')), 'copyrightnotice'); @@ -141,7 +142,8 @@ } if (empty($confirmrelease)) { $strcurrentrelease = get_string("currentrelease"); - print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, " ", " "); + $navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc'))); + print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, " ", " "); print_heading("Moodle $release"); print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'generalbox boxaligncenter boxwidthwide'); echo '
'; @@ -157,7 +159,8 @@ $strdatabasesetup = get_string("databasesetup"); $strdatabasesuccess = get_string("databasesuccess"); - print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup, + $navigation = build_navigation(array(array('name'=>$strdatabasesetup, 'link'=>null, 'type'=>'misc'))); + print_header($strdatabasesetup, $strdatabasesetup, $navigation, "", upgrade_get_javascript(), false, " ", " "); /// return to original debugging level $CFG->debug = $origdebug; @@ -167,13 +170,13 @@ /// Both old .sql files and new install.xml are supported /// But we prioritise install.xml (XMLDB) if present - + change_db_encoding(); // first try to change db encoding to utf8 if (!setup_is_unicodedb()) { // If could not convert successfully, throw error, and prevent installation - print_error('unicoderequired', 'admin'); + print_error('unicoderequired', 'admin'); } - + $status = false; if (file_exists("$CFG->libdir/db/install.xml")) { $status = install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method @@ -267,7 +270,8 @@ } if (empty($confirmupgrade)) { - print_header($strdatabasechecking, $stradministration, $strdatabasechecking, + $navigation = build_navigation(array(array('name'=>$strdatabasechecking, 'link'=>null, 'type'=>'misc'))); + print_header($strdatabasechecking, $stradministration, $navigation, "", "", false, " ", " "); notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=1', 'index.php'); @@ -275,14 +279,15 @@ } else if (empty($confirmrelease)){ $strcurrentrelease = get_string("currentrelease"); - print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, " ", " "); + $navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc'))); + print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, " ", " "); print_heading("Moodle $release"); print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes')); require_once($CFG->libdir.'/environmentlib.php'); print_heading(get_string('environment', 'admin')); if (!check_moodle_environment($release, $environment_results, true)) { - notice_yesno(get_string('environmenterrorupgrade', 'admin'), + notice_yesno(get_string('environmenterrorupgrade', 'admin'), 'index.php?confirmupgrade=1&confirmrelease=1', 'index.php'); } else { notify(get_string('environmentok', 'admin'), 'notifysuccess'); @@ -300,7 +305,8 @@ die; } else { $strdatabasesuccess = get_string("databasesuccess"); - print_header($strdatabasechecking, $stradministration, $strdatabasechecking, + $navigation = build_navigation(array(array('name'=>$strdatabasesuccess, 'link'=>null, 'type'=>'misc'))); + print_header($strdatabasechecking, $stradministration, $navigation, "", upgrade_get_javascript(), false, " ", " "); /// return to original debugging level @@ -309,7 +315,7 @@ upgrade_log_start(); /// Upgrade current language pack if we can - upgrade_language_pack(); + upgrade_language_pack(); print_heading($strdatabasechecking); $db->debug=true; @@ -337,7 +343,7 @@ } // update core events events_update_definition(); - + require_once($CFG->libdir.'/statslib.php'); if (!stats_upgrade_for_roles_wrapper()) { notify('Couldn\'t upgrade the stats tables to use the new roles system'); diff --git a/admin/mnet/delete.html b/admin/mnet/delete.html index bb11f2e288..973231e4a5 100644 --- a/admin/mnet/delete.html +++ b/admin/mnet/delete.html @@ -1,7 +1,10 @@ shortname: $strmnetsettings", "$site->fullname", - ''.$stradministration.' -> '. - ''.get_string('mnetsettings', 'mnet').' -> Delete host'); +$navlinks = array(); +$navlinks[] = array('name' => $stradministration, 'link' => $CFG->wwwroot.'/admin/index.php', 'type' => 'misc'); +$navlinks[] = array('name' => get_string('mnetsettings', 'mnet'), 'link' => $CFG->wwwroot.'/admin/mnet/index.php', 'type' => 'misc'); +$navlinks[] = array('name' => get_string('deletehost', 'mnet'), 'link' => null, 'type' => 'misc'); +$navigation = build_navigation($navlinks); +print_header("$site->shortname: $strmnetsettings", "$site->fullname", $navigation); print_heading(get_string('mnetsettings', 'mnet')); ?> diff --git a/admin/register.php b/admin/register.php index cd5fea53cf..ce558f4824 100644 --- a/admin/register.php +++ b/admin/register.php @@ -33,9 +33,11 @@ $stradministration = get_string("administration"); $strregistration = get_string("registration"); $strregistrationinfo = get_string("registrationinfo"); - - print_header("$site->shortname: $strregistration", $site->fullname, - "admin/index.php\">$stradministration -> $strregistration"); + $navlinks = array(); + $navlinks[] = array('name' => $stradministration, 'link' => "../$CFG->admin/index.php", 'type' => 'misc'); + $navlinks[] = array('name' => $strregistration, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + print_header("$site->shortname: $strregistration", $site->fullname, $navigation); print_heading($strregistration); @@ -63,12 +65,12 @@ echo '
'; echo '
'.$CFG->wwwroot.'
'; echo '
'; - + echo '
'; echo '
'; echo '
'."$CFG->release ($CFG->version)".'
'; echo '
'; - + echo '
'; echo '
'; echo '
'; @@ -103,7 +105,7 @@ unset($options); echo '
'; echo '
'; - + echo '
'; echo '
'; echo '
'; @@ -119,7 +121,7 @@ echo '
'; // total number of role assignments - $count = count_records('role_assignments'); + $count = count_records('role_assignments'); echo get_string('roleassignments', 'role').": ".$count; echo "\n"; echo '
'; @@ -127,13 +129,13 @@ // first find all distinct roles with mod/course:update // please change the name and strings to something appropriate to reflect the new data collected $sql = "SELECT COUNT(DISTINCT u.id) - FROM {$CFG->prefix}role_capabilities rc, + FROM {$CFG->prefix}role_capabilities rc, {$CFG->prefix}role_assignments ra, {$CFG->prefix}user u WHERE (rc.capability = 'moodle/course:update' or rc.capability='moodle/site:doanything') AND rc.roleid = ra.roleid AND u.id = ra.userid"; - + $count = count_records_sql($sql); echo get_string("teachers").": ".$count; echo "\n"; @@ -154,7 +156,7 @@ echo "\n"; echo '
'; echo '
'; - + echo '
'; echo '
'; echo '
'; diff --git a/admin/roles/assign.php b/admin/roles/assign.php index b1d507144b..7cb22c5b2a 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -90,7 +90,7 @@ $timeformat = get_string('strftimedate'); $today = time(); $today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0); - + $basemenu[0] = get_string('startdate') . ' (' . userdate($course->startdate, $timeformat) . ')'; if ($course->enrollable != 2 || ($course->enrolstartdate == 0 || $course->enrolstartdate <= $today) && ($course->enrolenddate == 0 || $course->enrolenddate > $today)) { $basemenu[3] = get_string('today') . ' (' . userdate($today, $timeformat) . ')' ; @@ -103,7 +103,7 @@ $basemenu[5] = get_string('courseenrolenddate') . ' (' . userdate($course->enrolenddate, $timeformat) . ')'; } } - + /// Make sure this user can assign that role if ($roleid) { @@ -122,16 +122,22 @@ if ($context->contextlevel == CONTEXT_USER) { /// course header + $navlinks = array(); if ($courseid != SITEID) { - print_header("$fullname", "$fullname", - "wwwroot/course/view.php?id=$course->id\">$course->shortname -> - wwwroot/user/index.php?id=$course->id\">$strparticipants -> wwwroot/user/view.php?id=$userid&course=$courseid\">$fullname ->".$straction, - "", "", true, " ", navmenu($course)); + $navlinks[] = array('name' => $course->shortname, 'link' => "$CFG->wwwroot/course/view.php?id=$course->id", 'type' => 'course'); + $navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc'); + $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&course=$courseid", 'type' => 'misc'); + $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + + print_header("$fullname", "$fullname", $navigation, "", "", true, " ", navmenu($course)); /// site header } else { - print_header("$course->fullname: $fullname", $course->fullname, - "wwwroot/user/view.php?id=$userid&course=$courseid\">$fullname -> $straction", "", "", true, " ", navmenu($course)); + $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&course=$courseid", 'type' => 'misc'); + $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + print_header("$course->fullname: $fullname", $course->fullname, $navigation, "", "", true, " ", navmenu($course)); } $showroles = 1; @@ -190,7 +196,7 @@ $timestart = $course->enrolenddate; break; } - + if($extendperiod > 0) { $timeend = $timestart + $extendperiod; } else { @@ -251,7 +257,7 @@ if ($context->contextlevel==CONTEXT_SYSTEM) { print_box(get_string('globalroleswarning', 'role')); } - + if ($roleid) { /// prints a form to swap roles /// Get all existing participants in this context. diff --git a/admin/roles/override.php b/admin/roles/override.php index d5de485abb..78c7fa116f 100755 --- a/admin/roles/override.php +++ b/admin/roles/override.php @@ -100,8 +100,8 @@ continue; } - if (isset($localoverrides[$capname])) { - // Something exists, so update it + if (isset($localoverrides[$capname])) { + // Something exists, so update it assign_capability($capname, $value, $roleid, $context->id, true); } else { // insert a record if ($value != CAP_INHERIT) { // Ignore inherits @@ -116,18 +116,22 @@ /// Print the header and tabs if ($context->contextlevel == CONTEXT_USER) { - + $navlinks = array(); /// course header if ($course->id != SITEID) { - print_header("$fullname", "$fullname", - "wwwroot/course/view.php?id=$course->id\">$course->shortname -> - wwwroot/user/index.php?id=$course->id\">$strparticipants -> wwwroot/user/view.php?id=$userid&course=$course->id\">$fullname -> $straction", - "", "", true, " ", navmenu($course)); + $navlinks[] = array('name' => $course->shortname, 'link' => "$CFG->wwwroot/course/view.php?id=$course->id", 'type' => 'course'); + $navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc'); + $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&course=$courseid", 'type' => 'misc'); + $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + print_header("$fullname", "$fullname", $navigation, "", "", true, " ", navmenu($course)); /// site header } else { - print_header("$course->fullname: $fullname", $course->fullname, - "wwwroot/user/view.php?id=$userid&course=$course->id\">$fullname -> $straction", "", "", true, " ", navmenu($course)); + $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&course=$courseid", 'type' => 'misc'); + $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + print_header("$course->fullname: $fullname", $course->fullname, $navigation, "", "", true, " ", navmenu($course)); } $showroles = 1; $currenttab = 'override'; diff --git a/admin/roles/tabs.php b/admin/roles/tabs.php index 4b81efb5e5..63347c24e5 100755 --- a/admin/roles/tabs.php +++ b/admin/roles/tabs.php @@ -13,7 +13,10 @@ if ($currenttab != 'update') { case CONTEXT_SYSTEM: $stradministration = get_string('administration'); - print_header($SITE->fullname, "$SITE->fullname","$stradministration -> $straction"); + $navlinks[] = array('name' => $stradministration, 'link' => '../index.php', 'type' => 'misc'); + $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + print_header($SITE->fullname, "$SITE->fullname", $navigation); break; case CONTEXT_PERSONAL: diff --git a/admin/stickyblocks.php b/admin/stickyblocks.php index 6ce5f055bf..d13b5e2c38 100644 --- a/admin/stickyblocks.php +++ b/admin/stickyblocks.php @@ -1,20 +1,20 @@ dirroot.'/my/pagelib.php'); require_once($CFG->dirroot.'/lib/pagelib.php'); require_once($CFG->dirroot.'/lib/blocklib.php'); - + if (!empty($THEME->customcorners)) { require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); } - + $pt = optional_param('pt', null, PARAM_SAFEDIR); //alhanumeric and - $pagetypes = array(PAGE_MY_MOODLE => array('id' => PAGE_MY_MOODLE, 'lib' => '/my/pagelib.php', 'name' => get_string('mymoodle','admin')), - PAGE_COURSE_VIEW => array('id' => PAGE_COURSE_VIEW, + PAGE_COURSE_VIEW => array('id' => PAGE_COURSE_VIEW, 'lib' => '/lib/pagelib.php', 'name' => get_string('stickyblockscourseview','admin')) // ... more? @@ -27,29 +27,33 @@ } require_login(); - + require_capability('moodle/site:manageblocks', get_context_instance(CONTEXT_SYSTEM, SITEID)); // first thing to do is print the dropdown menu $strtitle = get_string('stickyblocks','admin'); $strheading = get_string('adminhelpstickyblocks'); - - + + if (!empty($pt)) { require_once($CFG->dirroot.$pagetypes[$pt]['lib']); - + define('ADMIN_STICKYBLOCKS',$pt); - + $PAGE = page_create_object($pt, SITEID); $blocks = blocks_setup($PAGE,BLOCKS_PINNED_TRUE); $blocks_preferred_width = bounded_number(180, blocks_preferred_width($blocks[BLOCK_POS_LEFT]), 210); - print_header($strtitle,$strtitle,''. - get_string('administration').' -> '.$strtitle); - + $navlinks = array(array('name' => get_string('administration'), + 'link' => "$CFG->wwwroot/$CFG->admin/index.php", + 'type' => 'misc')); + $navlinks[] = array('name' => $strtitle, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + print_header($strtitle,$strtitle,$navigation); + echo ''; echo ''; @@ -60,7 +64,7 @@ echo ''; echo '
'; if (!empty($THEME->customcorners)) print_custom_corners_start(); - + } else { require_once($CFG->libdir.'/adminlib.php'); admin_externalpage_setup('stickyblocks'); diff --git a/admin/timezone.php b/admin/timezone.php index 3c27e2f084..73a9d24e6c 100644 --- a/admin/timezone.php +++ b/admin/timezone.php @@ -13,7 +13,7 @@ $strusers = get_string("users"); $strall = get_string("all"); - print_header($strtimezone, $strtimezone, $strtimezone); + print_header($strtimezone, $strtimezone, build_navigation(array(array('name' => $strtimezone, 'link' => null, 'type' => 'misc')))); print_heading(""); diff --git a/lang/en_utf8/mnet.php b/lang/en_utf8/mnet.php index 5558041d5d..2335ced11e 100644 --- a/lang/en_utf8/mnet.php +++ b/lang/en_utf8/mnet.php @@ -16,8 +16,8 @@ $string['trustedhostsexplain'] = '

The trusted hosts mechanism allows is available for scripts to control Moodle behaviour and can be a very dangerous option to enable. If in doubt, keep it off.

This is not needed for Moodle Networking.

-

To enable it, enter a list of IP addresses or networks, - one on each line. +

To enable it, enter a list of IP addresses or networks, + one on each line. Some examples:

'. 'Your local host:
'. '127.0.0.1
'. @@ -50,6 +50,7 @@ $string['selectahost'] = 'Please select a remote Moodle host.'; $string['selectaccesslevel'] = 'Please select an access level from the list.'; $string['noaclentries'] = 'No entries in the SSO access control list'; $string['deleteaserver'] = 'Deleting a Server'; +$string['deletehost'] = 'Delete host'; $string['nosite'] = 'Could not find site-level course'; $string['postrequired'] = 'The delete function requires a POST request.'; $string['hostdeleted'] = 'Ok - host deleted'; @@ -75,7 +76,7 @@ $string['expireyourkeyexplain'] = 'Moodle automatically rotates your key 'key has been compromised. A replacement will be immediately automatically generated.
'. 'Deleting this key will make it impossible for other Moodles to communicate with you, until you '. 'manually contact each administrator and provide them with your new key.'; -$string['deleteoutoftime'] = 'Your 60-second window for deleting this key has expired. Please start again.'; +$string['deleteoutoftime'] = 'Your 60-second window for deleting this key has expired. Please start again.'; $string['deletewrongkeyvalue'] = 'An error has occurred. If you were not trying to delete your server\'s SSL key, it is possible '. 'you have been the subject of a malicious attack. No action has been taken.'; @@ -92,7 +93,7 @@ $string['forbidden-function'] = 'That function has not been enabled fo $string['forbidden-transport'] = 'The transport method you are trying to use is not permitted.'; $string['registerallhosts'] = 'Register all hosts (Hub mode)'; -$string['registerallhostsexplain'] = 'You can choose to register all hosts that try to connect to you automatically. +$string['registerallhostsexplain'] = 'You can choose to register all hosts that try to connect to you automatically. This means that a record will appear in your hosts list for any '. 'Moodle site that connects to you and requests your public key.
'. 'You have the option below to configure services for \'All Hosts\' and by enabling some services there, you are able to provide '. @@ -104,7 +105,7 @@ $string['ssl_acl_deny'] = 'SSO ACL: Deny user $a[0] from $a[1]'; $string['enabled_for_all'] = '(This service has been enabled for all hosts).'; $string['nosuchfile'] = 'The file/function $a does not exist.'; $string['nosuchfunction'] = 'Unable to locate function, or function prohibited for RPC.'; -$string['nosuchmodule'] = 'The function was incorrectly addressed and could not be located. Please use the +$string['nosuchmodule'] = 'The function was incorrectly addressed and could not be located. Please use the mod/modulename/lib/functionname format.'; $string['nosuchpublickey'] = 'Unable to obtain public key for signature verification.'; $string['nosuchservice'] = 'The RPC service is not running on this host.'; @@ -228,7 +229,7 @@ $string['logs'] = 'logs'; $string['courses'] = 'courses'; $string['enrolcourses_desc'] = 'Courses offered for remote enrolment by this host.'; -$string['enrolcourseenrol_desc'] = 'Enrol/unenrol users from this course using Moodle Network enrolments. +$string['enrolcourseenrol_desc'] = 'Enrol/unenrol users from this course using Moodle Network enrolments. Note that users may have been enrolled in this course via other enrolment methods if the remote hosts allows them. Such enrolments are listed under Other enrolled users'; diff --git a/lib/adminlib.php b/lib/adminlib.php index f3f65bb0c5..4e6ff72b89 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -2784,6 +2784,9 @@ function admin_externalpage_setup($section) { } +/** + * TODO document + */ function admin_externalpage_print_header() { global $CFG, $PAGE, $SITE, $THEME; @@ -2802,7 +2805,7 @@ function admin_externalpage_print_header() { BLOCK_L_MAX_WIDTH); $PAGE->print_header(); echo ''; - + $lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable; foreach ($lt as $column) { $lt1[] = $column; @@ -2817,12 +2820,12 @@ function admin_externalpage_print_header() { if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; break; - + case 'middle': echo ''; break; - + case 'middle': if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; break; - + case 'right': if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) { echo '
'; if (!empty($THEME->customcorners)) print_custom_corners_start(); break; - + case 'right': if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) { echo ''; @@ -2872,12 +2875,12 @@ function admin_externalpage_print_footer() { if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; diff --git a/lib/weblib.php b/lib/weblib.php index 8960daba84..168467667a 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2246,17 +2246,17 @@ function get_html_lang($dir = false) { * @uses $USER * @uses $CFG * @uses $SESSION - * @param string $title Appears at the top of the window - * @param string $heading Appears at the top of the page - * @param string $navigation Premade navigation string (for use as breadcrumbs links) - * @param string $focus Indicates form element to get cursor focus on load eg inputform.password - * @param string $meta Meta tags to be added to the header + * @param string $title Appears at the top of the window + * @param string $heading Appears at the top of the page + * @param array $navigation Array of $navlinks arrays (keys: name, link, type) for use as breadcrumbs links + * @param string $focus Indicates form element to get cursor focus on load eg inputform.password + * @param string $meta Meta tags to be added to the header * @param boolean $cache Should this page be cacheable? - * @param string $button HTML code for a button (usually for module editing) - * @param string $menu HTML code for a popup menu + * @param string $button HTML code for a button (usually for module editing) + * @param string $menu HTML code for a popup menu * @param boolean $usexml use XML for this page - * @param string $bodytags This text will be included verbatim in the tag (useful for onload() etc) - * @param bool $return If true, return the visible elements of the header instead of echoing them. + * @param string $bodytags This text will be included verbatim in the tag (useful for onload() etc) + * @param bool $return If true, return the visible elements of the header instead of echoing them. */ function print_header ($title='', $heading='', $navigation='', $focus='', $meta='', $cache=true, $button=' ', $menu='', @@ -4263,7 +4263,7 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v */ function use_html_editor($name='', $editorhidebuttons='', $id='') { global $THEME; - + $editor = 'editor_'.md5($name); //name might contain illegal characters if ($id === '') { $id = 'edit-'.$name; @@ -4274,7 +4274,7 @@ function use_html_editor($name='', $editorhidebuttons='', $id='') { echo "var config = $editor.config;\n"; echo print_editor_config($editorhidebuttons); - + if (empty($THEME->htmleditorpostprocess)) { if (empty($name)) { echo "\nHTMLArea.replaceAll($editor.config);\n"; @@ -6398,7 +6398,7 @@ function print_arrow($direction='up', $strsort=null, $return=false) { } } -/** +/** * Returns boolean true if the current language is right-to-left (Hebrew, Arabic etc) * */ @@ -6420,8 +6420,8 @@ function right_to_left() { * @return string */ function fix_align_rtl($align) { - if (!right_to_left()) { - return $align; + if (!right_to_left()) { + return $align; } if ($align=='left') { return 'right'; } if ($align=='right') { return 'left'; } diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index be84dafb2e..fd24b3db37 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -98,7 +98,7 @@ class assignment_base { $this->navigation[] = array('name' => $this->strassignment, 'link' => '', 'type' => 'activityinstance'); $navigation = build_navigation($this->navigation); - print_header($pagetitle, $this->course->fullname, "$this->navigation $this->strassignment", + print_header($pagetitle, $this->course->fullname, $this->navigation, "", "", true, '', navmenu($this->course, $this->cm)); notice(get_string("activityiscurrentlyhidden"), "$CFG->wwwroot/course/view.php?id={$this->course->id}"); } @@ -690,7 +690,7 @@ class assignment_base { 'grade'.$submission->userid, $buttontext, 450, 700, $buttontext, 'none', true, 'button'.$submission->userid); $output.= 'opener.document.getElementById("up'.$submission->userid.'").innerHTML="'.addslashes_js($button).'";'; } - + if (!empty($CFG->enableoutcomes) and empty($SESSION->flextable['mod-assignment-submissions']->collapse['outcomes'])) { if ($outcomes_data = grade_get_outcomes($this->course->id, 'mod', 'assignment', $this->assignment->id, $submission->userid)) { foreach($outcomes_data as $n=>$data) { @@ -2482,9 +2482,9 @@ function assignment_count_real_submissions($assignment, $groupid=0) { return count_records_sql("SELECT COUNT(DISTINCT gm.userid, gm.groupid) FROM {$CFG->prefix}assignment_submissions a, {$CFG->prefix}groups_members g - WHERE a.assignment = $assignment->id + WHERE a.assignment = $assignment->id AND a.timemodified > 0 - AND g.groupid = '$groupid' + AND g.groupid = '$groupid' AND a.userid = g.userid "); } else { $cm = get_coursemodule_from_instance('assignment', $assignment->id); diff --git a/mod/resource/config.html b/mod/resource/config.html index df1343dfd8..62c7080cd2 100644 --- a/mod/resource/config.html +++ b/mod/resource/config.html @@ -1,5 +1,5 @@ - +