Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1657 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  tinyMCE et Ibrowser

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

tinyMCE et Ibrowser

n°1761706
dougui_bzh
Posté le 18-07-2008 à 17:14:06  profilanswer
 

Bonjour, j'ai tenté d'installer Ibrowser pour tinyMCE afin de pouvoir uploader des images lors ce que j'écris un texte.
J'ai suivi ce tuto : http://seoroot.com/blog/computing/ [...] lugin.html
 
J'ai donc ceci dans config.inc.php :
 

Code :
  1. //-------------------------------------------------------------------------
  2. // use static image libraries  
  3. $cfg['ilibs'] = array (                // image library path with slashes; absolute to root directory - please make sure that the directories have write permissions  
  4.  array (
  5.   'value'    => '/jourj/images/',
  6.   'text'     => 'Images du site',
  7.  ),
  8. );
  9. //-------------------------------------------------------------------------
  10. // use dynamic image libraries - if $cfg['ilibs_inc'] is set, static image libraries above are ignored
  11. // image directories to be scanned
  12. $cfg['ilibs_dir']     = array('/jourj/images/news/');          // image library path with slashes; absolute to root directory - please make sure that the directories have write permissions
  13. $cfg['ilibs_dir_show'] = true;              // show main library (true) or only sub-dirs (false)
  14. $cfg['ilibs_inc']      = realpath(dirname(__FILE__) . '/../scripts/rdirs.php');  // file to include in ibrowser.php (useful for setting $cfg['ilibs] dynamically


 
ceci dans editor_plugin.js et editor_plugin_src (placé dans jscripts/tiny_mce/plugin/ibrowser)
 

Code :
  1. // ================================================
  2. // PHP image browser - iBrowser  
  3. // ================================================
  4. // iBrowser - tinyMCE editor interface (IE & Gecko)
  5. // ================================================
  6. // Developed: net4visions.com
  7. // Copyright: net4visions.com
  8. // License: GPL - see license.txt
  9. // (c)2005 All rights reserved.
  10. // File: editor_plugin.js
  11. // ================================================
  12. // Revision: 1.0                   Date: 12/31/2005
  13. // ================================================
  14. //-------------------------------------------------------------------------
  15. // tinyMCE editor - ibrowser info
  16. function TinyMCE_ibrowser_getInfo() {
  17.  return {
  18.   longname  : 'iBrowser',
  19.   author    : 'net4visions.com',
  20.   authorurl : 'http://net4visions.com',
  21.   infourl   : 'http://net4visions.com',
  22.   version   : '1.3.2'
  23.  };
  24. };
  25. // tinyMCE editor - open iBrowser
  26. function TinyMCE_ibrowser_getControlHTML(control_name) {
  27.  switch (control_name) {
  28.   case 'ibrowser':
  29.    return '<img id="{$editor_id}_ibrowser" src="{$pluginurl}/images/ibrowser.gif" title="iBrowser" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="(iBrowser_click(\'{$editor_id}\'));">';
  30.   }
  31.  return '';
  32. }
  33. //-------------------------------------------------------------------------
  34. // tinyMCE editor - init iBrowser
  35. function iBrowser_click(editor) {
  36.  ib.isMSIE = (navigator.appName == 'Microsoft Internet Explorer');
  37.  ib.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
  38.  ib.oEditor = tinyMCE.getInstanceById(editor);
  39.  ib.editor = editor;
  40.  ib.selectedElement = ib.getSelectedElement();
  41.  ib.baseURL = tinyMCE.baseURL + '/plugins/ibrowser/ibrowser.php';
  42.  iBrowser_open(); // starting iBrowser
  43. }
  44. //-------------------------------------------------------------------------
  45. // include common interface code
  46. var js  = document.createElement('script');
  47. js.type = 'text/javascript';
  48. js.src  = tinyMCE.baseURL + '/plugins/ibrowser/interface/common.js';
  49. // Add the new object to the HEAD element.
  50. document.getElementsByTagName('head')[0].appendChild(js) ;
  51. //-------------------------------------------------------------------------  
  52. // ================================================
  53. // PHP image browser - iBrowser  
  54. // ================================================
  55. // iBrowser - tinyMCE editor interface (IE & Gecko)
  56. // ================================================
  57. // Developed: net4visions.com
  58. // Copyright: net4visions.com
  59. // License: GPL - see license.txt
  60. // (c)2005 All rights reserved.
  61. // File: editor_plugin.js
  62. // ================================================
  63. // Revision: 1.0                   Date: 12/31/2005
  64. // ================================================
  65. //-------------------------------------------------------------------------
  66. // tinyMCE editor - ibrowser info
  67. function TinyMCE_ibrowser_getInfo() {
  68.  return {
  69.   longname  : 'iBrowser',
  70.   author    : 'net4visions.com',
  71.   authorurl : 'http://net4visions.com',
  72.   infourl   : 'http://net4visions.com',
  73.   version   : '1.3.2'
  74.  };
  75. };
  76. // tinyMCE editor - open iBrowser
  77. function TinyMCE_ibrowser_getControlHTML(control_name) {
  78.  switch (control_name) {
  79.   case 'ibrowser':
  80.    return '<img id="{$editor_id}_ibrowser" src="{$pluginurl}/images/ibrowser.gif" title="iBrowser" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="(iBrowser_click(\'{$editor_id}\'));">';
  81.   }
  82.  return '';
  83. }
  84. //-------------------------------------------------------------------------
  85. // tinyMCE editor - init iBrowser
  86. function iBrowser_click(editor) {
  87.  ib.isMSIE = (navigator.appName == 'Microsoft Internet Explorer');
  88.  ib.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
  89.  ib.oEditor = tinyMCE.getInstanceById(editor);
  90.  ib.editor = editor;
  91.  ib.selectedElement = ib.getSelectedElement();
  92.  ib.baseURL = tinyMCE.baseURL + '/plugins/ibrowser/ibrowser.php';
  93.  iBrowser_open(); // starting iBrowser
  94. }
  95. //-------------------------------------------------------------------------
  96. // include common interface code
  97. var js  = document.createElement('script');
  98. js.type = 'text/javascript';
  99. js.src  = tinyMCE.baseURL + '/plugins/ibrowser/interface/common.js';
  100. // Add the new object to the HEAD element.
  101. document.getElementsByTagName('head')[0].appendChild(js) ;
  102. //-------------------------------------------------------------------------  
  103. /**
  104. http://wiki.moxiecode.com/index.php/...ate_plugin/3.x
  105. */
  106. (function() {
  107. tinymce.create('tinymce.plugins.IBrowserPlugin', {
  108. init : function(ed, url) {
  109. // Register commands
  110. ed.addCommand('mceIBrowser', function() {
  111. // Internal image object like a flash placeholder
  112. if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
  113. return;
  114. ed.windowManager.open({
  115. file : url + '/ibrowser.php',
  116. //width : 480 + parseInt(ed.getLang('ibrowser.delta_width', 0)),
  117. //height : 385 + parseInt(ed.getLang('ibrowser.delta_height', 0)),
  118. width : 700 ,
  119. height : 500 ,
  120. inline : 1
  121. }, {
  122. plugin_url : url
  123. });
  124. });
  125. // Register buttons
  126. ed.addButton('ibrowser', {
  127. title : 'Ajouter une image',
  128. cmd : 'mceIBrowser',
  129. image : url + '/images/ibrowser.gif'
  130. });
  131. // Add a node change handler, selects the button in the UI when a image is selected
  132. ed.onNodeChange.add(function(ed, cm, n) {
  133. cm.setActive('ibrowser', n.nodeName == 'IMG');
  134. });
  135. },
  136. createControl : function(n, cm) {
  137. return null;
  138. },
  139. getInfo : function() {
  140. return {
  141. longname : 'IBrowser pour tinyMCE 3',
  142. author : 'D. Ghysels',
  143. authorurl : '',
  144. infourl : '',
  145. version : tinymce.majorVersion + "." + tinymce.minorVersion
  146. };
  147. }
  148. });
  149. // Register plugin
  150. tinymce.PluginManager.add('ibrowser', tinymce.plugins.IBrowserPlugin);
  151. })();


 
et ceci dans ma page HTML :
 

Code :
  1. <script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
  2. <script type="text/javascript">
  3. tinyMCE.init({
  4.  mode: "textareas",
  5.  elements: "template_content",
  6.  theme: "advanced",
  7.  language: "fr",
  8.  plugins : "ibrowser",
  9.  theme_advanced_buttons2 : "ibrowser"
  10. });
  11. </script>


 
J'ai aussi mi les droits des dossiers en 755 comme indiqué dans la doc.
 
Cela marche en partie mais j'ai 3 problèmes.
 
1: Je n'arrive pas avoir la langue en français (peut être faut il installer un pack?)
2: J'arrive à uploader un image mais que je clique sur "insert", la fenêtre se ferme et rien n'est ajouter dans ma textarea.
3: Lorsque je lui demander de créer un dossier Firefox me met "Pour afficher cette page, les informations précédemment transmises par Firefox doivent être renvoyées. Ceci répètera toute action (telle qu'une recherche ou un ordre d'achat) entreprise précédemment." et je dois cliquer sur annuler sinon il me créer plusieurs dossier...
 
Qu'est je fais de mal?
 
Merci d'avance pour votre aide.

mood
Publicité
Posté le 18-07-2008 à 17:14:06  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  tinyMCE et Ibrowser

 

Sujets relatifs
TinyMce apres de l'ajax. Attribuer des toolbars différentesinstaller tinymce
Probleme d'URL tinyMCEtinyMCE et reformatage HTML
Problème avec TinyMCEurl dans TinyMCE
- TinyMCE > Fonctionne en localhost pas en ligneTinyMCE et son mode Advanced
Gros problème avec les accents avec tinymce (encodage ?) 
Plus de sujets relatifs à : tinyMCE et Ibrowser


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR