<?php register_plugin('addscript','JSSnow_plugin_handler_load',1); register_plugin('addscript','JSSnow_plugin_handler_execute',1); require_once('JSSnow.inc.php'); function JSSnow_plugin_handler_load($pluginEnv) { return array('src'=>$pluginEnv->root.'JSSnow.js'); } function JSSnow_plugin_handler_execute($pluginEnv) { $configxml=JSSnow_load_config($pluginEnv); $js ="(new UNIWITS.JSSnow({" ."maxpoints: ".$configxml->maxpoints."," ."pointspersec: ".$configxml->pointspersec."," ."rightmargin: ".$configxml->rightmargin."," ."bottommargin: ".$configxml->bottommargin."," ."zIndex: ".$configxml->zIndex."," ."gravity: {dx:".$configxml->gravitydx.",dy:".$configxml->gravitydy."}," ."snowpicurl: ".((string)$configxml->snowpicurl?"'".$configxml->snowpicurl."'":'null') ."})).activate();\n"; return $js; } ?>