Last modified: 2008-03-21 23:29:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5172, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3172 - PHPTal templates don't support setOnloadHandler
PHPTal templates don't support setOnloadHandler
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.9.x
PC All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: javascript
  Show dependency treegraph
 
Reported: 2005-08-17 04:18 UTC by Jonah Bossewitch
Modified: 2008-03-21 23:29 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Proposed patch (657 bytes, patch)
2007-02-06 11:47 UTC, Stefan Brüns
Details

Description Jonah Bossewitch 2005-08-17 04:18:30 UTC
Skin.php sets the onload body attr based on the onLoadHandler calls:

$a['onload'] = $wgOut->getOnloadHandler();
		if( $wgUser->getOption( 'editsectiononrightclick' ) ) {
			if( $a['onload'] != '' ) {
				$a['onload'] .= ';';
			}
			$a['onload'] .= 'setupRightClickEdit()';
		}
		return $a;

But, when using PHPTal (some of us still prefer these skins), functions set
using setOnLoadHandler calls are ignored.

We need something like
$tpl->set( 'onload', $wgOut->getOnloadHandler(); 

and a corresponding tal:attribute="onload onload" in the .pt file.

Of course, changes like this would be far easier to incorporate if there were a
runHook that passed through the $tmp so arbitrary variables could be set which
were available from the templates.

In this particular case, unobstrusive javascript can be used to set onload
handlers, but this is inconsistent with the setOnloadHandler api.

thanks,
/jsb
Comment 1 Stefan Brüns 2007-02-06 11:46:38 UTC
The patch adds a call to $wgOut->getOnloadHandler() and puts the result into the right 
variable.
Comment 2 Stefan Brüns 2007-02-06 11:47:25 UTC
Created attachment 3190 [details]
Proposed patch
Comment 3 Brion Vibber 2008-03-21 23:29:07 UTC
PHPTal skin support is now dead.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links