import mtweb.0.4.1
[mtweb] / web / libs / tiny_mce / plugins / tinybrowser / tb_tinymce.js.php
1 <?php
2
3 require_once("config_tinybrowser.php");
4
5 $tbpath = pathinfo($_SERVER['SCRIPT_NAME']);
6 $tbmain = $tbpath['dirname'].'/tinybrowser.php';
7 ?>
8
9  function tinyBrowser (field_name, url, type, win) {
10
11     /* If you work with sessions in PHP and your client doesn't accept cookies you might need to carry
12        the session name and session ID in the request string (can look like this: "?PHPSESSID=88p0n70s9dsknra96qhuk6etm5").
13        These lines of code extract the necessary parameters and add them back to the filebrowser URL again. */
14
15     var cmsURL = "<?php echo $tbmain; ?>";    // script URL - use an absolute path!
16     if (cmsURL.indexOf("?") < 0) {
17         //add the type as the only query parameter
18         cmsURL = cmsURL + "?type=" + type;
19     }
20     else {
21         //add the type as an additional query parameter
22         // (PHP session ID is now included if there is one at all)
23         cmsURL = cmsURL + "&type=" + type;
24     }
25
26     tinyMCE.activeEditor.windowManager.open({
27         file : cmsURL,
28         title : 'Tiny Browser',
29         width : <?php echo $tinybrowser['window']['width']; ?>, 
30         height : <?php echo $tinybrowser['window']['height']; ?>,
31         resizable : "yes",
32                   scrollbars : "yes",
33         inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
34         close_previous : "no"
35     }, {
36         window : win,
37         input : field_name
38     });
39     return false;
40   }