<?php if (!defined('PmWiki')) exit (); /* * This script allows to embed Mindjet MindManager map in pmwiki pages. * Original source code from WMPlayer by HansB * Adapted for MindjetMap by Stéphane Heckel * * Markup (:mindjetmap Attach:filename width=number height=number [key=value] [key=value] ... :) * Example (:mindjetmap Attach:mymap.mmpa width=100% height=600:) * use Attach:filename or http://urlpath/filepath/filename * height= an width= parameters are mandatory * * other parameters can be supplied to control viewer's behaviour * Description of HTML Object Element * Object element: On Microsoft Internet Explorer, this will show an ActiveX Object: * id attribute: the id of the viewer so that it can be accessed via scripting * height attribute: the height of the viewer control * width attribute: the width of the viewer control * codeBase attribute: the location of the installer for the Mindjet Map Viewer. If the viewer is not installed, then Internet Explorer will attempt to install the viewer from this address. If you want to host the .cab file on your own site, please send a request to hostViewer@mindjet.com. * classid attribute: the classid of the Mindjet Map Viewer (this is required) * Image param: the URL to the .mmap or .xml file that will be shown in the viewer * EmptySpaceMenu param: 1 to show a context menu when right-clicking on empty space in the viewer * Toolbar param: 1 to show the toolbar at the top of the viewer * FitLevels param: the number of levels to show in the map, 0 to show all levels * PurchaseCommand param: 1 to show the Purchase MindManager link in the Help Menu * PromoSpace param: 1 to show a small promotional button in the upper right corner of the viewer * * Version History * --------------- * 13 mai 2007 : initial release */ # set to 0 to disable loading of files with http://urlpath... SDV($EnableExternalResource, 1); Markup('mindjetmap', '<img', "/\\(:mindjetmap (.*?:)(.*?)(\\s.*?)?\\s*?:\\)/e", "MindjetMap('$1','$2','$3')"); function MindjetMap($imap, $path, $args) { global $UploadFileFmt, $pagename, $PageUrl, $PubDirUrl, $IMapLinkFmt, $EnableExternalResource; if ($EnableExternalResource==1 && $imap=='http:') { $exturl=1; $FileUrl = 'http:'.$path; } else { $filepath = FmtPageName("$UploadFileFmt/".$path, $pagename); if (file_exists($filepath)) $IMapLinkFmt['Attach:'] = '$LinkUrl'; $FileUrl = LinkUpload($pagename, $imap, $path, $path, $path); } if (file_exists($filepath) || $exturl==1) { $args = ParseArgs($args); ## object tag $out = "<object id=\"viewer\" "; $out.= "classid=\"clsid:4C57C98A-E582-46E4-8FD8-5EBDC94CEA39\" "; $out.= "codebase=\"http://www.mindjetmap.com/viewer/ax/en/MjMmViewer.cab\" "; if (isset($args['width'])) $out .= " width=\"".$args['width']."\""; if (isset($args['height'])) $out .= " height=\"".$args['height']."\""; $out .= ">"; $out .= "<param name=\"Image\" value=\"$FileUrl\" />"; foreach ($args as $key => $arg) if ($key != '#') $out .= "<param name=\"$key\" value=\"$arg\" />"; $out .= "<param name=\"PurchaseCommand\" value='0' />"; $out .= "<param name=\"PromoSpace\" value='0' />"; $out .= "</object>"; return Keep($out); } if($imap=='http:') return ""; else return Keep($FileUrl); }