Commit 02c2a424 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1729079: Create a mechanism to build manual links"

parents 853f1b43 dbf1ef2b
......@@ -12,6 +12,7 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'managegroups/groups');
define('SECTION_PAGE', 'manage');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$group = get_record_select('group', 'id = ? AND deleted = 0', array(param_integer('id')));
......
......@@ -11,7 +11,8 @@
define('INTERNAL', 1);
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'configusers');
define('MENUITEM', 'configusers/usersearch');
define('SECTION_PAGE', 'bulkedit');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once(get_config('docroot') . 'lib/antispam.php');
......
......@@ -16,6 +16,7 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('accountsettings', 'admin'));
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'edit');
require_once('activity.php');
require_once(get_config('docroot') . 'lib/antispam.php');
......
......@@ -14,7 +14,7 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('Institutions', 'admin'));
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'institutions');
require_once('license.php');
define('MENUITEM', 'manageinstitutions/institutions');
......@@ -54,7 +54,7 @@ if (!$USER->get('admin')) {
}
if ($institution || $add) {
define('SECTION_PAGE', 'institutionedit');
$authinstances = auth_get_auth_instances_for_institution($institution);
if (false == $authinstances) {
$authinstances = array();
......@@ -655,6 +655,7 @@ if ($institution || $add) {
}
else {
// Get a list of institutions
define('SECTION_PAGE', 'institutions');
require_once(get_config('libroot') . 'institution.php');
if (!$USER->get('admin')) { // Filter the list for institutional admins
$filter = $USER->get('admininstitutions');
......
......@@ -55,6 +55,7 @@ else if ($groupid = param_alphanum('group', null)) {
}
else {
define('TITLE', get_string('newblog', 'artefact.blog') . ': ' . get_string('blogsettings','artefact.blog'));
PluginArtefactBlog::set_blog_nav();
}
$form = array(
......
......@@ -22,6 +22,7 @@ if (!PluginArtefactPlans::is_active()) {
$id = param_integer('id',0);
if ($id) {
define('SECTION_PAGE', 'newtask');
$plan = new ArtefactTypePlan($id);
if (!$USER->can_edit_artefact($plan)) {
throw new AccessDeniedException(get_string('accessdenied', 'error'));
......@@ -30,6 +31,7 @@ if ($id) {
$form = ArtefactTypeTask::get_form($id);
}
else {
define('SECTION_PAGE', 'newplan');
define('TITLE', get_string('newplan','artefact.plans'));
$form = ArtefactTypePlan::get_form();
}
......
......@@ -108,6 +108,7 @@ foreach ($CFG as $key => $option) {
require('dml.php');
require('web.php');
require('user.php');
require('manualhelp.php');
// Optional local/lib.php file
$locallib = get_config('docroot') . 'local/lib.php';
if (file_exists($locallib)) {
......
......@@ -726,6 +726,7 @@ $string['privacystatement'] = 'Privacy statement';
$string['about'] = 'About';
$string['contactus'] = 'Contact us';
$string['legal'] = 'Legal';
$string['externalmanual'] = 'External manual';
// my account
$string['account'] = 'Settings';
......
......@@ -5759,5 +5759,16 @@ function xmldb_core_upgrade($oldversion=0) {
execute_sql("UPDATE {block_instance} SET title = '' WHERE blocktype IN ('myviews', 'mygroups', 'myfriends', 'wall')");
}
if ($oldversion < 2018022300) {
log_debug('Add "manualhelp" as a default footer link');
$footerlinkstr = get_config('footerlinks');
$footerlinks = unserialize($footerlinkstr);
if (!in_array('manualhelp', $footerlinks)) {
$footerlinks[] = 'manualhelp';
}
$footerlinkstr = serialize($footerlinks);
set_config('footerlinks', $footerlinkstr);
}
return $status;
}
This diff is collapsed.
......@@ -856,7 +856,7 @@ function core_install_firstcoredata_defaults() {
set_config('anonymouscomments', 1);
set_config('homepageinfo', 1);
set_config('showonlineuserssideblock', 1);
set_config('footerlinks', serialize(array('legal', 'about', 'contactus')));
set_config('footerlinks', serialize(array('legal', 'about', 'contactus', 'manualhelp')));
set_config('nousernames', 0);
set_config('onlineuserssideblockmaxusers', 10);
set_config('loggedinprofileviewaccess', 1);
......
......@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2018022200;
$config->version = 2018022300;
$config->series = '18.04';
$config->release = '18.04dev';
$config->minupgradefrom = 2015030409;
......
......@@ -3107,6 +3107,58 @@ function footer_menu($all=false) {
'title' => get_string('contactus'),
),
);
$helpkeys = null;
if (defined('MENUITEM')) {
$helpkey = ($USER->is_logged_in() ? '' : 'loggedout') . MENUITEM;
$helpkeys = explode('/', $helpkey);
}
if (defined('SECTION_PAGE')) {
$helpkeys[] = SECTION_PAGE;
}
if (defined('VIEW_TYPE')) {
$helpkeys[] = VIEW_TYPE;
}
// To handle the 'Report' pages where type/subtype are passed in as params
if (defined('MENUITEM') && MENUITEM == 'reports') {
if (param_exists('type')) {
$helpkeys[] = param_alpha('type');
}
if (param_exists('subtype')) {
$helpkeys[] = param_variable('subtype');
}
}
// To handle the configmanager page where plugintye/pluginname are
// passed in as params (not when defined as part of php file)
if (param_exists('plugintype')) {
$helpkeys[] = param_alpha('plugintype');
}
if (param_exists('pluginname')) {
$helpkeys[] = param_variable('pluginname');
}
// If we are in resume section
if (defined('RESUME_SUBPAGE')) {
$helpkeys[] = RESUME_SUBPAGE;
}
// If group is set
if (param_exists('group')) {
$helpkeys[] = 'group';
}
// If institution is set
if (param_exists('institution') || param_exists('i')) {
$helpkeys[] = 'institution';
}
// To handle when things have a 'new' state vs edit state
if (param_exists('id')) {
if (param_exists('new')) {
$helpkeys[] = 'new';
}
}
$menu['manualhelp'] = array('fullurl' => get_manual_help_link($helpkeys),
'title' => get_string('externalmanual'),
'url' => _get_manual_link_prefix(),
);
if ($all) {
return $menu;
}
......@@ -3126,6 +3178,7 @@ function footer_menu($all=false) {
}
}
}
return $menu;
}
......
......@@ -14,7 +14,7 @@ define('ADMIN', 1);
define('MENUITEM', 'configextensions/frameworks');
define('SECTION_PLUGINTYPE', 'module');
define('SECTION_PLUGINNAME', 'framework');
define('SECTION_PAGE', 'frameworks');
define('SECTION_PAGE', 'frameworkmanager');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('Framework', 'module.framework'));
......
......@@ -161,12 +161,28 @@ class BehatGeneral extends BehatBase {
}
/**
* Switches to the main Moodle window. Useful when you finish interacting with popup windows.
* Switches to the newly opened tab/window. Useful when you do not know name of window/tab.
*
* @Given /^I switch to the new window$/
*/
public function switch_to_the_new_window() {
$windowNames = $this->getSession()->getWindowNames();
if (count($windowNames) > 1) {
$this->getSession()->switchToWindow(end($windowNames));
}
else {
throw new Exception('Only one tab/window available.');
}
}
/**
* Switches to the main window. Useful when you finish interacting with other windows/tabs.
*
* @Given /^I switch to the main window$/
*/
public function switch_to_the_main_window() {
$this->getSession()->switchToWindow();
$windowNames = $this->getSession()->getWindowNames();
$this->getSession()->switchToWindow($windowNames[0]);
}
/**
......
......@@ -2,6 +2,9 @@
background-color: rgba(255, 255, 255, 0.7);
.footer-nav {
font-size: $font-size-small;
.icon-stack {
font-size: 0.75em;
}
}
.footer-performance-info {
......
......@@ -38,7 +38,11 @@
<ul class="nav nav-pills footer-nav pull-left">
{foreach from=$FOOTERMENU item=item name=footermenu}
<li>
{if $item.fullurl}
{$item.fullurl|safe}
{else}
<a href="{$item.url}">{$item.title}</a>
{/if}
</li>
{/foreach}
</ul>
......
......@@ -11,6 +11,7 @@
define('INTERNAL', 1);
define('MENUITEM', 'groups/findfriends');
define('SECTION_PAGE', 'removefriend');
require(dirname(dirname(__FILE__)) . '/init.php');
$id = param_integer('id');
......
......@@ -15,6 +15,7 @@ define('PUBLIC', 1);
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'internal');
define('SECTION_PAGE', 'view');
define('VIEW_TYPE', 'profile');
require(dirname(dirname(__FILE__)).'/init.php');
require_once('group.php');
......
......@@ -10,14 +10,18 @@ Background:
| UserA | Kupuhipa1 | test01@example.com | Angela | User | mahara | internal | member |
# Skins need to be enabled
Given the following site settings are set:
And the following site settings are set:
| field | value |
| skins | 1 |
Given the following "pages" exist:
And the following "pages" exist:
| title | description| ownertype | ownername |
| Page 01 | UserA's page 01 | user | UserA |
And the following "groups" exist:
| name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff |
| GroupA | admin | GroupA owned by admin | standard | ON | ON | all | ON | ON | UserA | |
Scenario: Showing contextual help for pages under menu "Portfolio" (Bug 809297).
When I log in as "UserA" with password "Kupuhipa1"
# Test pages and collections help
......@@ -81,3 +85,31 @@ Scenario: Showing contextual help for pages under menu "Portfolio" (Bug 809297).
And I choose "Import" in "Portfolio" from main menu
And I click on "Help"
Then I should see "You can import your (or any valid Leap2a) portfolio from another Mahara site yourself."
Scenario: Showing correct external manual help file for mahara page
# Test by going to pages and collections help for user / institution / site / group
When I log in as "admin" with password "Kupuhipa1"
And I choose "Pages and collections" in "Portfolio" from main menu
And I follow "Help" in the ".footer-nav" "css_element"
And I switch to the new window
And I should see "5.1.1. Overview page"
And I switch to the main window
When I am on homepage
And I choose "Pages and collections" in "Institutions" from administration menu
And I follow "Help" in the ".footer-nav" "css_element"
And I switch to the new window
And I should see "10.6.11. Institution pages and collections"
And I switch to the main window
When I am on homepage
And I choose "Pages and collections" in "Configure site" from administration menu
And I follow "Help" in the ".footer-nav" "css_element"
And I switch to the new window
And I should see "10.3.6. Site pages and collections"
And I switch to the main window
When I am on homepage
And I follow "GroupA"
And I follow "Pages and collections (tab)"
And I follow "Help" in the ".footer-nav" "css_element"
And I switch to the new window
And I should see "6.4.4. Pages and collections"
And I switch to the main window
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment