Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00c6579
commit 0329c9c
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
tinyMCE.init({ | ||
mode : "textareas", | ||
theme : "modern", | ||
//theme : "advanced", | ||
plugins : "fullpage", | ||
theme_advanced_toolbar_location : "top", | ||
theme_advanced_toolbar_align : "left", | ||
theme_advanced_statusbar_location : "bottom", | ||
theme_advanced_resizing : true, | ||
extended_valid_elements : "iframe[src|width|height|name|align]", | ||
entity_encoding : "numeric", | ||
file_browser_callback : 'yanelLookupResource', | ||
}); | ||
|
||
function yanelLookupResource(field_name, url, type, win) { | ||
|
||
// alert("Field_Name: " + field_name + "\nURL: " + url + "\nType: " + type + "\nWin: " + win); // debug/testing | ||
|
||
/* 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. */ | ||
|
||
if (window.location.pathname.charAt(window.location.pathname.length) != "/") { | ||
path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/") + 1) | ||
} | ||
var cmsURL = path + BACK2REALM + "usecases/tinymce-lookup.html" // script URL | ||
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; | ||
} | ||
// INFO: Suppress the toolbar | ||
cmsURL = cmsURL + "&yanel.target-back2realm=" + BACK2REALM + "&yanel.toolbar=suppress"; | ||
|
||
tinyMCE.activeEditor.windowManager.open({ | ||
file : cmsURL, | ||
title : 'Lookup', | ||
width : 420, // Your dimensions may differ - toy around with them! | ||
height : 400, | ||
resizable : "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; | ||
} |