Add javascript to recordActions: Difference between revisions
Appearance
New page: Actually I just got this working by digging into the code of class.atkrecordlist.inc. If the keyword "javascript:" is preappended to the url, a javascript function is automatically creat... |
No edit summary |
||
| Line 1: | Line 1: | ||
{{howto|easy|Jorge Garifuna}} | |||
Actually I just got this working by digging into the code of class.atkrecordlist.inc. | Actually I just got this working by digging into the code of class.atkrecordlist.inc. | ||
| Line 5: | Line 7: | ||
Below is my working code to create popup from recordActions(): | Below is my working code to create popup from recordActions(): | ||
<syntaxhighlight lang="php"> | |||
public function recordActions($record, &$actions, &$mra) | |||
{ | |||
$url = session_url(dispatch_url("somemodule.somenode", "helloworld"), SESSION_NESTED); | |||
$actions["hello"] = 'javascript:window.open ("'.$url.'","split","location=0,status=0,scrollbars=1,width=600,height=600")'; | |||
} | |||
</syntaxhighlight> | |||
Latest revision as of 07:38, 10 February 2010
|
ATK Howto: Add javascript to recordActions
|
Actually I just got this working by digging into the code of class.atkrecordlist.inc.
If the keyword "javascript:" is preappended to the url, a javascript function is automatically created.
Below is my working code to create popup from recordActions():
public function recordActions($record, &$actions, &$mra)
{
$url = session_url(dispatch_url("somemodule.somenode", "helloworld"), SESSION_NESTED);
$actions["hello"] = 'javascript:window.open ("'.$url.'","split","location=0,status=0,scrollbars=1,width=600,height=600")';
}