SPAW CSS config

Gesperrt
djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

SPAW CSS config

Beitrag von djavet » Do 26. Feb 2004, 18:11

Hello,

After I read several tread, I write down my problem.
I try to include my CSS file into spaw.
I can't manage it... I use Contenido 4.4.3.

Here's the editor.php

Code: Alles auswählen

<?php

   $contenido_path = "../../../"; // CONTENIDO
  @include ("config.php"); // CONTENIDO
  @include ($contenido_path . "includes/config.php"); // CONTENIDO
   include $cfg["path"]["wysiwyg"].'config/spaw_control.config.php';
   include $cfg["path"]["wysiwyg"].'spaw_control.class.php';

/*
  $editor = new SPAW_Wysiwyg(
              $control_name='CMS_HTML', // control's name
              $value='',                  // initial value
              $lang='en',                 // language
              $mode = '',                 // toolbar mode
              $theme='',                  // theme (skin)
              $width='100%',              // width
              $height='300px',            // height
              $css_stylesheet='',         // css stylesheet file for content
              $dropdown_data=''           // data for dropdowns (style, font, etc.)
            );

$editor->show();*/

$sw = new SPAW_Wysiwyg('CMS_HTML',$a_content[$type][$typenr],$spaw_default_lang,
                       $toolbar_mode,'contenido','100%',$editorheight, $css_stylesheet /*stylesheet file*/);

$sw->show();

?>
[code]

My spaw_control_config.php 
[code]<?php
// ================================================
// SPAW PHP WYSIWYG editor control
// ================================================
// Configuration file for CONTENIDO
// ================================================
// Developed: Alan Mendelevich, alan@solmetra.lt
// Copyright: Solmetra (c)2003 All rights reserved.
// ------------------------------------------------
//                                www.solmetra.com
// ================================================
// Modified: Martin Horwath, horwath@opensa.org
// SPAW1.0.3 for Contenido 4.3.2.1, 2003-10-08 v0.1
// ================================================

   $contenido_path = "../../../../"; // CONTENIDO
  @include ("config.php"); // CONTENIDO
  @include ($contenido_path . "includes/config.php"); // CONTENIDO
  @include_once ($cfg["path"]["wysiwyg"] . 'class/lang.class.php'); // CONTENIDO
  @include_once ($cfg["path"]["contenido"].$cfg["path"]["includes"] . 'functions.i18n.php'); // CONTENIDO
  @include_once ($cfg["path"]["contenido"].$cfg["path"]["classes"] . 'class.user.php'); // CONTENIDO
   i18nInit($cfg["path"]["contenido"].$cfg["path"]["locale"], $belang);

if ($cfgClient["set"] != "set")
{
    $sql = "SELECT
                idclient,
                frontendpath,
                htmlpath,
                errsite_cat,
                errsite_art
            FROM
                ".$cfg["tab"]["clients"];

    $db = new DB_Contenido;
    $db->query($sql);

    while ($db->next_record())
    {
            $cfgClient["set"] = "set";
            $cfgClient[$db->f("idclient")]["path"]["frontend"] = $db->f("frontendpath");
            $cfgClient[$db->f("idclient")]["path"]["htmlpath"] = $db->f("htmlpath");
            $errsite_idcat[$db->f("idclient")] = $db->f("errsite_cat");
            $errsite_idart[$db->f("idclient")] = $db->f("errsite_art");

            $cfgClient[$db->f("idclient")]["images"] = $db->f("htmlpath")."images/";
            $cfgClient[$db->f("idclient")]["upload"] = "upload/";

            $cfgClient[$db->f("idclient")]["htmlpath"]["frontend"] = $cfgClient[$db->f("idclient")]["path"]["htmlpath"];
            $cfgClient[$db->f("idclient")]["upl"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"]."upload/";
            $cfgClient[$db->f("idclient")]["upl"]["htmlpath"] = $cfgClient[$db->f("idclient")]["htmlpath"]["frontend"]."upload/";
            $cfgClient[$db->f("idclient")]["upl"]["frontendpath"] = "upload/";
            $cfgClient[$db->f("idclient")]["css"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"] . "css/";
            $cfgClient[$db->f("idclient")]["js"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"] . "js/";

    }
}

// directory where spaw files are located
$spaw_root = $cfg['path']['wysiwyg'];
$spaw_dir = $cfg['path']['wysiwyg_html'];
$spaw_base_url = $cfgClient[$client]["path"]["htmlpath"].$cfgClient[$client]["upload"];

$spaw_default_toolbars = 'default';
$spaw_default_theme = 'default';
$langs = i18nGetAvailableLanguages(); // CONTENIDO
$spaw_default_lang = $langs[$belang][4]; // CONTENIDO
$spaw_default_css_stylesheet = $spaw_dir.'wysiwyg.css';

// add javascript inline or via separate file
$spaw_inline_js = false;

// use active toolbar (reflecting current style) or static
$spaw_active_toolbar = true;

// style data
$user = new User;
$user->loadUserByUserID($auth->auth["uid"]);
$styles = explode(";",$user->getUserProperty("wysiwyg","spaw-styles",true));

switch ($type)
{
	case "CMS_HTML":
			$editorheight = $user->getUserProperty("wysiwyg","spaw-height-html",true);
			break;
	case "CMS_HTMLHEAD":
			$editorheight = $user->getUserProperty("wysiwyg","spaw-height-head",true);
			break;
	default:
			$editorheight = $user->getUserProperty("wysiwyg","spaw-height",true);
			break;
}

echo $editorheight;

if (!is_numeric($editorheight))
{
	$editorheight = 350;
}

if (is_array($styles))
{
    foreach ($styles as $style)
    {
    	$spaw_dropdown_data['style'][$style] = $style;
    }
} else {
	/* Default styles */
    $spaw_dropdown_data['style']['default'] = 'Normal';
    $spaw_dropdown_data['style']['style1'] = 'Style No1';
    $spaw_dropdown_data['style']['style2'] = 'Style No2';
}

$toolbar_mode = $user->getUserProperty("wysiwyg","spaw-toolbar-mode",true);

if ($toolbar_mode == false)
{
	$toolbar_mode = "default";
}

$css_stylesheet = $cfgClient[$client]["path"]["htmlpath"].$user->getUserProperty("wysiwyg","spaw-stylesheet-file");

$spaw_dropdown_data['font']['Arial, Helvetica, Verdana, Sans Serif'] = 'Arial';
$spaw_dropdown_data['font']['Courier, Courier New'] = 'Courier';
$spaw_dropdown_data['font']['Tahoma, Verdana, Arial, Helvetica, Sans Serif'] = 'Tahoma';
$spaw_dropdown_data['font']['Times New Roman, Times, Serif'] = 'Times';
$spaw_dropdown_data['font']['Verdana, Tahoma, Arial, Helvetica, Sans Serif'] = 'Verdana';

$spaw_dropdown_data['fontsize']['1'] = '1';
$spaw_dropdown_data['fontsize']['2'] = '2';
$spaw_dropdown_data['fontsize']['3'] = '3';
$spaw_dropdown_data['fontsize']['4'] = '4';
$spaw_dropdown_data['fontsize']['5'] = '5';
$spaw_dropdown_data['fontsize']['6'] = '6';

$spaw_dropdown_data['paragraph']['<P>'] = 'Normal';
$spaw_dropdown_data['paragraph']['<H1>'] = 'Heading 1';
$spaw_dropdown_data['paragraph']['<H2>'] = 'Heading 2';
$spaw_dropdown_data['paragraph']['<H3>'] = 'Heading 3';
$spaw_dropdown_data['paragraph']['<H4>'] = 'Heading 4';
$spaw_dropdown_data['paragraph']['<H5>'] = 'Heading 5';
$spaw_dropdown_data['paragraph']['<H6>'] = 'Heading 6';

// allowed extentions for image files
$spaw_valid_imgs = array('gif', 'jpg', 'jpeg', 'png');

$spaw_debug = "Debug:<br>spaw_root:".$spaw_root."<br>spaw_base_url:".$spaw_base_url."<br>spaw_dir:".$spaw_dir
?>
And under the admin user control -> User-defined properties:
wysiwyg | spaw-stylesheet-file | css/metastyle.css

What is wrong?
Is the CSS file in the admin user propeties relative from where?

Many thx for your help.

Regards, Dom

emergence
Beiträge: 10645
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Do 26. Feb 2004, 19:08

in your case:

Code: Alles auswählen

$css_stylesheet = $cfgClient[$client]["path"]["htmlpath"].$user->getUserProperty("wysiwyg","spaw-stylesheet-file"); 
relative from the current client path...

you can try follwing code to see the path contenido generates for you:

Code: Alles auswählen

echo "Path:"$css_stylesheet;
just add this in editor.php

djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet » Do 26. Feb 2004, 21:04

Hello,

Yop, thx the path is correct.
How can I set the ropdown menu with the class I've set in my external file?
I see nothing how to do...

Regards, Dom

4423
Beiträge: 133
Registriert: Mi 3. Sep 2003, 10:46
Kontaktdaten:

Beitrag von 4423 » Fr 27. Feb 2004, 09:46

-------------------------------------------------------

http://www.pinger-eden.de

djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet » Fr 27. Feb 2004, 17:51

Yep! Thx a lot, it's working well ;o)

Just one question:
It is possible to apply the style to only one word instead of the whole paragraph?

I see a tip to set the word in bold and then apply the style, but if I remove the bold, it remove also the style...
BTW, what I mean is the <span class=...>my word</span> tag.

Regards, Dom

Gesperrt