mise a jour pour mtweb.0.9.0
[mw_pages] / app / out / default / tiny_mce / plugins / tinybrowser / tb_tinymce.js.php
diff --git a/app/out/default/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php b/app/out/default/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php
new file mode 100644 (file)
index 0000000..b19dad7
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+require_once("config_tinybrowser.php");
+
+$tbpath = pathinfo($_SERVER['SCRIPT_NAME']);
+$tbmain = $tbpath['dirname'].'/tinybrowser.php';
+?>
+
+ function tinyBrowser (field_name, url, type, win) {
+
+    /* If you work with sessions in PHP and your client doesn't accept cookies you might need to carry
+       the session name and session ID in the request string (can look like this: "?PHPSESSID=88p0n70s9dsknra96qhuk6etm5").
+       These lines of code extract the necessary parameters and add them back to the filebrowser URL again. */
+
+    var cmsURL = "<?php echo $tbmain; ?>";    // script URL - use an absolute path!
+    if (cmsURL.indexOf("?") < 0) {
+        //add the type as the only query parameter
+        cmsURL = cmsURL + "?type=" + type;
+    }
+    else {
+        //add the type as an additional query parameter
+        // (PHP session ID is now included if there is one at all)
+        cmsURL = cmsURL + "&type=" + type;
+    }
+
+    tinyMCE.activeEditor.windowManager.open({
+        file : cmsURL,
+        title : 'Tiny Browser',
+        width : <?php echo $tinybrowser['window']['width']; ?>, 
+        height : <?php echo $tinybrowser['window']['height']; ?>,
+        resizable : "yes",
+                 scrollbars : "yes",
+        inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
+        close_previous : "no"
+    }, {
+        window : win,
+        input : field_name
+    });
+    return false;
+  }
\ No newline at end of file