From 77d1efccba274a376cdc62f448d925275b850a97 Mon Sep 17 00:00:00 2001 From: taggon Date: Thu, 8 Dec 2011 06:26:44 +0000 Subject: [PATCH] issue 910: Hide material writer if the material module isn't exists git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9920 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/editor/skins/dreditor/editor.html | 4 ++-- modules/editor/skins/dreditor/js/DrEditor.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/editor/skins/dreditor/editor.html b/modules/editor/skins/dreditor/editor.html index bd7860fe1..5a5d7c83d 100644 --- a/modules/editor/skins/dreditor/editor.html +++ b/modules/editor/skins/dreditor/editor.html @@ -20,7 +20,7 @@ {@$cookie_tool=explode(',', $_COOKIE['DrEditorToolbar'])} -{@$default_tool=explode(',', 'hx,txt,material,link,list,quote,img,movie,file,hr,index')} +{@$default_tool=explode(',', 'hx,txt,'.($material_exists?'material,':'').'link,list,quote,img,movie,file,hr,index');} {@$external_components=array_keys($drComponentList)} {@$enable_tool=array_unique(array_merge($cookie_tool, $default_tool, (array)$external_components))} @@ -479,7 +479,7 @@ -
+
{$lang->edit->materials} diff --git a/modules/editor/skins/dreditor/js/DrEditor.js b/modules/editor/skins/dreditor/js/DrEditor.js index 6b0e45f5d..94c923fec 100644 --- a/modules/editor/skins/dreditor/js/DrEditor.js +++ b/modules/editor/skins/dreditor/js/DrEditor.js @@ -1238,7 +1238,7 @@ var ImageWriter = xe.createPlugin('ImageWriter', { var callback_id = ''+(new Date).getTime()+Math.ceil(Math.random()*1000); window[callback_id] = function(fileObj){ self.onfileuploaded(seq, callback_id, fileObj); } - var filesrl = _image.attr('class').match(/(?:^|\s)xe_filesrl_(\d+)(?:\s|$)/); + var filesrl = (_image.attr('class')||'').match(/(?:^|\s)xe_filesrl_(\d+)(?:\s|$)/); filesrl = (filesrl && filesrl[1])? filesrl[1] : ''; // upload file