Skip to content

Commit

Permalink
MDL-56553 tool_usertours: add admin and course tours
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwyllie committed Dec 1, 2016
1 parent 3eb3d91 commit 10df630
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 4 deletions.
5 changes: 4 additions & 1 deletion admin/tool/usertours/classes/manager.php
Expand Up @@ -786,7 +786,10 @@ public static function update_shipped_tours() {
// A list of tours that are shipped with Moodle. They are in
// the format filename => version. The version value needs to
// be increased if the tour has been updated.
$shippedtours = [];
$shippedtours = [
'boost_administrator.json' => 1,
'boost_course_view.json' => 1,
];

$existingtourrecords = $DB->get_recordset('tool_usertours_tours');

Expand Down
4 changes: 2 additions & 2 deletions admin/tool/usertours/db/upgrade.php
Expand Up @@ -35,11 +35,11 @@
function xmldb_tool_usertours_upgrade($oldversion) {
global $CFG, $DB;

if ($oldversion < 2016102002) {
if ($oldversion < 2016112900) {
// Update the tours shipped with Moodle.
manager::update_shipped_tours();

upgrade_plugin_savepoint(true, 2016102002, 'tool', 'usertours');
upgrade_plugin_savepoint(true, 2016112900, 'tool', 'usertours');
}

return true;
Expand Down
32 changes: 32 additions & 0 deletions admin/tool/usertours/lang/en/tool_usertours.php
Expand Up @@ -137,3 +137,35 @@
$string['viewtour_info'] = 'This is the \'{$a->tourname}\' tour. It applies to the path \'{$a->path}\'.';
$string['viewtour_edit'] = 'You can <a href="{$a->editlink}">edit the tour defaults</a> and <a href="{$a->resetlink}">force the tour to be displayed</a> to all users again.';
$string['tour_resetforall'] = 'The state of the tour has been reset. It will be displayed to all users again.';

// Boost - administrator tour.
$string['tour1_title_welcome'] = 'Welcome';
$string['tour1_content_welcome'] = 'Welcome to the Boost theme for Moodle 3.2. If you\'ve used Moodle before you might find some things look a bit different.';
$string['tour1_title_navigation'] = 'Navigation';
$string['tour1_content_navigation'] = 'Major navigation is now though this nav drawer. The contents update depending on where you are in the site. Use the button at the top to hide or show it.';
$string['tour1_title_customisation'] = 'Customisation';
$string['tour1_content_customisation'] = 'To customise the look of your site and the front page, use the settings menu in the corner of this header. Try turning editing on right now.';
$string['tour1_title_blockregion'] = 'Block region';
$string['tour1_content_blockregion'] = 'There is still a block region over here. We recommend removing the Navigation and Settings blocks completely, as all the functionality is elsewhere in the Boost theme.';
$string['tour1_title_addingblocks'] = 'Adding blocks';
$string['tour1_content_addingblocks'] = 'In fact, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle mobile app, so as a general rule it\'s much better to make sure your site works well without any blocks.';
$string['tour1_title_end'] = 'End of tour';
$string['tour1_content_end'] = 'This has been a user tour, a new feature in Moodle 3.2. It won\'t show again unless you reset it using the link in the footer. As an admin you can also create your own tours like this!';

// Boost - course view tour.
$string['tour2_title_welcome'] = 'Welcome';
$string['tour2_content_welcome'] = 'Welcome to the Boost theme for Moodle 3.2. If you\'ve used Moodle before you might find things look a bit different here on the course page.';
$string['tour2_title_customisation'] = 'Customisation';
$string['tour2_content_customisation'] = 'To change any course settings, use the settings menu in the corner of this header. You will find a similar settings menu on the home page of every activity, too. Try turning editing on right now.';
$string['tour2_title_navigation'] = 'Navigation';
$string['tour2_content_navigation'] = 'Major navigation is now though this nav drawer. Use the button at the top to hide or show it. You will see that there are links for major sections of your course.';
$string['tour2_title_opendrawer'] = 'Open the nav drawer';
$string['tour2_content_opendrawer'] = 'Try opening the nav drawer now.';
$string['tour2_title_participants'] = 'Course participants';
$string['tour2_content_participants'] = 'View participants here. This is also where you go to add or remove students.';
$string['tour2_title_addblock'] = 'Add a block';
$string['tour2_content_addblock'] = 'If you enable editing mode you can add blocks from the nav drawer. However, think carefully about including any blocks on your pages. Blocks are not shown on Moodle mobile app, so for the best student experience it is much better to make sure your course works well without any blocks.';
$string['tour2_title_addingblocks'] = 'Adding blocks';
$string['tour2_content_addingblocks'] = 'You can add blocks to this page using this button. However, think carefully about including any blocks on your pages. Blocks are not shown on Moodle mobile app, so for the best student experience it is much better to make sure your course works well without any blocks.';
$string['tour2_title_end'] = 'End of tour';
$string['tour2_content_end'] = 'This has been a user tour, a new feature in Moodle 3.2. It won\'t show again unless you reset it using the link in the footer. The site admin can also create further tours for this site if required.';
2 changes: 2 additions & 0 deletions admin/tool/usertours/tours/boost_administrator.json
@@ -0,0 +1,2 @@
{"name":"Boost - administrator","description":"A tour for Administrator's new to the Boost theme","pathmatch":"FRONTPAGE","enabled":"1","sortorder":"0","configdata":"{\"placement\":\"bottom\",\"orphan\":\"0\",\"backdrop\":\"1\",\"reflex\":\"0\",\"filtervalues\":{\"role\":[\"-1\"],\"theme\":[\"boost\"]},\"majorupdatetime\":1479366244,\"default_tour\":true,\"filename\":\"boost_administrator.json\",\"version\":1}","version":"2016102001","steps":[{"title":"tour1_title_welcome,tool_usertours","content":"tour1_content_welcome,tool_usertours","targettype":"2","targetvalue":"","sortorder":"0","configdata":"{}"},{"title":"tour1_title_navigation,tool_usertours","content":"tour1_content_navigation,tool_usertours","targettype":"0","targetvalue":"[data-region=\"drawer-toggle\"] button[data-action=\"toggle-drawer\"]","sortorder":"1","configdata":"{}"},{"title":"tour1_title_customisation,tool_usertours","content":"tour1_content_customisation,tool_usertours","targettype":"0","targetvalue":"body:not(.editing) #page-header .card-block","sortorder":"2","configdata":"{\"placement\":\"bottom\"}"},{"title":"tour1_title_blockregion,tool_usertours","content":"tour1_content_blockregion,tool_usertours","targettype":"0","targetvalue":"body.editing [data-region=\"blocks-column\"]","sortorder":"3","configdata":"{}"},{"title":"tour1_title_addingblocks,tool_usertours","content":"tour1_content_addingblocks,tool_usertours","targettype":"0","targetvalue":"body.editing [data-region=\"blocks-column\"]","sortorder":"4","configdata":"{\"placement\":\"bottom\"}"},{"title":"tour1_title_end,tool_usertours","content":"tour1_content_end,tool_usertours","targettype":"2","targetvalue":"","sortorder":"5","configdata":"{}"}]}

2 changes: 2 additions & 0 deletions admin/tool/usertours/tours/boost_course_view.json
@@ -0,0 +1,2 @@
{"name":"Boost - course view","description":"A tour for introducing administrators and teachers to courses in the Boost theme","pathmatch":"\/course\/view.php%","enabled":"1","sortorder":"1","configdata":"{\"placement\":\"bottom\",\"orphan\":\"0\",\"backdrop\":\"1\",\"reflex\":\"0\",\"filtervalues\":{\"role\":[\"-1\",\"editingteacher\"],\"theme\":[\"boost\"]},\"majorupdatetime\":1480050104}","version":"2016102001","steps":[{"title":"tour2_title_welcome,tool_usertours","content":"tour2_content_welcome,tool_usertours","targettype":"2","targetvalue":"","sortorder":"0","configdata":"{}"},{"title":"tour2_title_customisation,tool_usertours","content":"tour2_content_customisation,tool_usertours","targettype":"0","targetvalue":"body:not(.editing) #page-header .card-block","sortorder":"1","configdata":"{}"},{"title":"tour2_title_navigation,tool_usertours","content":"tour2_content_navigation,tool_usertours","targettype":"0","targetvalue":"[data-region=\"drawer-toggle\"] button[data-action=\"toggle-drawer\"]","sortorder":"2","configdata":"{}"},{"title":"tour2_title_opendrawer,tool_usertours","content":"tour2_content_opendrawer,tool_usertours","targettype":"0","targetvalue":"body:not(.drawer-open-left) [data-region=\"drawer-toggle\"] button[data-action=\"toggle-drawer\"]","sortorder":"3","configdata":"{}"},{"title":"tour2_title_participants,tool_usertours","content":"tour2_content_participants,tool_usertours","targettype":"0","targetvalue":"body.drawer-open-left [data-region=\"drawer\"] [data-key=\"participants\"]","sortorder":"4","configdata":"{\"placement\":\"bottom\",\"backdrop\":\"0\"}"},{"title":"tour2_title_addblock,tool_usertours","content":"tour2_content_addblock,tool_usertours","targettype":"0","targetvalue":"body.drawer-open-left:not(.editing) [data-region=\"drawer\"]","sortorder":"5","configdata":"{\"placement\":\"top\",\"orphan\":\"0\",\"backdrop\":\"0\",\"reflex\":\"0\"}"},{"title":"tour2_title_addingblocks,tool_usertours","content":"tour2_content_addingblocks,tool_usertours","targettype":"0","targetvalue":"body.drawer-open-left.editing [data-region=\"drawer\"] [data-key=\"addblock\"]","sortorder":"6","configdata":"{\"backdrop\":\"0\",\"placement\":\"top\"}"},{"title":"tour2_title_end,tool_usertours","content":"tour2_content_end,tool_usertours","targettype":"2","targetvalue":"","sortorder":"7","configdata":"{}"}]}

2 changes: 1 addition & 1 deletion admin/tool/usertours/version.php
Expand Up @@ -24,6 +24,6 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2016102001; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2016112900; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2016052300; // Requires this Moodle version.
$plugin->component = 'tool_usertours'; // Full name of the plugin (used for diagnostics).

0 comments on commit 10df630

Please sign in to comment.