*/ if (!defined('PmWiki')) exit(); /* * applet - Embed java applets into PmWiki 2.0 pages * Copyright 2005-2007 by D.Faure (dfaure@cpan.org) * Thanks to Shayne Steele (steele cs fsu edu) for the * article at: http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * See http://www.pmwiki.org/wiki/Cookbook/Applet for info. */ $RecipeInfo['Applet']['Version'] = '2007-12-05'; Markup('applet', 'directives', "/\\(:applet(\\s+.*)\\s*:\\)/e", "AppletMarkup(PSS('$1'))"); function AppletMarkup($args) { return Applet(ParseArgs($args, '(?>([\\w\\.]+)[:=])')); } function Applet($opt) { global $FarmPubDirUrl, $AppletRootCodebase, $AppletClassid, $AppletCabUrl, $AppletNotHandledFmt, $AppletParams; SDV($AppletRootCodebase, "$FarmPubDirUrl/applets"); SDV($AppletClassid, "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"); SDV($AppletCabUrl, "http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab"); SDV($AppletNotHandledFmt, " This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.
\n"); $opt = array_merge((array)$AppletParams, (array)$opt); unset($opt['#'], $opt['-'], $opt['+'], $opt['']); $code = @$opt['code']; unset($opt['code']); $archive = @$opt['archive']; unset($opt['archive']); $width = @$opt['width']; unset($opt['width']); $height = @$opt['height']; unset($opt['height']); $codebase = @preg_replace('!^/?!', "$AppletRootCodebase/", $opt['codebase']); unset($opt['codebase']); $out = array(); $out[] = " "; foreach($opt as $n => $v) $out[] = " "; $out[] = " "; if($archive) $out[] = " "; foreach($opt as $n => $v) $out[] = " "; $out[] = " $AppletNotHandledFmt "; return '<:block>'.Keep(implode("\n", $out)); }