开发者

TinyMCE or CKeditor intergration problems with Zend

The folder structure looks like this:

Application
-- Layouts
---- layout.phtml (the 'template' file which loads all the .phtml files into, like insert.phtml form the pages folder, and loads init.js)
-- Modules
---- Admin
------ Views
-------- Scripts
---------- Pages
------------ insert.phtml (the actual file where I want to use tinyMCE)
Library
Public
-- Tinymce
---- tiny_mc.js
-- Jquery
---- init.js (loads the tiny_mce.js file using this code:

I call this to a textarea using Loader, and that looks like this:

$('.textEditor').Loader({
  url: ['../../../tinymce/tiny_mce.js'],
  debug: [true],
  cache: [true],
  success: function(target){
   tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    editor_selector : "textEditor",
    plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

    // Theme options
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
    theme_开发者_如何转开发advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,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,
   });
  }
 });

When I look into my console I get this:

Loading: ../../../tinymce/tiny_mce.js
Loaded: ../../../tinymce/tiny_mce.js (126ms)
/dgpcms/public/admin/pages/insert//langs/en.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/dgpcms/public/admin/pages/insert//plugins/style/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/dgpcms/public/admin/pages/insert//plugins/layer/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/dgpcms/public/admin/pages/insert//plugins/table/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/dgpcms/public/admin/pages/insert//themes/advanced/editor_template.jsFailed to load resource: the server responded with a status of 404 (Not Found)

.... and so on for all plugins ....

How can I get tinyMCE to ignore the MVC structure of the Zend App? Or how to solve this problem...

Thanks in advance

This is the contents of my .htacces file as found in my public folder:

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule !\.(js|ico|gif|jpg|png|css|txt|swf)$ index.php

Edit: 03-11-2010

Changed something in the .htaccess file, and changed it back how it was setup before (as in the above situation), but the error has changed:

Loading: ../../../tinymce/tiny_mce.js
Loaded: ../../../tinymce/tiny_mce.js (230ms)
/langs/en.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/themes/advanced/editor_template.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/plugins/layer/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/plugins/table/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/plugins/save/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)

And so on for all plugins

So it's now looking in an other folder then before. Anybody any idea?

Edit: 05-11-2010

This is really bugging me out! I tried it with CKeditor, but the same problem occurs. I tried putting a .htaccess file in the folder (both for tinyMCE and CKeditor) with 'RewriteEngine Off', but that didn't make any difference.

Edit: 22-11-2010

Loading the tinyMCE on my layout file works. Not the best solution in this way, but it's better then nothing...


I suppose your putting this JS code on the view , but i would do some modification

    <?php
          $this->headScript()->captureStart();
                        /* insert some javascript here */
    $('.textEditor').Loader({
      url: [$this->baseUrl("tinymce/tiny_mce.js")],
      //// don't forget to add the rest of your javascript code here 
     });
         $this->headScript()->captureEnd();
    echo $this->headScript();
    ?>

now $this->baseUrl() will calculate the best link instead of hard-coding it manually for more info check out http://framework.zend.com/manual/en/zend.view.helpers.html


Can you not just use:

$('.textEditor').Loader({
    url: ['/tinymce/tiny_mce.js'],
    ...


There is not really an answer to this. Since this question my setup has changed a lot. I use Loader to load all the texteditor settings and that works great. I don't know if this question can be removed or closed but I don't think it will contribute in anyway....

There is not really an good answer (both are equaly in value in my opinion) so I'm accepting this one so it is answered/closed in a way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜