Absolute URL Path in Editor spaw2

Please post answers on the most frequently asked questions about CMSimple
Post Reply
leamaus
Posts: 90
Joined: Sat Jul 05, 2008 7:58 pm

Absolute URL Path in Editor spaw2

Post by leamaus » Sun Nov 30, 2008 1:59 pm

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

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Absolute URL Path in Editor spaw2

Post by cmb » Fri Sep 09, 2011 1:29 pm

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
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply