Function onload in cms.php

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Post Reply
jerry
Posts: 177
Joined: Fri Jul 25, 2008 8:54 pm
Location: Denmark
Contact:

Function onload in cms.php

Post by jerry » Fri Oct 17, 2008 8:07 am

Cmsimple has a function onload witch gets at global string $onload and returns it.

Code: Select all

function onload() {
	global $onload;
	return "$onload;
}
where $onload looks like this

Code: Select all

$onload="onload=self.focus();document.login.passwd.focus()";
In this way there are no place to more then one onload value and every additional $onload will replace the former one. The function is only used in login.php and in oedit.php.

I tried to solve the problem by adding load events thru javascript but unfotunetely it conflicts with oedit editor.

I will suggest the change of onload function in next version of CMSimple to something like this:

Code: Select all

function onload() {
	global $onload;
	return "onload=".$onload;
}
and the value of $onload will change to

Code: Select all

$onload.="self.focus();document.login.passwd.focus()";
......
$onload.="MyJavascriptFuntion()";
witch permits concatenation of onload arguments from f.eks. plugins

jerry
jerry/simplesolutions

harteg
Posts: 27
Joined: Wed May 28, 2008 11:55 am

Re: Function onload in cms.php

Post by harteg » Fri Nov 28, 2008 12:32 pm

Thx for your suggestion - I'll consider this.

Post Reply