ShowVisioAction


This is the development page for the ShowVisio action

Please feel free to make changes or leave comments!

There are 2 ways to show a Visio document within a Wikka page and they both require the MS Visio Viewer plugin.
You can get it from http://www.microsoft.com/downloads/details.aspx?FamilyID=3fb3bd5c-fed1-46cf-bd53-da23635ab2df&displaylang=en

I have tested it with IE and it works very well. Sadly, it does not work with Firefox.
  1. Using an action
{{visio url="http://devpc/application%20data/rpc_http_diagram.vsd" height="750" width="900"}}
!This was based on the Mindmap.php action. Thanks go to the author of that action!
  1. Using iframe
{{iframe width="1200" height="2000" url="http://devpc/application%20data/rpc_http_diagram.vsd"}}

I came up with the action before I realised that it could also be done with an iframe. If anyone can point out the pros/cons of each approach, I'd be grateful.

<?php

/*
Display a Microsoft Visio diagram within a Wikka page. Works with IE only!

Sample usage:
    {{visio url="http://devpc/application%20data/rpc_http_diagram.vsd" height="750" width="900"}}
    Height and Width are optional.

Nick Damoulakis
19nov2005

*/


$visio_url = $vars['url'];
if ((!$visio_url && !$height) && $wikka_vars) $visio_url = $wikka_vars;
$visio_url = $this->cleanUrl(trim($visio_url));
$height = $this->htmlspecialchars_ent(trim($vars['height']));
$width = $this->htmlspecialchars_ent(trim($vars['width']));

if ($visio_url) {

    if (!$height)
        {
            $height = "650";
        }

    if (!$width)
        {
            $width = "550";
        }

    $output =
        "<script type=\"text/javascript\" language=\"JavaScript\">\n".
        "<!--\n".
        "    if(!navigator.javaEnabled()) {\n".
        "        document.write('Please install a <a href=\"http://www.java.com/\">Java Runtime Environment</a> on your computer.');\n".
        "    }\n".
        "function popup(mylink, windowname)\n".
        "{\n".
        "if (! window.focus)return true;\n".
        "var href;\n".
        "if (typeof(mylink) == 'string')\n".
        "   href=mylink;\n".
        "else\n".
        "   href=mylink.href;\n".
        "window.open(href, windowname, ',type=fullWindow,fullscreen,scrollbars=yes');\n".
        "return false;\n".
        "}\n".
        "//-->\n".
        "</script>\n".
        "<OBJECT classid=\"CLSID:279D6C9A-652E-4833-BEFC-312CA8887857\"".
        "codebase=\"http://download.microsoft.com/download/4/5/2/452f8090-413f-408f-83c0-edd66db786ee/vviewer.exe\"".
        "id=\"viewer1\" width=".$width." height=".$height.">".
        "<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=".$visio_url.">".
        "<param name=\"CurrentPageIndex\" value=\"0\">".
        "<param name=\"Zoom\" value=\"-1\">".
        "</object>\n".
        "<br />$visio_url\n";

    print($output);

} else {
    echo "<span class='error'><em>Error: Invalid visio action syntax. <br /> Proper usage: {{visio http://domain.com/visiodiagram.vsd}} or {{visio url=\"http://domain.com/visiodiagram.vsd\"}}</em></span>";
}

?>




Categories

CategoryUserContributions
There is one comment on this page. [Display comment]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki