First commit
This commit is contained in:
13
cms/plugins/filebrowser/editorhooks/tinymce/index.php
Normal file
13
cms/plugins/filebrowser/editorhooks/tinymce/index.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/* utf-8 marker: äöü */
|
||||
if($s < 0){ return '';}
|
||||
$script = file_get_contents(dirname(__FILE__) . '/tinymce.js');
|
||||
$base = CMSIMPLE_ROOT . 'plugins/';
|
||||
$prefix = CMSIMPLE_BASE;
|
||||
$script = str_replace('%URL%', $base . 'filebrowser/editorbrowser.php?editor=tinymce&prefix='. $prefix .'&base=./&level=' . $l[$s], $script);
|
||||
|
||||
return $script;
|
||||
/*
|
||||
* end of plugins/wr_filebrowser/tinymce.php
|
||||
*/
|
||||
?>
|
34
cms/plugins/filebrowser/editorhooks/tinymce/script.php
Normal file
34
cms/plugins/filebrowser/editorhooks/tinymce/script.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
$script = '
|
||||
<script>
|
||||
|
||||
|
||||
var FileBrowserDialogue = {
|
||||
|
||||
init : function () {
|
||||
// Nothing to do
|
||||
},
|
||||
|
||||
|
||||
submit : function (url) {
|
||||
var URL = url;
|
||||
var args = top.tinymce.activeEditor.windowManager.getParams();
|
||||
var win = args.window;
|
||||
var input = win.document.getElementById(args.input);
|
||||
|
||||
input.value = URL;
|
||||
if (input.onchange) input.onchange(); //??? falls noch ein anderer trigger ???
|
||||
top.tinymce.activeEditor.windowManager.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setLink(link){
|
||||
|
||||
FileBrowserDialogue.submit(link);
|
||||
return true;
|
||||
}
|
||||
|
||||
</script>';
|
||||
?>
|
33
cms/plugins/filebrowser/editorhooks/tinymce/tinymce.js
Normal file
33
cms/plugins/filebrowser/editorhooks/tinymce/tinymce.js
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
function wrFilebrowser (field_name, url, type, win) {
|
||||
poppedUpWin = win;
|
||||
inputField = field_name;
|
||||
|
||||
// alert("Field_Name: " + field_name + "nURL: " + url + "nType: " + type + "nWin: " + win); // debug/testing
|
||||
|
||||
var cmsURL = "%URL%";
|
||||
|
||||
if (cmsURL.indexOf("?") < 0) {
|
||||
cmsURL = cmsURL + "?type="+ type ;
|
||||
}
|
||||
else {
|
||||
cmsURL = cmsURL + "&type="+type ;
|
||||
}
|
||||
|
||||
tinyMCE.activeEditor.windowManager.open(
|
||||
{
|
||||
file : cmsURL,
|
||||
width : 800,
|
||||
height : 600,
|
||||
resizable : "yes",
|
||||
inline : "yes",
|
||||
close_previous : "no",
|
||||
popup_css : false
|
||||
},
|
||||
{
|
||||
window : win,
|
||||
input : field_name
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
Reference in New Issue
Block a user