Absolute URL Path in Editor spaw2

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

Absolute URL Path in Editor spaw2

Postby 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: 12007
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Absolute URL Path in Editor spaw2

Postby 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, but not for CMSimple 4+


Return to “FAQ's”

Who is online

Users browsing this forum: No registered users and 2 guests