View previous topic :: View next topic |
Author |
Message |
johannes Smarty Regular
Joined: 10 May 2003 Posts: 85 Location: Malmö, Sweden
|
Posted: Sat May 24, 2003 6:29 pm Post subject: Smarty and SPAW-editor |
|
|
Hi list
Im thinking of using SPAW html-editor (see http://sourceforge.net/projects/spaw) and Smarty thogether.
Is it anybody on this forum that has done this before? Please let me know about problems and think-abouts, if there are any.... How did you solve this? and so on, tips and tricks.
...or is there a better html-editor too use?
/JohannesF |
|
Back to top |
|
Justin Smarty Regular
Joined: 07 May 2003 Posts: 38 Location: Vilnius, Lithuania
|
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Sun May 25, 2003 7:31 am Post subject: |
|
|
Well the new htmlArea works with Mozilla 1.3 browsers so its not IE only anymore _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
Justin Smarty Regular
Joined: 07 May 2003 Posts: 38 Location: Vilnius, Lithuania
|
Posted: Sun May 25, 2003 11:33 am Post subject: |
|
|
AZTEK wrote: | Well the new htmlArea works with Mozilla 1.3 browsers so its not IE only anymore |
but htmlArea v3 is still in alpha mode. and it's not working with my firebird0.6 (mozilla 1.4b based).. but stable version of htmlArea v3 will be realy cool. _________________ http://www.baubas.net |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jun 11, 2003 10:57 pm Post subject: |
|
|
I've been toying with the SPAW control (thanks for pointing it out johannes -- SPAW is pretty cool) and have implemented a Smarty custom plugin function to wrap it. It works -- in degrees -- but I am having a little bit of a problem with paths.
In particular, I am trying to keep all of the server-side Spaw code base out of my web root and then I want to put the client libraries and resources (js, css, img files) in directories of my choosing in the web root. Has anyone already done something like that?
In the meantime, I have the entire Spaw package located in a subdirectory off the webroot and it still isn't completely happy with that. The demos work okay, even with that setup, but I think only because they are in a subdir of the spaw directory. What doesn't work are the dialogs -- I'm not getting syntax errors anymore, but they aren't working as they are in the demo and I'm sure its because of the darn paths. I think SPAW wants to be at the document root.
I have to take another look at htmlArea--its been awhile and I got caught up by SPAW's flashy look Still, SPAW sure beats using <textarea> !
Okay, it is so simplistic, I'm embarassed to post it, but perhaps it will save a lazy soul a few keystrokes; here is the current state of the my custom {editor} function plugin. You'll obviously have to modify it a bit to match your website and spaw installation, but apparently I'm not the one to look for advice on that
[php:1:4319925d68]<?php
// this part determines the physical root of your website
define('DR', MY_ROOT_DIR.'www/');
// include the control file
include_once DR.'spaw/config/'.'spaw_control.config.php';
include_once DR.'spaw/'.'spaw_control.class.php';
/**
* Smarty function plugin
* -------------------------------------------------------------
* Type: function
* Name: editor
* Version: 1.0
* Author: boots
* Purpose: create a spaw editor control
* -------------------------------------------------------------
* @param name required form name for control
* @param data optional data that control will start with
* @param lang optional country code for language, default: en
* @param toolbar optional toolbar style, default: SPAW default
* @param width optional control width (css units), default: 200
* @param height optional control height (css units), default: 400
* @param stylesheet optional stylesheet to use for styling SPAW, default: SPAW default
* @param theme optional theme to use for styling SPAW, default: SPAW default
* @param styles optional array of drop down style options, default set in function
*/
function smarty_function_editor( $params, &$this )
{
extract ( $params );
if ( empty( $name ) ) {
$this->trigger_error('editor: required parameter "name" missing');
} else {
$_styles['style']['default'] = 'Default';
$_styles['style']['crazystyle1'] = 'Crazy style no. 1';
$_styles['style']['crazystyle2'] = 'Crazy style no. 2';
$_styles['style']['crazystyle3'] = 'Crazy style no. 3';
if (!isset($data) || empty($data)) $data = '';
if (!isset($lang) || empty($lang)) $lang = 'en';
if (!isset($toolbar) || empty($toolbar)) $toolbar = '';
if (!isset($width) || empty($width)) $width = 200;
if (!isset($height) || empty($height)) $height = 90;
if (!isset($stylesheet) || empty($stylesheet)) $stylesheet = '';
if (!isset($theme) || empty($theme)) $theme = '';
if (!isset($styles) || empty($styles) || !is_array($styles)) $styles = $_styles;
$sw = new SPAW_Wysiwyg( $name, stripslashes($data),
$lang, $toolbar, $theme,
$width, $height, $stylesheet, $styles );
return $sw->getHtml();
}
}
?>[/php:1:4319925d68]
Good Luck! |
|
Back to top |
|
Hpatoio Smarty Rookie
Joined: 29 Apr 2003 Posts: 25 Location: Italy
|
Posted: Tue Jun 17, 2003 2:40 pm Post subject: I'm trying too ... :| |
|
|
boots wrote: |
In particular, I am trying to keep all of the server-side Spaw code base out of my web root and then I want to put the client libraries and resources (js, css, img files) in directories of my choosing in the web root. Has anyone already done something like that?
|
Hello, I'm also getting crazy with Spaw setup.
The demo works ok but, what I want is to have SPAW in one directory and use the same installation for all the sites ...
If someone has any idea or has done it, please let me know ...
Bye Simone |
|
Back to top |
|
Hpatoio Smarty Rookie
Joined: 29 Apr 2003 Posts: 25 Location: Italy
|
Posted: Thu Jun 19, 2003 9:03 am Post subject: Finally |
|
|
boots wrote: | I've been toying with the SPAW control (thanks for pointing it out johannes -- SPAW is pretty cool) and have implemented a Smarty custom plugin function to wrap it. It works -- in degrees -- but I am having a little bit of a problem with paths. |
Hello, finally I've foud a way to have one installation of SPAW for may domains.
Anyway I can't post it here, because I have changed almost all the SPAW's files ... as soon as I can I'll let you know how I did it !
Have a lucky day
Simone |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Jun 19, 2003 9:49 am Post subject: |
|
|
@Hpatoio: That sounds great! I started to dig into the path problems and saw that I would have to be messing with the source files, so I put it aside again to ponder. Would you be willing to post a patch or diff so that I can see where the affected areas are?
It would be nice to have the ability to simply drop-in new versions of spaw, but it sounds like that is less likely to happen . |
|
Back to top |
|
Hpatoio Smarty Rookie
Joined: 29 Apr 2003 Posts: 25 Location: Italy
|
Posted: Thu Jun 26, 2003 1:43 pm Post subject: Finally ... |
|
|
Hej ... ok, sorry if I've been away 4 a while ...
I wanted to test my works before to spread it ... and now I think to have a stable and multi-domain version of SPAW
I'm going to write to the SPAW developers to see if they want to integrate my changes in the official release ...
But anyway, if you want I can send you a ZIP file with all the files !
It's your job to understand how it works ...
documentation is not provided !!!
So if you want these files let me know how to give them to U !
Ciao ciao
Simone |
|
Back to top |
|
blue Smarty Rookie
Joined: 07 Aug 2003 Posts: 7
|
Posted: Thu Oct 16, 2003 10:18 am Post subject: |
|
|
do you still have the zip package??? |
|
Back to top |
|
Hpatoio Smarty Rookie
Joined: 29 Apr 2003 Posts: 25 Location: Italy
|
Posted: Thu Oct 16, 2003 10:31 am Post subject: |
|
|
blue wrote: | do you still have the zip package??? |
I'll look for it this evening ...
Did you do something like that too ?? Or ...
Ciao ... |
|
Back to top |
|
blue Smarty Rookie
Joined: 07 Aug 2003 Posts: 7
|
Posted: Thu Oct 16, 2003 10:49 am Post subject: |
|
|
well i'm trying too..... i was just wondering how you did it. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Oct 16, 2003 5:50 pm Post subject: |
|
|
I tried both a few months ago and I heartily suggest htmlArea over SPAW. It is easier to integrate and appears to have a better licence and larger dev community. I've been very happy with htmlArea but pulled a lot of hairs out with SPAW, even after using Hpatio's customizations (thanks Hpatio). htmlArea v3 (currently beta) is also a big improvement over the v2. |
|
Back to top |
|
blue Smarty Rookie
Joined: 07 Aug 2003 Posts: 7
|
Posted: Fri Oct 17, 2003 7:33 am Post subject: |
|
|
did you release it as a plugin?? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Oct 17, 2003 1:46 pm Post subject: |
|
|
@blue: if you mean htmlArea -- check it out -- there is no need to release it as a plugin |
|
Back to top |
|
|