Allow main navigation to have an external link

Bug #1449770 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Robert Lyon
15.10
Fix Released
Undecided
Unassigned

Bug Description

Currently the main (top) navigation in Mahara appends the site's wwwroot to the url given in the menu array.

However the right side navigation lets one specify a different wwwroot for a menu item to allow for external links.

We need to add this functionality to the top navigation as well to allow better integration of mahara within other web systems.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/4712

Revision history for this message
Robert Lyon (robertl-9) wrote :

To test:

Add this code to htdocs/local/lib.php

function local_main_nav_update(&$menu) {
    $menu['support'] = array(
        'path' => 'support',
        'wwwroot' => 'http://docs.myportfolio.school.nz/',
        'url' => 'index.html',
        'title' => 'External link',
        'weight' => 50,
    );
}

You should see a new link in the menu called 'External link' - before patch the link should fail - afterwards it should work correctly

tags: added: no-behat-needed
Revision history for this message
Jinelle Foley-Barnes (jinelleb) wrote :

Hi Rob,

There's no lib.php in my local, so I created on and added this and it just showed this script under the all the headings on the the dashboard page.

Maybe the code I'm supposed to be editing is in a different directory?

Cheers,
Jinelle

Revision history for this message
Robert Lyon (robertl-9) wrote :

Ah, if you don't already have a local/lib.php file then make one with the opening php tag, like thus:

<?php

function local_main_nav_update(&$menu) {
    $menu['support'] = array(
        'path' => 'support',
        'wwwroot' => 'http://docs.myportfolio.school.nz/',
        'url' => 'index.html',
        'title' => 'External link',
        'weight' => 50,
    );
}

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/4712
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/179f3948c12adaacf2fc6a022900f70a50a51019
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 179f3948c12adaacf2fc6a022900f70a50a51019
Author: Robert Lyon <email address hidden>
Date: Wed Apr 29 09:59:29 2015 +1200

Bug 1449770 - allowing mainnav menu items to specify wwwroot

To allow for external links to be placed there

Change-Id: I014a25e6969fae0214381c4ce08f76b7e7a453e2
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.