Hi cchhita,
I am quite familiar with this problem with Spaw....the dev 1.2.3 has a new version script.js.php that strips out the absolute URL. This was a bug of the system itself, whose fix was posted by original developer and incorporated by OliG ( I think in 1.2.2+). The lack of an absolute URL, makes Spaw useless for newsletter creation...so I have looked at different alternatives (more later). Obviously it is a path problem you are having. You might want to take a look at dialogs/img_library.php, plus the config/spaw_control.config.php file and considering hard coding them.....at least this is what I have done in the past. What is strange about spaw is that sometimes it works and sometimes not....which suggests there is a wee bug in it. As I mentioned the scriipt.js fix is a workaround in my opinion.
But my own personal preference is to no longer use Spaw and go with FCKeditor2 FC. It can be downloaded from sourceforge (different than wcms version)......Pico has offered a lot of insights to get it to work. Having said that I am going to post my own findings.... I spent nearly a whole day yesterday...tweaking FCK to suit my needs and I think I have something that works. It does require about 5 minutes of hard coding:
FCKeditor2 - Modifications
(1) FCKeditor2 ROOT:
fckconfig.js
Import Wcms Sylesheets: This is Pico's idea - Allows using wcms stylesheets in FCKeditor!
Code: Select all
FCKConfig.EditorAreaCSS = FCKConfig.BasePath +'../../../../phpwcms_template/inc_css/frontend.css' ;
Enter your domain name:
Code: Select all
FCKConfig.BaseHref = 'http://www.myDomain.com' ;
Optional Skins settings: default | office 2003 | silver
(silver - my preference - similar look and feel to spaw editor)
Code: Select all
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/' ;
Declare PhpWcms version of toolbar set
Note: Only 3 drop downs Style, Fontname, Fontsize
This is because in summary section the toolbar gets truncated if there are 4
Also removed the 'save' (first line) since it creates a bug when working inside wcms:
Code: Select all
FCKConfig.ToolbarSets["phpwcms"] = [
['Source','-','NewPage'],
['Cut','Copy','Paste','PasteText','PasteWord','-'],
['Undo','Redo','-','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],['Templates'],
['Image'],['Table'],['Rule','SpecialChar'],
['TextColor','BGColor'],['About'],
['Style','FontName','FontSize']
] ;
Get rid of pesky insertion <P> tags (this is my preference)
Code: Select all
FCKConfig.UseBROnCarriageReturn = true ;
Point FCKEditor to use mcpuk version file manager (IMAGE PREVIEWS):
(uncomment the following lines)
Code: Select all
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/mcpuk/browser.html?
Connector=connectors/php/connector.php' ;
//Standardize browser window dialogue: (my preference for clients)
FCKConfig.LinkBrowserWindowWidth = 750 ;
FCKConfig.LinkBrowserWindowHeight = 540 ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/mcpuk/browser.html?
Type=Image&Connector=connectors/php/connector.php' ;
//Standardize browser window dialogue: (my preference for clients)
FCKConfig.ImageBrowserWindowWidth = 750 ;
FCKConfig.ImageBrowserWindowHeight = 540 ;
(2) FCKeditor2 ROOT:
fckstyles.xml
Declare Wcms Stylesheets in FCK Styles dropdown, change to suit.
COOL
Code: Select all
<Styles>
<Style name="Article Summary" element="span">
<Attribute name="class" value="articleSummary" />
</Style>
<Style name="Article Heading" element="span">
<Attribute name="class" value="articleHead" />
</Style>
<Style name="Article SubHeading" element="span">
<Attribute name="class" value="articleSubHead" />
</Style>
<Style name="Content Heading" element="span">
<Attribute name="class" value="contentHead" />
</Style>
<Style name="Content SubHeading" element="span">
<Attribute name="class" value="contentSubHead" />
</Style>
<Style name="Small Body Text" element="span">
<Attribute name="class" value="smallBodyText" />
</Style>
<Style name="Heading H1" element="h1" />
<Style name="Heading H2" element="h2" />
<Style name="Heading H3" element="h3" />
<Style name="Heading H4" element="h4" />
<Style name="Heading H5" element="h5" />
<Style name="Custom Italic" element="em" />
<Style name="Custom Ruler" element="hr">
<Attribute name="size" value="1" />
<Attribute name="color" value="#ff0000" />
</Style>
</Styles>
(3) FCKeditor2 ROOT
fckeditor.php
Instantiate Phpwcms version of toolbar:
Code: Select all
function FCKeditor( $instanceName )
{
$this->InstanceName = $instanceName ;
$this->BasePath = '/FCKeditor2/' ;
$this->Width = '100%' ;
$this->Height = '400' ;
$this->ToolbarSet = 'phpwcms' ;
$this->Value = '' ;
$this->Config = array() ;
}
(4) CREATE FOLDER @ SITE ROOT
(don't forget to chmod to 777 - read/write priviledges)
wysiwyg
then these subdirectories inside wysiwyg>>
Image
File
Flash
Media
(5) Define primary folder for FCK
(Pico had the idea to point to phpwcms_filestorage folder, but I encountered file permissions problems (600) in nix server setting, thus the strategy to create separate folder for FCK files. Edit this file:
\include\inc_ext\FCKEditor2\editor\filemanager\browser\mcpuk\connectors\php\config.php
//line 31 (uncomment)
Code: Select all
$fckphp_config['basedir']=$_SERVER['DOCUMENT_ROOT'];
//line 32 (comment out)
Code: Select all
//$fckphp_config['basedir'] = 'D:\Work\FCKEditor\www\FCKeditor.V2\editor\filemanager\browser\mcpuk' ;
//line 47: (add - no trailing /)
Code: Select all
$fckphp_config['UserFilesPath'] = "/wysiwyg" ;
(6) Hard code for absolute URL's (Useful if you are going to use to create newsletters) Edit this file:
\include\inc_ext\FCKEditor2\editor\filemanager\browser\mcpuk\frmresourceslist.html
Code: Select all
var sLink = '<a href="#" onclick="OpenFolder(\'http://www.myDomain.com' + escape(folderPath) + '\');return false;">' ;
var dLink = '<a href="#" onclick="DeleteFolder(\'http://www.myDomain.com' + escape(folderName) + '\');return false;">' ;
var rLink = '<a href="#" onclick="RenameFolder(\'http://www.myDomain.com' + escape(folderName) + '\');return false;">' ;
So that is the basic set of changes to get it to work. There are however other plugins if you wish to implement. They are pretty well documented. I did find the CSS Editor problematic, since I was unable to use it in a span setting....applied formatting globally... also no save funtionality. Pico has included another plugin Wei Zhuo's Image Manager in his zip, which is nice, but was unable to get the absolute URL to work....and did not spend time on trying to hard code...it is nice however.
Options:
FCKeditor2 ROOT:
fcktemplates.xml
Nice feature that allows you to create templates for FCKeditor...
shows mini thumb, text description and 'onclick' inserts actual Html
(all Html markup is embedded in [CDATA[.....]] tag.)
(note: use absolute url path to images)
I hope this helps.....
Just posting this to add to other documentation of FCKeditor for wcms.
Cheers,
John
