function showOptions_man($settings)
 {
     if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg", "settings")) {
         if (isset($_GET['func']) and $_GET['func'] == "update") {
             $settings = PHPWS_xw_cms::requests_man($settings);
         }
         $form = new EZform("xw_options");
         $form->add("module", "hidden", "xwysiwyg");
         $form->add("action", "hidden", "admin");
         $form->add("func", "hidden", "update");
         $form->add("width", "text", $settings['width']);
         $form->setWidth("width", "12");
         $form->add("height", "text", $settings['height']);
         $form->setWidth("height", "12");
         $form->add("path", "text", $settings['path']);
         $form->setWidth("path", "60");
         $form->add("browsers", "text", $settings['browsers']);
         $form->setWidth("browsers", "60");
         $form->add("lang_activ", "checkbox");
         $form->setMatch("lang_activ", $settings['lang_activ']);
         $form->add("view_anon", "checkbox");
         $form->setMatch("view_anon", $settings['view_anon']);
         $form->add("view_user", "checkbox");
         $form->setMatch("view_user", $settings['view_user']);
         $form->add("request_mode", "checkbox");
         $form->setMatch("request_mode", $settings['request_mode']);
         $form->add("enable_css", "checkbox");
         $form->setMatch("enable_css", $settings['enable_css']);
         if ($settings['plugins'] != 'none') {
             $i = 1;
             foreach ($settings['plugins'] as $key => $value) {
                 $form->add("plug_{$i}", "checkbox");
                 $form->setMatch("plug_{$i}", $value);
                 //$settings['plugins'][$key]);
                 $i++;
             }
         }
         if ($settings['themes'] != 'none') {
             $form->add("theme", "dropbox");
             $form->setValue("theme", $settings['themes']);
             $form->reindexValue("theme");
             $form->setMatch("theme", $settings['theme']);
         }
         $form->add("SUBMIT", "submit", $_SESSION['translate']->it("Save"));
         $formTags = $form->getTemplate();
         $formTags['TITLE'] = $_SESSION['translate']->it("Settings");
         //Version???
         $formTags['WIDTH_TEXT'] = $_SESSION['translate']->it("Set width of editor (eg.600)");
         $formTags['HEIGHT_TEXT'] = $_SESSION['translate']->it("Set height of editor (eg.300)");
         $formTags['LANG_ACTIV_TEXT'] = $_SESSION['translate']->it("Enable translation of [var1]", $settings['editor']);
         $formTags['VIEW_ANON_TEXT'] = $_SESSION['translate']->it("Allow anonymous to use [var1]", $settings['editor']);
         $formTags['VIEW_USER_TEXT'] = $_SESSION['translate']->it("Allow users to use [var1]", $settings['editor']);
         $formTags['REQUEST_MODE_TEXT'] = $_SESSION['translate']->it("Enable Request Mode");
         $formTags['ENABLE_CSS_TEXT'] = $_SESSION['translate']->it("Enable CSS @import");
         $formTags['PATH_TEXT'] = $_SESSION['translate']->it("Path");
         $formTags['BROWSERS_TEXT'] = $_SESSION['translate']->it("Browsers");
         if (isset($formTags['THEME'])) {
             $formTags['THEME_TEXT'] = $_SESSION['translate']->it("Theme");
         }
         $formTags['MESSAGE'] = PHPWS_xw_cms::updateOptions_man($settings);
         $formTags['TOGGLE'] = PHPWS_xw_cms::toggleButton_man($settings['editor']);
         $formTags['MANAGE'] = PHPWS_xw_cms::manageButton_man();
         $formTags['TEST'] = PHPWS_xw_cms::testButton_man();
         $formTags['BROWSER'] = PHPWS_xwysiwyg::sniffer($settings['browsers'], "text");
         $formTags['EDITOR'] = $_SESSION['translate']->it("You are using [var1] now.", "<strong>" . $settings['editor'] . "</strong>");
         if ($settings['plugins'] != 'none') {
             $i = 1;
             foreach ($settings['plugins'] as $key => $value) {
                 $formTags["PLUG_" . $i . "_TEXT"] = $_SESSION['translate']->it("Enable [var1] Plugin", $key);
                 $i++;
             }
         }
         $this->content .= PHPWS_Template::processTemplate($formTags, "xwysiwyg", "options.tpl");
         $this->content .= PHPWS_xw_cms::showArea_man();
     } else {
         $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions.");
     }
     // End of ADMINISTRATOR condition
 }
<?php

// xwysiwyg-hack-version of wysiwyg.php based on Revision 1.18
// start xwysiwyg code
$answer = NULL;
$xwysiwyg = NULL;
$xw_button = NULL;
$onRequest = NULL;
$mods = $GLOBALS["core"]->listModules(TRUE);
if (in_array("xwysiwyg", $mods)) {
    require_once PHPWS_SOURCE_DIR . 'mod/xwysiwyg/class/xwysiwyg.php';
    //include the xwysiwyg code
    $answer = PHPWS_xwysiwyg::isSupported($section_name);
    $onRequest = $answer["onRequest"];
    $xwysiwyg = $answer["xwysiwyg"];
    $xw_button = $answer["xwButton"];
}
if (!isset($GLOBALS['xwysiwyg']) and $xwysiwyg) {
    $GLOBALS['xwysiwyg'] = 0;
}
if ($xwysiwyg) {
    $GLOBALS['xwysiwyg_areas'][] = $section_name;
    $GLOBALS['xwysiwyg']++;
}
// end xwysiwyg code
include PHPWS_SOURCE_DIR . 'conf/javascriptSettings.php';
if (version_compare($GLOBALS['core']->version, "0.10.0") >= 0) {
    if (!$wysiwyg_on) {
        return;
    }
    // this isn't available in 0.9.3-4 could be used in 0.10.0 ff
<?php

/**
 * Runtime for xwysiwyg module
 *
 * $Id: runtime.php,v 1.2 2005/07/17 18:04:54 ykuendig Exp $
 * @author Yves Kuendig <*****@*****.**>
 * @module xwysiwyg
 * @moduletype mixed module / hack
 * @package phpwebsite = 0.9.3-4 +
 */
if (isset($GLOBALS['xwysiwyg_areas'])) {
    require_once PHPWS_SOURCE_DIR . 'mod/xwysiwyg/class/xwysiwyg.php';
    //include the xwysiwyg code
    $xwysiwyg = new PHPWS_xwysiwyg();
    $GLOBALS['core']->js_func[] = $xwysiwyg->makeJS();
    //build main-js
}
 function action()
 {
     //here we switch the actions
     require_once PHPWS_SOURCE_DIR . "mod/xwysiwyg/class/xw_cms.php";
     $this->content = "";
     $action = PHPWS_Text::parseInput($_GET["action"]);
     $this->linkRef = "./index.php?module=xwysiwyg";
     //i use this above, to shorten links...
     switch ($action) {
         case "toggle":
             if (isset($_GET['editor'])) {
                 PHPWS_xw_cms::toggleEditor_man(PHPWS_Text::parseInput($_GET["editor"]));
             }
         case "admin":
             //this for action=admin
             $settings = PHPWS_xwysiwyg::readConfig();
             if (!is_array($settings)) {
                 $this->content .= $settings;
                 PHPWS_xw_cms::manageEditors();
                 break;
             }
             PHPWS_xw_cms::showOptions_man($settings);
             break;
         case "testEditor":
             if (isset($_GET['xw_testarea'])) {
                 PHPWS_xw_cms::testEditors(PHPWS_Text::parseInput($_GET['xw_testarea']));
             } else {
                 $text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
                 PHPWS_xw_cms::testEditors($text);
             }
             break;
         case "manageEditor":
             PHPWS_xw_cms::manageEditors();
             break;
         case "addEditor":
             PHPWS_xw_cms::addEditor();
             PHPWS_xw_cms::manageEditors();
             break;
         case "delEditor":
             PHPWS_xw_cms::delEditor();
             PHPWS_xw_cms::manageEditors();
             break;
         case "cpyEditor":
             PHPWS_xw_cms::cpyEditor();
             PHPWS_xw_cms::manageEditors();
             break;
         case "tarEditor":
             PHPWS_xw_cms::tarEditor();
             PHPWS_xw_cms::manageEditors();
             break;
         case "delFile":
             PHPWS_xw_cms::delFile();
             PHPWS_xw_cms::manageEditors();
             break;
         case "addArea":
             $this->addArea();
             break;
         case "delArea":
             if (isset($_GET['area'])) {
                 $this->delArea(PHPWS_Text::parseInput($_GET["area"]));
             }
             break;
         default:
             $this->content .= $_SESSION['translate']->it("no action given...");
             break;
     }
     // send content to layout-module and forget the rest...
     $GLOBALS["CNT_xwysiwyg"]["title"] = $_SESSION['translate']->it("xwysiwyg Manager");
     $GLOBALS["CNT_xwysiwyg"]["content"] = $this->content;
 }