<?php if (!defined('PmWiki')) exit();
/*  Copyright 2005 Kevin R. Koltz (kevin.koltz@gmail.com)
    This file is distributed under the terms of the GNU General Public 
    License as published by the Free Software Foundation; either 
    version 2 of the License, or (at your option) any later version.  

    This module enables embedding of Visio Drawings (.vsd) files into
    wiki pages.  It also allows the the size of the drawing to be
    controlled by width= and height= in WikiStyles.

    To use this module, simply place this file in the cookbook/ directory
    and add the following line into config.php:

        include_once('cookbook/vsd.php');

*/

SDV($SwfTagFmt,"<object classid='CLSID:279D6C9A-652E-4833-BEFC-312CA8887857'
	codebase='http://download.microsoft.com/download/4/5/2/452f8090-413f-408f-83c0-edd66db786ee/vviewer.exe' >
	<param name='BackColor' value='16777120'>
	<param name='AlertsEnabled' value='1'>
	<param name='ContextMenuEnabled' value='1'>
	<param name='GridVisible' value='0'>
	<param name='HighQualityRender' value='1'>
	<param name='PageColor' value='16777215'>
	<param name='PageVisible' value='1'>
	<param name='PropertyDialogEnabled' value='1'>
	<param name='ScrollbarsVisible' value='1'>
	<param name='ToolbarVisible' value='1'>
	<param name='SRC' value='\$LinkUrl'>
	<param name='CurrentPageIndex' value='0'>
	<param name='Zoom' value='-1'>
</object>");

Markup('vsd', '<urllink', 
  "/\\b(?>(\\L))([^\\s$UrlExcludeChars]+\\.vsd)/e",
  "Keep(\$GLOBALS['LinkFunctions']['$1'](\$pagename,'$1','$2',NULL,'$1$2',
    \$GLOBALS['SwfTagFmt']), 'L')");

SDVA($WikiStyleAttr,array(
  'height' => 'object',
  'width' => 'object'));

?>