Merge branch 'MDL-42407-master' of git://github.com/phalacee/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 29 Oct 2013 07:08:13 +0000 (15:08 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 29 Oct 2013 07:08:13 +0000 (15:08 +0800)
203 files changed:
admin/roles/assign.php
admin/roles/check.php
admin/roles/define.php
admin/roles/override.php
admin/roles/permissions.php
admin/roles/usersroles.php
admin/settings.php
admin/settings/frontpage.php
admin/tests/behat/behat_admin.php
admin/tests/behat/display_short_names.feature
admin/tool/customlang/edit.php
admin/tool/customlang/index.php
admin/tool/generator/classes/testplan_backend.php
admin/tool/installaddon/classes/installer.php
admin/tool/installaddon/deploy.php
admin/tool/installaddon/tests/installer_test.php
backup/moodle2/restore_section_task.class.php
backup/util/dbops/restore_dbops.class.php
badges/action.php
badges/award.php
badges/criteria.php
badges/criteria_action.php
badges/criteria_settings.php
badges/edit.php
badges/index.php
badges/overview.php
badges/recipients.php
blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-debug.js
blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-min.js
blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js
blocks/navigation/yui/src/navigation/js/navigation.js
cohort/assign.php
cohort/edit.php
cohort/index.php
completion/tests/behat/restrict_activity_by_date.feature [new file with mode: 0644]
completion/tests/behat/restrict_activity_by_grade.feature [new file with mode: 0644]
completion/tests/behat/restrict_section_availability.feature
config-dist.php
course/delete.php
course/dnduploadlib.php
course/editcategory.php
course/format/renderer.php
course/management.php
course/modedit.php
course/reset.php
course/tests/behat/behat_course.php
course/tests/courselib_test.php
course/user.php
files/index.php
files/renderer.php
filter/manage.php
lang/en/backup.php
lang/en/moodle.php
lib/accesslib.php
lib/adminlib.php
lib/ajax/getsiteadminbranch.php [new file with mode: 0644]
lib/classes/event/course_deleted.php
lib/classes/event/user_deleted.php
lib/classes/session/handler.php
lib/classes/session/manager.php
lib/classes/session/memcached.php
lib/classes/useragent.php
lib/dml/moodle_database.php
lib/dml/mssql_native_moodle_database.php
lib/dml/mysqli_native_moodle_database.php
lib/dml/oci_native_moodle_database.php
lib/dml/pgsql_native_moodle_database.php
lib/dml/sqlite3_pdo_moodle_database.php
lib/dml/sqlsrv_native_moodle_database.php
lib/editor/tinymce/plugins/pdw/readme_moodle.txt
lib/editor/tinymce/plugins/pdw/tinymce/editor_plugin.js
lib/moodlelib.php
lib/navigationlib.php
lib/outputrenderers.php
lib/portfoliolib.php
lib/tests/accesslib_test.php
lib/tests/moodlelib_test.php
lib/tests/useragent_test.php
lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js
lib/yui/build/moodle-core-blocks/moodle-core-blocks-min.js
lib/yui/build/moodle-core-blocks/moodle-core-blocks.js
lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-debug.js
lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-min.js
lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit.js
lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-debug.js
lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-min.js
lib/yui/build/moodle-core-tooltip/moodle-core-tooltip.js
lib/yui/src/blocks/js/blocks.js
lib/yui/src/formautosubmit/js/formautosubmit.js
lib/yui/src/tooltip/js/tooltip.js
login/change_password.php
message/edit.php
mod/assign/feedback/editpdf/ajax_progress.php [new file with mode: 0644]
mod/assign/feedback/editpdf/classes/document_services.php
mod/assign/feedback/editpdf/classes/renderer.php
mod/assign/feedback/editpdf/classes/widget.php
mod/assign/feedback/editpdf/lang/en/assignfeedback_editpdf.php
mod/assign/feedback/editpdf/locallib.php
mod/assign/feedback/editpdf/styles.css
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/globals.js
mod/book/tool/importhtml/locallib.php
mod/chat/lib.php
mod/data/templates.php
mod/forum/lib.php
mod/forum/tests/behat/edit_post_student.feature
mod/lti/locallib.php
mod/lti/tests/locallib_test.php
pix/a/add_file.png
pix/a/add_file.svg [new file with mode: 0644]
pix/a/create_folder.png
pix/a/create_folder.svg [new file with mode: 0644]
pix/a/download_all.png
pix/a/download_all.svg [new file with mode: 0644]
pix/a/help.png
pix/a/help.svg [new file with mode: 0644]
pix/a/logout.png
pix/a/logout.svg [new file with mode: 0644]
pix/a/refresh.png
pix/a/refresh.svg [new file with mode: 0644]
pix/a/search.png
pix/a/search.svg [new file with mode: 0644]
pix/a/setting.png
pix/a/setting.svg [new file with mode: 0644]
pix/a/view_icon_active.png [new file with mode: 0644]
pix/a/view_icon_active.svg [new file with mode: 0644]
pix/a/view_list_active.png [new file with mode: 0644]
pix/a/view_list_active.svg [new file with mode: 0644]
pix/a/view_tree_active.png [new file with mode: 0644]
pix/a/view_tree_active.svg [new file with mode: 0644]
question/tests/behat/delete_questions.feature [new file with mode: 0644]
report/log/user.php
report/loglive/index.php
report/outline/user.php
report/stats/index.php
report/stats/user.php
theme/base/pix/fp/add_file.png [new file with mode: 0644]
theme/base/pix/fp/add_file.svg [new file with mode: 0644]
theme/base/pix/fp/create_folder.png [new file with mode: 0644]
theme/base/pix/fp/create_folder.svg [new file with mode: 0644]
theme/base/pix/fp/download_all.png [new file with mode: 0644]
theme/base/pix/fp/download_all.svg [new file with mode: 0644]
theme/base/pix/fp/help.png [new file with mode: 0644]
theme/base/pix/fp/help.svg [new file with mode: 0644]
theme/base/pix/fp/logout.png [new file with mode: 0644]
theme/base/pix/fp/logout.svg [new file with mode: 0644]
theme/base/pix/fp/refresh.png [new file with mode: 0644]
theme/base/pix/fp/refresh.svg [new file with mode: 0644]
theme/base/pix/fp/search.png [new file with mode: 0644]
theme/base/pix/fp/search.svg [new file with mode: 0644]
theme/base/pix/fp/setting.png [new file with mode: 0644]
theme/base/pix/fp/setting.svg [new file with mode: 0644]
theme/base/pix/fp/view_icon_active.png
theme/base/pix/fp/view_icon_active.svg [new file with mode: 0644]
theme/base/pix/fp/view_icon_inactive.png [deleted file]
theme/base/pix/fp/view_icon_selected.png [deleted file]
theme/base/pix/fp/view_list_active.png
theme/base/pix/fp/view_list_active.svg [new file with mode: 0644]
theme/base/pix/fp/view_list_inactive.png [deleted file]
theme/base/pix/fp/view_list_selected.png [deleted file]
theme/base/pix/fp/view_tree_active.png
theme/base/pix/fp/view_tree_active.svg [new file with mode: 0644]
theme/base/pix/fp/view_tree_inactive.png [deleted file]
theme/base/pix/fp/view_tree_selected.png [deleted file]
theme/base/style/core.css
theme/base/style/course.css
theme/base/style/filemanager.css
theme/bootstrapbase/less/moodle/course.less
theme/bootstrapbase/less/moodle/filemanager.less
theme/bootstrapbase/pix/fp/add_file.png [new file with mode: 0644]
theme/bootstrapbase/pix/fp/add_file.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/create_folder.png [new file with mode: 0644]
theme/bootstrapbase/pix/fp/create_folder.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/download_all.png [new file with mode: 0644]
theme/bootstrapbase/pix/fp/download_all.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/help.png [new file with mode: 0644]
theme/bootstrapbase/pix/fp/help.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/logout.png [new file with mode: 0644]
theme/bootstrapbase/pix/fp/logout.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/refresh.png [new file with mode: 0644]
theme/bootstrapbase/pix/fp/refresh.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/search.png [new file with mode: 0644]
theme/bootstrapbase/pix/fp/search.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/setting.png [new file with mode: 0644]
theme/bootstrapbase/pix/fp/setting.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/view_icon_active.png
theme/bootstrapbase/pix/fp/view_icon_active.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/view_icon_inactive.png [deleted file]
theme/bootstrapbase/pix/fp/view_icon_selected.png [deleted file]
theme/bootstrapbase/pix/fp/view_list_active.png
theme/bootstrapbase/pix/fp/view_list_active.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/view_list_inactive.png [deleted file]
theme/bootstrapbase/pix/fp/view_list_selected.png [deleted file]
theme/bootstrapbase/pix/fp/view_tree_active.png
theme/bootstrapbase/pix/fp/view_tree_active.svg [new file with mode: 0644]
theme/bootstrapbase/pix/fp/view_tree_inactive.png [deleted file]
theme/bootstrapbase/pix/fp/view_tree_selected.png [deleted file]
theme/bootstrapbase/style/moodle.css
user/edit.php
user/editadvanced.php

index 980e2ae..421eca2 100644 (file)
@@ -149,12 +149,11 @@ switch ($context->contextlevel) {
         $showroles = 1;
         break;
     case CONTEXT_COURSECAT:
-        $PAGE->set_heading("$SITE->fullname: ".get_string("categories"));
+        $PAGE->set_heading($SITE->fullname);
         break;
     case CONTEXT_COURSE:
         if ($isfrontpage) {
-            require_once($CFG->libdir.'/adminlib.php');
-            admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
+            $PAGE->set_heading(get_string('frontpage', 'admin'));
         } else {
             $PAGE->set_heading($course->fullname);
         }
index 0590165..938fc90 100644 (file)
@@ -50,6 +50,14 @@ if (!has_any_capability(array('moodle/role:assign', 'moodle/role:safeoverride',
     print_error('nopermissions', 'error', '', get_string('checkpermissions', 'core_role'));
 }
 $PAGE->set_url($url);
+
+if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
+    $PAGE->navigation->extend_for_user($user);
+    $PAGE->set_context(context_course::instance($course->id));
+} else {
+    $PAGE->set_context($context);
+}
+
 $PAGE->set_context($context);
 
 $courseid = $course->id;
@@ -79,12 +87,11 @@ switch ($context->contextlevel) {
         $showroles = 1;
         break;
     case CONTEXT_COURSECAT:
-        $PAGE->set_heading("$SITE->fullname: ".get_string("categories"));
+        $PAGE->set_heading($SITE->fullname);
         break;
     case CONTEXT_COURSE:
         if ($isfrontpage) {
-            require_once($CFG->libdir.'/adminlib.php');
-            admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid), $CFG->wwwroot . '/' . $CFG->admin . '/roles/check.php');
+            $PAGE->set_heading(get_string('frontpage', 'admin'));
         } else {
             $PAGE->set_heading($course->fullname);
         }
index 265b100..d30ad3e 100644 (file)
@@ -201,8 +201,7 @@ if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey() && $de
     $event = \core\event\role_capabilities_updated::create(
         array(
             'context' => $systemcontext,
-            'objectid' => $roleid,
-            'other' => array('name' => $definitiontable->get_role_name())
+            'objectid' => $roleid
         )
     );
     $event->set_legacy_logdata(array(SITEID, 'role', $action, 'admin/roles/define.php?action=view&roleid=' . $tableroleid,
index bc506f1..ab80e69 100644 (file)
@@ -53,9 +53,19 @@ if (!has_capability('moodle/role:override', $context)) {
     $safeoverridesonly = true;
 }
 $PAGE->set_url($url);
-$PAGE->set_context($context);
 $PAGE->set_pagelayout('admin');
 
+if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
+    $PAGE->navigation->extend_for_user($user);
+    $PAGE->set_context(context_course::instance($course->id));
+    navigation_node::override_active_url(new moodle_url('/admin/roles/permissions.php',
+        array('contextid'=>$context->id, 'userid'=>$context->instanceid, 'courseid'=>$course->id)));
+
+} else {
+    $PAGE->set_context($context);
+    navigation_node::override_active_url(new moodle_url('/admin/roles/permissions.php', array('contextid'=>$context->id)));
+}
+
 $courseid = $course->id;
 
 $returnurl = new moodle_url('/admin/roles/permissions.php', array('contextid' => $context->id));
@@ -91,12 +101,11 @@ switch ($context->contextlevel) {
         $showroles = 1;
         break;
     case CONTEXT_COURSECAT:
-        $PAGE->set_heading("$SITE->fullname: ".get_string("categories"));
+        $PAGE->set_heading($SITE->fullname);
         break;
     case CONTEXT_COURSE:
         if ($isfrontpage) {
-            require_once($CFG->libdir.'/adminlib.php');
-            admin_externalpage_setup('frontpageroles', '', array(), $PAGE->url);
+            $PAGE->set_heading(get_string('frontpage', 'admin'));
         } else {
             $PAGE->set_heading($course->fullname);
         }
@@ -130,8 +139,7 @@ if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
         array(
             'context' => $context,
             'objectid' => $roleid,
-            'courseid' => $courseid,
-            'other' => array('name' => $rolename)
+            'courseid' => $courseid
         )
     );
 
index 8af137a..3670a86 100644 (file)
@@ -57,7 +57,14 @@ if ($course) {
 require_login($course, false, $cm);
 require_capability('moodle/role:review', $context);
 $PAGE->set_url($url);
-$PAGE->set_context($context);
+
+if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
+    $PAGE->navigation->extend_for_user($user);
+    $PAGE->set_context(context_course::instance($course->id));
+} else {
+    $PAGE->set_context($context);
+}
+
 $courseid = $course->id;
 
 
@@ -88,12 +95,11 @@ switch ($context->contextlevel) {
         $showroles = 1;
         break;
     case CONTEXT_COURSECAT:
-        $PAGE->set_heading("$SITE->fullname: ".get_string("categories"));
+        $PAGE->set_heading($SITE->fullname);
         break;
     case CONTEXT_COURSE:
         if ($isfrontpage) {
-            require_once($CFG->libdir.'/adminlib.php');
-            admin_externalpage_setup('frontpageroles', '', array(), $PAGE->url);
+            $PAGE->set_heading(get_string('frontpage', 'admin'));
         } else {
             $PAGE->set_heading($course->fullname);
         }
index c62c979..99ded8f 100644 (file)
@@ -41,11 +41,17 @@ $systemcontext = context_system::instance();
 $baseurl = new moodle_url('/admin/roles/usersroles.php', array('userid'=>$userid, 'courseid'=>$courseid));
 
 $PAGE->set_url($baseurl);
-$PAGE->set_context($coursecontext);
 $PAGE->set_pagelayout('admin');
 
 // Check login and permissions.
-require_login($course);
+if ($course->id == SITEID) {
+    require_login();
+    $PAGE->set_context($usercontext);
+} else {
+    require_login($course);
+    $PAGE->set_context($coursecontext);
+}
+
 $canview = has_any_capability(array('moodle/role:assign', 'moodle/role:safeoverride',
         'moodle/role:override', 'moodle/role:manage'), $usercontext);
 if (!$canview) {
@@ -120,10 +126,10 @@ $title = get_string('xroleassignments', 'core_role', $fullname);
 
 // Course header.
 $PAGE->set_title($title);
-if ($courseid != SITEID) {
+if ($courseid == SITEID) {
     $PAGE->set_heading($fullname);
 } else {
-    $PAGE->set_heading($course->fullname);
+    $PAGE->set_heading($course->fullname.': '.$fullname);
 }
 echo $OUTPUT->header();
 echo $OUTPUT->heading($title, 3);
index c8444c5..3236444 100644 (file)
@@ -14,6 +14,7 @@ $PAGE->set_url('/admin/settings.php', array('section' => $section));
 $PAGE->set_pagetype('admin-setting-' . $section);
 $PAGE->set_pagelayout('admin');
 $PAGE->navigation->clear_cache();
+navigation_node::require_admin_tree();
 
 $adminroot = admin_get_root(); // need all settings
 $settingspage = $adminroot->locate($section, true);
index e52f6ff..d435022 100644 (file)
@@ -69,29 +69,6 @@ if (!during_initial_install()) { //do not use during installation
         }
         $temp->add(new admin_setting_configselect('defaultfrontpageroleid', new lang_string('frontpagedefaultrole', 'admin'), '', $defaultfrontpageroleid, $options));
 
-
         $ADMIN->add('frontpage', $temp);
-
-        $ADMIN->add('frontpage', new admin_externalpage('frontpageroles', new lang_string('frontpageroles', 'admin'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $frontpagecontext->id, 'moodle/role:assign', false, $frontpagecontext));
-
-        $ADMIN->add('frontpage', new admin_externalpage('frontpagefilters', new lang_string('frontpagefilters', 'admin'), "$CFG->wwwroot/filter/manage.php?contextid=" . $frontpagecontext->id, 'moodle/filter:manage', false, $frontpagecontext));
-
-        $ADMIN->add('frontpage', new admin_externalpage('frontpagebackup', new lang_string('frontpagebackup', 'admin'), $CFG->wwwroot.'/backup/backup.php?id='.SITEID, 'moodle/backup:backupcourse', false, $frontpagecontext));
-
-        $ADMIN->add('frontpage', new admin_externalpage('frontpagerestore', new lang_string('frontpagerestore', 'admin'), $CFG->wwwroot.'/backup/restorefile.php?contextid='.$frontpagecontext->id, 'moodle/restore:restorecourse', false, $frontpagecontext));
-
-        $questioncapabilities = array(
-                'moodle/question:add',
-                'moodle/question:editmine',
-                'moodle/question:editall',
-                'moodle/question:viewmine',
-                'moodle/question:viewall',
-                'moodle/question:movemine',
-                'moodle/question:moveall');
-        $ADMIN->add('frontpage', new admin_externalpage('frontpagequestions', new lang_string('frontpagequestions', 'admin'), $CFG->wwwroot.'/question/edit.php?courseid='.SITEID, $questioncapabilities, false, $frontpagecontext));
-
-        if (!empty($SITE->legacyfiles) and $SITE->legacyfiles === 2) {
-            $ADMIN->add('frontpage', new admin_externalpage('sitefiles', new lang_string('sitelegacyfiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
-        }
     }
 }
index 6b4f88f..91afdcf 100644 (file)
@@ -28,7 +28,8 @@
 require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
 require_once(__DIR__ . '/../../../lib/behat/behat_field_manager.php');
 
-use Behat\Gherkin\Node\TableNode as TableNode,
+use Behat\Behat\Context\Step\Given as Given,
+    Behat\Gherkin\Node\TableNode as TableNode,
     Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
 
 /**
@@ -110,4 +111,23 @@ class behat_admin extends behat_base {
             $this->getSession()->wait($timeout, $javascript);
         }
     }
+
+    /**
+     * Goes to notification page ensuring site admin navigation is loaded.
+     *
+     * @Given /^I go to notifications page$/
+     * @return Given[]
+     */
+    public function i_go_to_notifications_page() {
+        if ($this->running_javascript()) {
+            return array(
+                new Given('I expand "' . get_string('administrationsite') . '" node'),
+                new Given('I follow "' . get_string('notifications') . '"')
+            );
+        } else {
+            return array(
+                new Given('I follow "' . get_string('administrationsite') . '"')
+            );
+        }
+    }
 }
index f17f092..86231b2 100644 (file)
@@ -15,7 +15,8 @@ Feature: Display extended course names
     And I should not see "C_shortname Course fullname"
 
   Scenario: Courses list with extended course names
-    Given I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][not(contains(., 'Site administration'))][contains(., 'Appearance')]" "xpath_element"
+    Given I go to notifications page
+    And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element"
     And I check "Display extended course names"
     When I press "Save changes"
     And I am on homepage
index 6aaec2f..71c54fe 100644 (file)
@@ -24,6 +24,7 @@
 require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
 require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
 require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/filter_form.php');
+require_once($CFG->libdir.'/adminlib.php');
 
 require_login(SITEID, false);
 require_capability('tool/customlang:edit', context_system::instance());
@@ -32,11 +33,10 @@ $lng                    = required_param('lng', PARAM_LANG);
 $currentpage            = optional_param('p', 0, PARAM_INT);
 $translatorsubmitted    = optional_param('translatorsubmitted', 0, PARAM_BOOL);
 
-$PAGE->set_pagelayout('report'); // Allows for wide page contents.
-$PAGE->set_url('/admin/tool/customlang/edit.php', array('lng' => $lng));
-navigation_node::override_active_url(new moodle_url('/admin/tool/customlang/index.php'));
-$PAGE->set_title(get_string('pluginname', 'tool_customlang'));
-$PAGE->set_heading(get_string('pluginname', 'tool_customlang'));
+admin_externalpage_setup('toolcustomlang', '', null,
+    new moodle_url('/admin/tool/customlang/edit.php', array('lng' => $lng)),
+    array('pagelayout' => 'report')); // Hack: allows for wide page contents.
+
 $PAGE->requires->js_init_call('M.tool_customlang.init_editor', array(), true);
 
 if (empty($lng)) {
index aff45ef..431a911 100644 (file)
@@ -29,7 +29,7 @@ require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
 require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
 require_once($CFG->libdir.'/adminlib.php');
 
-require_login(SITEID, false);
+require_login(null, false);
 require_capability('tool/customlang:view', context_system::instance());
 
 $action  = optional_param('action', '', PARAM_ALPHA);
index 7499500..2e43b4c 100644 (file)
@@ -317,7 +317,7 @@ class tool_generator_testplan_backend extends tool_generator_backend {
 
         // Checks that the selected course has enough users.
         $coursesizes = tool_generator_course_backend::get_users_per_size();
-        if (count($users) < $coursesizes[$size]) {
+        if (count($users) < self::$users[$size]) {
             $errors['size'] = get_string('notenoughusers', 'tool_generator');
         }
 
index 1a1866c..e759c43 100644 (file)
@@ -392,8 +392,10 @@ class tool_installaddon_installer {
      *
      * @param string $source full path to the existing directory
      * @param string $target full path to the new location of the directory
+     * @param int $dirpermissions
+     * @param int $filepermissions
      */
-    public function move_directory($source, $target) {
+    public function move_directory($source, $target, $dirpermissions, $filepermissions) {
 
         if (file_exists($target)) {
             throw new tool_installaddon_installer_exception('err_folder_already_exists', array('path' => $target));
@@ -405,7 +407,16 @@ class tool_installaddon_installer {
             throw new tool_installaddon_installer_exception('err_no_such_folder', array('path' => $source));
         }
 
-        make_writable_directory($target);
+        if (!file_exists($target)) {
+            // Do not use make_writable_directory() here - it is intended for dataroot only.
+            mkdir($target, true);
+            @chmod($target, $dirpermissions);
+        }
+
+        if (!is_writable($target)) {
+            closedir($handle);
+            throw new tool_installaddon_installer_exception('err_folder_not_writable', array('path' => $target));
+        }
 
         while ($filename = readdir($handle)) {
             $sourcepath = $source.'/'.$filename;
@@ -416,10 +427,11 @@ class tool_installaddon_installer {
             }
 
             if (is_dir($sourcepath)) {
-                $this->move_directory($sourcepath, $targetpath);
+                $this->move_directory($sourcepath, $targetpath, $dirpermissions, $filepermissions);
 
             } else {
                 rename($sourcepath, $targetpath);
+                @chmod($targetpath, $filepermissions);
             }
         }
 
index 7dea2cc..b80af83 100644 (file)
@@ -69,6 +69,10 @@ if (file_exists($plugintypepath.'/'.$pluginname)) {
         get_string('invaliddata', 'core_error'));
 }
 
-$installer->move_directory($zipcontentpath.'/'.$pluginname, $plugintypepath.'/'.$pluginname);
+// Copy permissions form the plugin type directory.
+$dirpermissions = fileperms($plugintypepath);
+$filepermissions = ($dirpermissions & 0666); // Strip execute flags.
+
+$installer->move_directory($zipcontentpath.'/'.$pluginname, $plugintypepath.'/'.$pluginname, $dirpermissions, $filepermissions);
 fulldelete($CFG->tempdir.'/tool_installaddon/'.$jobid);
 redirect(new moodle_url('/admin'));
index 28e37bd..948294c 100644 (file)
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
  * @copyright 2013 David Mudrak <david@moodle.com>
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-class tool_installaddon_installer_test extends advanced_testcase {
+class tool_installaddon_installer_testcase extends advanced_testcase {
 
     public function test_get_addons_repository_url() {
         $installer = testable_tool_installaddon_installer::instance();
@@ -137,7 +137,7 @@ class tool_installaddon_installer_test extends advanced_testcase {
         file_put_contents($contentsdir.'/readme.txt', 'Hello world!');
 
         $installer = tool_installaddon_installer::instance();
-        $installer->move_directory($jobroot.'/contents', $jobroot.'/moved');
+        $installer->move_directory($jobroot.'/contents', $jobroot.'/moved', 0777, 0666);
 
         $this->assertFalse(is_dir($jobroot.'/contents'));
         $this->assertTrue(is_file($jobroot.'/moved/sub/folder/readme.txt'));
index 7550261..b46ed6b 100644 (file)
@@ -161,6 +161,9 @@ class restore_section_task extends restore_task {
         $section_included = new restore_section_included_setting($settingname, base_setting::IS_BOOLEAN, true);
         if (is_number($this->info->title)) {
             $label = get_string('includesection', 'backup', $this->info->title);
+        } elseif (empty($this->info->title)) { // Don't throw error if title is empty, gracefully continue restore.
+            $this->log('Section title missing in backup for section id '.$this->info->sectionid, backup::LOG_WARNING, $this->name);
+            $label = get_string('unnamedsection', 'backup');
         } else {
             $label = $this->info->title;
         }
index a1aafb8..a6d5bce 100644 (file)
@@ -978,6 +978,15 @@ abstract class restore_dbops {
             );
 
             if (empty($file->repositoryid)) {
+                // If contenthash is empty then gracefully skip adding file.
+                if (empty($file->contenthash)) {
+                    $result = new stdClass();
+                    $result->code = 'file_missing_in_backup';
+                    $result->message = sprintf('missing file (%s) contenthash in backup for component %s', $file->filename, $component);
+                    $result->level = backup::LOG_WARNING;
+                    $results[] = $result;
+                    continue;
+                }
                 // this is a regular file, it must be present in the backup pool
                 $backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash);
 
index 66c2b3b..929d9a0 100644 (file)
@@ -44,12 +44,15 @@ $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
 if ($badge->type == BADGE_TYPE_COURSE) {
     require_login($badge->courseid);
     $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
+    $PAGE->set_pagelayout('standard');
+    navigation_node::override_active_url($navurl);
+} else {
+    $PAGE->set_pagelayout('admin');
+    navigation_node::override_active_url($navurl, true);
 }
 
 $PAGE->set_context($context);
 $PAGE->set_url('/badges/action.php', array('id' => $badge->id));
-$PAGE->set_pagelayout('standard');
-navigation_node::override_active_url($navurl);
 
 if ($return !== 0) {
     $returnurl = new moodle_url($return);
index 834af0c..9c3db8c 100644 (file)
@@ -50,6 +50,11 @@ if ($badge->type == BADGE_TYPE_COURSE) {
     }
     require_login($badge->courseid);
     $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
+    $PAGE->set_pagelayout('standard');
+    navigation_node::override_active_url($navurl);
+} else {
+    $PAGE->set_pagelayout('admin');
+    navigation_node::override_active_url($navurl, true);
 }
 
 require_capability('moodle/badges:awardbadge', $context);
@@ -60,11 +65,9 @@ $PAGE->set_context($context);
 
 // Set up navigation and breadcrumbs.
 $strrecipients = get_string('recipients', 'badges');
-navigation_node::override_active_url($navurl);
 $PAGE->navbar->add($badge->name, new moodle_url('overview.php', array('id' => $badge->id)))->add($strrecipients);
 $PAGE->set_title($strrecipients);
 $PAGE->set_heading($badge->name);
-$PAGE->set_pagelayout('standard');
 
 if (!$badge->is_active()) {
     echo $OUTPUT->header();
index 20848d2..ad4b5a6 100644 (file)
@@ -48,18 +48,19 @@ if ($badge->type == BADGE_TYPE_COURSE) {
     }
     require_login($badge->courseid);
     $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
+    $PAGE->set_pagelayout('standard');
+    navigation_node::override_active_url($navurl);
+} else {
+    $PAGE->set_pagelayout('admin');
+    navigation_node::override_active_url($navurl, true);
 }
 
 $currenturl = new moodle_url('/badges/criteria.php', array('id' => $badge->id));
 
 $PAGE->set_context($context);
 $PAGE->set_url($currenturl);
-$PAGE->set_pagelayout('standard');
 $PAGE->set_heading($badge->name);
 $PAGE->set_title($badge->name);
-
-// Set up navigation and breadcrumbs.
-navigation_node::override_active_url($navurl);
 $PAGE->navbar->add($badge->name);
 
 $output = $PAGE->get_renderer('core', 'badges');
index 51b3e89..3af6984 100644 (file)
@@ -48,14 +48,17 @@ if ($badge->is_active() || $badge->is_locked()) {
 if ($badge->type == BADGE_TYPE_COURSE) {
     require_login($badge->courseid);
     $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
+    $PAGE->set_pagelayout('standard');
+    navigation_node::override_active_url($navurl);
+} else {
+    $PAGE->set_pagelayout('admin');
+    navigation_node::override_active_url($navurl, true);
 }
 
 $PAGE->set_context($context);
 $PAGE->set_url('/badges/criteria_action.php');
-$PAGE->set_pagelayout('standard');
 $PAGE->set_heading($badge->name);
 $PAGE->set_title($badge->name);
-navigation_node::override_active_url($navurl);
 
 if ($delete && has_capability('moodle/badges:configurecriteria', $context)) {
     if (!$confirm) {
index 6f52fa0..32efa61 100644 (file)
@@ -58,14 +58,17 @@ if ($badge->is_active() || $badge->is_locked()) {
 if ($badge->type == BADGE_TYPE_COURSE) {
     require_login($badge->courseid);
     $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
+    $PAGE->set_pagelayout('standard');
+    navigation_node::override_active_url($navurl);
+} else {
+    $PAGE->set_pagelayout('admin');
+    navigation_node::override_active_url($navurl, true);
 }
 
 $PAGE->set_context($context);
 $PAGE->set_url('/badges/criteria_settings.php');
-$PAGE->set_pagelayout('standard');
 $PAGE->set_heading($badge->name);
 $PAGE->set_title($badge->name);
-navigation_node::override_active_url($navurl);
 $PAGE->navbar->add($badge->name, new moodle_url('overview.php', array('id' => $badge->id)))->add(get_string('criteria_' . $type, 'badges'));
 
 $cparams = array('criteriatype' => $type, 'badgeid' => $badge->id);
index b0a4783..61e9cc6 100644 (file)
@@ -53,18 +53,19 @@ if ($badge->type == BADGE_TYPE_COURSE) {
     }
     require_login($badge->courseid);
     $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
+    $PAGE->set_pagelayout('standard');
+    navigation_node::override_active_url($navurl);
+} else {
+    $PAGE->set_pagelayout('admin');
+    navigation_node::override_active_url($navurl, true);
 }
 
 $currenturl = new moodle_url('/badges/edit.php', array('id' => $badge->id, 'action' => $action));
 
 $PAGE->set_context($context);
 $PAGE->set_url($currenturl);
-$PAGE->set_pagelayout('standard');
 $PAGE->set_heading($badge->name);
 $PAGE->set_title($badge->name);
-
-// Set up navigation and breadcrumbs.
-navigation_node::override_active_url($navurl);
 $PAGE->navbar->add($badge->name);
 
 $output = $PAGE->get_renderer('core', 'badges');
index d476cfc..6c73990 100644 (file)
@@ -79,7 +79,7 @@ if ($type == BADGE_TYPE_SITE) {
     $PAGE->set_context(context_system::instance());
     $PAGE->set_pagelayout('admin');
     $PAGE->set_heading($title . ': ' . $hdr);
-    navigation_node::override_active_url(new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE)));
+    navigation_node::override_active_url(new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE)), true);
 } else {
     require_login($course);
     $coursecontext = context_course::instance($course->id);
index e2dec7f..7801674 100644 (file)
@@ -46,18 +46,19 @@ if ($badge->type == BADGE_TYPE_COURSE) {
     }
     require_login($badge->courseid);
     $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
+    $PAGE->set_pagelayout('standard');
+    navigation_node::override_active_url($navurl);
+} else {
+    $PAGE->set_pagelayout('admin');
+    navigation_node::override_active_url($navurl, true);
 }
 
 $currenturl = new moodle_url('/badges/overview.php', array('id' => $badge->id));
 
 $PAGE->set_context($context);
 $PAGE->set_url($currenturl);
-$PAGE->set_pagelayout('standard');
 $PAGE->set_heading($badge->name);
 $PAGE->set_title($badge->name);
-
-// Set up navigation and breadcrumbs.
-navigation_node::override_active_url($navurl);
 $PAGE->navbar->add($badge->name);
 
 echo $OUTPUT->header();
index d05a562..4e77e3d 100644 (file)
@@ -60,15 +60,18 @@ if ($badge->type == BADGE_TYPE_COURSE) {
     }
     require_login($badge->courseid);
     $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
+    $PAGE->set_pagelayout('standard');
+    navigation_node::override_active_url($navurl);
+} else {
+    $PAGE->set_pagelayout('admin');
+    navigation_node::override_active_url($navurl, true);
 }
 
 $PAGE->set_context($context);
 $PAGE->set_url('/badges/recipients.php', array('id' => $badgeid, 'sort' => $sortby, 'dir' => $sorthow));
-$PAGE->set_pagelayout('standard');
 $PAGE->set_heading($badge->name);
 $PAGE->set_title($badge->name);
 $PAGE->navbar->add($badge->name);
-navigation_node::override_active_url($navurl);
 
 $output = $PAGE->get_renderer('core', 'badges');
 
index 5c9aa7d..d0542ac 100644 (file)
Binary files a/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-debug.js and b/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-debug.js differ
index 190c180..ce342d8 100644 (file)
Binary files a/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-min.js and b/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-min.js differ
index bed94d7..55e4047 100644 (file)
Binary files a/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js and b/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js differ
index c7ed370..97e8bdc 100644 (file)
@@ -180,6 +180,8 @@ var NODETYPE = {
     CUSTOM : 60,
     // @type int Setting = 70
     SETTING : 70,
+    // @type int site administration = 71
+    SITEADMIN : 71,
     // @type int User context = 80
     USER : 80,
     // @type int Container = 90
@@ -257,6 +259,26 @@ TREE.prototype = {
             M.block_navigation.expandablebranchcount++;
             this.branches[branch.get('id')] = branch;
         }
+        // Create siteadmin branch.
+        if (window.siteadminexpansion) {
+            var siteadminbranch = new BRANCH({
+                tree: this,
+                branchobj: window.siteadminexpansion,
+                overrides : {
+                    expandable : true,
+                    children : [],
+                    haschildren : true
+                }
+            }).wire();
+            M.block_navigation.expandablebranchcount++;
+            this.branches[siteadminbranch.get('id')] = siteadminbranch;
+            // Remove link on site admin with JS to keep old UI.
+            var siteadminlinknode = siteadminbranch.node.get('childNodes').item(0);
+            if (siteadminlinknode) {
+                var siteadminnode = Y.Node.create('<span tabindex="0">'+siteadminlinknode.get('innerHTML')+'</span>');
+                siteadminbranch.node.replaceChild(siteadminnode, siteadminlinknode);
+            }
+        }
         if (M.block_navigation.expandablebranchcount > 0) {
             // Delegate some events to handle AJAX loading.
             Y.delegate('click', this.fire_branch_action, node.one('.block_tree'), '.tree_item.branch[data-expandable]', this);
@@ -586,7 +608,13 @@ BRANCH.prototype = {
             instance : this.get('tree').get('instance')
         };
 
-        Y.io(M.cfg.wwwroot+'/lib/ajax/getnavbranch.php', {
+        var ajaxfile = '/lib/ajax/getnavbranch.php';
+        // For siteadmin navigation get tree from getsiteadminbranch.php.
+        if (this.get('type') === NODETYPE.SITEADMIN) {
+            ajaxfile = '/lib/ajax/getsiteadminbranch.php';
+        }
+
+        Y.io(M.cfg.wwwroot + ajaxfile, {
             method:'POST',
             data:  build_querystring(params),
             on: {
index 2da394d..c50e3a0 100644 (file)
@@ -36,6 +36,7 @@ require_capability('moodle/cohort:assign', $context);
 
 $PAGE->set_context($context);
 $PAGE->set_url('/cohort/assign.php', array('id'=>$id));
+$PAGE->set_pagelayout('admin');
 
 $returnurl = new moodle_url('/cohort/index.php', array('contextid'=>$cohort->contextid));
 
@@ -51,11 +52,8 @@ if (optional_param('cancel', false, PARAM_BOOL)) {
 if ($context->contextlevel == CONTEXT_COURSECAT) {
     $category = $DB->get_record('course_categories', array('id'=>$context->instanceid), '*', MUST_EXIST);
     navigation_node::override_active_url(new moodle_url('/cohort/index.php', array('contextid'=>$cohort->contextid)));
-    $PAGE->set_pagelayout('report');
-
 } else {
     navigation_node::override_active_url(new moodle_url('/cohort/index.php', array()));
-    $PAGE->set_pagelayout('admin');
 }
 $PAGE->navbar->add(get_string('assign', 'cohort'));
 
index 3a18ddb..a585f35 100644 (file)
@@ -62,15 +62,14 @@ if (!empty($cohort->component)) {
 $PAGE->set_context($context);
 $PAGE->set_url('/cohort/edit.php', array('contextid'=>$context->id, 'id'=>$cohort->id));
 $PAGE->set_context($context);
+$PAGE->set_pagelayout('admin');
 
 if ($context->contextlevel == CONTEXT_COURSECAT) {
     $category = $DB->get_record('course_categories', array('id'=>$context->instanceid), '*', MUST_EXIST);
     navigation_node::override_active_url(new moodle_url('/cohort/index.php', array('contextid'=>$cohort->contextid)));
-    $PAGE->set_pagelayout('report');
 
 } else {
     navigation_node::override_active_url(new moodle_url('/cohort/index.php', array()));
-    $PAGE->set_pagelayout('admin');
 }
 
 if ($delete and $cohort->id) {
index 3c31556..b0c30bd 100644 (file)
@@ -56,7 +56,7 @@ if (!$manager) {
 $strcohorts = get_string('cohorts', 'cohort');
 
 if ($category) {
-    $PAGE->set_pagelayout('report');
+    $PAGE->set_pagelayout('admin');
     $PAGE->set_context($context);
     $PAGE->set_url('/cohort/index.php', array('contextid'=>$context->id));
     $PAGE->set_title($strcohorts);
diff --git a/completion/tests/behat/restrict_activity_by_date.feature b/completion/tests/behat/restrict_activity_by_date.feature
new file mode 100644 (file)
index 0000000..fe1a0f2
--- /dev/null
@@ -0,0 +1,68 @@
+@core @core_completion
+Feature: Restrict activity availability through date conditions
+  In order to control activity access through date condition
+  As a teacher
+  I need to set allow access dates to restrict activity access
+
+  Background:
+    Given the following "courses" exists:
+      | fullname | shortname | category |
+      | Course 1 | C1 | 0 |
+    And the following "users" exists:
+      | username | firstname | lastname | email |
+      | teacher1 | Teacher | Frist | teacher1@asd.com |
+      | student1 | Student | First | student1@asd.com |
+    And the following "course enrolments" exists:
+      | user | course | role |
+      | teacher1 | C1 | editingteacher |
+      | student1 | C1 | student |
+    And I log in as "admin"
+    And I set the following administration settings values:
+      | Enable conditional access | 1 |
+    And I log out
+
+  @javascript
+  Scenario: Show activity greyed-out to students when available from date is in future
+    Given I log in as "teacher1"
+    And I follow "Course 1"
+    And I turn editing mode on
+    And I add a "Assignment" to section "1"
+    And I fill the moodle form with:
+      | Assignment name | Test assignment 1 |
+      | Description | This assignment is restricted by date |
+      | assignsubmission_onlinetext_enabled | 1 |
+      | assignsubmission_file_enabled | 0 |
+      | id_availablefrom_day | 31 |
+      | id_availablefrom_month | 12 |
+      | id_availablefrom_year | 2050 |
+      | id_showavailability | 1 |
+    And I click on "id_availablefrom_enabled" "checkbox"
+    And I press "Save and return to course"
+    And I log out
+    When I log in as "student1"
+    And I follow "Course 1"
+    Then I should see "Available from 31 December 2050."
+    And "Test assignment 1" activity should be hidden
+    And I log out
+
+  @javascript
+  Scenario: Show activity hidden to students when available until date is in past
+    Given I log in as "teacher1"
+    And I follow "Course 1"
+    And I turn editing mode on
+    And I add a "Assignment" to section "2"
+    And I fill the moodle form with:
+      | Assignment name | Test assignment 2 |
+      | Description | This assignment is restricted by date |
+      | assignsubmission_onlinetext_enabled | 1 |
+      | assignsubmission_file_enabled | 0 |
+      | id_availableuntil_day | 1 |
+      | id_availableuntil_month | 2 |
+      | id_availableuntil_year | 2013 |
+      | id_showavailability | 0 |
+    And I click on "id_availableuntil_enabled" "checkbox"
+    And I press "Save and return to course"
+    And I log out
+    When I log in as "student1"
+    And I follow "Course 1"
+    Then I should not see "Test assignment 2"
diff --git a/completion/tests/behat/restrict_activity_by_grade.feature b/completion/tests/behat/restrict_activity_by_grade.feature
new file mode 100644 (file)
index 0000000..e3de103
--- /dev/null
@@ -0,0 +1,63 @@
+@core @core_completion
+Feature: Restrict activity availability through grade conditions
+  In order to control activity access through grade condition
+  As a teacher
+  I need to set grade condition to restrict activity access
+
+  @javascript
+  Scenario: Show activity greyed-out to students when grade condition is not satisfied
+    Given the following "courses" exists:
+      | fullname | shortname | category |
+      | Course 1 | C1 | 0 |
+    And the following "users" exists:
+      | username | firstname | lastname | email |
+      | teacher1 | Teacher | Frist | teacher1@asd.com |
+      | student1 | Student | First | student1@asd.com |
+    And the following "course enrolments" exists:
+      | user | course | role |
+      | teacher1 | C1 | editingteacher |
+      | student1 | C1 | student |
+    And I log in as "admin"
+    And I set the following administration settings values:
+      | Enable conditional access | 1 |
+    And I log out
+    And I log in as "teacher1"
+    And I follow "Course 1"
+    And I turn editing mode on
+    And I add a "Assignment" to section "1" and I fill the form with:
+      | Assignment name | Grade assignment |
+      | Description | Grade this assignment to revoke restriction on restricted assignment |
+      | assignsubmission_onlinetext_enabled | 1 |
+      | assignsubmission_file_enabled | 0 |
+    And I add a "Page" to section "2" and I fill the form with:
+      | Name | Test page name |
+      | Description | Restricted page, till grades in Grade assignment is at least 20% |
+      | Page content | Test page contents |
+      | id_conditiongradegroup_0_conditiongradeitemid | 2 |
+      | id_conditiongradegroup_0_conditiongrademin | 20 |
+      | id_showavailability | 1 |
+    And I log out
+    When I log in as "student1"
+    And I follow "Course 1"
+    Then I should see "Not available until you achieve a required score in Grade assignment"
+    And "Test page name" activity should be hidden
+    And I follow "Grade assignment"
+    And I press "Add submission"
+    And I fill the moodle form with:
+      | Online text | I'm the student submission |
+    And I press "Save changes"
+    And I should see "Submitted for grading"
+    And I log out
+    And I log in as "teacher1"
+    And I follow "Course 1"
+    And I follow "Grade assignment"
+    And I follow "View/grade all submissions"
+    And I click on "Grade Student First" "link" in the "Student First" "table_row"
+    And I fill the moodle form with:
+      | Grade | 21 |
+    And I press "Save changes"
+    And I log out
+    And I log in as "student1"
+    And I follow "Course 1"
+    And "Test page name" activity should be visible
+    And I should not see "Not available until you achieve a required score in Grade assignment"
index 35b7f09..03505dc 100644 (file)
@@ -1,11 +1,10 @@
 @core @core_completion
-Feature: Restrict sections availability through completion conditions
-  In order to control section's contents access through activities completion
+Feature: Restrict sections availability through completion or grade conditions
+  In order to control section's contents access through activities completion or grade condition
   As a teacher
   I need to restrict sections availability using different conditions
 
-  @javascript
-  Scenario: Show section greyed-out to students when completion conditions are not satisfied
+  Background:
     Given the following "courses" exists:
       | fullname | shortname | category |
       | Course 1 | C1 | 0 |
@@ -22,7 +21,10 @@ Feature: Restrict sections availability through completion conditions
       | Enable completion tracking | 1 |
       | Enable conditional access | 1 |
     And I log out
-    And I log in as "teacher1"
+
+  @javascript
+  Scenario: Show section greyed-out to student when completion condition is not satisfied
+    Given I log in as "teacher1"
     And I follow "Course 1"
     And I turn editing mode on
     And I follow "Edit settings"
@@ -36,12 +38,10 @@ Feature: Restrict sections availability through completion conditions
       | Name | Test page name |
       | Description | Test page description |
       | Page content | Test page contents |
-    When I click on "Edit summary" "link" in the "#section-2" "css_element"
-    And I fill the moodle form with:
+    When I edit the section "2" and I fill the form with:
       | id_conditioncompletiongroup_0_conditionsourcecmid | Test label |
       | id_conditioncompletiongroup_0_conditionrequiredcompletion | must be marked complete |
       | Before section can be accessed | Show section greyed-out, with restriction information |
-    And I press "Save changes"
     And I log out
     And I log in as "student1"
     And I follow "Course 1"
@@ -50,3 +50,47 @@ Feature: Restrict sections availability through completion conditions
     And I press "Not completed: Test label. Select to mark as complete."
     And I should see "Test page name"
     And I should not see "Not available until the activity Test label is marked complete."
+
+  @javascript
+  Scenario: Show section greyed-out to student when grade condition is not satisfied
+    Given I log in as "teacher1"
+    And I follow "Course 1"
+    And I turn editing mode on
+    And I add a "Assignment" to section "1" and I fill the form with:
+      | Assignment name | Grade assignment |
+      | Description | Grade this assignment to revoke restriction on restricted assignment |
+      | assignsubmission_onlinetext_enabled | 1 |
+      | assignsubmission_file_enabled | 0 |
+    And I add a "Page" to section "2" and I fill the form with:
+      | Name | Test page name |
+      | Description | Restricted section page resource, till grades in Grade assignment is at least 20% |
+      | Page content | Test page contents |
+    And I edit the section "2" and I fill the form with:
+      | id_conditiongradegroup_0_conditiongradeitemid | 2 |
+      | id_conditiongradegroup_0_conditiongrademin | 20 |
+      | Before section can be accessed | 1 |
+    And I log out
+    When I log in as "student1"
+    And I follow "Course 1"
+    Then I should see "Not available until you achieve a required score in Grade assignment"
+    And "Test page name" activity should be hidden
+    And I follow "Grade assignment"
+    And I press "Add submission"
+    And I fill the moodle form with:
+      | Online text | I'm the student submission |
+    And I press "Save changes"
+    And I should see "Submitted for grading"
+    And I log out
+    And I log in as "teacher1"
+    And I follow "Course 1"
+    And I follow "Grade assignment"
+    And I follow "View/grade all submissions"
+    And I click on "Grade Student First" "link" in the "Student First" "table_row"
+    And I fill the moodle form with:
+      | Grade | 21 |
+    And I press "Save changes"
+    And I log out
+    And I log in as "student1"
+    And I follow "Course 1"
+    And "Test page name" activity should be visible
+    And I should not see "Not available until you achieve a required score in Grade assignment"
\ No newline at end of file
index c5bf4be..3050973 100644 (file)
@@ -237,6 +237,8 @@ $CFG->admin = 'admin';
 //      $CFG->session_handler_class = '\core\session\memcached';
 //      $CFG->session_memcached_save_path = '127.0.0.1:11211';
 //      $CFG->session_memcached_prefix = 'memc.sess.key.';
+//      $CFG->session_memcached_acquire_lock_timeout = 120;
+//      $CFG->session_memcached_lock_expire = 7200;       // Ignored if memcached extension <= 2.1.0
 //
 // Following setting allows you to alter how frequently is timemodified updated in sessions table.
 //      $CFG->session_update_timemodified_frequency = 20; // In seconds.
index 2f720f5..31d4817 100644 (file)
@@ -28,24 +28,26 @@ require_once($CFG->dirroot . '/course/lib.php');
 $id = required_param('id', PARAM_INT); // Course ID.
 $delete = optional_param('delete', '', PARAM_ALPHANUM); // Confirmation hash.
 
-$PAGE->set_url('/course/delete.php', array('id' => $id));
-$PAGE->set_context(context_system::instance());
-require_login();
-
 $course = $DB->get_record('course', array('id' => $id), '*', MUST_EXIST);
 $coursecontext = context_course::instance($course->id);
 
-if ((int)$SITE->id === (int)$course->id || !can_delete_course($id)) {
+require_login();
+
+if ($SITE->id == $course->id || !can_delete_course($id)) {
     // Can not delete frontpage or don't have permission to delete the course.
     print_error('cannotdeletecourse');
 }
 
+$categorycontext = context_coursecat::instance($course->category);
+$PAGE->set_url('/course/delete.php', array('id' => $id));
+$PAGE->set_context($categorycontext);
+$PAGE->set_pagelayout('admin');
+navigation_node::override_active_url(new moodle_url('/course/management.php', array('categoryid'=>$course->category)));
+
 $courseshortname = format_string($course->shortname, true, array('context' => $coursecontext));
 $coursefullname = format_string($course->fullname, true, array('context' => $coursecontext));
 $categoryurl = new moodle_url('/course/management.php', array('categoryid' => $course->category));
 
-navigation_node::override_active_url(new moodle_url('/course/management.php'));
-
 // Check if we've got confirmation.
 if ($delete === md5($course->timemodified)) {
     // We do - time to delete the course.
index 8126449..6519fb4 100644 (file)
@@ -599,6 +599,8 @@ class dndupload_ajax_processor {
      * Create the coursemodule to hold the file/content that has been uploaded
      */
     protected function create_course_module() {
+        global $CFG;
+
         if (!course_allowed_module($this->course, $this->module->name)) {
             throw new coding_exception("The module {$this->module->name} is not allowed to be added to this course");
         }
@@ -616,7 +618,7 @@ class dndupload_ajax_processor {
         // Set the correct default for completion tracking.
         $this->cm->completion = COMPLETION_TRACKING_NONE;
         $completion = new completion_info($this->course);
-        if ($completion->is_enabled()) {
+        if ($completion->is_enabled() && $CFG->completiondefault) {
             if (plugin_supports('mod', $this->cm->modulename, FEATURE_MODEDIT_DEFAULT_COMPLETION, true)) {
                 $this->cm->completion = COMPLETION_TRACKING_MANUAL;
             }
index f2793a2..b457920 100644 (file)
@@ -45,6 +45,7 @@ if ($id) {
     $itemid = 0; // Initialise itemid, as all files in category description has item id 0.
     $title = $strtitle;
     $fullname = $coursecat->get_formatted_name();
+
 } else {
     $parent = required_param('parent', PARAM_INT);
     $url->param('parent', $parent);
@@ -54,6 +55,7 @@ if ($id) {
     } else {
         $context = context_system::instance();
     }
+    navigation_node::override_active_url(new moodle_url('/course/editcategory.php', array('parent' => $parent)));
 
     $category = new stdClass();
     $category->id = 0;
@@ -66,12 +68,6 @@ if ($id) {
 
 require_capability('moodle/category:manage', $context);
 
-// Page "Add new category" (with "Top" as a parent) does not exist in navigation.
-// We pretend we are on course management page.
-if ($id !== 0) {
-    navigation_node::override_active_url(new moodle_url('/course/management.php'));
-}
-
 $PAGE->set_context($context);
 $PAGE->set_url($url);
 $PAGE->set_pagelayout('admin');
index 229b29c..c296ec9 100644 (file)
@@ -533,7 +533,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
         $o.= html_writer::tag('div', '', array('class' => 'left side'));
         $o.= html_writer::tag('div', '', array('class' => 'right side'));
         $o.= html_writer::start_tag('div', array('class' => 'content'));
-        $o.= $this->output->heading(get_string('orphanedactivities'), 3, 'sectionname');
+        $o.= $this->output->heading(get_string('orphanedactivitiesinsectionno', '', $sectionno), 3, 'sectionname');
         return $o;
     }
 
index 7463b11..b787853 100644 (file)
@@ -48,7 +48,6 @@ if ($issearching) {
 }
 
 $url = new moodle_url('/course/management.php');
-navigation_node::override_active_url($url);
 $systemcontext = $context = context_system::instance();
 if ($courseid) {
     $record = get_course($courseid);
@@ -56,13 +55,18 @@ if ($courseid) {
     $category = coursecat::get($course->category);
     $categoryid = $category->id;
     $context = context_coursecat::instance($category->id);
+    $url->param('categoryid', $categoryid);
+    navigation_node::override_active_url($url);
     $url->param('courseid', $course->id);
+
 } else if ($categoryid) {
     $courseid = null;
     $course = null;
     $category = coursecat::get($categoryid);
     $context = context_coursecat::instance($category->id);
     $url->param('categoryid', $category->id);
+    navigation_node::override_active_url($url);
+
 } else {
     $course = null;
     $courseid = null;
@@ -72,6 +76,7 @@ if ($courseid) {
         $viewmode = 'categories';
     }
     $context = $systemcontext;
+    navigation_node::override_active_url($url);
 }
 
 if ($page !== 0) {
index bf088d8..3e6ef68 100644 (file)
@@ -126,6 +126,9 @@ if (!empty($add)) {
     $url->param('update', $update);
     $PAGE->set_url($url);
 
+    // Select the "Edit settings" from navigation.
+    navigation_node::override_active_url(new moodle_url('/course/modedit.php', array('update'=>$update, 'return'=>1)));
+
     // Check the course module exists.
     $cm = get_coursemodule_from_id('', $update, 0, false, MUST_EXIST);
 
index 0517f39..f831b23 100644 (file)
@@ -37,6 +37,7 @@ if (!$course = $DB->get_record('course', array('id'=>$id))) {
 }
 
 $PAGE->set_url('/course/reset.php', array('id'=>$id));
+$PAGE->set_pagelayout('admin');
 
 require_login($course);
 require_capability('moodle/course:reset', context_course::instance($course->id));
index e572403..2a80d75 100644 (file)
@@ -85,13 +85,14 @@ class behat_course extends behat_base {
      * @return Given[]
      */
     public function i_go_to_the_courses_management_page() {
-
-        return array(
-            new Given('I am on homepage'),
-            new Given('I expand "' . get_string('administrationsite') . '" node'),
-            new Given('I expand "' . get_string('courses', 'admin') . '" node'),
-            new Given('I follow "' . get_string('coursemgmt', 'admin') . '"'),
-        );
+        if ($this->running_javascript()) {
+            $scenario = array(new Given('I expand "' . get_string('administrationsite') . '" node'));
+        } else {
+            $scenario = array(new Given('I follow "' . get_string('administrationsite') . '"'));
+        }
+        $scenario[] = new Given('I expand "' . get_string('courses', 'admin') . '" node');
+        $scenario[] = new Given('I follow "' . get_string('coursemgmt', 'admin') . '"');
+        return $scenario;
     }
 
     /**
@@ -226,6 +227,33 @@ class behat_course extends behat_base {
         }
     }
 
+    /**
+     * Go to editing section page for specified section number. You need to be in the course page and on editing mode.
+     *
+     * @Given /^I edit the section "(?P<section_number>\d+)"$/
+     * @param int $sectionnumber
+     */
+    public function i_edit_the_section($sectionnumber) {
+        return new Given('I click on "' . get_string('editsummary') . '" "link" in the "#section-' . $sectionnumber . '" "css_element"');
+    }
+
+    /**
+     * Edit specified section and fill the form data with the specified field/value pairs.
+     *
+     * @When /^I edit the section "(?P<section_number>\d+)" and I fill the form with:$/
+     * @param int $sectionnumber The section number
+     * @param TableNode $data The activity field/value data
+     * @return Given[]
+     */
+    public function i_edit_the_section_and_i_fill_the_form_with($sectionnumber, TableNode $data) {
+
+        return array(
+            new Given('I edit the section "' . $sectionnumber . '"'),
+            new Given('I fill the moodle form with:', $data),
+            new Given('I press "' . get_string('savechanges') . '"')
+        );
+    }
+
     /**
      * Checks if the specified course section hightlighting is turned on. You need to be in the course page on editing mode.
      *
index b28522e..1935ec7 100644 (file)
@@ -1534,6 +1534,10 @@ class core_course_courselib_testcase extends advanced_testcase {
         $this->assertEquals($coursecontext->id, $event->contextid);
         $this->assertEquals($course, $event->get_record_snapshot('course', $course->id));
         $this->assertEquals('course_deleted', $event->get_legacy_eventname());
+        $eventdata = $event->get_data();
+        $this->assertSame($course->idnumber, $eventdata['other']['idnumber']);
+        $this->assertSame($course->fullname, $eventdata['other']['fullname']);
+        $this->assertSame($course->shortname, $eventdata['other']['shortname']);
         // The legacy data also passed the context in the course object.
         $course->context = $coursecontext;
         $this->assertEventLegacyData($course, $event);
index 73839e1..cd37afc 100644 (file)
@@ -58,7 +58,7 @@ $personalcontext = context_user::instance($user->id);
 $PAGE->set_url('/course/user.php', array('id'=>$id, 'user'=>$user->id, 'mode'=>$mode));
 
 require_login();
-$PAGE->set_pagelayout('admin');
+$PAGE->set_pagelayout('report');
 if (has_capability('moodle/user:viewuseractivitiesreport', $personalcontext) and !is_enrolled($coursecontext)) {
     // do not require parents to be enrolled in courses ;-)
     $PAGE->set_course($course);
index f2e8a6d..42cb947 100644 (file)
@@ -26,7 +26,7 @@
 
 require('../config.php');
 
-$contextid  = optional_param('contextid', SYSCONTEXTID, PARAM_INT);
+$contextid  = optional_param('contextid', 0, PARAM_INT);
 $filepath   = optional_param('filepath', '', PARAM_PATH);
 $filename   = optional_param('filename', '', PARAM_FILE);
 // hard-coded to course legacy area
@@ -34,7 +34,12 @@ $component = 'course';
 $filearea  = 'legacy';
 $itemid    = 0;
 
+if (empty($contextid)) {
+    $contextid = context_course::instance(SITEID)->id;
+}
+
 $PAGE->set_url('/files/index.php', array('contextid'=>$contextid, 'filepath'=>$filepath, 'filename'=>$filename));
+navigation_node::override_active_url(new moodle_url('/files/index.php', array('contextid'=>$contextid)));
 
 if ($filepath === '') {
     $filepath = null;
index 4017ade..4b2e8c8 100644 (file)
@@ -201,14 +201,14 @@ class core_files_renderer extends plugin_renderer_base {
     <div class="fp-navbar">
         <div class="filemanager-toolbar">
             <div class="fp-toolbar">
-                <div class="{!}fp-btn-add"><a role="button" href="#"><img src="'.$this->pix_url('a/add_file').'" /> '.$straddfile.'</a></div>
-                <div class="{!}fp-btn-mkdir"><a role="button" href="#"><img src="'.$this->pix_url('a/create_folder').'" /> '.$strmakedir.'</a></div>
-                <div class="{!}fp-btn-download"><a role="button" href="#"><img src="'.$this->pix_url('a/download_all').'" /> '.$strdownload.'</a></div>
+                <div class="{!}fp-btn-add"><a role="button" href="#"><img src="'.$this->pix_url('a/add_file').'" alt="'.$straddfile.'" /></a></div>
+                <div class="{!}fp-btn-mkdir"><a role="button" href="#"><img src="'.$this->pix_url('a/create_folder').'" alt="'.$strmakedir.'" /></a></div>
+                <div class="{!}fp-btn-download"><a role="button" href="#"><img src="'.$this->pix_url('a/download_all').'" alt="'.$strdownload.'" /></a></div>
             </div>
             <div class="{!}fp-viewbar">
-                <a title="'. get_string('displayicons', 'repository') .'" class="{!}fp-vb-icons" href="#"></a>
-                <a title="'. get_string('displaydetails', 'repository') .'" class="{!}fp-vb-details" href="#"></a>
-                <a title="'. get_string('displaytree', 'repository') .'" class="{!}fp-vb-tree" href="#"></a>
+                <a title="'. get_string('displayicons', 'repository') .'" class="{!}fp-vb-icons" href="#"><img alt="" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" /></a>
+                <a title="'. get_string('displaydetails', 'repository') .'" class="{!}fp-vb-details" href="#"><img alt="" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" /></a>
+                <a title="'. get_string('displaytree', 'repository') .'" class="{!}fp-vb-tree" href="#"><img alt="" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" /></a>
             </div>
         </div>
         <div class="fp-pathbar">
@@ -536,14 +536,14 @@ class core_files_renderer extends plugin_renderer_base {
                     <div class="{!}fp-tb-search"><form></form></div>
                     <div class="{!}fp-tb-refresh"><a href="#"><img alt="'. get_string('refresh', 'repository') .'"  src="'.$this->pix_url('a/refresh').'" /></a></div>
                     <div class="{!}fp-tb-logout"><img alt="'. get_string('logout', 'repository') .'" src="'.$this->pix_url('a/logout').'" /><a href="#"></a></div>
-                    <div class="{!}fp-tb-manage"><a href="#"><img alt="'. get_string('settings', 'repository') .'" src="'.$this->pix_url('a/setting').'" /> '.get_string('manageurl', 'repository').'</a></div>
-                    <div class="{!}fp-tb-help"><a href="#"><img alt="'. get_string('help', 'repository') .'" src="'.$this->pix_url('a/help').'" /> '.get_string('help').'</a></div>
+                    <div class="{!}fp-tb-manage"><a href="#"><img alt="'. get_string('settings', 'repository') .'" src="'.$this->pix_url('a/setting').'" /></a></div>
+                    <div class="{!}fp-tb-help"><a href="#"><img alt="'. get_string('help', 'repository') .'" src="'.$this->pix_url('a/help').'" /></a></div>
                     <div class="{!}fp-tb-message"></div>
                 </div>
                 <div class="{!}fp-viewbar">
-                    <a title="'. get_string('displayicons', 'repository') .'" class="{!}fp-vb-icons" href="#"></a>
-                    <a title="'. get_string('displaydetails', 'repository') .'" class="{!}fp-vb-details" href="#"></a>
-                    <a title="'. get_string('displaytree', 'repository') .'" class="{!}fp-vb-tree" href="#"></a>
+                    <a title="'. get_string('displayicons', 'repository') .'" class="{!}fp-vb-icons" href="#"><img alt="" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" /></a>
+                    <a title="'. get_string('displaydetails', 'repository') .'" class="{!}fp-vb-details" href="#"><img alt="" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" /></a>
+                    <a title="'. get_string('displaytree', 'repository') .'" class="{!}fp-vb-tree" href="#"><img alt="" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" /></a>
                 </div>
                 <div class="fp-clear-left"></div>
             </div>
index 550b0f0..f453c97 100644 (file)
@@ -57,7 +57,7 @@ $isfrontpage = ($context->contextlevel == CONTEXT_COURSE && $context->instanceid
 $contextname = $context->get_context_name();
 
 if ($context->contextlevel == CONTEXT_COURSECAT) {
-    $heading = "$SITE->fullname: ".get_string("categories");
+    $heading = $SITE->fullname;
 } else if ($context->contextlevel == CONTEXT_COURSE) {
     $heading = $course->fullname;
 } else if ($context->contextlevel == CONTEXT_MODULE) {
@@ -119,16 +119,11 @@ if ($forfilter) {
 }
 $straction = get_string('filters', 'admin'); // Used by tabs.php
 
-/// Print the header and tabs
-if ($isfrontpage) {
-    admin_externalpage_setup('frontpagefilters');
-    echo $OUTPUT->header();
-} else {
-    $PAGE->set_cacheable(false);
-    $PAGE->set_title($title);
-    $PAGE->set_pagelayout('admin');
-    echo $OUTPUT->header();
-}
+// Print the header and tabs.
+$PAGE->set_cacheable(false);
+$PAGE->set_title($title);
+$PAGE->set_pagelayout('admin');
+echo $OUTPUT->header();
 
 /// Print heading.
 echo $OUTPUT->heading_with_help($title, 'filtersettings', 'filters');
index f156fa9..18a34ff 100644 (file)
@@ -262,6 +262,7 @@ $string['skipmodifprevhelp'] = 'Choose whether or not to skip courses that have
 $string['title'] = 'Title';
 $string['totalcategorysearchresults'] = 'Total categories: {$a}';
 $string['totalcoursesearchresults'] = 'Total courses: {$a}';
+$string['unnamedsection'] = 'Unnamed section';
 $string['userinfo'] = 'Userinfo';
 $string['module'] = 'Module';
 $string['morecoursesearchresults'] = 'More than {$a} courses found, showing first {$a} results';
index f8dcbc1..684ffbd 100644 (file)
@@ -1319,7 +1319,7 @@ $string['optional'] = 'optional';
 $string['options'] = 'options';
 $string['order'] = 'Order';
 $string['originalpath'] = 'Original path';
-$string['orphanedactivities'] = 'Orphaned activities';
+$string['orphanedactivitiesinsectionno'] = 'Orphaned activities (section {$a})';
 $string['other'] = 'Other';
 $string['outline'] = 'Outline';
 $string['outlinereport'] = 'Outline report';
index 7d7bb69..45f07b4 100644 (file)
@@ -1528,7 +1528,6 @@ function delete_role($roleid) {
             'objectid' => $roleid,
             'other' =>
                 array(
-                    'name' => $role->name,
                     'shortname' => $role->shortname,
                     'description' => $role->description,
                     'archetype' => $role->archetype
index 2d3c61f..b300687 100644 (file)
@@ -6266,6 +6266,8 @@ function admin_externalpage_setup($section, $extrabutton = '', array $extraurlpa
         die;
     }
 
+    navigation_node::require_admin_tree();
+
     // $PAGE->set_extra_button($extrabutton); TODO
 
     if (!$actualurl) {
diff --git a/lib/ajax/getsiteadminbranch.php b/lib/ajax/getsiteadminbranch.php
new file mode 100644 (file)
index 0000000..a57959b
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file is used to deliver a branch from the site administration
+ * in XML format back to a page from an AJAX call
+ *
+ * @since 2.6
+ * @package core
+ * @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+define('AJAX_SCRIPT', true);
+require_once(dirname(__FILE__) . '/../../config.php');
+
+// This should be accessed by only valid logged in user.
+if (!isloggedin() or isguestuser()) {
+    die('Invalid access.');
+}
+
+// This identifies the type of the branch we want to get. Make sure it's SITE_ADMIN.
+$branchtype = required_param('type', PARAM_INT);
+if ($branchtype !== navigation_node::TYPE_SITE_ADMIN) {
+    die('Wrong node type passed.');
+}
+
+$PAGE->set_context(context_system::instance());
+$PAGE->set_url('/lib/ajax/getsiteadminbranch.php', array('type'=>$branchtype));
+
+$sitenavigation = new settings_navigation_ajax($PAGE);
+
+// Set XML headers.
+header('Content-type: text/plain; charset=utf-8');
+// Convert and output the branch as XML.
+$converter = new navigation_json();
+$branch = $sitenavigation->get('root');
+echo $converter->convert($branch);
index db17175..0f704a7 100644 (file)
@@ -71,7 +71,7 @@ class course_deleted extends base {
     protected function get_legacy_eventdata() {
         $course = $this->get_record_snapshot('course', $this->objectid);
         $course->context = $this->context;
-
+        $course->timemodified = $this->data['timecreated'];
         return $course;
     }
 
index 545d691..9457519 100644 (file)
@@ -58,7 +58,7 @@ class user_deleted extends base {
      * @return string
      */
     public function get_description() {
-        $user = (object)$this->other['user'];
+        $user = $this->get_record_snapshot('user', $this->data['objectid']);
         return 'User profile deleted for user '.$user->firstname.' '.$user->lastname.' id ('.$user->id.')';
     }
 
@@ -77,7 +77,13 @@ class user_deleted extends base {
      * @return \stdClass user data.
      */
     protected function get_legacy_eventdata() {
-        return (object)$this->other['user'];
+        $user = $this->get_record_snapshot('user', $this->data['objectid']);
+        $user->deleted = 0;
+        $user->username = $this->data['other']['username'];
+        $user->email = $this->data['other']['email'];
+        $user->idnumber = $this->data['other']['idnumber'];
+        $user->picture = $this->data['other']['picture'];
+        return $user;
     }
 
     /**
@@ -86,8 +92,8 @@ class user_deleted extends base {
      * @return array
      */
     protected function get_legacy_logdata() {
-        $user = (object)$this->other['user'];
-        return array(SITEID, 'user', 'delete', "view.php?id=$user->id", $user->firstname.' '.$user->lastname);
+        $user = $this->get_record_snapshot('user', $this->data['objectid']);
+        return array(SITEID, 'user', 'delete', "view.php?id=".$user->id, $user->firstname.' '.$user->lastname);
     }
 
     /**
@@ -97,9 +103,29 @@ class user_deleted extends base {
      * @return void
      */
     protected function validate_data() {
-        parent::validate_data();
-        if (!isset($this->other['user'])) {
-            throw new \coding_exception('user must be set in $other.');
+        global $CFG;
+
+        if ($CFG->debugdeveloper) {
+            parent::validate_data();
+            if (!isset($this->other['username'])) {
+                throw new \coding_exception('username must be set in $other.');
+            }
+
+            if (!isset($this->other['email'])) {
+                throw new \coding_exception('email must be set in $other.');
+            }
+
+            if (!isset($this->other['idnumber'])) {
+                throw new \coding_exception('idnumber must be set in $other.');
+            }
+
+            if (!isset($this->other['picture'])) {
+                throw new \coding_exception('picture must be set in $other.');
+            }
+
+            if (!isset($this->other['mnethostid'])) {
+                throw new \coding_exception('mnethostid must be set in $other.');
+            }
         }
     }
 }
index a656175..995784a 100644 (file)
@@ -34,6 +34,14 @@ defined('MOODLE_INTERNAL') || die();
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 abstract class handler {
+    /**
+     * Start the session.
+     * @return bool success
+     */
+    public function start() {
+        return session_start();
+    }
+
     /**
      * Init session handler.
      */
index 2b1e7f0..c5e764c 100644 (file)
@@ -74,7 +74,7 @@ class manager {
             self::prepare_cookies();
             $newsid = empty($_COOKIE[session_name()]);
 
-            session_start();
+            self::$handler->start();
 
             self::initialise_user_session($newsid);
             self::check_security();
index 7281537..4e07f3c 100644 (file)
@@ -40,6 +40,13 @@ class memcached extends handler {
     protected $servers;
     /** @var string $prefix session key prefix  */
     protected $prefix;
+    /** @var int $acquiretimeout how long to wait for session lock */
+    protected $acquiretimeout = 120;
+    /**
+     * @var int $lockexpire how long to wait before expiring the lock so that other requests
+     * may continue execution, ignored if memcached <= 2.1.0.
+     */
+    protected $lockexpire = 7200;
 
     /**
      * Create new instance of handler.
@@ -64,6 +71,32 @@ class memcached extends handler {
         } else {
             $this->prefix = $CFG->session_memcached_prefix;
         }
+
+        if (!empty($CFG->session_memcached_acquire_lock_timeout)) {
+            $this->acquiretimeout = (int)$CFG->session_memcached_acquire_lock_timeout;
+        }
+
+        if (!empty($CFG->session_memcached_lock_expire)) {
+            $this->lockexpire = (int)$CFG->session_memcached_lock_expire;
+        }
+    }
+
+    /**
+     * Start the session.
+     * @return bool success
+     */
+    public function start() {
+        // NOTE: memcached <= 2.1.0 expires session locks automatically after max_execution_time,
+        //       this leads to major difference compared to other session drivers that timeout
+        //       and stop the second request execution instead.
+
+        $default = ini_get('max_execution_time');
+        set_time_limit($this->acquiretimeout);
+
+        $result = parent::start();
+
+        set_time_limit($default);
+        return $result;
     }
 
     /**
@@ -81,11 +114,14 @@ class memcached extends handler {
             throw new exception('sessionhandlerproblem', 'error', '', null, '$CFG->session_memcached_save_path must be specified in config.php');
         }
 
-        // NOTE: we cannot set any lock acquiring timeout here - bad luck.
         ini_set('session.save_handler', 'memcached');
         ini_set('session.save_path', $this->savepath);
         ini_set('memcached.sess_prefix', $this->prefix);
         ini_set('memcached.sess_locking', '1'); // Locking is required!
+
+        // Try to configure lock and expire timeouts - ignored if memcached <=2.1.0.
+        ini_set('memcached.sess_lock_max_wait', $this->acquiretimeout);
+        ini_set('memcached.sess_lock_expire', $this->lockexpire);
     }
 
     /**
index 971d138..3782b5c 100644 (file)
@@ -475,12 +475,13 @@ class core_useragent {
     }
 
     /**
-     * Checks the user agent is IE and that the version is equal to or greater than that specified.
+     * Checks the user agent is IE and returns its main properties:
+     * - browser version;
+     * - whether running in compatibility view.
      *
-     * @param string|int $version A version to check for, returns true if its equal to or greater than that specified.
-     * @return bool
+     * @return bool|array False if not IE, otherwise an associative array of properties.
      */
-    public static function check_ie_version($version = null) {
+    public static function check_ie_properties() {
         // Internet Explorer.
         $useragent = self::get_user_agent_string();
         if ($useragent === false) {
@@ -490,25 +491,71 @@ class core_useragent {
             // Reject Opera.
             return false;
         }
-        // In case of IE we have to deal with BC of the version parameter.
-        if (is_null($version)) {
-            $version = 5.5; // Anything older is not considered a browser at all!
-        }
-        // IE uses simple versions, let's cast it to float to simplify the logic here.
-        $version = round($version, 1);
         // See: http://www.useragentstring.com/pages/Internet%20Explorer/.
         if (preg_match("/MSIE ([0-9\.]+)/", $useragent, $match)) {
             $browser = $match[1];
+        // See: http://msdn.microsoft.com/en-us/library/ie/bg182625%28v=vs.85%29.aspx for IE11+ useragent details.
+        } else if (preg_match("/Trident\/[0-9\.]+/", $useragent) && preg_match("/rv:([0-9\.]+)/", $useragent, $match)) {
+            $browser = $match[1];
         } else {
             return false;
         }
+        $compat_view = false;
         // IE8 and later versions may pretend to be IE7 for intranet sites, use Trident version instead,
         // the Trident should always describe the capabilities of IE in any emulation mode.
         if ($browser === '7.0' and preg_match("/Trident\/([0-9\.]+)/", $useragent, $match)) {
+            $compat_view = true;
             $browser = $match[1] + 4; // NOTE: Hopefully this will work also for future IE versions.
         }
         $browser = round($browser, 1);
-        return ($browser >= $version);
+        return array(
+            'version'    => $browser,
+            'compatview' => $compat_view
+        );
+    }
+
+    /**
+     * Checks the user agent is IE and that the version is equal to or greater than that specified.
+     *
+     * @param string|int $version A version to check for, returns true if its equal to or greater than that specified.
+     * @return bool
+     */
+    public static function check_ie_version($version = null) {
+        // Internet Explorer.
+        $properties = self::check_ie_properties();
+        if (!is_array($properties)) {
+            return false;
+        }
+        // In case of IE we have to deal with BC of the version parameter.
+        if (is_null($version)) {
+            $version = 5.5; // Anything older is not considered a browser at all!
+        }
+        // IE uses simple versions, let's cast it to float to simplify the logic here.
+        $version = round($version, 1);
+        return ($properties['version'] >= $version);
+    }
+
+    /**
+     * Checks the user agent is IE and that IE is running under Compatibility View setting.
+     *
+     * @return bool true if internet explorer runs in Compatibility View mode.
+     */
+    public static function check_ie_compatibility_view() {
+        // IE User Agent string when in Compatibility View:
+        // - IE  8: "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; ...)".
+        // - IE  9: "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; ...)".
+        // - IE 10: "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0; ...)".
+        // - IE 11: "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; ...)".
+        // Refs:
+        // - http://blogs.msdn.com/b/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx.
+        // - http://blogs.msdn.com/b/ie/archive/2010/03/23/introducing-ie9-s-user-agent-string.aspx.
+        // - http://blogs.msdn.com/b/ie/archive/2011/04/15/the-ie10-user-agent-string.aspx.
+        // - http://msdn.microsoft.com/en-us/library/ie/hh869301%28v=vs.85%29.aspx.
+        $properties = self::check_ie_properties();
+        if (!is_array($properties)) {
+            return false;
+        }
+        return $properties['compatview'];
     }
 
     /**
@@ -829,4 +876,27 @@ class core_useragent {
         }
         return $instance->supportssvg;
     }
+
+    /**
+     * Returns true if the user agent supports the MIME media type for JSON text, as defined in RFC 4627.
+     *
+     * @return bool
+     */
+    public static function supports_json_contenttype() {
+        // Modern browsers other than IE correctly supports 'application/json' media type.
+        if (!self::is_ie()) {
+            return true;
+        }
+
+        // IE8+ supports 'application/json' media type, when NOT in Compatibility View mode.
+        // Refs:
+        // - http://blogs.msdn.com/b/ie/archive/2008/09/10/native-json-in-ie8.aspx;
+        // - MDL-39810: issues when using 'text/plain' in Compatibility View for the body of an HTTP POST response.
+        if (self::check_ie_version(8) && !self::check_ie_compatibility_view()) {
+            return true;
+        }
+
+        // This browser does not support json.
+        return false;
+    }
 }
index e8a5aae..156d39c 100644 (file)
@@ -373,7 +373,6 @@ abstract class moodle_database {
             $this->database_manager = null;
         }
         $this->tables  = null;
-        $this->metacache = null;
     }
 
     /**
@@ -962,26 +961,11 @@ abstract class moodle_database {
      */
     public function reset_caches() {
         $this->tables = null;
-        $this->metacache = null;
         // Purge MUC as well
         $identifiers = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
         cache_helper::purge_by_definition('core', 'databasemeta', $identifiers);
     }
 
-    /**
-     * Call before using $this->metacache.
-     *
-     * Note: this is necessary because we want to write to database in shutdown handler
-     *       and it needs to use the caches, but MUC would be already disposed.
-     */
-    protected function init_caches() {
-        if ($this->metacache) {
-            return;
-        }
-        $properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
-        $this->metacache = cache::make('core', 'databasemeta', $properties);
-    }
-
     /**
      * Returns the sql generator used for db manipulation.
      * Used mostly in upgrade.php scripts.
index 88c3575..2ad78aa 100644 (file)
@@ -398,8 +398,9 @@ class mssql_native_moodle_database extends moodle_database {
     public function get_columns($table, $usecache=true) {
 
         if ($usecache) {
-            $this->init_caches();
-            if ($data = $this->metacache->get($table)) {
+            $properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
+            $cache = cache::make('core', 'databasemeta', $properties);
+            if ($data = $cache->get($table)) {
                 return $data;
             }
         }
@@ -495,7 +496,7 @@ class mssql_native_moodle_database extends moodle_database {
         $this->free_result($result);
 
         if ($usecache) {
-            $result = $this->metacache->set($table, $structure);
+            $cache->set($table, $structure);
         }
 
         return $structure;
index f80c479..5196484 100644 (file)
@@ -511,8 +511,9 @@ class mysqli_native_moodle_database extends moodle_database {
     public function get_columns($table, $usecache=true) {
 
         if ($usecache) {
-            $this->init_caches();
-            if ($data = $this->metacache->get($table)) {
+            $properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
+            $cache = cache::make('core', 'databasemeta', $properties);
+            if ($data = $cache->get($table)) {
                 return $data;
             }
         }
@@ -618,7 +619,7 @@ class mysqli_native_moodle_database extends moodle_database {
         }
 
         if ($usecache) {
-            $result = $this->metacache->set($table, $structure);
+            $cache->set($table, $structure);
         }
 
         return $structure;
index 5f412ef..95985f9 100644 (file)
@@ -470,8 +470,9 @@ class oci_native_moodle_database extends moodle_database {
     public function get_columns($table, $usecache=true) {
 
         if ($usecache) {
-            $this->init_caches();
-            if ($data = $this->metacache->get($table)) {
+            $properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
+            $cache = cache::make('core', 'databasemeta', $properties);
+            if ($data = $cache->get($table)) {
                 return $data;
             }
         }
@@ -663,7 +664,7 @@ class oci_native_moodle_database extends moodle_database {
         }
 
         if ($usecache) {
-            $result = $this->metacache->set($table, $structure);
+            $cache->set($table, $structure);
         }
 
         return $structure;
index 3ae868d..3754d9b 100644 (file)
@@ -385,8 +385,9 @@ class pgsql_native_moodle_database extends moodle_database {
      */
     public function get_columns($table, $usecache=true) {
         if ($usecache) {
-            $this->init_caches();
-            if ($data = $this->metacache->get($table)) {
+            $properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
+            $cache = cache::make('core', 'databasemeta', $properties);
+            if ($data = $cache->get($table)) {
                 return $data;
             }
         }
@@ -569,7 +570,7 @@ class pgsql_native_moodle_database extends moodle_database {
         pg_free_result($result);
 
         if ($usecache) {
-            $result = $this->metacache->set($table, $structure);
+            $cache->set($table, $structure);
         }
 
         return $structure;
index c711197..7828eb7 100644 (file)
@@ -201,8 +201,9 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database {
     public function get_columns($table, $usecache=true) {
 
         if ($usecache) {
-            $this->init_caches();
-            if ($data = $this->metacache->get($table)) {
+            $properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
+            $cache = cache::make('core', 'databasemeta', $properties);
+            if ($data = $cache->get($table)) {
                 return $data;
             }
         }
@@ -299,7 +300,7 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database {
         }
 
         if ($usecache) {
-            $result = $this->metacache->set($table, $structure);
+            $cache->set($table, $structure);
         }
 
         return $structure;
index 3d45697..e8d8281 100644 (file)
@@ -462,8 +462,9 @@ class sqlsrv_native_moodle_database extends moodle_database {
      */
     public function get_columns($table, $usecache = true) {
         if ($usecache) {
-            $this->init_caches();
-            if ($data = $this->metacache->get($table)) {
+            $properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
+            $cache = cache::make('core', 'databasemeta', $properties);
+            if ($data = $cache->get($table)) {
                 return $data;
             }
         }
@@ -559,7 +560,7 @@ class sqlsrv_native_moodle_database extends moodle_database {
         $this->free_result($result);
 
         if ($usecache) {
-            $result = $this->metacache->set($table, $structure);
+            $cache->set($table, $structure);
         }
 
         return $structure;
index cf2fcb0..17f7516 100644 (file)
@@ -15,3 +15,4 @@ Upgrade procedure:
 5/ reimplement patch in MDL-40668
 6/ add in "DOM.setStyle(ifr, 'width',DOM.getSize(ifrcon).w); // Resize iframe" (without quotes)
    after "DOM.setStyle(ifr, 'height',DOM.getSize(ifr).h + dy); // Resize iframe"
+7/ reimplement patch in MDL-42481
index 8691147..22e42b7 100644 (file)
 \r
             // For very small text areas - allow the editable region to be smaller than the size of the toolbars.\r
             if (rows >= 3) {\r
+                // This set of changes addresses MDL-42481.\r
+                // Moodle collapses form sections by setting display to none on the fcontainer element.\r
+                // In order to calculate the offsetWidth, the iframe must be visible within the DOM, otherwise it's offsetWidth is\r
+                // calculate as 0px.\r
+                // We attempt to find any collapsed element, uncollapse them, then calculate the width and height, and finally\r
+                // collapse them again.\r
+                var collapsedContainer = DOM.getParent(ifr, 'fieldset.collapsed');\r
+                if (collapsedContainer) {\r
+                    DOM.removeClass(collapsedContainer, 'collapsed');\r
+                }\r
+\r
                 DOM.setStyle(ifr, 'height',DOM.getSize(ifr).h + dy); // Resize iframe\r
                 DOM.setStyle(ifr, 'width',DOM.getSize(ifrcon).w); // Resize iframe\r
                 ed.theme.deltaHeight += dy; // For resize cookie\r
+\r
+                if (collapsedContainer) {\r
+                    // We have a collapsedContainer, so collapse it again.\r
+                    DOM.addClass(collapsedContainer, 'collapsed');\r
+                }\r
             }\r
+\r
                },\r
 \r
                /**\r
index 2d34445..2cf904a 100644 (file)
@@ -4131,6 +4131,9 @@ function delete_user(stdClass $user) {
         return false;
     }
 
+    // Keep user record before updating it, as we have to pass this to user_deleted event.
+    $olduser = clone $user;
+
     // Keep a copy of user context, we need it for event.
     $usercontext = context_user::instance($user->id);
 
@@ -4210,10 +4213,16 @@ function delete_user(stdClass $user) {
             array(
                 'objectid' => $user->id,
                 'context' => $usercontext,
-                'other' => array('user' => (array)clone $user)
+                'other' => array(
+                    'username' => $user->username,
+                    'email' => $user->email,
+                    'idnumber' => $user->idnumber,
+                    'picture' => $user->picture,
+                    'mnethostid' => $user->mnethostid
+                    )
                 )
             );
-    $event->add_record_snapshot('user', $updateuser);
+    $event->add_record_snapshot('user', $olduser);
     $event->trigger();
 
     // We will update the user's timemodified, as it will be passed to the user_deleted event, which
@@ -4805,6 +4814,7 @@ function set_login_session_preferences() {
     $SESSION->justloggedin = true;
 
     unset($SESSION->lang);
+    unset($SESSION->load_navigation_admin);
 }
 
 
@@ -4842,10 +4852,6 @@ function delete_course($courseorid, $showfeedback = true) {
     // Delete the course and related context instance.
     context_helper::delete_instance(CONTEXT_COURSE, $courseid);
 
-    // We will update the course's timemodified, as it will be passed to the course_deleted event,
-    // which should know about this updated property, as this event is meant to pass the full course record.
-    $course->timemodified = time();
-
     $DB->delete_records("course", array("id" => $courseid));
     $DB->delete_records("course_format_options", array("courseid" => $courseid));
 
@@ -4853,8 +4859,11 @@ function delete_course($courseorid, $showfeedback = true) {
     $event = \core\event\course_deleted::create(array(
         'objectid' => $course->id,
         'context' => $context,
-        'other' => array('shortname' => $course->shortname,
-                         'fullname' => $course->fullname)
+        'other' => array(
+            'shortname' => $course->shortname,
+            'fullname' => $course->fullname,
+            'idnumber' => $course->idnumber
+            )
     ));
     $event->add_record_snapshot('course', $course);
     $event->trigger();
index a4ce8d9..79244ab 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * The name that will be used to separate the navigation cache within SESSION
  */
 define('NAVIGATION_CACHE_NAME', 'navigation');
+define('NAVIGATION_SITE_ADMIN_CACHE_NAME', 'navigationsiteadmin');
 
 /**
  * This class is used to represent a node in a navigation tree
@@ -71,6 +72,8 @@ class navigation_node implements renderable {
     const TYPE_CUSTOM =     60;
     /** @var int Setting node type, used only within settings nav 70 */
     const TYPE_SETTING =    70;
+    /** @var int site admin branch node type, used only within settings nav 71 */
+    const TYPE_SITE_ADMIN = 71;
     /** @var int Setting node type, used only within settings nav 80 */
     const TYPE_USER =       80;
     /** @var int Setting node type, used for containers of no importance 90 */
@@ -129,11 +132,13 @@ class navigation_node implements renderable {
     /** @var bool Set to true if we KNOW that this node can be expanded.  */
     public $isexpandable = false;
     /** @var array */
-    protected $namedtypes = array(0=>'system',10=>'category',20=>'course',30=>'structure',40=>'activity',50=>'resource',60=>'custom',70=>'setting', 80=>'user');
+    protected $namedtypes = array(0=>'system',10=>'category',20=>'course',30=>'structure',40=>'activity',50=>'resource',60=>'custom',70=>'setting',71=>'siteadmin', 80=>'user');
     /** @var moodle_url */
     protected static $fullmeurl = null;
     /** @var bool toogles auto matching of active node */
     public static $autofindactive = true;
+    /** @var bool should we load full admin tree or rely on AJAX for performance reasons */
+    protected static $loadadmintree = false;
     /** @var mixed If set to an int, that section will be included even if it has no activities */
     public $includesectionnum = false;
 
@@ -237,10 +242,25 @@ class navigation_node implements renderable {
      * is either $PAGE->url or if that hasn't been set $FULLME.
      *
      * @param moodle_url $url The url to use for the fullmeurl.
+     * @param bool $loadadmintree use true if the URL point to administration tree
      */
-    public static function override_active_url(moodle_url $url) {
+    public static function override_active_url(moodle_url $url, $loadadmintree = false) {
         // Clone the URL, in case the calling script changes their URL later.
         self::$fullmeurl = new moodle_url($url);
+        // True means we do not want AJAX loaded admin tree, required for all admin pages.
+        if ($loadadmintree) {
+            // Do not change back to false if already set.
+            self::$loadadmintree = true;
+        }
+    }
+
+    /**
+     * Use when page is linked from the admin tree,
+     * if not used navigation could not find the page using current URL
+     * because the tree is not fully loaded.
+     */
+    public static function require_admin_tree() {
+        self::$loadadmintree = true;
     }
 
     /**
@@ -324,7 +344,8 @@ class navigation_node implements renderable {
         // If added node is a category node or the user is logged in and it's a course
         // then mark added node as a branch (makes it expandable by AJAX)
         $type = $childnode->type;
-        if (($type == self::TYPE_CATEGORY) || (isloggedin() && ($type == self::TYPE_COURSE)) || ($type == self::TYPE_MY_CATEGORY)) {
+        if (($type == self::TYPE_CATEGORY) || (isloggedin() && ($type == self::TYPE_COURSE)) || ($type == self::TYPE_MY_CATEGORY) ||
+                ($type === self::TYPE_SITE_ADMIN)) {
             $node->nodetype = self::NODETYPE_BRANCH;
         }
         // If this node is hidden mark it's children as hidden also
@@ -3303,7 +3324,6 @@ class settings_navigation extends navigation_node {
             $this->load_block_settings();
             $context = $context->get_parent_context();
         }
-
         switch ($context->contextlevel) {
             case CONTEXT_SYSTEM:
                 if ($this->page->url->compare(new moodle_url('/admin/settings.php', array('section'=>'frontpagesettings')))) {
@@ -3331,19 +3351,47 @@ class settings_navigation extends navigation_node {
                 break;
         }
 
-        $settings = $this->load_user_settings($this->page->course->id);
+        $usersettings = $this->load_user_settings($this->page->course->id);
 
-        if (isloggedin() && !isguestuser() && (!property_exists($SESSION, 'load_navigation_admin') || $SESSION->load_navigation_admin)) {
-            $admin = $this->load_administration_settings();
-            $SESSION->load_navigation_admin = ($admin->has_children());
-        } else {
-            $admin = false;
+        $adminsettings = false;
+        if (isloggedin() && !isguestuser() && (!isset($SESSION->load_navigation_admin) || $SESSION->load_navigation_admin)) {
+            $isadminpage = $this->is_admin_tree_needed();
+
+            if (has_capability('moodle/site:config', context_system::instance())) {
+                // Make sure this works even if config capability changes on the fly
+                // and also make it fast for admin right after login.
+                $SESSION->load_navigation_admin = 1;
+                if ($isadminpage) {
+                    $adminsettings = $this->load_administration_settings();
+                }
+
+            } else if (!isset($SESSION->load_navigation_admin)) {
+                $adminsettings = $this->load_administration_settings();
+                $SESSION->load_navigation_admin = (int)($adminsettings->children->count() > 0);
+
+            } else if ($SESSION->load_navigation_admin) {
+                if ($isadminpage) {
+                    $adminsettings = $this->load_administration_settings();
+                }
+            }
+
+            // Print empty navigation node, if needed.
+            if ($SESSION->load_navigation_admin && !$isadminpage) {
+                if ($adminsettings) {
+                    // Do not print settings tree on pages that do not need it, this helps with performance.
+                    $adminsettings->remove();
+                    $adminsettings = false;
+                }
+                $siteadminnode = $this->add(get_string('administrationsite'), new moodle_url('/admin'), self::TYPE_SITE_ADMIN, null, 'siteadministration');
+                $siteadminnode->id = 'expandable_branch_'.$siteadminnode->type.'_'.clean_param($siteadminnode->key, PARAM_ALPHANUMEXT);
+                $this->page->requires->data_for_js('siteadminexpansion', $siteadminnode);
+            }
         }
 
-        if ($context->contextlevel == CONTEXT_SYSTEM && $admin) {
-            $admin->force_open();
-        } else if ($context->contextlevel == CONTEXT_USER && $settings) {
-            $settings->force_open();
+        if ($context->contextlevel == CONTEXT_SYSTEM && $adminsettings) {
+            $adminsettings->force_open();
+        } else if ($context->contextlevel == CONTEXT_USER && $usersettings) {
+            $usersettings->force_open();
         }
 
         // Check if the user is currently logged in as another user
@@ -3360,6 +3408,10 @@ class settings_navigation extends navigation_node {
 
         foreach ($this->children as $key=>$node) {
             if ($node->nodetype != self::NODETYPE_BRANCH || $node->children->count()===0) {
+                // Site administration is shown as link.
+                if (!empty($SESSION->load_navigation_admin) && ($node->type === self::TYPE_SITE_ADMIN)) {
+                    continue;
+                }
                 $node->remove();
             }
         }
@@ -3408,6 +3460,30 @@ class settings_navigation extends navigation_node {
         }
         return $node;
     }
+
+    /**
+     * Does this page require loading of full admin tree or is
+     * it enough rely on AJAX?
+     *
+     * @return bool
+     */
+    protected function is_admin_tree_needed() {
+        if (self::$loadadmintree) {
+            // Usually external admin page or settings page.
+            return true;
+        }
+
+        if ($this->page->pagelayout === 'admin' or strpos($this->page->pagetype, 'admin-') === 0) {
+            // Admin settings tree is intended for system level settings and management only, use navigation for the rest!
+            if ($this->page->context->contextlevel != CONTEXT_SYSTEM) {
+                return false;
+            }
+            return true;
+        }
+
+        return false;
+    }
+
     /**
      * Load the site administration tree
      *
@@ -3435,7 +3511,7 @@ class settings_navigation extends navigation_node {
 
             // Disable the navigation from automatically finding the active node
             navigation_node::$autofindactive = false;
-            $referencebranch = $this->add(get_string('administrationsite'), null, self::TYPE_SETTING, null, 'root');
+            $referencebranch = $this->add(get_string('administrationsite'), null, self::TYPE_SITE_ADMIN, null, 'root');
             foreach ($adminroot->children as $adminbranch) {
                 $this->load_administration_settings($referencebranch, $adminbranch);
             }
@@ -3758,7 +3834,7 @@ class settings_navigation extends navigation_node {
 
         // Settings for the module
         if (has_capability('moodle/course:manageactivities', $this->page->cm->context)) {
-            $url = new moodle_url('/course/modedit.php', array('update' => $this->page->cm->id, 'return' => true, 'sesskey' => sesskey()));
+            $url = new moodle_url('/course/modedit.php', array('update' => $this->page->cm->id, 'return' => 1));
             $modulenode->add(get_string('editsettings'), $url, navigation_node::TYPE_SETTING, null, 'modedit');
         }
         // Assign local roles
@@ -4350,7 +4426,7 @@ class settings_navigation extends navigation_node {
         // Manage files
         if ($course->legacyfiles == 2 and has_capability('moodle/course:managefiles', $this->context)) {
             //hiden in new installs
-            $url = new moodle_url('/files/index.php', array('contextid'=>$coursecontext->id, 'itemid'=>0, 'component' => 'course', 'filearea'=>'legacy'));
+            $url = new moodle_url('/files/index.php', array('contextid'=>$coursecontext->id));
             $frontpage->add(get_string('sitelegacyfiles'), $url, self::TYPE_SETTING, null, null, new pix_icon('i/folder', ''));
         }
         return $frontpage;
@@ -4375,6 +4451,41 @@ class settings_navigation extends navigation_node {
     }
 }
 
+/**
+ * Class used to populate site admin navigation for ajax.
+ *
+ * @package   core
+ * @category  navigation
+ * @copyright 2013 Rajesh Taneja <rajesh@moodle.com>
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class settings_navigation_ajax extends settings_navigation {
+    /**
+     * Constructs the navigation for use in an AJAX request
+     *
+     * @param moodle_page $page
+     */
+    public function __construct(moodle_page &$page) {
+        $this->page = $page;
+        $this->cache = new navigation_cache(NAVIGATION_CACHE_NAME);
+        $this->children = new navigation_node_collection();
+        $this->initialise();
+    }
+
+    /**
+     * Initialise the site admin navigation.
+     *
+     * @return array An array of the expandable nodes
+     */
+    public function initialise() {
+        if ($this->initialised || during_initial_install()) {
+            return false;
+        }
+        $this->load_administration_settings();
+        $this->initialised = true;
+    }
+}
+
 /**
  * Simple class used to output a navigation branch in XML
  *
@@ -4421,7 +4532,7 @@ class navigation_json {
         }
         $attributes = array();
         $attributes['id'] = $child->id;
-        $attributes['name'] = $child->text;
+        $attributes['name'] = (string)$child->text; // This can be lang_string object so typecast it.
         $attributes['type'] = $child->type;
         $attributes['key'] = $child->key;
         $attributes['class'] = $child->get_css_type();
index 56b6f56..39a7cec 100644 (file)
@@ -3485,6 +3485,12 @@ class core_renderer_ajax extends core_renderer {
         // unfortunately YUI iframe upload does not support application/json
         if (!empty($_FILES)) {
             @header('Content-type: text/plain; charset=utf-8');
+            if (!core_useragent::supports_json_contenttype()) {
+                @header('X-Content-Type-Options: nosniff');
+            }
+        } else if (!core_useragent::supports_json_contenttype()) {
+            @header('Content-type: text/plain; charset=utf-8');
+            @header('X-Content-Type-Options: nosniff');
         } else {
             @header('Content-type: application/json; charset=utf-8');
         }
index 228080f..4c56703 100644 (file)
@@ -1291,11 +1291,13 @@ function portfolio_include_callback_file($component, $class = null) {
         // Get rid of the first slash (if it exists).
         $component = ltrim($component, '/');
         // Get a list of valid plugin types.
-        $plugintypes = get_plugin_types(false);
+        $plugintypes = core_component::get_plugin_types();
         // Assume it is not valid for now.
         $isvalid = false;
         // Go through the plugin types.
         foreach ($plugintypes as $type => $path) {
+            // Getting the path relative to the dirroot.
+            $path = preg_replace('|^' . preg_quote($CFG->dirroot, '|') . '/|', '', $path);
             if (strrpos($component, $path) === 0) {
                 // Found the plugin type.
                 $isvalid = true;
index d3c3c1e..5525061 100644 (file)
@@ -699,7 +699,6 @@ class core_accesslib_testcase extends advanced_testcase {
         $this->assertSame('role', $event->objecttable);
         $this->assertSame($role->id, $event->objectid);
         $this->assertEquals(context_system::instance(), $event->get_context());
-        $this->assertSame($role->name, $event->other['name']);
         $this->assertSame($role->shortname, $event->other['shortname']);
         $this->assertSame($role->description, $event->other['description']);
         $this->assertSame($role->archetype, $event->other['archetype']);
index 48ec5fd..54dac60 100644 (file)
@@ -1882,6 +1882,13 @@ class core_moodlelib_testcase extends advanced_testcase {
         $this->assertEventLegacyData($user, $event);
         $expectedlogdata = array(SITEID, 'user', 'delete', "view.php?id=$user->id", $user->firstname.' '.$user->lastname);
         $this->assertEventLegacyLogData($expectedlogdata, $event);
+        $eventdata = $event->get_data();
+        $this->assertSame($eventdata['other']['username'], $user->username);
+        $this->assertSame($eventdata['other']['email'], $user->email);
+        $this->assertSame($eventdata['other']['idnumber'], $user->idnumber);
+        $this->assertSame($eventdata['other']['picture'], $user->picture);
+        $this->assertSame($eventdata['other']['mnethostid'], $user->mnethostid);
+        $this->assertEquals($user, $event->get_record_snapshot('user', $event->objectid));
 
         // Try invalid params.
         $record = new stdClass();
index 7d74dd9..ddfadb8 100644 (file)
@@ -64,6 +64,12 @@ class core_useragent_testcase extends basic_testcase {
             '10.0i' => array(
                 'Windows 8' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Trident/6.0; Touch; .NET4.0E; .NET4.0C; Tablet PC 2.0)'
             ),
+            '11.0' => array(
+                'Windows 8.1' => 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0)'
+            ),
+            '11.0i' => array(
+                'Windows 8.1' => ' Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C)'
+            ),
         ),
         'Firefox' => array(
             '1.0.6' => array(
@@ -215,6 +221,7 @@ class core_useragent_testcase extends basic_testcase {
         $this->assertTrue(core_useragent::is_ie());
         $this->assertTrue(core_useragent::check_ie_version());
         $this->assertTrue(core_useragent::check_ie_version('5.0'));
+        $this->assertFalse(core_useragent::check_ie_compatibility_view());
         $this->assertFalse(core_useragent::check_ie_version('7.0'));
 
         core_useragent::instance(true, $this->user_agents['MSIE']['5.0']['Windows 98']);
@@ -222,6 +229,7 @@ class core_useragent_testcase extends basic_testcase {
         $this->assertFalse(core_useragent::check_ie_version());
         $this->assertTrue(core_useragent::check_ie_version(0));
         $this->assertTrue(core_useragent::check_ie_version('5.0'));
+        $this->assertFalse(core_useragent::check_ie_compatibility_view());
         $this->assertFalse(core_useragent::check_ie_version('7.0'));
 
         core_useragent::instance(true, $this->user_agents['MSIE']['9.0']['Windows 7']);
@@ -230,6 +238,7 @@ class core_useragent_testcase extends basic_testcase {
         $this->assertTrue(core_useragent::check_ie_version(0));
         $this->assertTrue(core_useragent::check_ie_version('5.0'));
         $this->assertTrue(core_useragent::check_ie_version('9.0'));
+        $this->assertFalse(core_useragent::check_ie_compatibility_view());
         $this->assertFalse(core_useragent::check_ie_version('10'));
 
         core_useragent::instance(true, $this->user_agents['MSIE']['9.0i']['Windows 7']);
@@ -238,6 +247,7 @@ class core_useragent_testcase extends basic_testcase {
         $this->assertTrue(core_useragent::check_ie_version(0));
         $this->assertTrue(core_useragent::check_ie_version('5.0'));
         $this->assertTrue(core_useragent::check_ie_version('9.0'));
+        $this->assertTrue(core_useragent::check_ie_compatibility_view());
         $this->assertFalse(core_useragent::check_ie_version('10'));
 
         core_useragent::instance(true, $this->user_agents['MSIE']['10.0']['Windows 8']);
@@ -247,6 +257,7 @@ class core_useragent_testcase extends basic_testcase {
         $this->assertTrue(core_useragent::check_ie_version('5.0'));
         $this->assertTrue(core_useragent::check_ie_version('9.0'));
         $this->assertTrue(core_useragent::check_ie_version('10'));
+        $this->assertFalse(core_useragent::check_ie_compatibility_view());
         $this->assertFalse(core_useragent::check_ie_version('11'));
 
         core_useragent::instance(true, $this->user_agents['MSIE']['10.0i']['Windows 8']);
@@ -256,8 +267,31 @@ class core_useragent_testcase extends basic_testcase {
         $this->assertTrue(core_useragent::check_ie_version('5.0'));
         $this->assertTrue(core_useragent::check_ie_version('9.0'));
         $this->assertTrue(core_useragent::check_ie_version('10'));
+        $this->assertTrue(core_useragent::check_ie_compatibility_view());
         $this->assertFalse(core_useragent::check_ie_version('11'));
 
+        core_useragent::instance(true, $this->user_agents['MSIE']['11.0']['Windows 8.1']);
+        $this->assertTrue(core_useragent::is_ie());
+        $this->assertTrue(core_useragent::check_ie_version());
+        $this->assertTrue(core_useragent::check_ie_version(0));
+        $this->assertTrue(core_useragent::check_ie_version('5.0'));
+        $this->assertTrue(core_useragent::check_ie_version('9.0'));
+        $this->assertTrue(core_useragent::check_ie_version('10'));
+        $this->assertTrue(core_useragent::check_ie_version('11'));
+        $this->assertFalse(core_useragent::check_ie_compatibility_view());
+        $this->assertFalse(core_useragent::check_ie_version('12'));
+
+        core_useragent::instance(true, $this->user_agents['MSIE']['11.0i']['Windows 8.1']);
+        $this->assertTrue(core_useragent::is_ie());
+        $this->assertTrue(core_useragent::check_ie_version());
+        $this->assertTrue(core_useragent::check_ie_version(0));
+        $this->assertTrue(core_useragent::check_ie_version('5.0'));
+        $this->assertTrue(core_useragent::check_ie_version('9.0'));
+        $this->assertTrue(core_useragent::check_ie_version('10'));
+        $this->assertTrue(core_useragent::check_ie_version('11'));
+        $this->assertTrue(core_useragent::check_ie_compatibility_view());
+        $this->assertFalse(core_useragent::check_ie_version('12'));
+
         core_useragent::instance(true, $this->user_agents['Firefox']['2.0']['Windows XP']);
         $this->assertTrue(core_useragent::is_firefox());
         $this->assertTrue(core_useragent::check_firefox_version());
index e2b34df..e2a1763 100644 (file)
Binary files a/lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js and b/lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js differ
index fb966a0..e4d3fd5 100644 (file)
Binary files a/lib/yui/build/moodle-core-blocks/moodle-core-blocks-min.js and b/lib/yui/build/moodle-core-blocks/moodle-core-blocks-min.js differ
index 0d3802f..550debb 100644 (file)
Binary files a/lib/yui/build/moodle-core-blocks/moodle-core-blocks.js and b/lib/yui/build/moodle-core-blocks/moodle-core-blocks.js differ
index 55abf69..b62338a 100644 (file)
Binary files a/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-debug.js and b/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-debug.js differ
index 8b5f752..bbe45e4 100644 (file)
Binary files a/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-min.js and b/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-min.js differ
index 098b6a3..5caab5b 100644 (file)
Binary files a/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit.js and b/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit.js differ
index 3cca88a..c3a5730 100644 (file)
Binary files a/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-debug.js and b/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-debug.js differ
index 797a467..d026cfc 100644 (file)
Binary files a/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-min.js and b/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-min.js differ
index 3cca88a..c3a5730 100644 (file)
Binary files a/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip.js and b/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip.js differ
index f3d17d2..6aa9f69 100644 (file)
@@ -113,7 +113,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
             blocklist.each(function(blocknode) {
                 var move = blocknode.one('a.'+CSS.EDITINGMOVE);
                 if (move) {
-                    move.replace(this.get_drag_handle(move.getAttribute('title'), '', 'icon', true));
+                    move.replace(this.get_drag_handle(move.getAttribute('title'), '', 'iconsmall', true));
                     blocknode.one('.'+CSS.HEADER).setStyle('cursor', 'move');
                 }
             }, this);
index ac5e1b6..a7f1e27 100644 (file)
@@ -72,8 +72,8 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, {
         startindex = select.getData('startindex');
         currentindex = select.get('selectedIndex');
 
-        previousindex = select.getAttribute('data-previousindex');
-        select.setAttribute('data-previousindex', currentindex);
+        previousindex = parseInt(select.getData('previousindex'), 10);
+        select.setData('previousindex', currentindex);
         if (!previousindex) {
             previousindex = startindex;
         }
index f48d116..25a4dd7 100644 (file)
@@ -325,9 +325,6 @@ Y.extend(TOOLTIP, M.core.dialogue, {
         // Grab the clickedlink - this contains the URL we fetch and we align the panel to it.
         clickedlink = e.target.ancestor('a', true);
 
-        // Align with the link that was clicked.
-        this.align(clickedlink, this.alignpoints);
-
         // Reset the initial text to a spinner while we retrieve the text.
         this.setAttrs({
             headerContent: this.get('initialheadertext'),
@@ -338,6 +335,9 @@ Y.extend(TOOLTIP, M.core.dialogue, {
         // Now that initial setup has begun, show the panel.
         this.show();
 
+        // Align with the link that was clicked.
+        this.align(clickedlink, this.alignpoints);
+
         // Add some listen events to close on.
         thisevent = this.bb.delegate('click', this.close_panel, SELECTORS.CLOSEBUTTON, this);
         this.listenevents.push(thisevent);
index 8f0803e..cb433d5 100644 (file)
@@ -67,6 +67,10 @@ if (!isloggedin() or isguestuser()) {
     redirect(get_login_url());
 }
 
+$PAGE->set_context(context_user::instance($USER->id));
+$PAGE->set_pagelayout('admin');
+$PAGE->set_course($course);
+
 // do not require change own password cap if change forced
 if (!get_user_preferences('auth_forcepasswordchange', false)) {
     require_capability('moodle/user:changeownpassword', $systemcontext);
@@ -122,8 +126,6 @@ if ($mform->is_cancelled()) {
 
     $fullname = fullname($USER, true);
 
-    $PAGE->navbar->add($fullname, new moodle_url('/user/view.php', array('id'=>$USER->id, 'course'=>$course->id)));
-    $PAGE->navbar->add($strpasswordchanged);
     $PAGE->set_title($strpasswordchanged);
     $PAGE->set_heading($COURSE->fullname);
     echo $OUTPUT->header();
@@ -141,8 +143,6 @@ $strchangepassword = get_string('changepassword');
 
 $fullname = fullname($USER, true);
 
-$PAGE->navbar->add($fullname, new moodle_url('/user/view.php', array('id'=>$USER->id, 'course'=>$course->id)));
-$PAGE->navbar->add($strchangepassword);
 $PAGE->set_title($strchangepassword);
 $PAGE->set_heading($COURSE->fullname);
 echo $OUTPUT->header();
index 394058a..8a49862 100644 (file)
@@ -48,7 +48,7 @@ $systemcontext   = context_system::instance();
 $personalcontext = context_user::instance($user->id);
 
 $PAGE->set_context($personalcontext);
-$PAGE->set_pagelayout('course');
+$PAGE->set_pagelayout('admin');
 $PAGE->requires->js_init_call('M.core_message.init_editsettings');
 
 // check access control
diff --git a/mod/assign/feedback/editpdf/ajax_progress.php b/mod/assign/feedback/editpdf/ajax_progress.php
new file mode 100644 (file)
index 0000000..184a957
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Process concurrent ajax request.
+ * ALL RETURNED INFO IS PUBLIC.
+ *
+ * @package assignfeedback_editpdf
+ * @copyright  2013 Jerome Mouneyrac
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+define('AJAX_SCRIPT', true);
+// To be able to process concurrent ajax request with the generate pdf ajax request we can not use cookie.
+define('NO_MOODLE_COOKIES', true);
+
+use \assignfeedback_editpdf\document_services;
+require_once('../../../../config.php');
+
+try {
+    $assignmentid = required_param('assignmentid', PARAM_INT);
+    $userid = required_param('userid', PARAM_INT);
+    $attemptnumber = required_param('attemptnumber', PARAM_INT);
+
+    // Retrieve the assignments.
+    require_once($CFG->dirroot . '/mod/assign/locallib.php');
+    $cm = get_coursemodule_from_instance('assign', $assignmentid, 0, false, MUST_EXIST);
+    $context = context_module::instance($cm->id);
+    $assignment = new assign($context, null, null);
+
+    // Get the generated images from file API call.
+    $grade = $assignment->get_user_grade($userid, false, $attemptnumber);
+
+    // Check we found a grade.
+    if (empty($grade)) {
+        throw new coding_exception('grade not found');
+    }
+
+    $component = 'assignfeedback_editpdf';
+    $filearea = document_services::PAGE_IMAGE_FILEAREA;
+    $filepath = '/';
+    $fs = get_file_storage();
+    $files = $fs->get_directory_files($context->id, $component, $filearea, $grade->id, $filepath);
+
+    // The important security part: we ONLY RETURN the total NUMBER of generated images.
+    echo $OUTPUT->header();
+    echo json_encode(count($files));
+    echo $OUTPUT->footer();
+} catch (Exception $e) {
+    // This should never happened!
+    // Return a 500 HTTP header so Y.io gets it as a failure.
+    if (substr(php_sapi_name(), 0, 3) == 'cgi') {
+        header("Status: 500 Internal Server Error");
+    } else {
+        header('HTTP/1.0 500 Internal Server Error');
+    }
+    throw new moodle_exception('An exception was caught but can not be returned for security purpose.
+        To easily debug, comment the try catch.');
+}
index 9fe930a..4acef80 100644 (file)
@@ -242,6 +242,47 @@ class document_services {
         return $file;
     }
 
+    /**
+     * This function will return the number of pages of a pdf.
+     * @param int|\assign $assignment
+     * @param int $userid
+     * @param int $attemptnumber (-1 means latest attempt)
+     * @return int number of pages
+     */
+    public static function page_number_for_attempt($assignment, $userid, $attemptnumber) {
+        global $CFG;
+
+        require_once($CFG->libdir . '/pdflib.php');
+
+        $assignment = self::get_assignment_from_param($assignment);
+
+        if (!$assignment->can_view_submission($userid)) {
+            \print_error('nopermission');
+        }
+
+        // Get a combined pdf file from all submitted pdf files.
+        $file = self::get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber);
+        if (!$file) {
+            \print_error('Could not generate combined pdf.');
+        }
+
+        // Store the combined pdf file somewhere to be opened by tcpdf.
+        $tmpdir = \make_temp_directory('assignfeedback_editpdf/pagetotal/'
+            . self::hash($assignment, $userid, $attemptnumber));
+        $combined = $tmpdir . '/' . self::COMBINED_PDF_FILENAME;
+        $file->copy_content_to($combined); // Copy the file.
+
+        // Get the total number of pages.
+        $pdf = new pdf();
+        $pagecount = $pdf->set_pdf($combined);
+
+        // Delete temporary folders and files.
+        @unlink($combined);
+        @rmdir($tmpdir);
+
+        return $pagecount;
+    }
+
     /**
      * This function will generate and return a list of the page images from a pdf.
      * @param int|\assign $assignment
@@ -263,7 +304,7 @@ class document_services {
         // Need to generate the page images - first get a combined pdf.
         $file = self::get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber);
         if (!$file) {
-            throw \moodle_exception('Could not generate combined pdf.');
+            throw new \moodle_exception('Could not generate combined pdf.');
         }
 
         $tmpdir = \make_temp_directory('assignfeedback_editpdf/pageimages/' . self::hash($assignment, $userid, $attemptnumber));
@@ -275,14 +316,8 @@ class document_services {
         $pdf->set_image_folder($tmpdir);
         $pagecount = $pdf->set_pdf($combined);
 
-        $i = 0;
-        $images = array();
-        for ($i = 0; $i < $pagecount; $i++) {
-            $images[$i] = $pdf->get_image($i);
-        }
         $grade = $assignment->get_user_grade($userid, true, $attemptnumber);
 
-        $files = array();
         $record = new \stdClass();
         $record->contextid = $assignment->get_context()->id;
         $record->component = 'assignfeedback_editpdf';
@@ -291,11 +326,14 @@ class document_services {
         $record->filepath = '/';
         $fs = \get_file_storage();
 
-        foreach ($images as $index => $image) {
+        $files = array();
+        for ($i = 0; $i < $pagecount; $i++) {
+            $image = $pdf->get_image($i);
             $record->filename = basename($image);
-            $files[$index] = $fs->create_file_from_pathname($record, $tmpdir . '/' . $image);
+            $files[$i] = $fs->create_file_from_pathname($record, $tmpdir . '/' . $image);
             @unlink($tmpdir . '/' . $image);
         }
+
         @unlink($combined);
         @rmdir($tmpdir);
 
@@ -407,7 +445,7 @@ class document_services {
         // Need to generate the page images - first get a combined pdf.
         $file = self::get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber);
         if (!$file) {
-            throw \moodle_exception('Could not generate combined pdf.');
+            throw new \moodle_exception('Could not generate combined pdf.');
         }
 
         $tmpdir = \make_temp_directory('assignfeedback_editpdf/final/' . self::hash($assignment, $userid, $attemptnumber));
index e77bf36..a5d32e0 100644 (file)
@@ -198,7 +198,16 @@ class assignfeedback_editpdf_renderer extends plugin_renderer_base {
                                        'pageheader');
         $body = $pageheader;
 
-        $loading = $this->pix_icon('i/loading', get_string('loadingeditor', 'assignfeedback_editpdf'), 'moodle', array('class'=>'loading'));
+        // Loading progress bar.
+        $progressbar = html_writer::div('', 'bar', array('style' => 'width: 0%'));
+        $progressbar = html_writer::div($progressbar, 'progress progress-info progress-striped active',
+            array('title' => get_string('loadingeditor', 'assignfeedback_editpdf'),
+                  'role'=> 'progressbar', 'aria-valuenow' => 0, 'aria-valuemin' => 0,
+                  'aria-valuemax' => 100));
+        $progressbarlabel = html_writer::div(get_string('generatingpdf', 'assignfeedback_editpdf'),
+            'progressbarlabel');
+        $loading = html_writer::div($progressbar . $progressbarlabel, 'loading');
+
         $canvas = html_writer::div($loading, 'drawingcanvas');
         $body .= html_writer::div($canvas, 'drawingregion');
 
@@ -214,7 +223,8 @@ class assignfeedback_editpdf_renderer extends plugin_renderer_base {
                                     'userid'=>$widget->userid,
                                     'attemptnumber'=>$widget->attemptnumber,
                                     'stampfiles'=>$widget->stampfiles,
-                                    'readonly'=>$widget->readonly));
+                                    'readonly'=>$widget->readonly,
+                                    'pagetotal'=>$widget->pagetotal));
 
         $this->page->requires->yui_module('moodle-assignfeedback_editpdf-editor',
                                           'M.assignfeedback_editpdf.editor.init',
index 5fba725..83b17c7 100644 (file)
@@ -47,6 +47,8 @@ class assignfeedback_editpdf_widget implements renderable {
     public $stampfiles = array();
     /** @var bool $readonly */
     public $readonly = true;
+    /** @var integer $pagetotal */
+    public $pagetotal = 0;
 
     /**
      * Constructor
@@ -57,8 +59,10 @@ class assignfeedback_editpdf_widget implements renderable {
      * @param string $downloadfilename - Name of the generated pdf.
      * @param string[] $stampfiles - The file names of the stamps.
      * @param bool $readonly - Show the readonly interface (no tools).
+     * @param integer $pagetotal - The total number of pages.
      */
-    public function __construct($assignment, $userid, $attemptnumber, $downloadurl, $downloadfilename, $stampfiles, $readonly) {
+    public function __construct($assignment, $userid, $attemptnumber, $downloadurl,
+                                $downloadfilename, $stampfiles, $readonly, $pagetotal) {
         $this->assignment = $assignment;
         $this->userid = $userid;
         $this->attemptnumber = $attemptnumber;
@@ -66,5 +70,6 @@ class assignfeedback_editpdf_widget implements renderable {
         $this->downloadfilename = $downloadfilename;
         $this->stampfiles = $stampfiles;
         $this->readonly = $readonly;
+        $this->pagetotal = $pagetotal;
     }
 }
index ed7ffcc..c6f18d3 100644 (file)
@@ -66,6 +66,7 @@ $string['pagenumber'] = 'Page {$a}';
 $string['pagexofy'] = 'Page {$a->page} of {$a->total}';
 $string['pen'] = 'Pen';
 $string['pluginname'] = 'Annotate PDF';
+$string['generatingpdf'] = 'Generating the PDF...';
 $string['rectangle'] = 'Rectangle';
 $string['red'] = 'Red';
 $string['result'] = 'Result:';
index c7372bf..1df66f3 100644 (file)
@@ -131,6 +131,10 @@ class assign_feedback_editpdf extends assign_feedback_plugin {
            $filename = $feedbackfile->get_filename();
         }
 
+        // Retrieve total number of pages.
+        $pagetotal = document_services::page_number_for_attempt($this->assignment->get_instance()->id,
+                $userid,
+                $attempt);
 
         $widget = new assignfeedback_editpdf_widget($this->assignment->get_instance()->id,
                                                     $userid,
@@ -138,7 +142,8 @@ class assign_feedback_editpdf extends assign_feedback_plugin {
                                                     $url,
                                                     $filename,
                                                     $stampfiles,
-                                                    $readonly);
+                                                    $readonly,
+                                                    $pagetotal);
         return $widget;
     }
 
index 71326ea..1e5e122 100644 (file)
@@ -240,3 +240,131 @@ ul.assignfeedback_editpdf_menu {
     padding-left: 20px;
     padding-right: 4px;
 }
+.assignfeedback_editpdf_widget .drawingcanvas .loading .progressbarlabel {
+    text-align: center;
+}
+
+/**
+ * Bootstrap 2.3.2 progress bar css.
+ * Required for none bootstrap theme.
+ */
+
+@-webkit-keyframes progress-bar-stripes {
+    from {
+        background-position: 40px 0;
+    }
+    to {
+        background-position: 0 0;
+    }
+}
+
+@-moz-keyframes progress-bar-stripes {
+    from {
+        background-position: 40px 0;
+    }
+    to {
+        background-position: 0 0;
+    }
+}
+
+@-ms-keyframes progress-bar-stripes {
+    from {
+        background-position: 40px 0;
+    }
+    to {
+        background-position: 0 0;
+    }
+}
+
+@-o-keyframes progress-bar-stripes {
+    from {
+        background-position: 0 0;
+    }
+    to {
+        background-position: 40px 0;
+    }
+}
+
+@keyframes progress-bar-stripes {
+    from {
+        background-position: 40px 0;
+    }
+    to {
+        background-position: 0 0;
+    }
+}
+
+.progress {
+    height: 20px;
+    margin-bottom: 20px;
+    overflow: hidden;
+    background-color: #f7f7f7;
+    background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9);
+    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));
+    background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);
+    background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);
+    background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9);
+    background-repeat: repeat-x;
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);
+    -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+    -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
+.progress .bar {
+    float: left;
+    width: 0;
+    height: 100%;
+    font-size: 12px;
+    color: #ffffff;
+    text-align: center;
+    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+    background-color: #0e90d2;
+    background-image: -moz-linear-gradient(top, #149bdf, #0480be);
+    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));
+    background-image: -webkit-linear-gradient(top, #149bdf, #0480be);
+    background-image: -o-linear-gradient(top, #149bdf, #0480be);
+    background-image: linear-gradient(to bottom, #149bdf, #0480be);
+    background-repeat: repeat-x;
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);
+    -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+    -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+    -webkit-box-sizing: border-box;
+    -moz-box-sizing: border-box;
+    box-sizing: border-box;
+    -webkit-transition: width 0.6s ease;
+    -moz-transition: width 0.6s ease;
+    -o-transition: width 0.6s ease;
+    transition: width 0.6s ease;
+}
+
+.progress .bar + .bar {
+    -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+    -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+    box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+}
+
+.progress-striped .bar {
+    background-color: #149bdf;
+    background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
+    background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+    background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+    background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+    -webkit-background-size: 40px 40px;
+    -moz-background-size: 40px 40px;
+    -o-background-size: 40px 40px;
+    background-size: 40px 40px;
+}
+
+.progress.active .bar {
+    -webkit-animation: progress-bar-stripes 2s linear infinite;
+    -moz-animation: progress-bar-stripes 2s linear infinite;
+    -ms-animation: progress-bar-stripes 2s linear infinite;
+    -o-animation: progress-bar-stripes 2s linear infinite;
+    animation: progress-bar-stripes 2s linear infinite;
+}
\ No newline at end of file
index e5d01da..fa2c392 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js differ
index 57cfd6d..5dbd8ac 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js differ
index e5d01da..fa2c392 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js differ
index d7c87d8..03964ed 100644 (file)
@@ -279,10 +279,10 @@ EDITOR.prototype = {
                 bodyContent: this.get('body'),
                 footerContent: this.get('footer'),
                 width: '840px',
-                visible: true
+                visible: false,
+                draggable: true
             });
 
-            this.dialogue.centerDialogue();
             // Add custom class for styling.
             this.dialogue.get('boundingBox').addClass(CSS.DIALOGUE);
 
@@ -298,9 +298,9 @@ EDITOR.prototype = {
 
                 this.refresh_button_state();
             }
-        } else {
-            this.dialogue.show();
         }
+        this.dialogue.centerDialogue();
+        this.dialogue.show();
 
         this.load_all_pages();
     },
@@ -311,30 +311,88 @@ EDITOR.prototype = {
      */
     load_all_pages : function() {
         var ajaxurl = AJAXBASE,
-            config;
+            config,
+            checkconversionstatus,
+            ajax_error_total;
 
         config = {
             method: 'get',
             context: this,
             sync: false,
             data : {
-                'sesskey' : M.cfg.sesskey,
-                'action' : 'loadallpages',
-                'userid' : this.get('userid'),
-                'attemptnumber' : this.get('attemptnumber'),
-                'assignmentid' : this.get('assignmentid')
+                sesskey : M.cfg.sesskey,
+                action : 'loadallpages',
+                userid : this.get('userid'),
+                attemptnumber : this.get('attemptnumber'),
+                assignmentid : this.get('assignmentid')
             },
             on: {
                 success: function(tid, response) {
                     this.all_pages_loaded(response.responseText);
                 },
                 failure: function(tid, response) {
-                    return M.core.exception(response.responseText);
+                    return new M.core.exception(response.responseText);
                 }
             }
         };
 
         Y.io(ajaxurl, config);
+
+        // If pages are not loaded, check PDF conversion status for the progress bar.
+        if (this.pagecount <= 0) {
+            checkconversionstatus = {
+                method: 'get',
+                context: this,
+                sync: false,
+                data : {
+                    sesskey : M.cfg.sesskey,
+                    action : 'conversionstatus',
+                    userid : this.get('userid'),
+                    attemptnumber : this.get('attemptnumber'),
+                    assignmentid : this.get('assignmentid')
+                },
+                on: {
+                    success: function(tid, response) {
+                        ajax_error_total = 0;
+                        if (this.pagecount === 0) {
+                            var pagetotal = this.get('pagetotal');
+
+                            // Update the progress bar.
+                            var progressbarcontainer = Y.one(SELECTOR.PROGRESSBARCONTAINER);
+                            var progressbar = progressbarcontainer.one('.bar');
+                            if (progressbar) {
+                                // Calculate progress.
+                                var progress = (response.response / pagetotal) * 100;
+                                progressbar.setStyle('width', progress + '%');
+                                progressbarcontainer.setAttribute('aria-valuenow', progress);
+                            }
+
+                            // New ajax request delayed of a second.
+                            Y.later(1000, this, function () {
+                                Y.io(AJAXBASEPROGRESS, checkconversionstatus);
+                            });
+                        }
+                    },
+                    failure: function(tid, response) {
+                        ajax_error_total = ajax_error_total + 1;
+                        // We only continue on error if the all pages were not generated,
+                        // and if the ajax call did not produce 5 errors in the row.
+                        if (this.pagecount === 0 && ajax_error_total < 5) {
+                            Y.later(1000, this, function () {
+                                Y.io(AJAXBASEPROGRESS, checkconversionstatus);
+                            });
+                        }
+                        return new M.core.exception(response.responseText);
+                    }
+                }
+            };
+            // We start the AJAX "generated page total number" call a second later to give a chance to
+            // the AJAX "combined pdf generation" call to clean the previous submission images.
+            Y.later(1000, this, function () {
+                ajax_error_total = 0;
+                Y.io(AJAXBASEPROGRESS, checkconversionstatus);
+            });
+        }
     },
 
     /**
@@ -801,7 +859,7 @@ EDITOR.prototype = {
                     }
                 },
                 failure: function(tid, response) {
-                    return M.core.exception(response.responseText);
+                    return new M.core.exception(response.responseText);
                 }
             }
         };
@@ -996,6 +1054,10 @@ Y.extend(EDITOR, Y.Base, EDITOR.prototype, {
         stampfiles : {
             validator : Y.Lang.isArray,
             value : ''
+        },
+        pagetotal : {
+            validator : Y.Lang.isInteger,
+            value : 0
         }
     }
 });
index 20b8de9..4ba472c 100644 (file)
@@ -19,6 +19,7 @@
  * @module moodle-assignfeedback_editpdf-editor
  */
 var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php',
+    AJAXBASEPROGRESS = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax_progress.php',
     CSS = {
         DIALOGUE : 'assignfeedback_editpdf_widget'
     },
@@ -30,6 +31,7 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php',
         SEARCHCOMMENTSLIST : '.assignfeedback_editpdf_commentsearch ul',
         PAGESELECT : '.' + CSS.DIALOGUE + ' .navigate-page-select',
         LOADINGICON : '.' + CSS.DIALOGUE + ' .loading',
+        PROGRESSBARCONTAINER : '.' + CSS.DIALOGUE + ' .progress-info.progress-striped',
         DRAWINGREGION : '.' + CSS.DIALOGUE + ' .drawingregion',
         DRAWINGCANVAS : '.' + CSS.DIALOGUE + ' .drawingcanvas',
         SAVE : '.' + CSS.DIALOGUE + ' .savebutton',
index d61a409..c34bd30 100644 (file)
@@ -144,7 +144,7 @@ function toolbook_importhtml_import_chapters($package, $type, $book, $context, $
                 foreach ($allchapters as $target) {
                     if ($target->importsrc === $chapterpath) {
                         $newcontent = str_replace($match, 'href="'.new moodle_url('/mod/book/view.php',
-                                array('id'=>$context->instanceid, 'chapter'=>$target->id)).'"', $newcontent);
+                                array('id'=>$context->instanceid, 'chapterid'=>$target->id)).'"', $newcontent);
                     }
                 }
             }
index b48df08..c51d33e 100644 (file)
@@ -274,14 +274,13 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
             continue;
         }
         $cm = $modinfo->cms[$cmid];
-        $cm->lasttime = $mcm->lasttime;
         if (!$modinfo->cms[$cm->id]->uservisible) {
             continue;
         }
 
         if (groups_get_activity_groupmode($cm) != SEPARATEGROUPS
          or has_capability('moodle/site:accessallgroups', context_module::instance($cm->id))) {
-            if ($timeout > time() - $cm->lasttime) {
+            if ($timeout > time() - $mcm->lasttime) {
                 $current[] = $cm;
             } else {
                 $past[] = $cm;
@@ -314,8 +313,8 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
              continue;
         }
 
-        $cm->lasttime = $mcm->lasttime;
-        if ($timeout > time() - $cm->lasttime) {
+        $mcms[$cmid]->lasttime = $mcm->lasttime;
+        if ($timeout > time() - $mcm->lasttime) {
             $current[] = $cm;
         } else {
             $past[] = $cm;
@@ -333,7 +332,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
 
         foreach ($past as $cm) {
             $link = $CFG->wwwroot.'/mod/chat/view.php?id='.$cm->id;
-            $date = userdate($cm->lasttime, $strftimerecent);
+            $date = userdate($mcms[$cm->id]->lasttime, $strftimerecent);
             echo '<div class="head"><div class="date">'.$date.'</div></div>';
             echo '<div class="info"><a href="'.$link.'">'.format_string($cm->name,true).'</a></div>';
         }
@@ -371,7 +370,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
             }
 
             $link = $CFG->wwwroot.'/mod/chat/view.php?id='.$cm->id;
-            $date = userdate($cm->lasttime, $strftimerecent);
+            $date = userdate($mcms[$cm->id]->lasttime, $strftimerecent);
 
             echo '<div class="head"><div class="date">'.$date.'</div></div>';
             echo '<div class="info"><a href="'.$link.'">'.format_string($cm->name,true).'</a></div>';
index 0651c4b..8adce53 100644 (file)
@@ -90,7 +90,7 @@ if ($mode == 'singletemplate') {
 $PAGE->requires->js('/mod/data/data.js');
 $PAGE->set_title($data->name);
 $PAGE->set_heading($course->fullname);
-$PAGE->set_pagelayout('report');
+$PAGE->set_pagelayout('admin');
 echo $OUTPUT->header();
 echo $OUTPUT->heading(format_string($data->name), 2);
 echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
index 2afcabc..8763021 100644 (file)
@@ -8322,8 +8322,14 @@ function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false,
             }
             // Get the forum in question
             $forum = $forums[$forumid];
-            // This is needed for functionality later on in the forum code....
-            $forum->cm = $cm;
+
+            // This is needed for functionality later on in the forum code. It is converted to an object
+            // because the cm_info is readonly from 2.6. This is a dirty hack because some other parts of the
+            // code were expecting an writeable object. See {@link forum_print_post()}.
+            $forum->cm = new stdClass();
+            foreach ($cm as $key => $value) {
+                $forum->cm->$key = $value;
+            }
 
             // Check that either the current user can view the forum, or that the
             // current user has capabilities over the requested user and the requested
index 4b3afcd..0f4aa79 100644 (file)
@@ -15,7 +15,7 @@ Feature: Students can edit or delete their forum posts within a set time limit
       | user | course | role |
       | student1 | C1 | student |
     And I log in as "admin"
-    And I expand "Site administration" node
+    And I go to notifications page
     And I expand "Security" node
     And I follow "Site policies"
     And I select "1 minutes" from "Maximum time to edit posts"
index 3f32ec1..f0fdcf6 100644 (file)
@@ -1168,7 +1168,7 @@ function lti_ensure_url_is_https($url) {
     } else {
         //If the URL starts with http, replace with https
         if (stripos($url, 'http://') === 0) {
-            $url = 'https://' . substr($url, 8);
+            $url = 'https://' . substr($url, 7);
         }
     }
 
index 2c3f392..33a2187 100644 (file)
@@ -139,4 +139,10 @@ class mod_lti_locallib_testcase extends basic_testcase {
 
         lti_verify_sourcedid($ltiinstance, $parsed);
     }
+
+    public function test_lti_ensure_url_is_https() {
+        $this->assertEquals('https://moodle.org', lti_ensure_url_is_https('http://moodle.org'));
+        $this->assertEquals('https://moodle.org', lti_ensure_url_is_https('moodle.org'));
+        $this->assertEquals('https://moodle.org', lti_ensure_url_is_https('https://moodle.org'));
+    }
 }
index 57d559e..805f5ad 100644 (file)
Binary files a/pix/a/add_file.png and b/pix/a/add_file.png differ
diff --git a/pix/a/add_file.svg b/pix/a/add_file.svg
new file mode 100644 (file)
index 0000000..300eabf
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="-1 0 16 16" style="overflow:visible;enable-background:new -1 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M10,15H8H1.2C1.1,15,1,14.9,1,14.7V1.2C1,1.1,1.1,1,1.2,1H9v4h4v4h1V5.2c0-0.7-0.4-1.6-0.9-2.1\r
+       l-2.2-2.2C10.4,0.4,9.4,0,8.8,0H1.2C0.6,0,0,0.6,0,1.2v13.5C0,15.4,0.6,16,1.2,16H10V15z M10,1.4c0.1,0,2.5,2.5,2.6,2.6H10V1.4z\r
+        M15,14h-2v2h-2v-2H9v-2h2v-2h2v2h2V14z"/>\r
+</svg>\r
index 643bc98..a62537c 100644 (file)
Binary files a/pix/a/create_folder.png and b/pix/a/create_folder.png differ
diff --git a/pix/a/create_folder.svg b/pix/a/create_folder.svg
new file mode 100644 (file)
index 0000000..ca1a63f
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1.5 16 16" style="overflow:visible;enable-background:new 0 -1.5 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#989898;" d="M9,9.5v4H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h6c0.5,0,1,0.5,1,1v1.5h7c0.5,0,1,0.5,1,1v6h-1v-2h-4\r
+       v2H9z M16,10.5h-2v-2h-2v2h-2v2h2v2h2v-2h2V10.5z"/>\r
+</svg>\r
index 7520b39..f2d450b 100644 (file)
Binary files a/pix/a/download_all.png and b/pix/a/download_all.png differ
diff --git a/pix/a/download_all.svg b/pix/a/download_all.svg
new file mode 100644 (file)
index 0000000..9cc13cd
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M16,9v6c0,0.5-0.5,1-1,1h-1H2H1c-0.5,0-1-0.5-1-1V9c0-0.5,0.5-1,1-1h1c0.5,0,1,0.5,1,1v4h10V9\r
+       c0-0.5,0.5-1,1-1h1C15.5,8,16,8.5,16,9z M12.4,5.1l-0.7-0.7c-0.4-0.4-1-0.4-1.4,0L9.5,5.2V1c0-0.5-0.4-1-1-1h-1c-0.5,0-1,0.5-1,1\r
+       v4.2L5.7,4.4C5.3,4,4.7,4,4.3,4.4L3.6,5.1c-0.4,0.4-0.4,1,0,1.4l3.7,3.7c0.2,0.2,0.5,0.3,0.7,0.3c0.3,0,0.5-0.1,0.7-0.3l3.7-3.7\r
+       C12.8,6.2,12.8,5.5,12.4,5.1z"/>\r
+</svg>\r
index 5c822c3..e577b35 100644 (file)
Binary files a/pix/a/help.png and b/pix/a/help.png differ
diff --git a/pix/a/help.svg b/pix/a/help.svg
new file mode 100644 (file)
index 0000000..ae84f9c
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M8,0C3.6,0,0,3.6,0,8c0,4.4,3.6,8,8,8c4.4,0,8-3.6,8-8C16,3.6,12.4,0,8,0z M8,14c-3.3,0-6-2.7-6-6\r
+       s2.7-6,6-6s6,2.7,6,6S11.3,14,8,14z M5.8,6.6c-0.6,0-1-0.4-1-1C4.7,4.5,5.9,3,8.1,3c1.4,0,3.4,1,3.4,2.6c0,0.8-0.5,1.5-1.5,1.9\r
+       C8.5,8,9.3,9.1,8,9.1C7.4,9.1,7,8.8,7,8.2c0-1.2,1.2-1.8,1.2-3c0-0.3-0.1-0.7-0.5-0.7c-0.4,0-0.4,0.4-0.4,0.7\r
+       C7.2,6.1,6.7,6.6,5.8,6.6z M7.9,13.1c-0.8,0-1.5-0.7-1.5-1.5S7,10,7.9,10c0.8,0,1.5,0.7,1.5,1.5S8.7,13.1,7.9,13.1z"/>\r
+</svg>\r
index 6091248..e8eff8e 100644 (file)
Binary files a/pix/a/logout.png and b/pix/a/logout.png differ
diff --git a/pix/a/logout.svg b/pix/a/logout.svg
new file mode 100644 (file)
index 0000000..09a2416
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#989898;" d="M9,16H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h8v2H3C2.4,2,2,2.4,2,3v10c0,0.6,0.4,1,1,1h6V16z M5,7.5\r
+       v1c0,0.5,0.5,1,1,1h4.7l-1.1,1.1c-0.4,0.4-0.4,1,0,1.4l0.7,0.7c0.4,0.4,1,0.4,1.4,0l4-4c0.4-0.4,0.4-1,0-1.4l-4-4\r
+       c-0.4-0.4-1-0.4-1.4,0L9.6,4c-0.4,0.4-0.4,1,0,1.4l1,1H6C5.5,6.5,5,7,5,7.5z"/>\r
+</svg>\r
index 485448f..9c849d1 100644 (file)
Binary files a/pix/a/refresh.png and b/pix/a/refresh.png differ
diff --git a/pix/a/refresh.svg b/pix/a/refresh.svg
new file mode 100644 (file)
index 0000000..6bf89c5
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M7.9,16c4,0,7.4-3,7.8-7h-3c-0.5,2-2.5,4-4.9,4c-2.8,0-5-2.2-5-5c0-2.8,2.2-5,5-5c1.1,0,2.1,0,3,1h-1\r
+       C9.3,4,9,4.5,9,5.1v1C9,6.6,9.3,7,9.8,7h4h1C15.4,7,16,6.6,16,6.1v-1v-4C16,0.5,15.4,0,14.8,0h-1C13.3,0,13,0.5,13,1.1v0.9\r
+       c-1-1.1-3.1-1.8-5-1.8C3.6,0.2,0,3.7,0,8.1C0,12.4,3.5,16,7.9,16z"/>\r
+</svg>\r
index df78b8c..1331a0d 100644 (file)
Binary files a/pix/a/search.png and b/pix/a/search.png differ
diff --git a/pix/a/search.svg b/pix/a/search.svg
new file mode 100644 (file)
index 0000000..3f9b279
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="-0.1 -0.1 16 16"\r
+        style="overflow:visible;enable-background:new -0.1 -0.1 16 16;" xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M15.5,13.4l-2.1-2.1c-0.2-0.2-0.4-0.3-0.6-0.3C13.6,9.8,14,8.4,14,7c0-3.9-3.1-7-7-7C3.1,0,0,3.1,0,7\r
+       c0,1.9,0.7,3.6,2,5c1.3,1.3,3.1,2,5,2c1.4,0,2.8-0.4,3.9-1.2c0.1,0.2,0.2,0.4,0.3,0.6l2.1,2.1c0.6,0.6,1.5,0.6,2.1,0\r
+       S16.1,13.9,15.5,13.4z M7,11l0,1.5L7,11c-1.1,0-2.1-0.4-2.8-1.2C3.4,9.1,3,8.1,3,7c0-2.2,1.8-4,4-4c2.2,0,4,1.8,4,4\r
+       c0,1.1-0.4,2.1-1.2,2.8C9.1,10.6,8.1,11,7,11z"/>\r
+</svg>\r
index 89040d9..592c0c3 100644 (file)
Binary files a/pix/a/setting.png and b/pix/a/setting.png differ
diff --git a/pix/a/setting.svg b/pix/a/setting.svg
new file mode 100644 (file)
index 0000000..29ba063
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M15.9,9.3C16,8.9,16,8.4,16,8s0-0.9-0.1-1.3l-2.1-0.4c-0.1-0.4-0.3-0.8-0.5-1.2l1.2-1.8\r
+       C14,2.6,13.4,2,12.6,1.5l-1.8,1.2c-0.4-0.2-0.8-0.4-1.2-0.5L9.3,0.1C8.9,0,8.4,0,8,0S7.1,0,6.7,0.1L6.3,2.2C5.9,2.4,5.5,2.5,5.1,2.7\r
+       L3.4,1.5C2.6,2,2,2.6,1.5,3.4l1.2,1.8C2.5,5.5,2.4,5.9,2.2,6.3L0.1,6.7C0,7.1,0,7.6,0,8c0,0.4,0,0.9,0.1,1.3l2.1,0.4\r
+       c0.1,0.4,0.3,0.8,0.5,1.2l-1.2,1.8C2,13.4,2.6,14,3.4,14.5l1.8-1.2c0.4,0.2,0.8,0.4,1.2,0.5l0.4,2.1C7.1,16,7.6,16,8,16\r
+       s0.9,0,1.3-0.1l0.4-2.1c0.4-0.1,0.8-0.3,1.2-0.5l1.8,1.2c0.7-0.5,1.3-1.1,1.9-1.9l-1.2-1.8c0.2-0.4,0.4-0.8,0.5-1.2L15.9,9.3z M8,10\r
+       c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2s2,0.9,2,2C10,9.1,9.1,10,8,10z"/>\r
+</svg>\r
diff --git a/pix/a/view_icon_active.png b/pix/a/view_icon_active.png
new file mode 100644 (file)
index 0000000..d844557
Binary files /dev/null and b/pix/a/view_icon_active.png differ
diff --git a/pix/a/view_icon_active.svg b/pix/a/view_icon_active.svg
new file mode 100644 (file)
index 0000000..4d3d66f
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1 16 16" style="overflow:visible;enable-background:new 0 -1 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M9,14h7V8H9V14z M14,10v2h-3v-2H14z M7,8H0v6h7V8z M2,12v-2h3v2H2z M9,0v6h7V0H9z M14,4h-3V2h3V4z\r
+        M7,0H0v6h7V0z M2,4V2h3v2H2z"/>\r
+</svg>\r
diff --git a/pix/a/view_list_active.png b/pix/a/view_list_active.png
new file mode 100644 (file)
index 0000000..8917489
Binary files /dev/null and b/pix/a/view_list_active.png differ
diff --git a/pix/a/view_list_active.svg b/pix/a/view_list_active.svg
new file mode 100644 (file)
index 0000000..7f70988
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1 16 16" style="overflow:visible;enable-background:new 0 -1 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M16,14H0v-2h16V14z M0,10h16V8H0V10z M16,4H0v2h16V4z M16,2V0H0v2H16z"/>\r
+</svg>\r
diff --git a/pix/a/view_tree_active.png b/pix/a/view_tree_active.png
new file mode 100644 (file)
index 0000000..c3c0a38
Binary files /dev/null and b/pix/a/view_tree_active.png differ
diff --git a/pix/a/view_tree_active.svg b/pix/a/view_tree_active.svg
new file mode 100644 (file)
index 0000000..9ceb5f7
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1 16 16" style="overflow:visible;enable-background:new 0 -1 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M10,12h6v2h-6V12z M8,14v-2H6v2H8z M8,10h8V8H8V10z M4,8v2h2V8H4z M6,6h10V4H6V6z M2,4v2h2V4H2z M4,0\r
+       v2h12V0H4z M2,0H0v2h2V0z"/>\r
+</svg>\r
diff --git a/question/tests/behat/delete_questions.feature b/question/tests/behat/delete_questions.feature
new file mode 100644 (file)
index 0000000..41e0b78
--- /dev/null
@@ -0,0 +1,50 @@
+@core @core_question
+Feature: A teacher can delete questions in the question bank
+  In order to remove unused questions from the question bank
+  As a teacher
+  I need to delete questions
+
+  Background:
+    Given the following "users" exists:
+      | username | firstname | lastname | email |
+      | teacher1 | Teacher | 1 | teacher1@asd.com |
+    And the following "courses" exists:
+      | fullname | shortname | format |
+      | Course 1 | C1 | weeks |
+    And the following "course enrolments" exists:
+      | user | course | role |
+      | teacher1 | C1 | editingteacher |
+    And I log in as "teacher1"
+    And I follow "Course 1"
+    And I add a "Essay" question filling the form with:
+      | Question name | Test question name |
+      | Question text | Write about whatever you want |
+    And I follow "Course 1"
+
+  @javascript
+  Scenario: Delete a question not used in a quiz
+    Given I follow "Question bank"
+    And I click on "Delete" "link" in the "Test question name" "table_row"
+    When I press "Continue"
+    Then I should not see "Test question name"
+
+  @javascript
+  Scenario: Delete a question used in a quiz
+    Given I turn editing mode on
+    And I add a "Quiz" to section "1" and I fill the form with:
+      | Name | Test quiz |
+    And I follow "Test quiz"
+    And I follow "Edit quiz"
+    And I follow "Show"
+    And I click on "Add to quiz" "link" in the "Test question name" "table_row"
+    And I follow "Course 1"
+    And I follow "Question bank"
+    And I click on "Delete" "link" in the "Test question name" "table_row"
+    When I press "Continue"
+    Then I should not see "Test question name"
+    And I click on "Also show old questions" "checkbox"
+    And I should see "Test question name"
+    And I follow "Course 1"
+    And I follow "Test quiz"
+    And I click on "Preview quiz now" "button"
+    And I should see "Write about whatever you want"
\ No newline at end of file
index 5959379..202e51e 100644 (file)
@@ -64,7 +64,7 @@ if ($mode === 'today') {
 
 $stractivityreport = get_string('activityreport');
 
-$PAGE->set_pagelayout('admin');
+$PAGE->set_pagelayout('report');
 $PAGE->set_url('/report/log/user.php', array('id'=>$user->id, 'course'=>$course->id, 'mode'=>$mode));
 $PAGE->navigation->extend_for_user($user);
 $PAGE->navigation->set_userid_for_parent_checks($user->id); // see MDL-25805 for reasons and for full commit reference for reversal when fixed.
index 7bb84d8..3b13a78 100644 (file)
@@ -38,7 +38,12 @@ $inpopup = optional_param('inpopup', 0, PARAM_BOOL);
 
 $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
 
-require_login($course);
+if ($course->id == SITEID) {
+    require_login();
+    $PAGE->set_context(context_system::instance());
+} else {
+    require_login($course);
+}
 
 $context = context_course::instance($course->id);
 require_capability('report/loglive:view', $context);
index 9bd0475..a66b11a 100644 (file)
@@ -48,6 +48,7 @@ if ($USER->id != $user->id and has_capability('moodle/user:viewuseractivitiesrep
 } else {
     require_login($course);
 }
+$PAGE->set_url('/report/outline/user.php', array('id'=>$userid, 'course'=>$courseid, 'mode'=>$mode));
 
 if (!report_outline_can_access_user_report($user, $course, true)) {
     require_capability('report/outline:view', $coursecontext);
@@ -55,7 +56,7 @@ if (!report_outline_can_access_user_report($user, $course, true)) {
 
 $stractivityreport = get_string('activityreport');
 
-$PAGE->set_pagelayout('admin');
+$PAGE->set_pagelayout('report');
 $PAGE->set_url('/report/outline/user.php', array('id'=>$user->id, 'course'=>$course->id, 'mode'=>$mode));
 $PAGE->navigation->extend_for_user($user);
 $PAGE->navigation->set_userid_for_parent_checks($user->id); // see MDL-25805 for reasons and for full commit reference for reversal when fixed.
index 0ab4c04..408fd25 100644 (file)
@@ -66,6 +66,7 @@ $PAGE->set_url(new moodle_url('/report/stats/index.php', array('course' => $cour
                                                                'time'   => $time,
                                                                'mode'   => $mode,
                                                                'userid' => $userid)));
+navigation_node::override_active_url(new moodle_url('/report/stats/index.php', array('course' => $course->id)));
 
 // Trigger a content view event.
 $event = \report_stats\event\content_viewed::create(array('courseid' => $course->id,
index 42364af..68bef48 100644 (file)
@@ -51,7 +51,7 @@ if (!report_stats_can_access_user_report($user, $course, true)) {
 
 $stractivityreport = get_string('activityreport');
 
-$PAGE->set_pagelayout('admin');
+$PAGE->set_pagelayout('report');
 $PAGE->set_url('/report/stats/user.php', array('id'=>$user->id, 'course'=>$course->id));
 $PAGE->navigation->extend_for_user($user);
 $PAGE->navigation->set_userid_for_parent_checks($user->id); // see MDL-25805 for reasons and for full commit reference for reversal when fixed.
diff --git a/theme/base/pix/fp/add_file.png b/theme/base/pix/fp/add_file.png
new file mode 100644 (file)
index 0000000..805f5ad
Binary files /dev/null and b/theme/base/pix/fp/add_file.png differ
diff --git a/theme/base/pix/fp/add_file.svg b/theme/base/pix/fp/add_file.svg
new file mode 100644 (file)
index 0000000..300eabf
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="-1 0 16 16" style="overflow:visible;enable-background:new -1 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M10,15H8H1.2C1.1,15,1,14.9,1,14.7V1.2C1,1.1,1.1,1,1.2,1H9v4h4v4h1V5.2c0-0.7-0.4-1.6-0.9-2.1\r
+       l-2.2-2.2C10.4,0.4,9.4,0,8.8,0H1.2C0.6,0,0,0.6,0,1.2v13.5C0,15.4,0.6,16,1.2,16H10V15z M10,1.4c0.1,0,2.5,2.5,2.6,2.6H10V1.4z\r
+        M15,14h-2v2h-2v-2H9v-2h2v-2h2v2h2V14z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/create_folder.png b/theme/base/pix/fp/create_folder.png
new file mode 100644 (file)
index 0000000..a62537c
Binary files /dev/null and b/theme/base/pix/fp/create_folder.png differ
diff --git a/theme/base/pix/fp/create_folder.svg b/theme/base/pix/fp/create_folder.svg
new file mode 100644 (file)
index 0000000..ca1a63f
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1.5 16 16" style="overflow:visible;enable-background:new 0 -1.5 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#989898;" d="M9,9.5v4H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h6c0.5,0,1,0.5,1,1v1.5h7c0.5,0,1,0.5,1,1v6h-1v-2h-4\r
+       v2H9z M16,10.5h-2v-2h-2v2h-2v2h2v2h2v-2h2V10.5z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/download_all.png b/theme/base/pix/fp/download_all.png
new file mode 100644 (file)
index 0000000..f2d450b
Binary files /dev/null and b/theme/base/pix/fp/download_all.png differ
diff --git a/theme/base/pix/fp/download_all.svg b/theme/base/pix/fp/download_all.svg
new file mode 100644 (file)
index 0000000..9cc13cd
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M16,9v6c0,0.5-0.5,1-1,1h-1H2H1c-0.5,0-1-0.5-1-1V9c0-0.5,0.5-1,1-1h1c0.5,0,1,0.5,1,1v4h10V9\r
+       c0-0.5,0.5-1,1-1h1C15.5,8,16,8.5,16,9z M12.4,5.1l-0.7-0.7c-0.4-0.4-1-0.4-1.4,0L9.5,5.2V1c0-0.5-0.4-1-1-1h-1c-0.5,0-1,0.5-1,1\r
+       v4.2L5.7,4.4C5.3,4,4.7,4,4.3,4.4L3.6,5.1c-0.4,0.4-0.4,1,0,1.4l3.7,3.7c0.2,0.2,0.5,0.3,0.7,0.3c0.3,0,0.5-0.1,0.7-0.3l3.7-3.7\r
+       C12.8,6.2,12.8,5.5,12.4,5.1z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/help.png b/theme/base/pix/fp/help.png
new file mode 100644 (file)
index 0000000..e577b35
Binary files /dev/null and b/theme/base/pix/fp/help.png differ
diff --git a/theme/base/pix/fp/help.svg b/theme/base/pix/fp/help.svg
new file mode 100644 (file)
index 0000000..ae84f9c
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M8,0C3.6,0,0,3.6,0,8c0,4.4,3.6,8,8,8c4.4,0,8-3.6,8-8C16,3.6,12.4,0,8,0z M8,14c-3.3,0-6-2.7-6-6\r
+       s2.7-6,6-6s6,2.7,6,6S11.3,14,8,14z M5.8,6.6c-0.6,0-1-0.4-1-1C4.7,4.5,5.9,3,8.1,3c1.4,0,3.4,1,3.4,2.6c0,0.8-0.5,1.5-1.5,1.9\r
+       C8.5,8,9.3,9.1,8,9.1C7.4,9.1,7,8.8,7,8.2c0-1.2,1.2-1.8,1.2-3c0-0.3-0.1-0.7-0.5-0.7c-0.4,0-0.4,0.4-0.4,0.7\r
+       C7.2,6.1,6.7,6.6,5.8,6.6z M7.9,13.1c-0.8,0-1.5-0.7-1.5-1.5S7,10,7.9,10c0.8,0,1.5,0.7,1.5,1.5S8.7,13.1,7.9,13.1z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/logout.png b/theme/base/pix/fp/logout.png
new file mode 100644 (file)
index 0000000..e8eff8e
Binary files /dev/null and b/theme/base/pix/fp/logout.png differ
diff --git a/theme/base/pix/fp/logout.svg b/theme/base/pix/fp/logout.svg
new file mode 100644 (file)
index 0000000..09a2416
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#989898;" d="M9,16H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h8v2H3C2.4,2,2,2.4,2,3v10c0,0.6,0.4,1,1,1h6V16z M5,7.5\r
+       v1c0,0.5,0.5,1,1,1h4.7l-1.1,1.1c-0.4,0.4-0.4,1,0,1.4l0.7,0.7c0.4,0.4,1,0.4,1.4,0l4-4c0.4-0.4,0.4-1,0-1.4l-4-4\r
+       c-0.4-0.4-1-0.4-1.4,0L9.6,4c-0.4,0.4-0.4,1,0,1.4l1,1H6C5.5,6.5,5,7,5,7.5z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/refresh.png b/theme/base/pix/fp/refresh.png
new file mode 100644 (file)
index 0000000..9c849d1
Binary files /dev/null and b/theme/base/pix/fp/refresh.png differ
diff --git a/theme/base/pix/fp/refresh.svg b/theme/base/pix/fp/refresh.svg
new file mode 100644 (file)
index 0000000..6bf89c5
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M7.9,16c4,0,7.4-3,7.8-7h-3c-0.5,2-2.5,4-4.9,4c-2.8,0-5-2.2-5-5c0-2.8,2.2-5,5-5c1.1,0,2.1,0,3,1h-1\r
+       C9.3,4,9,4.5,9,5.1v1C9,6.6,9.3,7,9.8,7h4h1C15.4,7,16,6.6,16,6.1v-1v-4C16,0.5,15.4,0,14.8,0h-1C13.3,0,13,0.5,13,1.1v0.9\r
+       c-1-1.1-3.1-1.8-5-1.8C3.6,0.2,0,3.7,0,8.1C0,12.4,3.5,16,7.9,16z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/search.png b/theme/base/pix/fp/search.png
new file mode 100644 (file)
index 0000000..1331a0d
Binary files /dev/null and b/theme/base/pix/fp/search.png differ
diff --git a/theme/base/pix/fp/search.svg b/theme/base/pix/fp/search.svg
new file mode 100644 (file)
index 0000000..3f9b279
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="-0.1 -0.1 16 16"\r
+        style="overflow:visible;enable-background:new -0.1 -0.1 16 16;" xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M15.5,13.4l-2.1-2.1c-0.2-0.2-0.4-0.3-0.6-0.3C13.6,9.8,14,8.4,14,7c0-3.9-3.1-7-7-7C3.1,0,0,3.1,0,7\r
+       c0,1.9,0.7,3.6,2,5c1.3,1.3,3.1,2,5,2c1.4,0,2.8-0.4,3.9-1.2c0.1,0.2,0.2,0.4,0.3,0.6l2.1,2.1c0.6,0.6,1.5,0.6,2.1,0\r
+       S16.1,13.9,15.5,13.4z M7,11l0,1.5L7,11c-1.1,0-2.1-0.4-2.8-1.2C3.4,9.1,3,8.1,3,7c0-2.2,1.8-4,4-4c2.2,0,4,1.8,4,4\r
+       c0,1.1-0.4,2.1-1.2,2.8C9.1,10.6,8.1,11,7,11z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/setting.png b/theme/base/pix/fp/setting.png
new file mode 100644 (file)
index 0000000..592c0c3
Binary files /dev/null and b/theme/base/pix/fp/setting.png differ
diff --git a/theme/base/pix/fp/setting.svg b/theme/base/pix/fp/setting.svg
new file mode 100644 (file)
index 0000000..29ba063
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M15.9,9.3C16,8.9,16,8.4,16,8s0-0.9-0.1-1.3l-2.1-0.4c-0.1-0.4-0.3-0.8-0.5-1.2l1.2-1.8\r
+       C14,2.6,13.4,2,12.6,1.5l-1.8,1.2c-0.4-0.2-0.8-0.4-1.2-0.5L9.3,0.1C8.9,0,8.4,0,8,0S7.1,0,6.7,0.1L6.3,2.2C5.9,2.4,5.5,2.5,5.1,2.7\r
+       L3.4,1.5C2.6,2,2,2.6,1.5,3.4l1.2,1.8C2.5,5.5,2.4,5.9,2.2,6.3L0.1,6.7C0,7.1,0,7.6,0,8c0,0.4,0,0.9,0.1,1.3l2.1,0.4\r
+       c0.1,0.4,0.3,0.8,0.5,1.2l-1.2,1.8C2,13.4,2.6,14,3.4,14.5l1.8-1.2c0.4,0.2,0.8,0.4,1.2,0.5l0.4,2.1C7.1,16,7.6,16,8,16\r
+       s0.9,0,1.3-0.1l0.4-2.1c0.4-0.1,0.8-0.3,1.2-0.5l1.8,1.2c0.7-0.5,1.3-1.1,1.9-1.9l-1.2-1.8c0.2-0.4,0.4-0.8,0.5-1.2L15.9,9.3z M8,10\r
+       c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2s2,0.9,2,2C10,9.1,9.1,10,8,10z"/>\r
+</svg>\r
index 1aade6b..d844557 100644 (file)
Binary files a/theme/base/pix/fp/view_icon_active.png and b/theme/base/pix/fp/view_icon_active.png differ
diff --git a/theme/base/pix/fp/view_icon_active.svg b/theme/base/pix/fp/view_icon_active.svg
new file mode 100644 (file)
index 0000000..4d3d66f
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1 16 16" style="overflow:visible;enable-background:new 0 -1 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M9,14h7V8H9V14z M14,10v2h-3v-2H14z M7,8H0v6h7V8z M2,12v-2h3v2H2z M9,0v6h7V0H9z M14,4h-3V2h3V4z\r
+        M7,0H0v6h7V0z M2,4V2h3v2H2z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/view_icon_inactive.png b/theme/base/pix/fp/view_icon_inactive.png
deleted file mode 100644 (file)
index d4eca1d..0000000
Binary files a/theme/base/pix/fp/view_icon_inactive.png and /dev/null differ
diff --git a/theme/base/pix/fp/view_icon_selected.png b/theme/base/pix/fp/view_icon_selected.png
deleted file mode 100644 (file)
index 2d6c45e..0000000
Binary files a/theme/base/pix/fp/view_icon_selected.png and /dev/null differ
index e0977a0..8917489 100644 (file)
Binary files a/theme/base/pix/fp/view_list_active.png and b/theme/base/pix/fp/view_list_active.png differ
diff --git a/theme/base/pix/fp/view_list_active.svg b/theme/base/pix/fp/view_list_active.svg
new file mode 100644 (file)
index 0000000..7f70988
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1 16 16" style="overflow:visible;enable-background:new 0 -1 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M16,14H0v-2h16V14z M0,10h16V8H0V10z M16,4H0v2h16V4z M16,2V0H0v2H16z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/view_list_inactive.png b/theme/base/pix/fp/view_list_inactive.png
deleted file mode 100644 (file)
index b20c068..0000000
Binary files a/theme/base/pix/fp/view_list_inactive.png and /dev/null differ
diff --git a/theme/base/pix/fp/view_list_selected.png b/theme/base/pix/fp/view_list_selected.png
deleted file mode 100644 (file)
index 5d2e2cb..0000000
Binary files a/theme/base/pix/fp/view_list_selected.png and /dev/null differ
index 8819de3..c3c0a38 100644 (file)
Binary files a/theme/base/pix/fp/view_tree_active.png and b/theme/base/pix/fp/view_tree_active.png differ
diff --git a/theme/base/pix/fp/view_tree_active.svg b/theme/base/pix/fp/view_tree_active.svg
new file mode 100644 (file)
index 0000000..9ceb5f7
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1 16 16" style="overflow:visible;enable-background:new 0 -1 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M10,12h6v2h-6V12z M8,14v-2H6v2H8z M8,10h8V8H8V10z M4,8v2h2V8H4z M6,6h10V4H6V6z M2,4v2h2V4H2z M4,0\r
+       v2h12V0H4z M2,0H0v2h2V0z"/>\r
+</svg>\r
diff --git a/theme/base/pix/fp/view_tree_inactive.png b/theme/base/pix/fp/view_tree_inactive.png
deleted file mode 100644 (file)
index 68402b8..0000000
Binary files a/theme/base/pix/fp/view_tree_inactive.png and /dev/null differ
diff --git a/theme/base/pix/fp/view_tree_selected.png b/theme/base/pix/fp/view_tree_selected.png
deleted file mode 100644 (file)
index 37ee7d6..0000000
Binary files a/theme/base/pix/fp/view_tree_selected.png and /dev/null differ
index 274a139..939e0a5 100644 (file)
@@ -1466,7 +1466,7 @@ img#persona_signin { cursor: pointer; }
 .moodle-actionmenu > ul,
 .moodle-actionmenu > ul > li {display: inline-block;}
 .moodle-actionmenu ul {padding: 0;margin: 0;list-style-type: none;}
-.moodle-actionmenu a.hidden {display: none;}
+#page .moodle-actionmenu a.hidden {display: none;}
 .moodle-actionmenu .toggle-display,
 .moodle-actionmenu .menu-action-text {display: none;}
 
@@ -1495,22 +1495,30 @@ img#persona_signin { cursor: pointer; }
 .dir-rtl .moodle-actionmenu[data-enhanced].show .menu {text-align: right;right: auto;left: 0;}
 .dir-rtl .moodle-actionmenu[data-enhanced].show .menu .iconsmall {margin-right: 0;margin-left: 8px;}
 
-.menu.align-tl-bl {top: 100%;left: 0;margin-top: 4px;}
-.menu.align-tr-bl {top: 100%;right: 100%;}
-.menu.align-bl-bl {bottom: 100%;left: 0;}
-.menu.align-br-bl {right: 100%;bottom: 100%;}
-.menu.align-tl-br {top: 100%;left: 100%;}
-.menu.align-tr-br {top: 100%;right: 0;margin-top: 4px;}
-.menu.align-bl-br {bottom: 100%;left: 100%;}
-.menu.align-br-br {right: 0;bottom: 100%;}
-.menu.align-tl-tl {top: 0;left: 0;}
-.menu.align-tr-tl {top: 0;right: 100%;margin-right: 4px;}
-.menu.align-bl-tl {bottom: 100%;left: 0;margin-bottom: 4px;}
-.menu.align-br-tl {right: 100%;bottom: 100%;}
-.menu.align-tl-tr {top: 0;left: 100%;margin-left: 4px;}
-.menu.align-tr-tr {top: 0;right: 0;}
-.menu.align-bl-tr {bottom: 100%;left: 100%;}
-.menu.align-br-tr {right: 0;bottom: 100%;margin-bottom: 4px;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-tl-bl {top: 100%;left: 0;margin-top: 4px;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-tr-bl {top: 100%;right: 100%;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-bl-bl {bottom: 100%;left: 0;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-br-bl {right: 100%;bottom: 100%;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-tl-br {top: 100%;left: 100%;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-tr-br {top: 100%;right: 0;margin-top: 4px;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-bl-br {bottom: 100%;left: 100%;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-br-br {right: 0;bottom: 100%;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-tl-tl {top: 0;left: 0;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-tr-tl {top: 0;right: 100%;margin-right: 4px;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-bl-tl {bottom: 100%;left: 0;margin-bottom: 4px;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-br-tl {right: 100%;bottom: 100%;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-tl-tr {top: 0;left: 100%;margin-left: 4px;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-tr-tr {top: 0;right: 0;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-bl-tr {bottom: 100%;left: 100%;}
+.jsenabled .moodle-actionmenu[data-enhanced] .menu.align-br-tr {right: 0;bottom: 100%;margin-bottom: 4px;}
+
+.moodle-actionmenu > ul > li[role="menuitem"] {
+    display: none;
+}
+
+.jsenabled .moodle-actionmenu[data-enhance="moodle-core-actionmenu"] > ul > li[role="menuitem"] {
+    display: inline-block;
+}
 
 .dir-rtl .menu.align-tl-bl {right: 0;left: auto;}
 .dir-rtl .menu.align-tr-bl {right: auto;left: 100%;}
index 6a2033f..5eca08e 100644 (file)
 .site-topic ul.section,
 .course-content ul.section { margin: 1em;}
 .sitetopic .section .activity img.activityicon,
-.course-content .section .activity img.activityicon {vertical-align:text-bottom;margin-right: 6px;}
-.dir-rtl .sitetopic .section .activity img.activityicon,
-.dir-rtl .course-content .section .activity img.activityicon {margin-left: 6px; margin-right: 0;}
+.course-content .section .activity img.activityicon {
+    vertical-align: middle;
+    margin-right: 3px;
+    margin-left: 3px;
+    width: 24px;
+    height: 24px;
+}
+.section .activity .activityinstance .instancename {
+    vertical-align: bottom;
+}
 .sitetopic .section .activity .activityinstance,
 .course-content .section .activity .activityinstance,
 .sitetopic .section .activity .activityinstance div,
 .course-content .section .activity .activityinstance div { display: inline;}
 .sitetopic .section .activity .activityinstance,
-.course-content .section .activity .activityinstance { padding-right: 3em; }
+.course-content .section .activity .activityinstance { padding-right: 1em; }
 .dir-rtl .sitetopic .section .activity .activityinstance,
 .dir-rtl .course-content .section .activity .activityinstance { padding-right: 0; padding-left: 3em;}
 .sitetopic .section .activity .commands,
-.course-content .section .activity .commands { white-space: nowrap; display: inline-block; }
-.section .activity .moodle-actionmenu .menubar > li > * {display:inline-block;min-height:16px;padding: 0.2em;}
-.section .activity .moodle-actionmenu .menubar > li > img {margin: 0.2em;vertical-align: text-bottom;padding:0 3px 0 0;}
-.section .activity .moodle-actionmenu .iconsmall {vertical-align: baseline;width:16px;height:16px;}
+.course-content .section .activity .commands { white-space: nowrap; display: inline-block; padding: 0 3em 0 0;}
+.dir-rtl .sitetopic .section .activity .commands,
+.dir-rtl .course-content .section .activity .commands { padding: 0 0 0 3em;}
+
+.section .activity .moodle-actionmenu .menu > li > *,
+.section .activity .moodle-actionmenu .menubar > li > * {
+    display: inline-block;
+    min-height: 16px;
+}
+.section .activity .moodle-actionmenu[data-enhanced] .menu > li > * {
+    display: block;
+}
+.section .activity .moodle-actionmenu .menubar > li > img {
+    margin-right: 5px;
+    vertical-align: text-bottom;
+    padding:0 3px 0 0;
+}
+.section .activity .moodle-actionmenu[data-enhanced] .menu {margin-left: -2.8em;}
+.section img.iconsmall {
+    vertical-align: middle;
+    width: 16px;
+    height: 16px;
+    margin: 4px;
+}
 .single-section h3.sectionname {text-align:center;clear:both;}
 .sitetopic .section li.activity,
 .course-content .section li.activity {padding: .2em;}
@@ -190,7 +217,7 @@ li.section.hidden span.commands a.editing_show {cursor:default;}
 /* Quick edit of module name */
 
 .sitetopic .section .activity form.activityinstance,
-.course-content .section .activity form.activityinstance { display: inline; vertical-align: bottom; }
+.course-content .section .activity form.activityinstance { display: inline; vertical-align: middle; }
 span.editinstructions {
     position: absolute;
     top: 0px;
index 16e31d6..a0727ca 100644 (file)
@@ -2,50 +2,50 @@
  * File Picker and File Manager
  */
 
-.filemanager, .file-picker {font-size:11px;color: #555555;letter-spacing: .2px;}
+.filemanager, .file-picker {font-size:11px;color:#555555;letter-spacing:.2px;}
 .filemanager a, .file-picker a {color:#555555;}
-.filemanager a:hover, .file-picker a:hover {color:#555555;text-decoration: none;}
+.filemanager a:hover, .file-picker a:hover {color:#555555;text-decoration:none;}
 .filemanager select, .filemanager input, .filemanager button, .filemanager textarea,
-.file-picker select, .file-picker input, .file-picker button, .file-picker textarea {color:#555555; letter-spacing: .2px;}
-.filemanager input[type="text"], .file-picker input[type="text"] {border: 1px solid #BBBBBB;width: 265px;height: 18px;padding: 1px 6px;}
-.filemanager select, .file-picker select {height: 22px;padding: 2px 1px;}
-.fp-content-center {height: 100%;width: 100%;display:table-cell;vertical-align: middle;}
-.fp-content-hidden {visibility: hidden;}
+.file-picker select, .file-picker input, .file-picker button, .file-picker textarea {color:#555555;letter-spacing:.2px;}
+.filemanager input[type="text"], .file-picker input[type="text"] {border:1px solid #BBBBBB;width:265px;height:18px;padding:1px 6px;}
+.filemanager select, .file-picker select {height:22px;padding:2px 1px;}
+.fp-content-center {height:100%;width:100%;display:table-cell;vertical-align:middle;}
+.fp-content-hidden {visibility:hidden;}
 
 /*
  * Dialogue (File Picker and File Manager)
  */
-.yui3-panel-focused {outline: none;}
-#filesskin .yui3-panel-content {padding-bottom: 20px;background: #F2F2F2;border-radius: 8px;border: 1px solid #FFFFFF;display: inline-block;-webkit-box-shadow: 5px 5px 20px 0px #666666;-moz-box-shadow: 5px 5px 20px 0px #666666;box-shadow: 5px 5px 20px 0px #666666;}
-#filesskin .yui3-widget-hd {border-radius: 10px 10px 0px 0px;border-bottom: 1px solid #BBBBBB;padding:5px 5px 5px 5px;text-align: center;font-size:12px;letter-spacing: 1px;color:#333333; text-shadow: 1px 1px 1px #FFFFFF;filter: dropshadow(color=#FFFFFF, offx=1, offy=1);
-background: #E2E2E2;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#CCCCCC');background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#CCCCCC));background: -moz-linear-gradient(top,  #FFFFFF,  #CCCCCC);}
-.fp-panel-button {background: #FFFFFF;padding: 3px 20px 2px 20px; text-align: center;margin:10px; border-radius: 10px;display: inline-block;-webkit-box-shadow: 2px 2px 3px .1px #999999;-moz-box-shadow: 2px 2px 3px .1px #999999;box-shadow: 2px 2px 3px .1px #999999;}
+.yui3-panel-focused {outline:none;}
+#filesskin .yui3-panel-content {padding-bottom:20px;background:#F2F2F2;border-radius:8px;border:1px solid #FFFFFF;display:inline-block;-webkit-box-shadow:5px 5px 20px 0px #666666;-moz-box-shadow:5px 5px 20px 0px #666666;box-shadow:5px 5px 20px 0px #666666;}
+#filesskin .yui3-widget-hd {border-radius:10px 10px 0px 0px;border-bottom:1px solid #BBBBBB;padding:5px 5px 5px 5px;text-align:center;font-size:12px;letter-spacing:1px;color:#333333;text-shadow:1px 1px 1px #FFFFFF;filter:dropshadow(color=#FFFFFF, offx=1, offy=1);
+background:#E2E2E2;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#CCCCCC');background:-webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#CCCCCC));background:-moz-linear-gradient(top,  #FFFFFF,  #CCCCCC);}
+.fp-panel-button {background:#FFFFFF;padding:3px 20px 2px 20px;text-align:center;margin:10px;border-radius:10px;display:inline-block;-webkit-box-shadow:2px 2px 3px .1px #999999;-moz-box-shadow:2px 2px 3px .1px #999999;box-shadow:2px 2px 3px .1px #999999;}
 .moodle-dialogue-base .filepicker .moodle-dialogue-wrap .moodle-dialogue-bd {
-    padding: 0px;
+    padding:0px;
 }
 
 /*
  * File Picker layout
  */
-#filesskin .file-picker.fp-generallayout {width: 859px;background: #FFFFFF;border-radius:10px;border: 1px solid #CCCCCC;position: relative;}
+#filesskin .file-picker.fp-generallayout {width:859px;background:#FFFFFF;border-radius:10px;border:1px solid #CCCCCC;position:relative;}
 .file-picker .fp-repo-area {width:180px;overflow:auto;float:left;height:525px;border-right:1px solid #BBBBBB}
-.dir-rtl .file-picker .fp-repo-area {border-left:1px solid #BBBBBB; border-right: none; float: right;}
-.file-picker .fp-repo-items {float:left; width:693px;}
+.dir-rtl .file-picker .fp-repo-area {border-left:1px solid #BBBBBB;border-right:none;float:right;}
+.file-picker .fp-repo-items {float:left;width:693px;}
 .dir-rtl .file-picker .fp-repo-items {float:right;}
-.file-picker .fp-navbar {background: #F2F2F2;min-height:22px;border-bottom: 1px solid #BBBBBB;padding: 5px 8px;}
-.file-picker .fp-content {background: #FFFFFF;clear: both;overflow:auto;height: 468px;}
-.filepicker.moodle-dialogue-fullscreen .file-picker .fp-content { width: 100%; }
+.file-picker .fp-navbar {background:#F2F2F2;min-height:48px;border-bottom:1px solid #BBBBBB;padding:5px 8px;}
+.file-picker .fp-content {background:#FFFFFF;clear:both;overflow:auto;height:432px;}
+.filepicker.moodle-dialogue-fullscreen .file-picker .fp-content {width:100%;}
 
-.file-picker .fp-content-loading {height: 100%;width: 100%;display: table;text-align:center;}
+.file-picker .fp-content-loading {height:100%;width:100%;display:table;text-align:center;}
 .file-picker .fp-content .fp-object-container {width:98%;height:98%;}
 
 .dir-rtl .file-picker .fp-list {text-align:right;}
 .dir-rtl .file-picker .fp-toolbar {padding:0;}
 .dir-rtl .file-picker .fp-list {text-align:right;}
 .dir-rtl .file-picker .fp-repo-name {display:inline;}
-.dir-rtl .file-picker .fp-pathbar {text-align: right; display: block; border-top: none;}
+.dir-rtl .file-picker .fp-pathbar {text-align:right;display:block;border-top:none;}
 .dir-rtl .file-picker div.bd {text-align:right;}
-.dir-rtl #filemenu .yuimenuitemlabel {text-align: right;}
+.dir-rtl #filemenu .yuimenuitemlabel {text-align:right;}
 .dir-rtl .filepicker .yui-layout-unit-left {left:500px;}
 .dir-rtl .filepicker .yui-layout-unit-center {left:0px;}
 
@@ -61,116 +61,111 @@ background: #E2E2E2;filter: progid:DXImageTransform.Microsoft.gradient(startColo
 .dir-rtl .file-picker .fp-list {text-align:right;float:left;}
 .file-picker .fp-list .fp-repo a{display:block;padding:.5em .7em;}
 .file-picker .fp-list .fp-repo.active {background:#F2F2F2;}
-.file-picker .fp-list .fp-repo-icon {padding: 0 7px 0 5px; vertical-align: text-bottom;}
+.file-picker .fp-list .fp-repo-icon {padding:0 7px 0 5px;vertical-align:text-bottom;}
 
 /*
  * Tools, Path & View on fp-navbar (File Picker and File Manager)
  */
-.fp-toolbar {display: table-row;line-height: 22px;float:left; max-width: 70%;}
-
-.dir-rtl .fp-toolbar {float: right;}
-
+.fp-toolbar {display:table-row;line-height:22px;float:left;max-width:70%;}
+.dir-rtl .fp-toolbar {float:right;}
 .fp-toolbar.empty {display:none;}
 .fp-toolbar .disabled {display:none;}
-.fp-toolbar div {display: inline-block;padding: 0px 2px;padding-right: 10px;}
-.dir-rtl .fp-toolbar div {width:100px;}
-.fp-toolbar img {vertical-align: -15%; margin-right: 5px;}
-
-.fp-toolbar .fp-tb-search {width: 228px;height: 14px;}
-.fp-toolbar .fp-tb-search input {background:#FFFFFF url('[[pix:a/search]]') no-repeat 3px 3px;padding: 2px 6px 1px 20px;width: 200px;height: 16px;border: 1px solid #BBBBBB;}
-
-.fp-viewbar {float:right;width:69px;height:22px;margin-right:8px;}
-.dir-rtl .fp-toolbar img {vertical-align: -35%;}
-.dir-rtl .fp-viewbar {float: left;width: 100px;}
-
-.fp-vb-icons {background:url('[[pix:theme|fp/view_icon_active]]') no-repeat 0 0;width:22px;height:22px;display: inline-block;}
-.dir-rtl .fp-vb-icons {background:url('[[pix:theme|fp/view_icon_active]]') no-repeat 0 0; display: block; float:left; margin-right: 4px;}
-.fp-vb-icons.checked {background:url('[[pix:theme|fp/view_icon_selected]]');}
-.dir-rtl .fp-vb-icons.checked {background:url('[[pix:theme|fp/view_icon_selected]]'); display: block; float:left; margin-right: 4px;}
-.fp-viewbar.disabled .fp-vb-icons {background:url('[[pix:theme|fp/view_icon_inactive]]');}
-.fp-vb-details {background:url('[[pix:theme|fp/view_list_active]]') no-repeat 0px 0px;width:23px;height:22px;display: inline-block;margin-left: -4px;}
-.dir-rtl .fp-vb-details {background:url('[[pix:theme|fp/view_list_active]]') no-repeat 0px 0px; display: block; float:left;  margin-right: 4px;}
-.fp-vb-details.checked {background:url('[[pix:theme|fp/view_list_selected]]');}
-.dir-rtl .fp-vb-details.checked {background:url('[[pix:theme|fp/view_list_selected]]'); display: block; float:left; margin-right: 4px;}
-.fp-viewbar.disabled .fp-vb-details {background:url('[[pix:theme|fp/view_list_inactive]]');}
-.fp-vb-tree {background:url('[[pix:theme|fp/view_tree_active]]') no-repeat 0px 0px;width:23px;height:22px;display: inline-block;margin-left: -4px;}
-.dir-rtl .fp-vb-tree {background:url('[[pix:theme|fp/view_tree_active]]') no-repeat 0px 0px; display: block; float:left;  margin-right: 4px;}
-.fp-vb-tree.checked {background:url('[[pix:theme|fp/view_tree_selected]]');}
-.dir-rtl .fp-vb-tree.checked {background:url('[[pix:theme|fp/view_tree_selected]]'); display: block; float:left; margin-right: 4px;}
-.fp-viewbar.disabled .fp-vb-tree {background:url('[[pix:theme|fp/view_tree_inactive]]');}
-.file-picker .fp-clear-left {clear: left;}
+.file-picker .fp-toolbar div, .fp-navbar .filemanager-toolbar .fp-toolbar div {float:left;margin:9px 0 9px 9px;background:#FFFFFF;border:1px solid #CCCCCC;border-bottom:1px solid #B3B3B3;border-radius:4px;width:40px;height:30px;}
+.fp-toolbar div {display:block;}
+.fp-toolbar a {display:block;height:30px;width:40px;}
+.fp-toolbar a:hover {background-image:radial-gradient(ellipse at center, #ffffff 60%,#dfdfdf 100%);background-color:#ebebeb;}
+.fp-toolbar a:active {background-image:radial-gradient(ellipse at center, #ffffff 40%,#dfdfdf 100%);background-color:#dfdfdf;}
+.dir-rtl .fp-navbar .filemanager-toolbar .fp-toolbar div {margin:9px 9px 9px 0;}
+.file-picker .fp-toolbar div.disabled {display:none;}
+.fp-toolbar img {vertical-align:-15%;margin:7px 12px;}
+.fp-toolbar .fp-tb-search {width:228px;height:14px;}
+.fp-toolbar .fp-tb-search input {background:#FFFFFF url('[[pix:a/search]]') no-repeat 3px 3px;padding:2px 6px 1px 20px;width:200px;height:16px;border:1px solid #BBBBBB;}
+.fp-navbar .filemanager-toolbar .fp-toolbar
+.dir-rtl .fp-toolbar img {vertical-align:-35%;}
+.dir-rtl .file-picker .fp-viewbar, .dir-rtl .fp-navbar .filemanager-toolbar .fp-viewbar {float:left;}
+.dir-rtl .file-picker .fp-viewbar {margin-left:0;}
+.file-picker .fp-viewbar, .fp-navbar .filemanager-toolbar .fp-viewbar {float:right;margin:9px; background:white;border:1px solid #CCCCCC;border-radius:4px;border-bottom:1px solid #B3B3B3;height:30px;}
+.fp-viewbar .fp-vb-icons, .fp-viewbar .fp-vb-details, .fp-viewbar .fp-vb-tree {width:40px;height:30px;display:block;float:left;border-right:1px solid #CCCCCC;}
+.fp-viewbar a.fp-vb-icons {border-radius:4px 0 0 4px;}
+.fp-viewbar .fp-vb-tree {border-right:0;border-radius:0 4px 4px 0;}
+.fp-viewbar a img {margin:7px 12px;}
+.fp-viewbar a:hover {background-image:radial-gradient(ellipse at center, #ffffff 60%,#dfdfdf 100%);background-color:#ebebeb;}
+.fp-viewbar a:active {background-image:radial-gradient(ellipse at center, #ffffff 40%,#dfdfdf 100%);background-color:#dfdfdf;}
+.fp-viewbar a.checked {background-color:#dfdfdf;}
+.fp-viewbar.disabled a {opacity:.45;background:none;cursor:default;}
+.file-picker .fp-clear-left {clear:left;}
 
 /* over ride hover rule from core.css*/
 .dir-rtl .filemanager-toolbar .fp-vb-icons a:hover {background:url('[[pix:theme|fp/view_icon_selected]]');}
 .dir-rtl .filemanager-toolbar .fp-vb-icons.checked a:hover {background:url('[[pix:theme|fp/view_icon_active]]') no-repeat 0 0;}
-.dir-rtl .fp-vb-details a:hover {background:none; border:20px solid black}
-.dir-rtl .fp-vb-details.checked a:hover {background:none; border:40px solid black}
-.dir-rtl .fp-vb-tree a:hover {background:none; border:30px solid black}
-.dir-rtl .fp-vb-tree.checked a:hover {background:none; border:50px solid black}
-
-.file-picker .fp-pathbar {display: table-row;}
-.fp-pathbar.empty {display: none;}
-.fp-pathbar .fp-path-folder {background:url('[[pix:theme|fp/path_folder]]') no-repeat 0 0;width:27px;height:12px;margin-left: 4px;}
-.dir-rtl .fp-pathbar .fp-path-folder {background:url('[[pix:theme|fp/path_folder_rtl]]') no-repeat right top;width:auto;height:12px;margin-left: 4px;}
-.dir-rtl .fp-pathbar span {display: inline-block;float:right; margin-left: 32px;}
-.fp-pathbar .fp-path-folder-name {margin-left: 32px;line-height: 20px;}
-.dir-rtl .fp-pathbar .fp-path-folder-name {margin-right: 32px;line-height: 20px;}
+.dir-rtl .fp-vb-details a:hover {background:none;border:20px solid black}
+.dir-rtl .fp-vb-details.checked a:hover {background:none;border:40px solid black}
+.dir-rtl .fp-vb-tree a:hover {background:none;border:30px solid black}
+.dir-rtl .fp-vb-tree.checked a:hover {background:none;border:50px solid black}
+
+.file-picker .fp-pathbar {display:table-row;}
+.fp-pathbar.empty {display:none;}
+.fp-pathbar .fp-path-folder {background:url('[[pix:theme|fp/path_folder]]') no-repeat 0 0;width:27px;height:12px;margin-left:4px;}
+.dir-rtl .fp-pathbar .fp-path-folder {background:url('[[pix:theme|fp/path_folder_rtl]]') no-repeat right top;width:auto;height:12px;margin-left:4px;}
+.dir-rtl .fp-pathbar span {display:inline-block;float:right;margin-left:32px;}
+.fp-pathbar .fp-path-folder-name {margin-left:32px;line-height:20px;}
+.dir-rtl .fp-pathbar .fp-path-folder-name {margin-right:32px;line-height:20px;}
 
 /*
  * Icon view (File Picker and File Manager)
  */
-.fp-iconview .fp-file {float: left;text-align: center;position: relative;margin: 10px 10px 35px;}
-.fp-iconview .fp-thumbnail {min-width:110px;min-height:110px;line-height: 110px;text-align: center;border: 1px solid #FFFFFF;display: block;}
-.fp-iconview .fp-thumbnail img {border: 1px solid #DDDDDD;padding:3px;vertical-align: middle;-webkit-box-shadow: 1px 1px 2px 0px #CCCCCC;-moz-box-shadow: 1px 1px 2px 0px #CCCCCC;box-shadow: 1px 1px 2px 0px #CCCCCC;}
-.fp-iconview .fp-thumbnail:hover {background: #FFFFFF;border: 1px solid #DDDDDD;-webkit-box-shadow: inset 0px 0px 10px 0px #CCCCCC;-moz-box-shadow: inset 0px 0px 10px 0px #CCCCCC;box-shadow: inset 0px 0px 10px 0px #CCCCCC;}
-.fp-iconview .fp-filename-field {height:33px;word-wrap:break-word;overflow: hidden;position: absolute;}
-.fp-iconview .fp-filename-field:hover {overflow: visible;z-index: 1000;}
-.fp-iconview .fp-filename-field .fp-filename {background: #FFFFFF;padding-top: 5px;padding-bottom: 12px;min-width:112px;}
-.dir-rtl .fp-iconview .fp-file { float: right;}
+.fp-iconview .fp-file {float:left;text-align:center;position:relative;margin:10px 10px 35px;}
+.fp-iconview .fp-thumbnail {min-width:110px;min-height:110px;line-height:110px;text-align:center;border:1px solid #FFFFFF;display:block;}
+.fp-iconview .fp-thumbnail img {border:1px solid #DDDDDD;padding:3px;vertical-align:middle;-webkit-box-shadow:1px 1px 2px 0px #CCCCCC;-moz-box-shadow:1px 1px 2px 0px #CCCCCC;box-shadow:1px 1px 2px 0px #CCCCCC;}
+.fp-iconview .fp-thumbnail:hover {background:#FFFFFF;border:1px solid #DDDDDD;-webkit-box-shadow:inset 0px 0px 10px 0px #CCCCCC;-moz-box-shadow:inset 0px 0px 10px 0px #CCCCCC;box-shadow:inset 0px 0px 10px 0px #CCCCCC;}
+.fp-iconview .fp-filename-field {height:33px;word-wrap:break-word;overflow:hidden;position:absolute;}
+.fp-iconview .fp-filename-field:hover {overflow:visible;z-index:1000;}
+.fp-iconview .fp-filename-field .fp-filename {background:#FFFFFF;padding-top:5px;padding-bottom:12px;min-width:112px;}
+.dir-rtl .fp-iconview .fp-file {float:right;}
 
 /*
  * Table view (File Picker only)
  */
-.file-picker .yui3-datatable table {border: 0px solid #BBBBBB;width:100%;}
-#filesskin .file-picker .yui3-datatable-header {background: #FFFFFF;border-bottom: 1px solid #CCCCCC;border-left: 0 solid #FFFFFF;color: #555555;}
-#filesskin .file-picker .yui3-datatable-odd .yui3-datatable-cell {background-color: #F6F6F6;border-left: 0px solid #F6F6F6;}
-#filesskin .file-picker .yui3-datatable-even .yui3-datatable-cell {background-color: #FFFFFF;border-left: 0px solid #FFFFFF;}
-.dir-rtl .file-picker .yui3-datatable-header {text-align: right;}
+.file-picker .yui3-datatable table {border:0px solid #BBBBBB;width:100%;}
+#filesskin .file-picker .yui3-datatable-header {background:#FFFFFF;border-bottom:1px solid #CCCCCC;border-left:0 solid #FFFFFF;color:#555555;}
+#filesskin .file-picker .yui3-datatable-odd .yui3-datatable-cell {background-color:#F6F6F6;border-left:0px solid #F6F6F6;}
+#filesskin .file-picker .yui3-datatable-even .yui3-datatable-cell {background-color:#FFFFFF;border-left:0px solid #FFFFFF;}
+.dir-rtl .file-picker .yui3-datatable-header {text-align:right;}
 
 /*
  * Tree view (File Manager only)
  */
 /*.file-picker .fp-treeview .fp-folder .fp-icon, .filemanager .fp-treeview .fp-folder .fp-icon {}*/
 /* first or middle sibling, no children */
-.file-picker .ygtvtn, .filemanager .ygtvtn {background: url('[[pix:moodle|y/tn]]') 0px 0px no-repeat;width:17px;height:22px;}
-.dir-rtl .file-picker .ygtvtn, .dir-rtl .filemanager .ygtvtn {background: url('[[pix:moodle|y/tn_rtl]]') 0px 0px no-repeat;}
+.file-picker .ygtvtn, .filemanager .ygtvtn {background:url('[[pix:moodle|y/tn]]') 0px 0px no-repeat;width:17px;height:22px;}
+.dir-rtl .file-picker .ygtvtn, .dir-rtl .filemanager .ygtvtn {background:url('[[pix:moodle|y/tn_rtl]]') 0px 0px no-repeat;}
 /* first or middle sibling, collapsable */
-.file-picker .ygtvtm, .filemanager .ygtvtm {background: url('[[pix:moodle|y/tm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
+.file-picker .ygtvtm, .filemanager .ygtvtm {background:url('[[pix:moodle|y/tm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
 /* first or middle sibling, collapsable, hover */
-.file-picker .ygtvtmh, .filemanager .ygtvtmh {background: url('[[pix:moodle|y/tm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
+.file-picker .ygtvtmh, .filemanager .ygtvtmh {background:url('[[pix:moodle|y/tm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
 /* first or middle sibling, expandable */
-.file-picker .ygtvtp, .filemanager .ygtvtp {background: url('[[pix:moodle|y/tp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
-.dir-rtl .file-picker .ygtvtp, .dir-rtl .filemanager .ygtvtp {background: url('[[pix:moodle|y/tp_rtl]]') 0px 10px no-repeat;}
+.file-picker .ygtvtp, .filemanager .ygtvtp {background:url('[[pix:moodle|y/tp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
+.dir-rtl .file-picker .ygtvtp, .dir-rtl .filemanager .ygtvtp {background:url('[[pix:moodle|y/tp_rtl]]') 0px 10px no-repeat;}
 /* first or middle sibling, expandable, hover */
-.file-picker .ygtvtph, .filemanager .ygtvtph {background: url('[[pix:moodle|y/tp]]') 0px 10px no-repeat;width:13px;height:22px;cursor:pointer;}
-.dir-rtl .file-picker .ygtvtph, .dir-rtl .filemanager .ygtvtph {background: url('[[pix:moodle|y/tp_rtl]]') 0px 10px no-repeat}
+.file-picker .ygtvtph, .filemanager .ygtvtph {background:url('[[pix:moodle|y/tp]]') 0px 10px no-repeat;width:13px;height:22px;cursor:pointer;}
+.dir-rtl .file-picker .ygtvtph, .dir-rtl .filemanager .ygtvtph {background:url('[[pix:moodle|y/tp_rtl]]') 0px 10px no-repeat}
 /* last sibling, no children */
-.file-picker .ygtvln, .filemanager .ygtvln {background: url('[[pix:moodle|y/ln]]') 0px 0px no-repeat;width:17px;height:22px;}
-.dir-rtl .file-picker .ygtvln, .dir-rtl .filemanager .ygtvln {background: url('[[pix:moodle|y/ln_rtl]]') 0px 0px no-repeat;}
+.file-picker .ygtvln, .filemanager .ygtvln {background:url('[[pix:moodle|y/ln]]') 0px 0px no-repeat;width:17px;height:22px;}
+.dir-rtl .file-picker .ygtvln, .dir-rtl .filemanager .ygtvln {background:url('[[pix:moodle|y/ln_rtl]]') 0px 0px no-repeat;}
 /* Last sibling, collapsable */
-.file-picker .ygtvlm, .filemanager .ygtvlm {background: url('[[pix:moodle|y/lm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
+.file-picker .ygtvlm, .filemanager .ygtvlm {background:url('[[pix:moodle|y/lm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
 /* Last sibling, collapsable, hover */
-.file-picker .ygtvlmh, .filemanager .ygtvlmh {background: url('[[pix:moodle|y/lm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
+.file-picker .ygtvlmh, .filemanager .ygtvlmh {background:url('[[pix:moodle|y/lm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
 /* Last sibling, expandable */
-.file-picker .ygtvlp, .filemanager .ygtvlp {background: url('[[pix:moodle|y/lp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
-.dir-rtl .file-picker .ygtvlp, .dir-rtl .filemanager .ygtvlp {background: url('[[pix:moodle|y/lp_rtl]]') 0px 10px no-repeat;}
+.file-picker .ygtvlp, .filemanager .ygtvlp {background:url('[[pix:moodle|y/lp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
+.dir-rtl .file-picker .ygtvlp, .dir-rtl .filemanager .ygtvlp {background:url('[[pix:moodle|y/lp_rtl]]') 0px 10px no-repeat;}
 /* Last sibling, expandable, hover */
-.file-picker .ygtvlph, .filemanager .ygtvlph {background: url('[[pix:moodle|y/lp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
-.dir-rtl .file-picker .ygtvlph, .dir-rtl .filemanager .ygtvlph {background: url('[[pix:moodle|y/lp_rtl]]') 0px 10px no-repeat;}
+.file-picker .ygtvlph, .filemanager .ygtvlph {background:url('[[pix:moodle|y/lp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;}
+.dir-rtl .file-picker .ygtvlph, .dir-rtl .filemanager .ygtvlph {background:url('[[pix:moodle|y/lp_rtl]]') 0px 10px no-repeat;}
 /* Loading icon */
-.file-picker .ygtvloading, .filemanager .ygtvloading {background: transparent url('[[pix:moodle|y/loading]]') 0 0 no-repeat;width:16px;height:22px;}
+.file-picker .ygtvloading, .filemanager .ygtvloading {background:transparent url('[[pix:moodle|y/loading]]') 0 0 no-repeat;width:16px;height:22px;}
 /* the style for the empty cells that are used for rendering the depth* of the node */
-.file-picker .ygtvdepthcell, .filemanager .ygtvdepthcell {background: url('[[pix:moodle|y/vline]]') 0 0 no-repeat;width:17px;height:/*22px;*/32px;}
+.file-picker .ygtvdepthcell, .filemanager .ygtvdepthcell {background:url('[[pix:moodle|y/vline]]') 0 0 no-repeat;width:17px;height:/*22px;*/32px;}
 .file-picker .ygtvblankdepthcell, .filemanager .ygtvblankdepthcell {width:17px;height:22px;}
 /* the style of the div around each node */
 /*.file-picker .ygtvitem  table, .filemanager .ygtvitem  table{margin-bottom:0;}*/
@@ -179,54 +174,54 @@ background: #E2E2E2;filter: progid:DXImageTransform.Microsoft.gradient(startColo
 /** html .file-picker .ygtvchildren, * html .filemanager .ygtvchildren {height:1%;}*/
 /* the style of the text label in ygTextNode */
 /*.file-picker .ygtvlabel,.file-picker .ygtvlabel:link,.file-picker .ygtvlabel:visited,.file-picker .ygtvlabel:hover,
-.filemanager .ygtvlabel,.filemanager .ygtvlabel:link,.filemanager .ygtvlabel:visited,.filemanager .ygtvlabel:hover {margin-left:2px;text-decoration: none;}*/
-a.ygtvspacer:hover {color: transparent;text-decoration: none;}
-.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {background-color: transparent;cursor: pointer;margin-left: 2px;text-decoration: none;}
-.file-picker .ygtvfocus, .filemanager .ygtvfocus {background-color: #EEEEEE;}
-
-.fp-filename-icon {margin-top: 10px;display: block;position: relative;}
-.fp-icon {float: left;margin-top: -7px;width: 24px;height: 24px;margin-right: 10px;text-align: center;line-height: 24px;}
-.dir-rtl .fp-icon {float: right;margin-left: 10px;margin-right: 0;}
-.fp-icon img {max-height:24px;max-width:24px;vertical-align: middle;}
-.fp-filename {padding-right: 10px;}
-.dir-rtl .fp-filename {padding-left: 10px;padding-right: 0;}
+.filemanager .ygtvlabel,.filemanager .ygtvlabel:link,.filemanager .ygtvlabel:visited,.filemanager .ygtvlabel:hover {margin-left:2px;text-decoration:none;}*/
+a.ygtvspacer:hover {color:transparent;text-decoration:none;}
+.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {background-color:transparent;cursor:pointer;margin-left:2px;text-decoration:none;}
+.file-picker .ygtvfocus, .filemanager .ygtvfocus {background-color:#EEEEEE;}
+
+.fp-filename-icon {margin-top:10px;display:block;position:relative;}
+.fp-icon {float:left;margin-top:-7px;width:24px;height:24px;margin-right:10px;text-align:center;line-height:24px;}
+.dir-rtl .fp-icon {float:right;margin-left:10px;margin-right:0;}
+.fp-icon img {max-height:24px;max-width:24px;vertical-align:middle;}
+.fp-filename {padding-right:10px;}
+.dir-rtl .fp-filename {padding-left:10px;padding-right:0;}
 
 /*
  * Repositories Login on fp-content (File Picker only)
  */
-.file-picker .fp-login-form {height: 100%;width: 100%;display: table;}
-.file-picker .fp-login-form table {margin: 0 auto;}
-.file-picker .fp-login-form p {text-align: center;margin-top: 3em;}
-.file-picker .fp-login-form .fp-login-input .label {text-align: right;vertical-align: middle;}
-.file-picker .fp-login-form .fp-login-input .input {text-align: left;}
-.file-picker .fp-login-form input[type="checkbox"]{width: 15px;height:15px;}
+.file-picker .fp-login-form {height:100%;width:100%;display:table;}
+.file-picker .fp-login-form table {margin:0 auto;}
+.file-picker .fp-login-form p {text-align:center;margin-top:3em;}
+.file-picker .fp-login-form .fp-login-input .label {text-align:right;vertical-align:middle;}
+.file-picker .fp-login-form .fp-login-input .input {text-align:left;}
+.file-picker .fp-login-form input[type="checkbox"]{width:15px;height:15px;}
 
 /*
  * Upload on fp-content (File Picker only)
  */
-.file-picker .fp-upload-form {height: 100%;width: 100%;display: table;}
-.file-picker .fp-upload-form table {margin: 0 auto;}
-.file-picker .fp-upload-btn {margin: 2em;}
+.file-picker .fp-upload-form {height:100%;width:100%;display:table;}
+.file-picker .fp-upload-form table {margin:0 auto;}
+.file-picker .fp-upload-btn {margin:2em;}
 
 /*
  * File exists dialogue on Upload (File Picker only)
  */
-.file-picker.fp-dlg {text-align: center;}
-.file-picker.fp-dlg .fp-dlg-text {padding: 30px 20px 10px;font-size: 12px;}
-.file-picker.fp-dlg .fp-dlg-buttons {margin: 0 20px;}
+.file-picker.fp-dlg {text-align:center;}
+.file-picker.fp-dlg .fp-dlg-text {padding:30px 20px 10px;font-size:12px;}
+.file-picker.fp-dlg .fp-dlg-buttons {margin:0 20px;}
 
 /*
  * Error dialogue on Upload (File Picker only)
  */
-.file-picker.fp-msg {text-align: center;}
-.file-picker.fp-msg .fp-msg-text {padding: 40px 20px 10px 20px;min-width:200px;max-width:500px;max-height:300px;overflow:auto;font-size: 12px;}
-.file-picker.fp-msg.fp-msg-error .fp-msg-text {padding: 40px 20px 10px 20px;font-size: 12px;}
+.file-picker.fp-msg {text-align:center;}
+.file-picker.fp-msg .fp-msg-text {padding:40px 20px 10px 20px;min-width:200px;max-width:500px;max-height:300px;overflow:auto;font-size:12px;}
+.file-picker.fp-msg.fp-msg-error .fp-msg-text {padding:40px 20px 10px 20px;font-size:12px;}
 
 /*
  * Error on fp-content (File Picker only)
  */
-.file-picker .fp-content-error {height: 100%;width: 100%;display: table;text-align: center;}
-.file-picker .fp-content-error .fp-error {height: 100%;width: 100%;display:table-cell;vertical-align: middle;padding: 40px 20px 10px 20px;font-size: 12px;}
+.file-picker .fp-content-error {height:100%;width:100%;display:table;text-align:center;}
+.file-picker .fp-content-error .fp-error {height:100%;width:100%;display:table-cell;vertical-align:middle;padding:40px 20px 10px 20px;font-size:12px;}
 
 /*
  * Lazy loading on fp-content (File Picker only)
@@ -234,36 +229,36 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
 .file-picker .fp-nextpage {clear:both;}
 .file-picker .fp-nextpage .fp-nextpage-loading {display:none;}
 .file-picker .fp-nextpage.loading .fp-nextpage-link {display:none;}
-.file-picker .fp-nextpage.loading .fp-nextpage-loading {display:block;text-align: center;height: 100px;padding-top: 50px;}
+.file-picker .fp-nextpage.loading .fp-nextpage-loading {display:block;text-align:center;height:100px;padding-top:50px;}
 
 /*
  * Select Dialogue (File Picker and File Manager)
  */
-.fp-select form {padding: 20px 20px 0;}
-.fp-select .fp-select-loading {text-align: center;margin-top: 20px;}
-.fp-select .fp-hr {clear: both;height: 1px; background-color: #FFFFFF;border-bottom: 1px solid #BBBBBB;width: auto; margin: 10px 0;}
-.fp-select table {padding: 0 0 10px;}
-.fp-select table .mdl-right {min-width: 84px;}
-.fp-select .fp-reflist .mdl-right {vertical-align: top;}
-.fp-select .fp-select-buttons {float: right;}
-.fp-select .fp-info {display: block;clear: both;padding: 1px 20px 0;}
-.fp-select .fp-thumbnail {float:left;min-width:110px;min-height:110px;line-height: 110px;text-align: center;margin: 10px 20px 0 0;background: #FFFFFF;border: 1px solid #DDDDDD;-webkit-box-shadow: inset 0 0 10px 0 #CCCCCC;-moz-box-shadow: inset 0 0 10px 0 #CCCCCC;box-shadow: inset 0 0 10px 0 #CCCCCC;}
-.fp-select .fp-thumbnail img {border: 1px solid #DDDDDD;padding:3px;vertical-align: middle;margin: 10px;}
-.fp-select .fp-fileinfo {display: inline-block;margin-top: 10px;}
+.fp-select form {padding:20px 20px 0;}
+.fp-select .fp-select-loading {text-align:center;margin-top:20px;}
+.fp-select .fp-hr {clear:both;height:1px;background-color:#FFFFFF;border-bottom:1px solid #BBBBBB;width:auto;margin:10px 0;}
+.fp-select table {padding:0 0 10px;}
+.fp-select table .mdl-right {min-width:84px;}
+.fp-select .fp-reflist .mdl-right {vertical-align:top;}
+.fp-select .fp-select-buttons {float:right;}
+.fp-select .fp-info {display:block;clear:both;padding:1px 20px 0;}
+.fp-select .fp-thumbnail {float:left;min-width:110px;min-height:110px;line-height:110px;text-align:center;margin:10px 20px 0 0;background:#FFFFFF;border:1px solid #DDDDDD;-webkit-box-shadow:inset 0 0 10px 0 #CCCCCC;-moz-box-shadow:inset 0 0 10px 0 #CCCCCC;box-shadow:inset 0 0 10px 0 #CCCCCC;}
+.fp-select .fp-thumbnail img {border:1px solid #DDDDDD;padding:3px;vertical-align:middle;margin:10px;}
+.fp-select .fp-fileinfo {display:inline-block;margin-top:10px;}
 .file-picker.fp-select .fp-fileinfo {max-width:240px;}
-.fp-select .fp-fileinfo div {padding-bottom: 5px;}
+.fp-select .fp-fileinfo div {padding-bottom:5px;}
 
 .file-picker.fp-select .uneditable {display:none;}
 .file-picker.fp-select .fp-select-loading {display:none;}
 .file-picker.fp-select.loading .fp-select-loading {display:block;}
 .file-picker.fp-select.loading form {display:none;}
-.fp-select .fp-dimensions.fp-unknown {display: none;}
+.fp-select .fp-dimensions.fp-unknown {display:none;}
 
  /*
  * File Manager
  */
 .filemanager-loading{display:none}
-.jsenabled .filemanager-loading{display:block;margin-top: 100px;}
+.jsenabled .filemanager-loading{display:block;margin-top:100px;}
 .filemanager.fm-loading .filemanager-toolbar,
 .filemanager.fm-loading .fp-pathbar,
 .filemanager.fm-loading .filemanager-container {display:none;}
@@ -274,7 +269,7 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
 .filemanager .fm-empty-container {display:none;}
 .filemanager.fm-noitems .filemanager-container .fp-content {display:none;}
 .filemanager .filemanager-updating {display:none;text-align:center;}
-.filemanager.fm-updating .filemanager-updating {display:block;margin-top: 37px;}
+.filemanager.fm-updating .filemanager-updating {display:block;margin-top:37px;}
 .filemanager.fm-updating .fm-content-wrapper {display:none;}
 .filemanager.fm-nomkdir .fp-btn-mkdir {display:none;}
 .fitem.disabled .filemanager .filemanager-toolbar,
@@ -285,18 +280,18 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
  /*
  * File Manager layout
  */
-.fp-restrictions{text-align: right;}
-.filemanager .fp-navbar {background: #F2F2F2;border-top: 1px solid #BBBBBB;border-left: 1px solid #BBBBBB;border-right: 1px solid #BBBBBB;}
-.filemanager-toolbar{padding: 5px 8px;min-height:22px;}
-.fp-pathbar {border-top: 1px solid #BBBBBB;padding: 5px 8px 1px;min-height: 20px;}
+.fp-restrictions{text-align:right;}
+.filemanager .fp-navbar {background:#F2F2F2;border-top:1px solid #BBBBBB;border-left:1px solid #BBBBBB;border-right:1px solid #BBBBBB;}
+.filemanager-toolbar{min-height:48px;}
+.fp-pathbar {border-top:1px solid #BBBBBB;padding:5px 8px 1px;min-height:20px;}
 
 .filemanager .fp-pathbar.empty {display:none;}
 .filepicker-filelist,
-.filemanager-container {background: #FFFFFF;clear: both;overflow:auto;border: 1px solid #BBBBBB;min-height: 140px;position: relative;}
+.filemanager-container {background:#FFFFFF;clear:both;overflow:auto;border:1px solid #BBBBBB;min-height:140px;position:relative;}
 /*.filemanager-container ul{margin:0;padding:0;}
 .filemanager-container ul li{white-space:nowrap;list-style-type:none;}
 .filemanager-container ul li a{padding:0}*/
-.filemanager .fp-content{overflow: auto;max-height: 472px;min-height: 157px;}
+.filemanager .fp-content{overflow:auto;max-height:472px;min-height:157px;}
 .filemanager-container, .filepicker-filelist {overflow:hidden;}
 .fitem.disabled .filepicker-filelist, .fitem.disabled .filemanager-container {background-color:#EBEBE4;}
 .fitem.disabled .fp-btn-choose {color:graytext;}
@@ -307,22 +302,22 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
  */
 .fp-iconview .fp-reficons1 {position:absolute;height:100%;width:100%;top:0;left:0;}
 .fp-iconview .fp-reficons2 {position:absolute;height:100%;width:100%;top:0;left:0;}
-.fp-iconview .fp-file.fp-hasreferences .fp-reficons1 {background: url('[[pix:theme|fp/link]]') no-repeat;background-position:bottom right;}
-.fp-iconview .fp-file.fp-isreference .fp-reficons2 {background: url('[[pix:theme|fp/alias]]') no-repeat;background-position:bottom left;}
+.fp-iconview .fp-file.fp-hasreferences .fp-reficons1 {background:url('[[pix:theme|fp/link]]') no-repeat;background-position:bottom right;}
+.fp-iconview .fp-file.fp-isreference .fp-reficons2 {background:url('[[pix:theme|fp/alias]]') no-repeat;background-position:bottom left;}
 
 .filemanager .fp-iconview .fp-file.fp-originalmissing .fp-thumbnail img {display:none;}
-.filemanager .fp-iconview .fp-file.fp-originalmissing .fp-thumbnail {background: url([[pix:s/dead]]) no-repeat;background-position:center center;}
+.filemanager .fp-iconview .fp-file.fp-originalmissing .fp-thumbnail {background:url([[pix:s/dead]]) no-repeat;background-position:center center;}
 
 /*
  * Table view (File Manager only)
  */
-.filemanager .yui3-datatable table {border: 0px solid #BBBBBB;width:100%;}
-.filemanager .yui3-datatable-header {background: #FFFFFF!important;border-bottom: 1px solid #CCCCCC!important;border-left: 0 solid #FFFFFF!important;color: #555555!important;}
-.filemanager .yui3-datatable-odd .yui3-datatable-cell {background-color: #F6F6F6!important;border-left: 0px solid #F6F6F6;}
-.filemanager .yui3-datatable-even .yui3-datatable-cell {background-color: #FFFFFF!important;border-left: 0px solid #FFFFFF;}
+.filemanager .yui3-datatable table {border:0px solid #BBBBBB;width:100%;}
+.filemanager .yui3-datatable-header {background:#FFFFFF!important;border-bottom:1px solid #CCCCCC!important;border-left:0 solid #FFFFFF!important;color:#555555!important;}
+.filemanager .yui3-datatable-odd .yui3-datatable-cell {background-color:#F6F6F6!important;border-left:0px solid #F6F6F6;}
+.filemanager .yui3-datatable-even .yui3-datatable-cell {background-color:#FFFFFF!important;border-left:0px solid #FFFFFF;}
 
-.filemanager .fp-filename-icon.fp-hasreferences .fp-reficons1{background: url('[[pix:theme|fp/link_sm]]') no-repeat 0 0;height:100%;width:100%;position:absolute;top: 8px;left: 17px;z-index:1000;}
-.filemanager .fp-filename-icon.fp-isreference .fp-reficons2 {background: url('[[pix:theme|fp/alias_sm]]') no-repeat 0 0;height:100%;width:100%;position:absolute;top: 9px;left: -6px;z-index:1001;}
+.filemanager .fp-filename-icon.fp-hasreferences .fp-reficons1{background:url('[[pix:theme|fp/link_sm]]') no-repeat 0 0;height:100%;width:100%;position:absolute;top:8px;left:17px;z-index:1000;}
+.filemanager .fp-filename-icon.fp-isreference .fp-reficons2 {background:url('[[pix:theme|fp/alias_sm]]') no-repeat 0 0;height:100%;width:100%;position:absolute;top:9px;left:-6px;z-index:1001;}
 
 /*
  * Folder Context Menu (File Manager only)
@@ -330,21 +325,21 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
 .filemanager .fp-contextmenu {display:none;}
 .filemanager .fp-iconview .fp-folder.fp-hascontextmenu .fp-contextmenu {display:block;position:absolute;right:7px;bottom:5px;}
 .filemanager .fp-treeview .fp-folder.fp-hascontextmenu .fp-contextmenu,
-.filemanager .fp-tableview .fp-folder.fp-hascontextmenu .fp-contextmenu {display: inline;position: absolute;left: 14px;margin-right: -20px;top: 6px;}
+.filemanager .fp-tableview .fp-folder.fp-hascontextmenu .fp-contextmenu {display:inline;position:absolute;left:14px;margin-right:-20px;top:6px;}
 
 .dir-rtl .filemanager .fp-iconview .fp-folder.fp-hascontextmenu .fp-contextmenu {left:7px;right:inherit;}
 .dir-rtl .filemanager .fp-treeview .fp-folder.fp-hascontextmenu .fp-contextmenu,
-.dir-rtl .filemanager .fp-tableview .fp-folder.fp-hascontextmenu .fp-contextmenu {left:inherit;right: 16px;margin-right: 0;}
+.dir-rtl .filemanager .fp-tableview .fp-folder.fp-hascontextmenu .fp-contextmenu {left:inherit;right:16px;margin-right:0;}
 
 /*
  * Drag and drop support (filemanager and filepicker form elements)
  */
 .filepicker-filelist .filepicker-container,
-.filemanager.fm-noitems .fm-empty-container {display:block;position:absolute;top:10px;bottom:10px;left:10px;right:10px;border: 2px dashed #BBBBBB;padding-top:85px;text-align:center;}
+.filemanager.fm-noitems .fm-empty-container {display:block;position:absolute;top:10px;bottom:10px;left:10px;right:10px;border:2px dashed #BBBBBB;padding-top:85px;text-align:center;}
 .filepicker-filelist .dndupload-target,
-.filemanager-container .dndupload-target {background:#FFFFFF;position:absolute;top:10px;bottom:10px;left:10px;right:10px;border: 2px dashed #fb7979;padding-top:85px;text-align:center;-webkit-box-shadow:  0px 0px 0px 10px #FFFFFF;-moz-box-shadow: 0px 0px 0px 10px #FFFFFF;box-shadow:  0px 0px 0px 10px #FFFFFF;}
+.filemanager-container .dndupload-target {background:#FFFFFF;position:absolute;top:10px;bottom:10px;left:10px;right:10px;border:2px dashed #fb7979;padding-top:85px;text-align:center;-webkit-box-shadow: 0px 0px 0px 10px #FFFFFF;-moz-box-shadow:0px 0px 0px 10px #FFFFFF;box-shadow: 0px 0px 0px 10px #FFFFFF;}
 .filepicker-filelist.dndupload-over .dndupload-target,
-.filemanager-container.dndupload-over .dndupload-target {background:#FFFFFF;position:absolute;top:10px;bottom:10px;left:10px;right:10px;border: 2px dashed #6c8cd3;padding-top:85px;text-align:center;}
+.filemanager-container.dndupload-over .dndupload-target {background:#FFFFFF;position:absolute;top:10px;bottom:10px;left:10px;right:10px;border:2px dashed #6c8cd3;padding-top:85px;text-align:center;}
 .dndupload-message {display:none;}
 .dndsupported .dndupload-message {display:inline;}
 .dnduploadnotsupported-message {display:none;}
@@ -353,7 +348,7 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
 .dndsupported .dndupload-ready .dndupload-target {display:block;}
 .dndupload-uploadinprogress {display:none;text-align:center;}
 .dndupload-uploading .dndupload-uploadinprogress {display:block;}
-.dndupload-arrow {background:url([[pix:theme|fp/dnd_arrow]]) center no-repeat;width:100%;height:80px;position:absolute;margin-left: -28px;top: 5px;}
+.dndupload-arrow {background:url([[pix:theme|fp/dnd_arrow]]) center no-repeat;width:100%;height:80px;position:absolute;margin-left:-28px;top:5px;}
 .fitem.disabled .filepicker-container, .fitem.disabled .fm-empty-container {display:none;}
 .dndupload-progressbars {padding:10px;display:none;}
 .dndupload-inprogress .dndupload-progressbars {display:block;}
@@ -368,7 +363,7 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
 .filemanager.fp-select .fp-select-loading {display:none;}
 .filemanager.fp-select.loading .fp-select-loading {display:block;}
 .filemanager.fp-select.loading form {display:none;}
-/* disable unavailable actions: */
+/* disable unavailable actions:*/
 /*.filemanager.fp-select.fp-zip .fp-license,*/
 .filemanager.fp-select.fp-folder .fp-license,
 /*.filemanager.fp-select.fp-zip .fp-author,*/
@@ -383,7 +378,7 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
 .filemanager.fp-select.fp-cansetmain .fp-file-setmain-help {display:inline-block;}
 .filemanager .fp-mainfile .fp-filename {font-weight:bold;}
 .filemanager.fp-select.fp-folder .fp-file-download {display:none;} /* to be implemented */
-.fm-operation {font-weight: bold;}
+.fm-operation {font-weight:bold;}
 
 .filemanager.fp-select .fp-original.fp-unknown {display:none;}
 .filemanager.fp-select .fp-original .fp-originloading {display:none;}
@@ -391,24 +386,24 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
 
 .filemanager.fp-select .fp-reflist.fp-unknown {display:none;}
 .filemanager.fp-select .fp-reflist .fp-reflistloading {display:none;}
-.filemanager.fp-select .fp-refcount {max-width: 265px;}
+.filemanager.fp-select .fp-refcount {max-width:265px;}
 .filemanager.fp-select .fp-reflist.fp-loading .fp-reflistloading {display:inline;}
-.filemanager.fp-select .fp-reflist .fp-value {background: #F9F9F9;border: 1px solid #BBBBBB;padding: 8px 7px;margin: 0px;max-width: 265px;max-height: 75px;overflow:auto;}
-.filemanager.fp-select .fp-reflist .fp-value li {padding-bottom: 7px;}
+.filemanager.fp-select .fp-reflist .fp-value {background:#F9F9F9;border:1px solid #BBBBBB;padding:8px 7px;margin:0px;max-width:265px;max-height:75px;overflow:auto;}
+.filemanager.fp-select .fp-reflist .fp-value li {padding-bottom:7px;}
 
 /*
  * Create folder dialogue (File Manager only)
  */
-.filemanager.fp-mkdir-dlg {text-align: center;}
-.filemanager.fp-mkdir-dlg .fp-mkdir-dlg-text {text-align: left;margin: 20px;}
+.filemanager.fp-mkdir-dlg {text-align:center;}
+.filemanager.fp-mkdir-dlg .fp-mkdir-dlg-text {text-align:left;margin:20px;}
 
-.dir-rtl .filemanager .fp-mkdir-dlg p {text-align: right;}
+.dir-rtl .filemanager .fp-mkdir-dlg p {text-align:right;}
 
 /*
  * Confirm dialogue for delete (File Manager only)
  */
-.filemanager.fp-dlg {text-align: center;}
-.filemanager.fp-dlg .fp-dlg-text {padding: 0px 10px;min-width:200px;max-width:340px;max-height:300px;overflow:auto;line-height: 22px;margin: 40px 20px 20px;font-size: 12px;}
+.filemanager.fp-dlg {text-align:center;}
+.filemanager.fp-dlg .fp-dlg-text {padding:0px 10px;min-width:200px;max-width:340px;max-height:300px;overflow:auto;line-height:22px;margin:40px 20px 20px;font-size:12px;}
 
 /*
  *file picker search dialog
@@ -417,27 +412,27 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;}
 
 /* RTL Overrides
 -------------------------*/
-.dir-rtl .file-picker div.bd {text-align: right;}
-.dir-rtl .file-picker .fp-pathbar {text-align: right;}
-.dir-rtl .file-picker .fp-list {text-align: right;}
-.dir-rtl .filepicker .yui-layout-unit-left {left: 500px;}
-.dir-rtl .filepicker .yui-layout-unit-center {left: 0;}
-.dir-rtl #filemenu .yuimenuitemlabel {text-align: right;}
-.dir-rtl .filemanager-container .yui3-skin-sam .yui3-datatable-header {text-align: right;}
+.dir-rtl .file-picker div.bd {text-align:right;}
+.dir-rtl .file-picker .fp-pathbar {text-align:right;}
+.dir-rtl .file-picker .fp-list {text-align:right;}
+.dir-rtl .filepicker .yui-layout-unit-left {left:500px;}
+.dir-rtl .filepicker .yui-layout-unit-center {left:0;}
+.dir-rtl #filemenu .yuimenuitemlabel {text-align:right;}
+.dir-rtl .filemanager-container .yui3-skin-sam .yui3-datatable-header {text-align:right;}
 
 
 /**
  * Responsive styles for the filepicker
  */
-@media (max-width: 873px) {
-    .file-picker .fp-repo-area { width: 100%; height: auto; max-height: 220px; y-scroll: auto; float: none; border: 0px; }
-    .file-picker .fp-repo-items { width: 100%; float: none; }
-    .file-picker .fp-login-form .fp-login-input .label { text-align: left; }
-    .dir-rtl .file-picker .fp-login-form .fp-login-input .label { text-align: right; }
-    .file-picker .fp-content form td { display: block; width: 100%; text-align: left; }
-    .dir-rtl .file-picker .fp-content form td { text-align: right; }
-    .fp-content .mdl-right { text-align: left; }
-    .dir-rtl .fp-content .mdl-right { text-align: right; }
-    .fp-repo-items .fp-navbar { border-top: 1px solid rgb(187, 187, 187); }
+@media (max-width:873px) {
+    .file-picker .fp-repo-area {width:100%;height:auto;max-height:220px;y-scroll:auto;float:none;border:0px;}
+    .file-picker .fp-repo-items {width:100%;float:none;}
+    .file-picker .fp-login-form .fp-login-input .label {text-align:left;}
+    .dir-rtl .file-picker .fp-login-form .fp-login-input .label {text-align:right;}
+    .file-picker .fp-content form td {display:block;width:100%;text-align:left;}
+    .dir-rtl .file-picker .fp-content form td {text-align:right;}
+    .fp-content .mdl-right {text-align:left;}
+    .dir-rtl .fp-content .mdl-right {text-align:right;}
+    .fp-repo-items .fp-navbar {border-top:1px solid rgb(187, 187, 187);}
 }
 
index 1729d7a..62a22cf 100644 (file)
 .path-site li.activity > div,
 .path-course-view li.activity > div {
     position: relative;
+    padding: 0 16px 0 0; /* to accommodate the floated completion icon with highlighting */
+}
+.dir-rtl.path-site li.activity > div,
+.dir-rtl.path-course-view li.activity > div {
+    position: relative;
+    padding: 0 0 0 16px;
 }
 .path-course-view li.activity span.autocompletion,
 .path-course-view li.activity form.togglecompletion {
     float: right;
+    width: 0; /* Reduce the width of the control to 0 and rely on natural overflow */
+}
+.path-course-view li.activity span.autocompletion img,
+.path-course-view li.activity form.togglecompletion img {
+    max-width: none; /* The width is 0 so ensure we don't end up with a relative max-width */
 }
 .path-course-view li.activity form.togglecompletion .ajaxworking {
     width: 16px;
@@ -606,8 +617,6 @@ span.editinstructions {
     max-width: none !important; /** reset sets 100% !important which breaks on IE8 without this !important */
     width:16px;
     height:16px;
-    width:1rem;
-    height:1rem;
     padding:0.3em;
 }
 
index 2412177..75ff57d 100644 (file)
 }
 .file-picker .fp-navbar {
     background: #F2F2F2;
-    min-height: 22px;
     border-bottom: 1px solid #BBBBBB;
-    padding: 5px 8px;
+    min-height: 48px;
 }
+.file-picker .fp-navbar .fp-viewbar {
+    margin: 9px;
+}
+
 .file-picker .fp-content {
     background: #FFFFFF;
     clear: both;
     overflow: auto;
-    height: 468px;
+    height: 432px;
 }
 .filepicker.moodle-dialogue-fullscreen .file-picker .fp-content {
     width: 100%;
 }
 // Tools, Path & View on fp-navbar (File Picker and File Manager)
 .fp-toolbar {
-    display: table-row;
-    line-height: 22px;
     float: left;
-    max-width: 70%;
 }
 .dir-rtl .fp-toolbar {
     float: right;
     display: none;
 }
 .fp-toolbar div {
-    display: inline-block;
-    .ie7-inline-block();
-    padding: 0 2px;
-    padding-right: 10px;
+    display: block;
+    float: left;
+    margin-right: 9px;
 }
 .dir-rtl .fp-toolbar div {
-    width: 100px;
-    padding-right: 0px;
+    display: block;
+    float: right;
+    margin-left: 9px;
 }
 .fp-toolbar img {
     vertical-align: -15%;
 }
 .fp-viewbar {
     float: right;
-    width: 69px;
-    height: 22px;
-    margin-right: 8px;
+    height: 30px;
+    border: 1px solid #CCC;
+    border-bottom: 1px solid #B3B3B3;
+    border-radius: 4px;
+    background: white;
+}
+.fp-repo-items fp-viewbar {
+    margin: 9px;
 }
 .dir-rtl .fp-toolbar img {
     vertical-align: -35%;
 }
 .dir-rtl .fp-viewbar {
     float: left;
-    width: 100px;
-}
-.fp-vb-icons {
-    background: url('[[pix:theme|fp/view_icon_active]]') no-repeat 0 0;
-    width: 22px;
-    height: 22px;
-    display: inline-block;
-    .ie7-inline-block();
-}
-.dir-rtl .fp-vb-icons {
-    background: url('[[pix:theme|fp/view_icon_active]]') no-repeat 0 0;
-    display: block;
-    float: left;
-    margin-right: 4px;
-}
-.fp-vb-icons.checked {
-    background: url('[[pix:theme|fp/view_icon_selected]]');
-}
-.dir-rtl .fp-vb-icons.checked {
-    background: url('[[pix:theme|fp/view_icon_selected]]');
-    display: block;
-    float: left;
-    margin-right: 4px;
-}
-.fp-viewbar.disabled .fp-vb-icons {
-    background: url('[[pix:theme|fp/view_icon_inactive]]');
-}
-.fp-vb-details {
-    background: url('[[pix:theme|fp/view_list_active]]') no-repeat 0 0;
-    width: 23px;
-    height: 22px;
-    display: inline-block;
-    .ie7-inline-block();
-    margin-left: -4px;
 }
-.dir-rtl .fp-vb-details {
-    background: url('[[pix:theme|fp/view_list_active]]') no-repeat 0 0;
+
+.fp-viewbar a {
+    width: 40px;
+    height: 30px;
+    border-right: 1px solid #CCC;
     display: block;
-    float: left;
-    margin-right: 4px;
+    float:left;
 }
-.fp-vb-details.checked {
-    background: url('[[pix:theme|fp/view_list_selected]]');
-}
-.dir-rtl .fp-vb-details.checked {
-    background: url('[[pix:theme|fp/view_list_selected]]');
-    display: block;
-    float: left;
-    margin-right: 4px;
+.fp-viewbar a:hover {
+    background-image: radial-gradient(ellipse at center, #ffffff 60%,#dfdfdf 100%);
+    background-color: #ebebeb;
 }
-.fp-viewbar.disabled .fp-vb-details {
-    background: url('[[pix:theme|fp/view_list_inactive]]');
+
+.fp-viewbar a:active {
+    background-image: radial-gradient(ellipse at center, #ffffff 40%,#dfdfdf 100%);
+    background-color: #dfdfdf;
 }
-.fp-vb-tree {
-    background: url('[[pix:theme|fp/view_tree_active]]') no-repeat 0 0;
-    width: 23px;
-    height: 22px;
-    display: inline-block;
-    .ie7-inline-block();
-    margin-left: -4px;
+
+.fp-viewbar a.fp-vb-icons {
+    border-radius: 4px 0 0 4px;
 }
-.dir-rtl .fp-vb-tree {
-    background: url('[[pix:theme|fp/view_tree_active]]') no-repeat 0 0;
-    display: block;
-    float: left;
-    margin-right: 4px;
+.fp-viewbar a.fp-vb-tree {
+    border-right: 0;
+    border-radius: 0 4px 4px 0;
 }
-.fp-vb-tree.checked {
-    background: url('[[pix:theme|fp/view_tree_selected]]');
+.fp-viewbar a img {
+    margin: 7px 12px;
 }
-.dir-rtl .fp-vb-tree.checked {
-    background: url('[[pix:theme|fp/view_tree_selected]]');
-    display: block;
-    float: left;
-    margin-right: 4px;
+
+.fp-viewbar a.checked {
+    background-color: #dfdfdf;
 }
-.fp-viewbar.disabled .fp-vb-tree {
-    background: url('[[pix:theme|fp/view_tree_inactive]]');
+
+.fp-viewbar.disabled a {
+    opacity: .45;
+    background: none;
+    cursor: default;
 }
+
 .file-picker .fp-clear-left {
     clear: left;
 }
@@ -827,8 +793,7 @@ a.ygtvspacer:hover {
     border-bottom: none;
 }
 .filemanager-toolbar{
-    padding: 5px 8px;
-    min-height: 22px;
+    padding: 9px;
     overflow: hidden;
 }
 .fp-pathbar {
@@ -836,6 +801,61 @@ a.ygtvspacer:hover {
     padding: 5px 8px 1px;
     min-height: 20px;
 }
+
+.file-picker .fp-toolbar {
+    padding: 9px;
+}
+
+.fp-toolbar .fp-btn-add,
+.fp-toolbar .fp-btn-download,
+.fp-toolbar .fp-btn-mkdir,
+.fp-toolbar .fp-tb-help,
+.fp-toolbar .fp-tb-manage,
+.fp-toolbar .fp-tb-logout,
+.fp-toolbar .fp-tb-refresh
+ {
+    border: 1px solid #CCC;
+    border-bottom: 1px solid #B3B3B3;
+    border-radius: 4px;
+    background: white;
+    width: 40px;
+    height: 30px;
+}
+
+.fp-toolbar a:hover {
+    background-image: radial-gradient(ellipse at center, #ffffff 60%,#dfdfdf 100%);
+    background-color: #ebebeb;
+}
+
+.fp-toolbar a:active {
+    background-image: radial-gradient(ellipse at center, #ffffff 40%,#dfdfdf 100%);
+    background-color: #dfdfdf;
+}
+
+.fp-btn-add a,
+.fp-btn-download a,
+.fp-btn-mkdir a,
+.fp-tb-help a,
+.fp-tb-manage a,
+.fp-tb-logout a,
+.fp-tb-refresh a
+{
+    display: block;
+    width: 40px;
+    height: 30px;
+    border-radius: 4px;
+}
+
+.fp-btn-add img,
+.fp-btn-download img,
+.fp-btn-mkdir img,
+.fp-tb-help img,
+.fp-tb-manage img,
+.fp-tb-logout img,
+.fp-tb-refresh img {
+    margin: 7px 12px;
+}
+
 .filemanager .fp-pathbar.empty {
     display: none;
 }
diff --git a/theme/bootstrapbase/pix/fp/add_file.png b/theme/bootstrapbase/pix/fp/add_file.png
new file mode 100644 (file)
index 0000000..805f5ad
Binary files /dev/null and b/theme/bootstrapbase/pix/fp/add_file.png differ
diff --git a/theme/bootstrapbase/pix/fp/add_file.svg b/theme/bootstrapbase/pix/fp/add_file.svg
new file mode 100644 (file)
index 0000000..300eabf
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="-1 0 16 16" style="overflow:visible;enable-background:new -1 0 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#999999;" d="M10,15H8H1.2C1.1,15,1,14.9,1,14.7V1.2C1,1.1,1.1,1,1.2,1H9v4h4v4h1V5.2c0-0.7-0.4-1.6-0.9-2.1\r
+       l-2.2-2.2C10.4,0.4,9.4,0,8.8,0H1.2C0.6,0,0,0.6,0,1.2v13.5C0,15.4,0.6,16,1.2,16H10V15z M10,1.4c0.1,0,2.5,2.5,2.6,2.6H10V1.4z\r
+        M15,14h-2v2h-2v-2H9v-2h2v-2h2v2h2V14z"/>\r
+</svg>\r
diff --git a/theme/bootstrapbase/pix/fp/create_folder.png b/theme/bootstrapbase/pix/fp/create_folder.png
new file mode 100644 (file)
index 0000000..a62537c
Binary files /dev/null and b/theme/bootstrapbase/pix/fp/create_folder.png differ
diff --git a/theme/bootstrapbase/pix/fp/create_folder.svg b/theme/bootstrapbase/pix/fp/create_folder.svg
new file mode 100644 (file)
index 0000000..ca1a63f
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 -1.5 16 16" style="overflow:visible;enable-background:new 0 -1.5 16 16;"\r
+        xml:space="preserve">\r
+<defs>\r
+</defs>\r
+<path style="fill:#989898;" d="M9,9.5v4H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h6c0.5,0,1,0.5,1,1v1.5h7c0.5,0,1,0.5,1,1v6h-1v-2h-4\r
+       v2H9z M16,10.5h-2v-2h-2v2h-2v2h2v2h2v-2h2V10.5z"/>\r
+</svg>\r
diff --git a/theme/bootstrapbase/pix/fp/download_all.png b/theme/bootstrapbase/pix/fp/download_all.png
new file mode 100644 (file)
index 0000000..f2d450b
Binary files /dev/null and b/theme/bootstrapbase/pix/fp/download_all.png differ
diff --git a/theme/bootstrapbase/pix/fp/download_all.svg b/theme/bootstrapbase/pix/fp/download_all.svg
new file mode 100644 (file)
index 0000000..9cc13cd
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]>\r
+<svg version="1.1"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
+        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r