Seite 1 von 1

bug: spaw snapshot 21.11.2003

Verfasst: Mo 24. Nov 2003, 08:06
von emergence
an sich nichts tragisches... spaw_styles funktioniert nicht korrekt und noch ein paar kleinigkeiten - hab ein paar modifikationen und änderungen in ein paar dateien vorgenommen...

1. in spaw/config/spaw_controll.config.php -> wird komplett ersetzt...

Code: Alles auswählen

<?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.4.x, 2003-11-24 v0.2
// ================================================

   $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
  @include_once ($cfg["path"]["contenido"].$cfg["path"]["includes"] . 'functions.general.php'); // CONTENIDO
   i18nInit($cfg["path"]["contenido"].$cfg["path"]["locale"], $belang);

   if ($cfgClient["set"] != "set") // CONTENIDO
   {
      $db = new DB_Contenido;
      rereadClients();
   }

// 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;

// spaw configuration - CONTENIDO
$toolbar_mode = getEffectiveSetting("wysiwyg","spaw-toolbar-mode");

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

$spaw_theme = getEffectiveSetting("wysiwyg","spaw-theme");

if ($spaw_theme == false)
{
	$spaw_theme = "contenido";
}

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

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

$css_stylesheet = getEffectiveSetting("wysiwyg","spaw-stylesheet-file");

if ($css_stylesheet == false)
{
	$css_stylesheet = "";
}

$styles = getEffectiveSetting("wysiwyg","spaw-styles");

if ($styles == false)
{
    $spaw_dropdown_data['style']['default'] = 'Normal';
    $spaw_dropdown_data['style']['style1'] = 'Style No1';
    $spaw_dropdown_data['style']['style2'] = 'Style No2';
} else {
    $styles = explode(";",urldecode($styles));
    if (is_array($styles))
    {
        foreach ($styles as $style) // if there are more values
        {
    	    $spaw_dropdown_data['style'][$style] = $style;
        }
    } else {
        $spaw_dropdown_data['style'][$styles] = $styles; // for one value
    }
}

$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';

// extentions for image files
$spaw_valid_imgs = "'gif', 'jpg', 'jpeg', 'png'"; // Part of SQL Query

$spaw_debug = "Debug:<br>spaw_root:".$spaw_root."<br>spaw_base_url:".$spaw_base_url."<br>spaw_dir:".$spaw_dir
?>
2. in spaw/editor.php (die zeile für die editor definition)

Code: Alles auswählen

$sw = new SPAW_Wysiwyg('CMS_HTML', urldecode($a_content[$type][$typenr]), $spaw_default_lang,
                       $toolbar_mode, $spaw_theme, '100%', $editorheight, $css_stylesheet);
3. in spaw/dialogs/img_library.php beim sql query zeile 31 durch

Code: Alles auswählen

filetype IN ($spaw_valid_imgs)
ersetzen...

begründung:
diese änderungen haben jetzt den vorteil das configurations einstellungen nur mehr über die spaw_controll.config.php laufen...
die client configuration wird nun mehr von functions.general.php erledigt (da der code sonst zweimal vorhanden wäre -> in meinen augen unsinnig)
die definierung der styles funktioniert jetzt: 1. wenn kein value definiert wird werden die standard (normal,style1,style2 angezeigt) 2. falls werte definiert wurden die mittels ; getrennt wurden funktiniert es wie bis her 3. falls nur ein wert definiert wurde (ohne ; ) wird dieser jetzt ebenso definiert
weiters in wurde $spaw_valid_imgs dazu benützt das sql query in img_library zu steuern (der wert war sonst unbenützt)
ebenso müsste die einbindung eines stylesheet files nun funktionieren...
(ich habs zwar noch nicht geschafft aber egal...) war in editor.php nicht mit angegeben...
zusätzlich gibts ein neues property "wysiwyg" "spaw_theme" "contenido"/"default" welches standard mäßig falls nicht gesetzt den wert contenido verwendet...

****** ergänzung

ähm ja nur ne kleinigkeit... zusätzlich includes/include.systemsettings.php (4.4.2)
ist mir aufgefallen als ich ein spaw_styles mit ; trennen wollte, weiss zwar nicht ob es so beabsichtigt ist, aber dort findet sich einmal

inputbox = new cHTMLTextbox ("sysvalue", $value);
und einmal
$list->setCell($count,4, $value);

sollte jedoch um korrekt ; anzuzeigen
inputbox = new cHTMLTextbox ("sysvalue", urldecode($value));
und einmal
$list->setCell($count,4, urldecode($value));
sein...

spaw_controll.config.php habe ich oben ebenfalls diese ergänzung verpasst...

lg

Re: bug: spaw contenido 4.4.2 & snapshot 21.11.2003

Verfasst: Mo 24. Nov 2003, 11:02
von timo
emergence hat geschrieben: zusätzlich gibts ein neues property "wysiwyg" "spaw_theme" "contenido"/"default" welches standard mäßig falls nicht gesetzt den wert contenido verwendet...
Habe ich alles aufgenommen, in der Doku ist der neue Config-Wert auch vertreten.
ähm ja nur ne kleinigkeit... zusätzlich includes/include.systemsettings.php (4.4.2)
Gibts nicht in 4.4.2 :). Die Abzüge vom CVS sind HEAD (also 4.5.0), und die 4.4.2 ist ein Bugfix für die 4.4.1. Deine Änderungen habe ich also alle ins HEAD eingebaut.

Verfasst: Mo 24. Nov 2003, 11:14
von emergence
alles klar, dann ändere ich die titel der postings...

Verfasst: Di 25. Nov 2003, 08:39
von emergence
noch was wichtiges:
das theme classic sollte momentan komplett raus - da es jede menge javascript fehler versuchen kann (bilder fehlen und definition innerhalb der css und js dateien sind nicht korrekt angegeben)

Verfasst: Mi 10. Dez 2003, 10:17
von timo
classic habe ich rausgenommen. Ich mach hier mal zu.