今天找到了時間,回頭關心一下找到的 template editor 問題。
關於前面提到的第二部份:剛安裝好的 template editor ,即使是 admin 也無法編輯,必需先
啟動 允許使用者編輯模版後再
取消啟用 才能讓 admin 使用的這個部份已經抓到問題了。因為剛安裝好的 plugin 沒有把
plugin_templateeditor_allowedextension 設定值加到 blog config 裡面,所以任何副檔名的檔案都是
不可編輯的 。
我在 plugintemplateeditor.class.php 裡面的 第19行後 加了下面幾行:
$pluginAllowedExtensions = $config->getValue( "plugin_templateeditor_allowedextension" );
if( empty( $pluginAllowedExtensions )){
$config->saveValue( "plugin_templateeditor_allowedextension", "css,inc,template,txt" );
}
在 pllugin 執行時先檢查
plugin_templateeditor_allowedextension 是否已設定,若沒有,就加上預設值。
在我的 LifeType 站已經試過可行。
Mark,這純粹是頭痛醫頭,腳痛醫腳的方式,你看看能不能用。