Przez moją niewiedzę tyle się z tym męczyłem. Dla tych co mieli, bądź mają problemy z integracją ibrowser z tinymce.
1. Ściągamy najnowszą wersję tinymce oraz ibrowser.
2. Po wgraniu tinymce na serwer, wrzucamy do folderu plugins folder ibrowser.
3. Tworzymy plik tiny_mce_init.js
Kod
tinyMCE.init({
// General options
mode : "textareas",
language : "pl",
theme : "advanced",
editor_deselector : "mceNoEditor",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iesp
ell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,pa
s
te,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,temp
l
ate,ibrowser",
extended_valid_elements : "iframe[src|width|height|name|align]",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justify
center,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizesele
c
t",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outd
ent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,ibrowser,cleanup,help,cod
e
,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespe
ll,media,advhr,|,print,|,ltr,rtl,|,fullscreen,image",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acron
ym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
file_browser_callback : 'myFileBrowser',
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
//noconvert URL
convert_urls : false,
relative_urls : false,
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
// General options
mode : "textareas",
language : "pl",
theme : "advanced",
editor_deselector : "mceNoEditor",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iesp
ell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,pa
s
te,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,temp
l
ate,ibrowser",
extended_valid_elements : "iframe[src|width|height|name|align]",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justify
center,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizesele
c
t",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outd
ent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,ibrowser,cleanup,help,cod
e
,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespe
ll,media,advhr,|,print,|,ltr,rtl,|,fullscreen,image",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acron
ym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
file_browser_callback : 'myFileBrowser',
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
//noconvert URL
convert_urls : false,
relative_urls : false,
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
4. Przechodzimy do katalogu pluginu ibrowser/config/config.inc
Zmieniamy ścieżkę dostępu do katalogu w którym będą pliki (katalog musi mieć uprawnienia do zapisu!).
Jak widać to jest tablica, możemy przekazać w niej kilka katalogów, gdyż z poziomu ibrowser nie możemy ich tworzyć (albo tego nie zauważyłem ).
Kod
$cfg['ilibs'] = array ( // image library path with slashes; absolute to root directory - please make sure that the directories have write permissions
array (
'value' => '/public/store/',
'text' => 'Galeria',
),
);
array (
'value' => '/public/store/',
'text' => 'Galeria',
),
);
5. Po odpaleniu tinymce i kliknięciu na ibrowser pojawi się okienko zo zarządzania plikami.
Mam nadzieję, że komuś się przyda.