Page 1 of 1

Absolute URL Path in Editor spaw2

Posted: Sun Nov 30, 2008 1:59 pm
by leamaus
In the spaw2 Editor for cmsimple there are wrong code to build internal links.

Here, I present some changes which lead to correct links:

1) Open the spaw.php file and search for:

Code: Select all

SpawConfig::setStaticConfigItem('strip_absolute_urls', false, SPAW_CFG_TRANSFER_JS); // useabsolute path for displaying image
Replace this line with:

Code: Select all

SpawConfig::setStaticConfigItem('strip_absolute_urls', true, SPAW_CFG_TRANSFER_JS); // useabsolute path for displaying image
2) Open the file spaw/class/editor.class.php and search for:

Code: Select all

$pagetpl .= '<iframe name="'.$pname.'_rEdit" id="'.$pname.'_rEdit" style="width: 100%; height: '.$this->height.'; display: '.(($this->name == $pname)?'inline':'none').';" frameborder="no" src="'.SpawConfig::getStaticConfigValue("SPAW_DIR").'empty/empty.html?'.microtime().'"></iframe>';
Replace this line with:

Code: Select all

$pagetpl .= '<iframe name="'.$pname.'_rEdit" id="'.$pname.'_rEdit" style="width: 100%; height: '.$this->height.'; display: '.(($this->name == $pname)?'inline':'none').';" frameborder="no" src="'.SpawConfig::getStaticConfigValue("SPAW_DIR").'.?'.microtime().'"></iframe>';
These few changes will fix the bug and internal links will be built correctly.

leamaus

Re: Absolute URL Path in Editor spaw2

Posted: Fri Sep 09, 2011 1:29 pm
by cmb
Hi Jugin,

I have no experience with the SPAW editor, and I guess nobody is currently maintaining this package. So I suggest you have a look at CMSimple_XH which comes bundled with a working FCKeditor.
Jugin wrote:Why does it place "xadmin/outils/spaw2/empty/" in the link ?
You have to adjust the file paths in the code you've changed:

Code: Select all

SpawConfig::setStaticConfigItem('DOCUMENT_ROOT', '/home/copierep/www/');
SpawConfig::setStaticConfigItem('SPAW_ROOT', '/home/copierep/www/xadmin/outils/spaw2/');
SpawConfig::setStaticConfigItem('SPAW_DIR', 'outils/spaw2/');
I can imagine that your first problem will be solved too, when the paths are correctly set.

Christoph