2010-11-01 34 views
1

的文件夾結構TinyMCE的或CKEDITOR一體化的問題是這樣的:與Zend

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: 

我把這個用裝載機一textarea和看起來像這樣:

$('.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, 
    }); 
    } 
}); 

當我凝視我的控制檯我得到這個:

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) 

....等等所有插件....

如何讓tinyMCE忽略Zend App的MVC結構? 或如何解決這個問題?

在此先感謝

這是我.htacces文件的內容在我的公共文件夾中找到:

SETENV APPLICATION_ENV發展

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 

編輯:03-11-2010

更改.h中的某些內容taccess文件,並改回以前的樣子設置(如上面的情況),但錯誤已經改變:

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) 

等了所有插件

所以它現在正在尋找在其他然後纔是文件夾。任何人有任何想法?

編輯:05-11-2010

這是真的煩我了!我用CKeditor嘗試過,但同樣的問題發生。我嘗試在'RewriteEngine Off'文件夾中放置一個.htaccess文件(對於tinyMCE和CKeditor),但這沒有什麼區別。

編輯:22-11-2010

加載在我的佈局文件的工作TinyMCE的。不能以這種方式最好的解決辦法,但最好再沒有什麼......

回答

0

沒有真的是這個答案。由於這個問題我的設置已經改變了很多。我使用Loader來加載所有的texteditor設置,這很好。我不知道這個問題是否可以被刪除或關閉,但我不認爲它會有助於......

這裏沒有一個很好的答案(兩者在我看來都是相同的價值),所以我接受這個答案,所以它以某種方式回答/關閉。

1

我想你把這個JS的視圖代碼,但我會做一些修改

<?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(); 
    ?> 

現在$this->baseUrl()將計算最佳鏈接而不是硬編碼手動將其更多的信息請查看http://framework.zend.com/manual/en/zend.view.helpers.html

+0

tiny_mce.js從佈局模板中調用的外部文件(init.js)中調用,因此我無法在代碼中使用任何php。 – 2010-11-01 15:55:59

+0

那麼你gatta使用絕對url – tawfekov 2010-11-01 16:03:52

+0

與相對url沒有區別 – 2010-11-02 08:48:03

1

你能不能只用:

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

不,我不能,因爲現在它不指向tiny_mce.js文件 – 2010-11-01 15:51:13

+0

爲什麼,你的tiny_mce.js文件的路徑是什麼?你也可以發佈你的.htaccess的內容。 – 2010-11-03 16:57:48

+0

../../../tiny_mce.js是文件的正確路徑,我需要返回三個目錄的... 我的.htaccess文件的內容被添加到我的原始文章 – 2010-11-05 14:47:16