[Jaws-commits] r12498 - trunk/jaws/html/include/Jaws/Widgets

afz at jaws-project.com afz at jaws-project.com
Fri Jan 27 19:07:24 UTC 2012


Author: afz
Date: 2012-01-27 19:07:24 +0000 (Fri, 27 Jan 2012)
New Revision: 12498

Modified:
   trunk/jaws/html/include/Jaws/Widgets/TinyMCE.php
Log:
Checked Phoo and FileBrowser already installed in tinyMCE wrapper

Modified: trunk/jaws/html/include/Jaws/Widgets/TinyMCE.php
===================================================================
--- trunk/jaws/html/include/Jaws/Widgets/TinyMCE.php	2012-01-27 19:06:56 UTC (rev 12497)
+++ trunk/jaws/html/include/Jaws/Widgets/TinyMCE.php	2012-01-27 19:07:24 UTC (rev 12498)
@@ -212,10 +212,19 @@
         $this->_XHTML.= "<script type=\"text/javascript\">\n";
         $this->_XHTML.= $jawsPluginsFunctions;
 
-        $ibrowser = $GLOBALS['app']->getSiteURL(). '/'. BASE_SCRIPT. '?gadget=Phoo&action=BrowsePhoo';
-        $fbrowser = $GLOBALS['app']->getSiteURL(). '/'. BASE_SCRIPT. '?gadget=FileBrowser&action=BrowseFile';
+        $ibrowser = '';
+        if (Jaws_Gadget::IsGadgetInstalled('Phoo')) {
+            $ibrowser = $GLOBALS['app']->getSiteURL(). '/'. BASE_SCRIPT. '?gadget=Phoo&action=BrowsePhoo';
+        }
+
+        $fbrowser = '';
+        if (Jaws_Gadget::IsGadgetInstalled('FileBrowser')) {
+            $fbrowser = $GLOBALS['app']->getSiteURL(). '/'. BASE_SCRIPT. '?gadget=FileBrowser&action=BrowseFile';
+        }
+
         $this->_XHTML.= "function jaws_filebrowser_callback(field_name, url, type, win) {\n";
         $this->_XHTML.= "var browser = (type === 'image')? '$ibrowser' : '$fbrowser';\n";
+        $this->_XHTML.= "if (browser != '') {\n";
         $this->_XHTML.= "tinyMCE.activeEditor.windowManager.open({\n";
         $this->_XHTML.= "   file : browser,\n";
         $this->_XHTML.= "   title : 'My File Browser',\n";
@@ -229,6 +238,7 @@
         $this->_XHTML.= "   window : win,\n";
         $this->_XHTML.= "   input : field_name\n";
         $this->_XHTML.= "});\n";
+        $this->_XHTML.= "}\n";
         $this->_XHTML.= "return false;\n";
         $this->_XHTML.= "}\n";
 



More information about the Jaws-commits mailing list