|
[
Permalink
| « Hide
]
Jerome Mouneyrac added a comment - 23/Sep/09 02:52 PM
good catch, fixing it
Hi David,
I looked more into this bug. I'm quite sure this bug is not related directly to resource. In fact it's related to the function navmenu() into weblib which doesn't support no javascript. I think you wrote an issue for that: MDL-16158 Ahah you try to make me fix bug that other didn't want to fix but I caught you after thinking your old bug is just a bit similar, I have a look
Heh, I maintain that weblib patch in my local tree and had forgotten about that other bug!
Yes, they both relate to target="_top", but this is in the header breadcrumbs, and the other is about autolinks in uploaded files. Ok assigned to Sam Navigation Master, the problem is in build_navigation, line 3877:
$navigation .= "<a onclick=\"this.target='$CFG->framename'\" href=\"{$navlink['link']}\">"; We need a sort of test on no javascript, something like that Thank you Hi Guys,
Did a quick bit of research on this and it turns out that Petr provided us with a solution back in 2007 when he changed over the target attribute to a JS onclick event. If you would prefer to to use the target='..' attribute the simply add the following line into your Moodle site's config.php file somewhere after the call to include setup.php. config.php // This must be added AFTER `require_once($CFG->dirroot/lib/setup.php);` // or it will not work $CFG->frametarget = " target='$CFG->framename' "; Note: It will not replace the JS onclick event, but simply add a target attribute as well Commited small patch to ensure CFG->frametarget is used in all navigation code in 1.9 and patched 2.0 to ensure that the same occurs for links using OUTPUT->link (which the navigation does).
Please update to ensure consistency. Thanks all OK, so for users you basically ONLY need to just set "framename" in the admin settings GUI.
Developers need to include $CFG->frametarget in links that could potentially be inside a Moodle frame (eg navigation type things) I just added patches to 1.9 and 1.8 to FORCE the definition of frametarget to the top frames of resources to completely fix this for the resource module. Sam's hack in config.php a few comments back should never be needed.
tested, it works fine, thanks Sam, Martin and David. Closing the issue.
Note: I just tested on 1.9, this initial issue is fixed when javascript is disabled on 1.9.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||