function addEditor()
 {
     if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg", "settings")) {
         //Administrativ condition
         if (isset($_GET['addEditor'])) {
             $data['editor'] = PHPWS_Text::parseInput($_GET['addEditor']);
         } else {
             return FALSE;
         }
         if (isset($_GET['fn'])) {
             $file = PHPWS_Text::parseInput($_GET['fn']);
         } else {
             return FALSE;
         }
         require PHPWS_HOME_DIR . "files/xwysiwyg/editors/" . $file;
         if ($data['editor'] = $cfg_editor) {
             if (isset($cfg_path)) {
                 $data['path'] = $cfg_path;
             }
             if (isset($cfg_browsers)) {
                 $data['browsers'] = $cfg_browsers;
             }
             if (isset($cfg_height)) {
                 $data['height'] = $cfg_height;
             }
             if (isset($cfg_width)) {
                 $data['width'] = $cfg_width;
             }
             if (isset($cfg_plugins) && $cfg_plugins != 'none') {
                 $data['plugins'] = array_flip(explode(";", $cfg_plugins));
                 foreach ($data['plugins'] as $key => $value) {
                     $data['plugins'][$key] = 0;
                 }
                 $data['plugins'] = serialize($data['plugins']);
             } else {
                 $data['plugins'] = "none";
             }
             if (isset($cfg_themes)) {
                 $data['themes'] = $cfg_themes;
             } else {
                 $data['themes'] = "none";
             }
             if (isset($cfg_def_theme)) {
                 $data['theme'] = $cfg_def_theme;
             }
         } else {
             return FALSE;
         }
         if ($GLOBALS['core']->sqlInsert($data, "mod_xw_config", TRUE, FALSE)) {
             $this->content .= "<span style=\"color:green;font-weight:bold\">" . $_SESSION['translate']->it("Saving was successful") . "</span><br />";
             if (!$GLOBALS['core']->quickFetch("SELECT editor FROM mod_xw_editor", TRUE, TRUE)) {
                 $result = PHPWS_xw_cms::toggleEditor_man($cfg_editor);
             }
         } else {
             $this->content .= "<span style=\"color:red;\">" . $_SESSION['translate']->it("There was a problem saving to the database") . "</span><br />";
         }
     } else {
         $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions.");
     }
     // End of ADMINISTRATOR condition
 }
 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;
 }