From: Yves K. <yku...@us...> - 2004-10-26 07:32:08
|
Update of /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30606/xwysiwyg/mod/xwysiwyg/class Modified Files: phpSniff.class.php phpSniff.core.php xwysiwyg.php Log Message: saved in unix-format Index: phpSniff.core.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/class/phpSniff.core.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** phpSniff.core.php 25 Oct 2004 18:11:51 -0000 1.1.1.1 --- phpSniff.core.php 26 Oct 2004 07:31:54 -0000 1.2 *************** *** 1,547 **** ! <?php ! /******************************************************************************* ! $Id$ ! ! phpSniff: HTTP_USER_AGENT Client Sniffer for PHP ! Copyright (C) 2001 Roger Raymond ~ eps...@us... ! ! This library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either [...1067 lines suppressed...] ! // this is probably a netscape browser or compatible ! $this->_set_browser('long_name','netscape'); ! $this->_set_browser('browser',$this->_get_short_name('netscape')); ! } ! } ! ! function _set_browser ($k,$v) ! { $this->_browser_info[strtolower($k)] = strtolower($v); ! } ! ! function _set_feature ($k) ! { $this->_feature_set[strtolower($k)] = !$this->_feature_set[strtolower($k)]; ! } ! ! function _set_quirk ($k) ! { $this->_quirks[strtolower($k)] = true; ! } ! } ?> \ No newline at end of file Index: xwysiwyg.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/class/xwysiwyg.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** xwysiwyg.php 25 Oct 2004 18:12:02 -0000 1.1.1.1 --- xwysiwyg.php 26 Oct 2004 07:31:54 -0000 1.2 *************** *** 1,479 **** ! <?php ! require_once(PHPWS_SOURCE_DIR . "core/Text.php"); //this we use to parse input and for ezTable ! /** ! * Class file for xwysiwyg module ! * ! * @version $0.1 2004/08/29 yk$ ! * @author Yves Kuendig <ph...@NO...> ! * @module xwysiwyg ! * @moduletype mixed module / hack ! * @package phpwebsite = 0.9.3-4 ! */ ! ! class PHPWS_xwysiwyg { ! ! function isBox($area){ ! $settings = PHPWS_xwysiwyg::readConfig(); ! if((!$settings['view_anon'])AND(!$_SESSION["OBJ_user"]->isUser())) return FALSE; ! if((!$settings['view_user'])AND(!$_SESSION["OBJ_user"]->isDeity())) return FALSE; ! $query = "SELECT id FROM ".PHPWS_TBL_PREFIX."mod_xwysiwyg_areas WHERE area = '$area'"; ! $result = $GLOBALS['core']->quickFetch($query); ! if($result) return TRUE; ! else return FALSE; ! } ! ! ! function loadPlugins($settings) { ! $loadplugs = ""; ! if($settings['editor']=="htmlarea") { ! if($settings['plug_table']) $loadplugs .= " HTMLArea.loadPlugin(\"TableOperations\");\n"; ! if($settings['plug_context']) $loadplugs .= " HTMLArea.loadPlugin(\"ContextMenu\");\n"; ! if($settings['plug_chara']) $loadplugs .= " HTMLArea.loadPlugin(\"CharacterMap\");\n"; ! if($settings['plug_para']) $loadplugs .= " HTMLArea.loadPlugin(\"EnterParagraphs\");\n"; ! if($settings['plug_list']) $loadplugs .= " HTMLArea.loadPlugin(\"ListType\");\n"; ! if($settings['plug_file']) $loadplugs .= " HTMLArea.loadPlugin(\"InsertFile\");\n"; ! if($settings['plug_image']) $loadplugs .= " HTMLArea.loadPlugin(\"ImageManager\");\n"; ! if($settings['plug_spell']) $loadplugs .= " HTMLArea.loadPlugin(\"SpellChecker\");\n"; ! } else if($settings['editor']=="fck") { ! } ! return $loadplugs; ! } ! ! function registerPlugins($settings,$index) { ! $regplugs = ""; ! if($settings['editor']=="htmlarea") { ! if($settings['plug_table']) $regplugs .= " editor$index.registerPlugin(TableOperations);\n"; ! if($settings['plug_context']) $regplugs .= " editor$index.registerPlugin(ContextMenu);\n"; ! if($settings['plug_chara']) $regplugs .= " editor$index.registerPlugin(CharacterMap);\n"; ! if($settings['plug_para']) $regplugs .= " editor$index.registerPlugin(EnterParagraphs);\n"; ! if($settings['plug_list']) $regplugs .= " editor$index.registerPlugin(ListType);\n"; ! if($settings['plug_file']) $regplugs .= " editor$index.registerPlugin(InsertFile);\n"; ! if($settings['plug_image']) $regplugs .= " editor$index.registerPlugin(ImageManager);\n"; ! if($settings['plug_spell']) $regplugs .= " editor$index.registerPlugin(SpellChecker);\n"; ! } else if($settings['editor']=="fck") { ! } ! return $regplugs; ! } ! ! function setLanguage($settings){ ! if($settings['lang_activ']) $lang = $_SESSION['translate']->current_language; ! else $lang = "en"; ! return $lang; ! } ! ! function makeEditors($settings,$index,$regplugs,$area,$lang) { // HtmlArea - Editor - Section ! if($settings['editor']=="htmlarea") { ! if($index==1){ ! if($settings['request_mode']) { // 1. HtmlArea Editor in Request-Mode ! $editors .= " ! function initEditor$index() { ! var editor$index = new HTMLArea(\"$area\"); ! ".$regplugs." ! editor$index.config.height = \"300px\"; ! editor$index.generate(); ! return false; ! } ! "; ! } else { // 1. HtmlArea Editor in Normal-Mode ! $editors .= " ! var editor$index = new HTMLArea(\"$area\"); ! ".$regplugs." ! editor$index.config.height = \"300px\"; ! editor$index.generate(); ! "; ! } ! } else { ! if($settings['request_mode']) { // 2. HtmlArea Editor in Request-Mode ! $editors .= " ! function initEditor$index() { ! var editor$index = new HTMLArea(\"$area\"); ! ".$regplugs." ! editor$index.config.height = \"300px\"; ! editor$index.generate(); ! return false; ! } ! "; ! } else { // 2. HtmlArea Editor in Normal-Mode ! $editors .= " ! var editor$index = new HTMLArea(\"$area\"); ! ".$regplugs." ! editor$index.config.height = \"300px\"; ! setTimeout(function() { ! editor$index.generate(); ! }, 900); ! "; ! } ! } ! } else if($settings['editor']=="fck") { // FCKeditor - Editor - Section ! $skin = $settings['fck_skin']; ! ! if($settings['request_mode']) { // FCK Editor in Request-Mode ! $editors .= "\n function initEditor$index() {\n"; } ! ! $editors .= " ! var editor$index = new FCKeditor(\"$area\"); ! editor$index.BasePath = \"mod/xwysiwyg/_fck/\" ; ! editor$index.CheckBrowser = false ; ! editor$index.Config[\"AutoDetectLanguage\"] = false ; ! editor$index.Config[\"DefaultLanguage\"] = \"$lang\" ; ! editor$index.Config[\"SkinPath\"] = \"skins/$skin/\" ; ! ".$regplugs; ! if($index==1){ // Ending for 1. Editor ! $editors .= " ! editor$index.ReplaceTextarea();"; ! } else { // Ending for further Editors ! $editors .= " ! setTimeout(function() { ! editor$index.ReplaceTextarea(); ! }, 400);"; ! } ! if($settings['request_mode']) { // Close FCK Editor in Request-Mode ! $editors .= "\n return false;\n }\n"; } ! } ! return $editors; ! } ! ! function makeMain($settings,$editors,$loadplugs,$lang) { ! if($settings['editor']=="htmlarea") { ! // start cookie-code from chris ! setcookie("htmlarea_insfile_cookie_create", $_SESSION['OBJ_user']->allow_access("documents", "edit_settings")); ! setcookie("htmlarea_insfile_cookie_upload", $_SESSION['OBJ_user']->allow_access("documents", "add_document")); ! setcookie("htmlarea_insfile_cookie_rename", $_SESSION['OBJ_user']->allow_access("documents", "edit_document")); ! setcookie("htmlarea_insfile_cookie_delete", $_SESSION['OBJ_user']->allow_access("documents", "delete_document")); ! setcookie("htmlarea_insfile_cookie_move", $_SESSION['OBJ_user']->allow_access("documents", "move_document")); ! setcookie("pws_lang", $lang); ! setcookie("pws_source_dir", PHPWS_SOURCE_DIR); ! setcookie("pws_source_http", PHPWS_SOURCE_HTTP); ! // end cookie-code from chris ! /* nur hier als erinnerung ! <script type=\"text/javascript\" src=\"mod/xwysiwyg/_htmlarea/dialog.js\"></script> ! <script type=\"text/javascript\" src=\"mod/xwysiwyg/_htmlarea/popupwin.js\"></script> ! */ ! if($settings['request_mode']) { // HtmlArea-Main in Request-Mode ! $main = " ! <script type=\"text/javascript\"> ! _editor_lang = \"".$lang."\"; ! _editor_url = \"mod/xwysiwyg/_htmlarea/\"; ! </script> ! <!-- load the main HTMLArea files --> ! <script type=\"text/javascript\" src=\"mod/xwysiwyg/_htmlarea/htmlarea.js\"></script> ! <script type=\"text/javascript\"> ! ".$loadplugs." ! $editors ! </script> ! "; ! } else { // HtmlArea-Main in Normal-Mode ! $main = " ! <script type=\"text/javascript\"> ! _editor_lang = \"".$lang."\"; ! _editor_url = \"mod/xwysiwyg/_htmlarea/\"; ! </script> ! <!-- load the main HTMLArea files --> ! <script type=\"text/javascript\" src=\"mod/xwysiwyg/_htmlarea/htmlarea.js\"></script> ! <script type=\"text/javascript\"> ! ".$loadplugs." ! function initEditor() { // create the editor(s) for the related textbox(es) ! $editors ! return false; ! } ! </script> ! "; ! } ! } else if($settings['editor']=="fck") { ! if($settings['request_mode']) { // FCK-Main in Request-Mode ! $main = " ! <!-- load the main FCKeditor files --> ! <script type=\"text/javascript\" src=\"mod/fckeditor/fck/fckeditor.js\"></script> ! <script type=\"text/javascript\"> ! ".$loadplugs." ! $editors ! </script> ! "; ! } else { // FCK-Main in Normal-Mode ! $main = " ! <!-- load the main FCKeditor files --> ! <script type=\"text/javascript\" src=\"mod/fckeditor/fck/fckeditor.js\"></script> ! <script type=\"text/javascript\"> ! ".$loadplugs." ! function initEditor() { // create the editor(s) for the related textbox(es) ! $editors ! return false; ! } ! </script> ! "; ! } ! } ! return $main; ! } ! ! ! ! function readConfig() { ! $sql = "SELECT * FROM ".PHPWS_TBL_PREFIX."mod_xwysiwyg_conf"; ! $settings = $GLOBALS['core']->quickFetch($sql); ! //$GLOBALS['xwysiwyg_settings'] = $settings; ! return $settings; ! }// END FUNC _read_config ! ! ! function showHAoptions($settings) { ! if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg", "settings")) { ! if($_REQUEST['func'] == "update") { ! if(isset($_REQUEST['lang_activ'])) { $settings['lang_activ'] = 1; } ! else { $settings['lang_activ'] = 0; } ! if(isset($_REQUEST['view_anon'])) { $settings['view_anon'] = 1; } ! else { $settings['view_anon'] = 0; } ! if(isset($_REQUEST['view_user'])) { $settings['view_user'] = 1; } ! else { $settings['view_user'] = 0; } ! if(isset($_REQUEST['request_mode'])) { $settings['request_mode'] = 1; } ! else { $settings['request_mode'] = 0; } ! if(isset($_REQUEST['plug_table'])) { $settings['plug_table'] = 1; } ! else { $settings['plug_table'] = 0; } ! if(isset($_REQUEST['plug_context'])) { $settings['plug_context'] = 1; } ! else { $settings['plug_context'] = 0; } ! if(isset($_REQUEST['plug_chara'])) { $settings['plug_chara'] = 1; } ! else { $settings['plug_chara'] = 0; } ! if(isset($_REQUEST['plug_para'])) { $settings['plug_para'] = 1; } ! else { $settings['plug_para'] = 0; } ! if(isset($_REQUEST['plug_list'])) { $settings['plug_list'] = 1; } ! else { $settings['plug_list'] = 0; } ! if(isset($_REQUEST['plug_file'])) { $settings['plug_file'] = 1; } ! else { $settings['plug_file'] = 0; } ! if(isset($_REQUEST['plug_image'])) { $settings['plug_image'] = 1; } ! else { $settings['plug_image'] = 0; } ! if(isset($_REQUEST['plug_spell'])) { $settings['plug_spell'] = 1; } ! else { $settings['plug_spell'] = 0; } ! } ! ! $form = new EZform("options"); ! $form->add("module", "hidden", "xwysiwyg"); ! $form->add("action", "hidden", "admin"); ! $form->add("func", "hidden", "update"); ! ! $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("plug_table", "checkbox"); ! $form->setMatch("plug_table", $settings['plug_table']); ! $form->add("plug_context", "checkbox"); ! $form->setMatch("plug_context", $settings['plug_context']); ! $form->add("plug_chara", "checkbox"); ! $form->setMatch("plug_chara", $settings['plug_chara']); ! $form->add("plug_para", "checkbox"); ! $form->setMatch("plug_para", $settings['plug_para']); ! $form->add("plug_list", "checkbox"); ! $form->setMatch("plug_list", $settings['plug_list']); ! $form->add("plug_file", "checkbox"); ! $form->setMatch("plug_file", $settings['plug_file']); ! $form->add("plug_image", "checkbox"); ! $form->setMatch("plug_image", $settings['plug_image']); ! // $form->add("plug_spell", "checkbox"); ! // $form->setMatch("plug_spell", $settings['plug_spell']); ! $form->add("SUBMIT", "submit", $_SESSION['translate']->it("Save")); ! ! $formTags = $form->getTemplate(); ! $formTags['TITLE'] = $_SESSION['translate']->it("Settings"); //Version??? ! $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['PLUG_TABLE_TEXT'] = $_SESSION['translate']->it("Enable TableOperations-Plugin"); ! $formTags['PLUG_CONTEXT_TEXT'] = $_SESSION['translate']->it("Enable ContextMenu-Plugin"); ! $formTags['PLUG_CHARA_TEXT'] = $_SESSION['translate']->it("Enable CharacterMap-Plugin"); ! $formTags['PLUG_PARA_TEXT'] = $_SESSION['translate']->it("Enable EnterParagraphs-Plugin"); ! $formTags['PLUG_LIST_TEXT'] = $_SESSION['translate']->it("Enable ListType-Plugin"); ! $formTags['PLUG_FILE_TEXT'] = $_SESSION['translate']->it("Enable InsertFile-Plugin"); ! $formTags['PLUG_IMAGE_TEXT'] = $_SESSION['translate']->it("Enable ImageManager-Plugin"); ! // $formTags['PLUG_SPELL_TEXT'] = "n.a. yet ".$_SESSION['translate']->it("Enable SpellChecker-Plugin"); ! if($_REQUEST['func'] == "update") { ! if($GLOBALS['core']->sqlUpdate($settings, "mod_xwysiwyg_conf")) { ! $formTags['MESSAGE'] = "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Settings saved successfully")."</span><br />"; } ! else { $formTags['MESSAGE'] = "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem saving to the database")."</span><br />"; } ! } else { $formTags['MESSAGE'] = "<span style=\"color:blue;font-weight:bold\">".$_SESSION['translate']->it("Make your selections")."</span><br />"; } ! $formTags['EDITOR'] = $_SESSION['translate']->it("You use [var1] now", "<b>".$settings['editor']."</b>"); ! $formTags['TOGGLE'] = $this->toggleButton($settings['editor']); ! $this->content .= PHPWS_Template::processTemplate($formTags, "xwysiwyg", "ha_options.tpl"); ! $this->content .= $this->showArea(); ! } else { ! $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions."); ! } // End of ADMINISTRATOR condition ! }// END FUNC showHAoptions ! ! ! function showFCKoptions($settings) { ! if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg", "settings")) { ! if($_REQUEST['func'] == "update") { ! if(isset($_REQUEST['lang_activ'])) { $settings['lang_activ'] = 1; } ! else { $settings['lang_activ'] = 0; } ! if(isset($_REQUEST['view_anon'])) { $settings['view_anon'] = 1; } ! else { $settings['view_anon'] = 0; } ! if(isset($_REQUEST['view_user'])) { $settings['view_user'] = 1; } ! else { $settings['view_user'] = 0; } ! if(isset($_REQUEST['request_mode'])) { $settings['request_mode'] = 1; } ! else { $settings['request_mode'] = 0; } ! if(isset($_REQUEST['fck_skin'])) { $settings['fck_skin'] = PHPWS_Text::parseInput($_REQUEST["fck_skin"]); } ! else { $settings['fck_skin'] = "default"; } ! } ! ! $form = new EZform("options"); ! $form->add("module", "hidden", "xwysiwyg"); ! $form->add("action", "hidden", "admin"); ! $form->add("func", "hidden", "update"); ! ! $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("fck_skin", "dropbox", array("default"=>"default","office2003"=>"office2003","silver"=>"silver")); ! $form->setMatch("fck_skin", $settings['fck_skin']); ! $form->add("SUBMIT", "submit", $_SESSION['translate']->it("Save")); ! ! $formTags = $form->getTemplate(); ! $formTags['TITLE'] = $_SESSION['translate']->it("Settings"); //Version??? ! $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['FCK_SKIN_TEXT'] = $_SESSION['translate']->it("Select your Skin"); ! if($_REQUEST['func'] == "update") { ! if($GLOBALS['core']->sqlUpdate($settings, "mod_xwysiwyg_conf")) { ! $formTags['MESSAGE'] = "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Settings saved successfully")."</span><br />"; } ! else { $formTags['MESSAGE'] = "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem saving to the database")."</span><br />"; } ! } else { $formTags['MESSAGE'] = "<span style=\"color:blue;font-weight:bold\">".$_SESSION['translate']->it("Make your selections")."</span><br />"; } ! $formTags['EDITOR'] = $_SESSION['translate']->it("You use [var1] now", "<b>".$settings['editor']."</b>"); ! $formTags['TOGGLE'] = $this->toggleButton($settings['editor']); ! $this->content .= PHPWS_Template::processTemplate($formTags, "xwysiwyg", "fck_options.tpl"); ! $this->content .= $this->showArea(); ! } else { ! $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions."); ! } // End of ADMINISTRATOR condition ! }// END FUNC showFCKoptions ! ! ! function showArea() { ! $query = "SELECT id, area FROM ".PHPWS_TBL_PREFIX."mod_xwysiwyg_areas ORDER BY 1"; ! $result = $GLOBALS['core']->query($query, FALSE, TRUE); ! $table[] = array("<b>ID</b>","<b>".$_SESSION['translate']->it("Area-Name")."</b>","<b>".$_SESSION['translate']->it("Action")."</b>"); ! if($result) { ! while($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) { ! $id = $row['id']; ! $area = $row['area']; ! $delelink = $this->linkRef."&action=deleData&id=$id"; ! $deletext = $_SESSION['translate']->it("Delete"); ! $table[] = array($id,$area,"<a href=\"$delelink\">$deletext</a>"); ! } ! } ! $content .= "<hr /><div style=\"float:right\"> ! <form action=\"index.php\" method=\"post\" TITLE=\"new\"> ! <input type=\"Hidden\" name=\"module\" value=\"xwysiwyg\"> ! <input type=\"Hidden\" name=\"action\" value=\"addArea\"> ! <input type=\"Text\" name=\"area\" size=\"20\"> ! <input type=\"Submit\" value=\"".$_SESSION['translate']->it("New")."\"> ! </form></div>"; ! $content .= PHPWS_Text::ezTable($table,2,2,1,"",NULL,1,"top"); ! return $content; ! } ! ! function toggleButton($editor) { ! $content .= "<form action=\"index.php\" method=\"POST\" title=\"toggle\"> ! <input type=\"Hidden\" name=\"module\" value=\"xwysiwyg\"> ! <input type=\"Hidden\" name=\"action\" value=\"toggle\">"; ! if($editor=="htmlarea") ! $content .= "<input type=\"Hidden\" name=\"editor\" value=\"fck\">"; ! else ! $content .= "<input type=\"Hidden\" name=\"editor\" value=\"htmlarea\">"; ! $content .="<input type=\"Submit\" value=\"".$_SESSION['translate']->it("Change")."\"> ! </form>"; ! return $content; ! } ! ! function toggleEditor($editor) { ! $data['editor'] = $editor; ! return $GLOBALS['core']->sqlUpdate($data, "mod_xwysiwyg_conf"); ! } ! ! ! function addArea() { ! if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg","settings")) {//Administrativ condition ! if($_REQUEST['area']) {$data['area'] = PHPWS_Text::parseInput($_REQUEST['area']); } ! else {return FALSE;} ! if($GLOBALS['core']->sqlInsert($data, "mod_xwysiwyg_areas", TRUE, FALSE)) { ! $this->content .= "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Saving was successfull")."</span><br />"; } ! else { $this->content .= "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem saving to the database")."</span><br />"; } ! $this->content .= "<br /><a href=\"./index.php\">".$_SESSION['translate']->it("Home")."</a>"; ! $this->content .= "<br /><a href=\"javascript:history.back()\">".$_SESSION['translate']->it("Back")."</a>"; ! ! } else { ! $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions."); ! } // End of ADMINISTRATOR condition ! } ! ! ! function delArea($id) { ! if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg","settings")) {//Administrativ condition ! if($GLOBALS['core']->sqlDelete("mod_xwysiwyg_areas","id",$id)) { ! $this->content .= "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Entry was successfully deleted from the database")."</span><br />"; } ! else { $this->content .= "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem deleting the entry")."</span><br />"; } ! $this->content .= "<br /><a href=\"".$this->linkRef."&action=admin\">".$_SESSION['translate']->it("Back")."</a>"; ! ! } 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 ! $this->content = ""; ! $action = PHPWS_Text::parseInput($_REQUEST["action"]); //now we use core/Text.php to check the input ! $this->linkRef = "./index.php?module=xwysiwyg"; //i use this above, to shorten links... ! ! switch($action) { ! ! case "toggle": //this for action=admin ! $this->toggleEditor(PHPWS_Text::parseInput($_REQUEST["editor"])); ! ! case "admin": //this for action=admin ! $settings = PHPWS_xwysiwyg::readConfig(); ! if($settings['editor']=="htmlarea") ! $this->showHAoptions($settings); ! else if($settings['editor']=="fck") ! $this->showFCKoptions($settings); ! else ! $this->content .= $_SESSION['translate']->it("Error: No editor selected"); ! break; ! ! case "addArea": //this for action=data ! $this->addArea(); ! break; ! ! case "editData": //this for action=data ! $this->editData(PHPWS_Text::parseInput($_REQUEST["id"])); ! break; ! ! case "deleData": //this for action=data ! $this->delArea(PHPWS_Text::parseInput($_REQUEST["id"])); ! 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; ! }//END action ! ! ! }//END class ?> \ No newline at end of file --- 1,502 ---- ! <?php ! require_once(PHPWS_SOURCE_DIR . "core/Text.php"); //this we use to parse input and for ezTable ! /** ! * Class file for xwysiwyg module ! * ! * @version $0.1 2004/08/29 yk$ ! * @author Yves Kuendig <ph...@NO...> ! * @module xwysiwyg ! * @moduletype mixed module / hack ! * @package phpwebsite = 0.9.3-4 ! */ ! ! class PHPWS_xwysiwyg { ! ! function isBox($area){ ! $settings = PHPWS_xwysiwyg::readConfig(); ! if((!$settings['view_anon'])AND(!$_SESSION["OBJ_user"]->isUser())) return FALSE; ! if((!$settings['view_user'])AND(!$_SESSION["OBJ_user"]->isDeity())) return FALSE; ! $query = "SELECT id FROM ".PHPWS_TBL_PREFIX."mod_xwysiwyg_areas WHERE area = '$area'"; ! $result = $GLOBALS['core']->quickFetch($query); ! if($result) return TRUE; ! else return FALSE; ! } ! ! ! function loadPlugins($settings) { ! $loadplugs = ""; ! if($settings['editor']=="htmlarea") { ! if($settings['plug_table']) $loadplugs .= " HTMLArea.loadPlugin(\"TableOperations\");\n"; ! if($settings['plug_context']) $loadplugs .= " HTMLArea.loadPlugin(\"ContextMenu\");\n"; ! if($settings['plug_chara']) $loadplugs .= " HTMLArea.loadPlugin(\"CharacterMap\");\n"; ! if($settings['plug_para']) $loadplugs .= " HTMLArea.loadPlugin(\"EnterParagraphs\");\n"; ! if($settings['plug_list']) $loadplugs .= " HTMLArea.loadPlugin(\"ListType\");\n"; ! if($settings['plug_file']) $loadplugs .= " HTMLArea.loadPlugin(\"InsertFile\");\n"; ! if($settings['plug_image']) $loadplugs .= " HTMLArea.loadPlugin(\"ImageManager\");\n"; ! if($settings['plug_spell']) $loadplugs .= " HTMLArea.loadPlugin(\"SpellChecker\");\n"; ! } else if($settings['editor']=="fck") { ! // no plugins yet ! } ! return $loadplugs; ! } ! ! function registerPlugins($settings,$index) { ! $regplugs = ""; ! if($settings['editor']=="htmlarea") { ! if($settings['plug_table']) $regplugs .= " editor$index.registerPlugin(TableOperations);\n"; ! if($settings['plug_context']) $regplugs .= " editor$index.registerPlugin(ContextMenu);\n"; ! if($settings['plug_chara']) $regplugs .= " editor$index.registerPlugin(CharacterMap);\n"; ! if($settings['plug_para']) $regplugs .= " editor$index.registerPlugin(EnterParagraphs);\n"; ! if($settings['plug_list']) $regplugs .= " editor$index.registerPlugin(ListType);\n"; ! if($settings['plug_file']) $regplugs .= " editor$index.registerPlugin(InsertFile);\n"; ! if($settings['plug_image']) $regplugs .= " editor$index.registerPlugin(ImageManager);\n"; ! if($settings['plug_spell']) $regplugs .= " editor$index.registerPlugin(SpellChecker);\n"; ! } else if($settings['editor']=="fck") { ! // no plugins yet ! } ! return $regplugs; ! } ! ! function setLanguage($settings){ ! if($settings['lang_activ']) $lang = $_SESSION['translate']->current_language; ! else $lang = "en"; ! return $lang; ! } ! ! function makeEditors($settings,$index,$regplugs,$area,$lang) { // HtmlArea - Editor - Section ! if($settings['editor']=="htmlarea") { ! if($index==1){ ! if($settings['request_mode']) { // 1. HtmlArea Editor in Request-Mode ! $editors .= " ! function initEditor$index() { ! var editor$index = new HTMLArea(\"$area\"); ! ".$regplugs." ! editor$index.config.height = \"300px\"; ! editor$index.generate(); ! return false; ! } ! "; ! } else { // 1. HtmlArea Editor in Normal-Mode ! $editors .= " ! var editor$index = new HTMLArea(\"$area\"); ! ".$regplugs." ! editor$index.config.height = \"300px\"; ! editor$index.generate(); ! "; ! } ! } else { ! if($settings['request_mode']) { // 2. HtmlArea Editor in Request-Mode ! $editors .= " ! function initEditor$index() { ! var editor$index = new HTMLArea(\"$area\"); ! ".$regplugs." ! editor$index.config.height = \"300px\"; ! editor$index.generate(); ! return false; ! } ! "; ! } else { // 2. HtmlArea Editor in Normal-Mode ! $editors .= " ! var editor$index = new HTMLArea(\"$area\"); ! ".$regplugs." ! editor$index.config.height = \"300px\"; ! setTimeout(function() { ! editor$index.generate(); ! }, 900); ! "; ! } ! } ! } else if($settings['editor']=="fck") { // FCKeditor - Editor - Section ! $skin = $settings['fck_skin']; ! ! if($settings['request_mode']) { // FCK Editor in Request-Mode ! $editors .= "\n function initEditor$index() {\n"; } ! ! $editors .= " ! var editor$index = new FCKeditor(\"$area\"); ! editor$index.BasePath = \"mod/xwysiwyg/_fck/\" ; ! editor$index.CheckBrowser = false ; ! editor$index.Config[\"AutoDetectLanguage\"] = false ; ! editor$index.Config[\"DefaultLanguage\"] = \"$lang\" ; ! editor$index.Config[\"SkinPath\"] = \"skins/$skin/\" ; ! ".$regplugs; ! if($index==1){ // Ending for 1. Editor ! $editors .= " ! editor$index.ReplaceTextarea();"; ! } else { // Ending for further Editors ! $editors .= " ! setTimeout(function() { ! editor$index.ReplaceTextarea(); ! }, 400);"; ! } ! if($settings['request_mode']) { // Close FCK Editor in Request-Mode ! $editors .= "\n return false;\n }\n"; } ! } ! return $editors; ! } ! ! function makeMain($settings,$editors,$loadplugs,$lang) { ! if($settings['editor']=="htmlarea") { ! // start cookie-code from chris ! setcookie("htmlarea_insfile_cookie_create", $_SESSION['OBJ_user']->allow_access("documents", "edit_settings")); ! setcookie("htmlarea_insfile_cookie_upload", $_SESSION['OBJ_user']->allow_access("documents", "add_document")); ! setcookie("htmlarea_insfile_cookie_rename", $_SESSION['OBJ_user']->allow_access("documents", "edit_document")); ! setcookie("htmlarea_insfile_cookie_delete", $_SESSION['OBJ_user']->allow_access("documents", "delete_document")); ! setcookie("htmlarea_insfile_cookie_move", $_SESSION['OBJ_user']->allow_access("documents", "move_document")); ! setcookie("pws_lang", $lang); ! setcookie("pws_source_dir", PHPWS_SOURCE_DIR); ! setcookie("pws_source_http", PHPWS_SOURCE_HTTP); ! // end cookie-code from chris ! /* nur hier als erinnerung ! <script type=\"text/javascript\" src=\"mod/xwysiwyg/_htmlarea/dialog.js\"></script> ! <script type=\"text/javascript\" src=\"mod/xwysiwyg/_htmlarea/popupwin.js\"></script> ! */ ! if($settings['request_mode']) { // HtmlArea-Main in Request-Mode ! $main = " ! <script type=\"text/javascript\"> ! _editor_lang = \"".$lang."\"; ! _editor_url = \"mod/xwysiwyg/_htmlarea/\"; ! </script> ! <!-- load the main HTMLArea files --> ! <script type=\"text/javascript\" src=\"mod/xwysiwyg/_htmlarea/htmlarea.js\"></script> ! <script type=\"text/javascript\"> ! ".$loadplugs." ! $editors ! </script> ! "; ! } else { // HtmlArea-Main in Normal-Mode ! $main = " ! <script type=\"text/javascript\"> ! _editor_lang = \"".$lang."\"; ! _editor_url = \"mod/xwysiwyg/_htmlarea/\"; ! </script> ! <!-- load the main HTMLArea files --> ! <script type=\"text/javascript\" src=\"mod/xwysiwyg/_htmlarea/htmlarea.js\"></script> ! <script type=\"text/javascript\"> ! ".$loadplugs." ! window.onload = function initEditor() { // create the editor(s) for the related textbox(es) ! $editors ! return false; ! } ! </script> ! "; ! } ! } else if($settings['editor']=="fck") { ! if($settings['request_mode']) { // FCK-Main in Request-Mode ! $main = " ! <!-- load the main FCKeditor files --> ! <script type=\"text/javascript\" src=\"mod/fckeditor/fck/fckeditor.js\"></script> ! <script type=\"text/javascript\"> ! ".$loadplugs." ! $editors ! </script> ! "; ! } else { // FCK-Main in Normal-Mode ! $main = " ! <!-- load the main FCKeditor files --> ! <script type=\"text/javascript\" src=\"mod/fckeditor/fck/fckeditor.js\"></script> ! <script type=\"text/javascript\"> ! ".$loadplugs." ! window.onload = function initEditor() { // create the editor(s) for the related textbox(es) ! $editors ! return false; ! } ! </script> ! "; ! } ! } ! return $main; ! } ! ! ! ! function makeJS() { ! if ($GLOBALS['xwysiwyg'] >= 1) { ! $areas = $GLOBALS['xwysiwyg_areas']; ! $settings = PHPWS_xwysiwyg::readConfig(); ! $loadplugs = PHPWS_xwysiwyg::loadPlugins($settings); //get Plugins to load ! $lang = PHPWS_xwysiwyg::setLanguage($settings); //get Language ! $editors = ""; ! $index = 1; ! foreach($areas as $area) { ! $regplugs = PHPWS_xwysiwyg::registerPlugins($settings,$index); //get Plugins to register ! $editors .= PHPWS_xwysiwyg::makeEditors($settings,$index,$regplugs,$area,$lang); //make Editors-js ! $index++; ! } ! $main = PHPWS_xwysiwyg::makeMain($settings,$editors,$loadplugs,$lang); ! } ! return $main; ! } ! ! ! ! ! function readConfig() { ! $sql = "SELECT * FROM ".PHPWS_TBL_PREFIX."mod_xwysiwyg_conf"; ! $settings = $GLOBALS['core']->quickFetch($sql); ! //$GLOBALS['xwysiwyg_settings'] = $settings; ! return $settings; ! }// END FUNC _read_config ! ! ! function showHAoptions($settings) { ! if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg", "settings")) { ! if($_REQUEST['func'] == "update") { ! if(isset($_REQUEST['lang_activ'])) { $settings['lang_activ'] = 1; } ! else { $settings['lang_activ'] = 0; } ! if(isset($_REQUEST['view_anon'])) { $settings['view_anon'] = 1; } ! else { $settings['view_anon'] = 0; } ! if(isset($_REQUEST['view_user'])) { $settings['view_user'] = 1; } ! else { $settings['view_user'] = 0; } ! if(isset($_REQUEST['request_mode'])) { $settings['request_mode'] = 1; } ! else { $settings['request_mode'] = 0; } ! if(isset($_REQUEST['plug_table'])) { $settings['plug_table'] = 1; } ! else { $settings['plug_table'] = 0; } ! if(isset($_REQUEST['plug_context'])) { $settings['plug_context'] = 1; } ! else { $settings['plug_context'] = 0; } ! if(isset($_REQUEST['plug_chara'])) { $settings['plug_chara'] = 1; } ! else { $settings['plug_chara'] = 0; } ! if(isset($_REQUEST['plug_para'])) { $settings['plug_para'] = 1; } ! else { $settings['plug_para'] = 0; } ! if(isset($_REQUEST['plug_list'])) { $settings['plug_list'] = 1; } ! else { $settings['plug_list'] = 0; } ! if(isset($_REQUEST['plug_file'])) { $settings['plug_file'] = 1; } ! else { $settings['plug_file'] = 0; } ! if(isset($_REQUEST['plug_image'])) { $settings['plug_image'] = 1; } ! else { $settings['plug_image'] = 0; } ! if(isset($_REQUEST['plug_spell'])) { $settings['plug_spell'] = 1; } ! else { $settings['plug_spell'] = 0; } ! } ! ! $form = new EZform("options"); ! $form->add("module", "hidden", "xwysiwyg"); ! $form->add("action", "hidden", "admin"); ! $form->add("func", "hidden", "update"); ! ! $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("plug_table", "checkbox"); ! $form->setMatch("plug_table", $settings['plug_table']); ! $form->add("plug_context", "checkbox"); ! $form->setMatch("plug_context", $settings['plug_context']); ! $form->add("plug_chara", "checkbox"); ! $form->setMatch("plug_chara", $settings['plug_chara']); ! $form->add("plug_para", "checkbox"); ! $form->setMatch("plug_para", $settings['plug_para']); ! $form->add("plug_list", "checkbox"); ! $form->setMatch("plug_list", $settings['plug_list']); ! $form->add("plug_file", "checkbox"); ! $form->setMatch("plug_file", $settings['plug_file']); ! $form->add("plug_image", "checkbox"); ! $form->setMatch("plug_image", $settings['plug_image']); ! // $form->add("plug_spell", "checkbox"); ! // $form->setMatch("plug_spell", $settings['plug_spell']); ! $form->add("SUBMIT", "submit", $_SESSION['translate']->it("Save")); ! ! $formTags = $form->getTemplate(); ! $formTags['TITLE'] = $_SESSION['translate']->it("Settings"); //Version??? ! $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['PLUG_TABLE_TEXT'] = $_SESSION['translate']->it("Enable TableOperations-Plugin"); ! $formTags['PLUG_CONTEXT_TEXT'] = $_SESSION['translate']->it("Enable ContextMenu-Plugin"); ! $formTags['PLUG_CHARA_TEXT'] = $_SESSION['translate']->it("Enable CharacterMap-Plugin"); ! $formTags['PLUG_PARA_TEXT'] = $_SESSION['translate']->it("Enable EnterParagraphs-Plugin"); ! $formTags['PLUG_LIST_TEXT'] = $_SESSION['translate']->it("Enable ListType-Plugin"); ! $formTags['PLUG_FILE_TEXT'] = $_SESSION['translate']->it("Enable InsertFile-Plugin"); ! $formTags['PLUG_IMAGE_TEXT'] = $_SESSION['translate']->it("Enable ImageManager-Plugin"); ! // $formTags['PLUG_SPELL_TEXT'] = "n.a. yet ".$_SESSION['translate']->it("Enable SpellChecker-Plugin"); ! if($_REQUEST['func'] == "update") { ! if($GLOBALS['core']->sqlUpdate($settings, "mod_xwysiwyg_conf")) { ! $formTags['MESSAGE'] = "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Settings saved successfully")."</span><br />"; } ! else { $formTags['MESSAGE'] = "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem saving to the database")."</span><br />"; } ! } else { $formTags['MESSAGE'] = "<span style=\"color:blue;font-weight:bold\">".$_SESSION['translate']->it("Make your selections")."</span><br />"; } ! $formTags['EDITOR'] = $_SESSION['translate']->it("You use [var1] now", "<b>".$settings['editor']."</b>"); ! $formTags['TOGGLE'] = $this->toggleButton($settings['editor']); ! $this->content .= PHPWS_Template::processTemplate($formTags, "xwysiwyg", "ha_options.tpl"); ! $this->content .= $this->showArea(); ! } else { ! $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions."); ! } // End of ADMINISTRATOR condition ! }// END FUNC showHAoptions ! ! ! function showFCKoptions($settings) { ! if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg", "settings")) { ! if($_REQUEST['func'] == "update") { ! if(isset($_REQUEST['lang_activ'])) { $settings['lang_activ'] = 1; } ! else { $settings['lang_activ'] = 0; } ! if(isset($_REQUEST['view_anon'])) { $settings['view_anon'] = 1; } ! else { $settings['view_anon'] = 0; } ! if(isset($_REQUEST['view_user'])) { $settings['view_user'] = 1; } ! else { $settings['view_user'] = 0; } ! if(isset($_REQUEST['request_mode'])) { $settings['request_mode'] = 1; } ! else { $settings['request_mode'] = 0; } ! if(isset($_REQUEST['fck_skin'])) { $settings['fck_skin'] = PHPWS_Text::parseInput($_REQUEST["fck_skin"]); } ! else { $settings['fck_skin'] = "default"; } ! } ! ! $form = new EZform("options"); ! $form->add("module", "hidden", "xwysiwyg"); ! $form->add("action", "hidden", "admin"); ! $form->add("func", "hidden", "update"); ! ! $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("fck_skin", "dropbox", array("default"=>"default","office2003"=>"office2003","silver"=>"silver")); ! $form->setMatch("fck_skin", $settings['fck_skin']); ! $form->add("SUBMIT", "submit", $_SESSION['translate']->it("Save")); ! ! $formTags = $form->getTemplate(); ! $formTags['TITLE'] = $_SESSION['translate']->it("Settings"); //Version??? ! $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['FCK_SKIN_TEXT'] = $_SESSION['translate']->it("Select your Skin"); ! if($_REQUEST['func'] == "update") { ! if($GLOBALS['core']->sqlUpdate($settings, "mod_xwysiwyg_conf")) { ! $formTags['MESSAGE'] = "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Settings saved successfully")."</span><br />"; } ! else { $formTags['MESSAGE'] = "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem saving to the database")."</span><br />"; } ! } else { $formTags['MESSAGE'] = "<span style=\"color:blue;font-weight:bold\">".$_SESSION['translate']->it("Make your selections")."</span><br />"; } ! $formTags['EDITOR'] = $_SESSION['translate']->it("You use [var1] now", "<b>".$settings['editor']."</b>"); ! $formTags['TOGGLE'] = $this->toggleButton($settings['editor']); ! $this->content .= PHPWS_Template::processTemplate($formTags, "xwysiwyg", "fck_options.tpl"); ! $this->content .= $this->showArea(); ! } else { ! $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions."); ! } // End of ADMINISTRATOR condition ! }// END FUNC showFCKoptions ! ! ! function showArea() { ! $query = "SELECT id, area FROM ".PHPWS_TBL_PREFIX."mod_xwysiwyg_areas ORDER BY 1"; ! $result = $GLOBALS['core']->query($query, FALSE, TRUE); ! $table[] = array("<b>ID</b>","<b>".$_SESSION['translate']->it("Area-Name")."</b>","<b>".$_SESSION['translate']->it("Action")."</b>"); ! if($result) { ! while($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) { ! $id = $row['id']; ! $area = $row['area']; ! $delelink = $this->linkRef."&action=deleData&id=$id"; ! $deletext = $_SESSION['translate']->it("Delete"); ! $table[] = array($id,$area,"<a href=\"$delelink\">$deletext</a>"); ! } ! } ! $content .= "<hr /><div style=\"float:right\"> ! <form action=\"index.php\" method=\"post\" TITLE=\"new\"> ! <input type=\"Hidden\" name=\"module\" value=\"xwysiwyg\"> ! <input type=\"Hidden\" name=\"action\" value=\"addArea\"> ! <input type=\"Text\" name=\"area\" size=\"20\"> ! <input type=\"Submit\" value=\"".$_SESSION['translate']->it("New")."\"> ! </form></div>"; ! $content .= PHPWS_Text::ezTable($table,2,2,1,"",NULL,1,"top"); ! return $content; ! } ! ! function toggleButton($editor) { ! $content .= "<form action=\"index.php\" method=\"POST\" title=\"toggle\"> ! <input type=\"Hidden\" name=\"module\" value=\"xwysiwyg\"> ! <input type=\"Hidden\" name=\"action\" value=\"toggle\">"; ! if($editor=="htmlarea") ! $content .= "<input type=\"Hidden\" name=\"editor\" value=\"fck\">"; ! else ! $content .= "<input type=\"Hidden\" name=\"editor\" value=\"htmlarea\">"; ! $content .="<input type=\"Submit\" value=\"".$_SESSION['translate']->it("Change")."\"> ! </form>"; ! return $content; ! } ! ! function toggleEditor($editor) { ! $data['editor'] = $editor; ! return $GLOBALS['core']->sqlUpdate($data, "mod_xwysiwyg_conf"); ! } ! ! ! function addArea() { ! if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg","settings")) {//Administrativ condition ! if($_REQUEST['area']) {$data['area'] = PHPWS_Text::parseInput($_REQUEST['area']); } ! else {return FALSE;} ! if($GLOBALS['core']->sqlInsert($data, "mod_xwysiwyg_areas", TRUE, FALSE)) { ! $this->content .= "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Saving was successfull")."</span><br />"; } ! else { $this->content .= "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem saving to the database")."</span><br />"; } ! $this->content .= "<br /><a href=\"./index.php\">".$_SESSION['translate']->it("Home")."</a>"; ! $this->content .= "<br /><a href=\"javascript:history.back()\">".$_SESSION['translate']->it("Back")."</a>"; ! ! } else { ! $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions."); ! } // End of ADMINISTRATOR condition ! } ! ! ! function delArea($id) { ! if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg","settings")) {//Administrativ condition ! if($GLOBALS['core']->sqlDelete("mod_xwysiwyg_areas","id",$id)) { ! $this->content .= "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Entry was successfully deleted from the database")."</span><br />"; } ! else { $this->content .= "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem deleting the entry")."</span><br />"; } ! $this->content .= "<br /><a href=\"".$this->linkRef."&action=admin\">".$_SESSION['translate']->it("Back")."</a>"; ! ! } 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 ! $this->content = ""; ! $action = PHPWS_Text::parseInput($_REQUEST["action"]); //now we use core/Text.php to check the input ! $this->linkRef = "./index.php?module=xwysiwyg"; //i use this above, to shorten links... ! ! switch($action) { ! ! case "toggle": //this for action=admin ! $this->toggleEditor(PHPWS_Text::parseInput($_REQUEST["editor"])); ! ! case "admin": //this for action=admin ! $settings = PHPWS_xwysiwyg::readConfig(); ! if($settings['editor']=="htmlarea") ! $this->showHAoptions($settings); ! else if($settings['editor']=="fck") ! $this->showFCKoptions($settings); ! else ! $this->content .= $_SESSION['translate']->it("Error: No editor selected"); ! break; ! ! case "addArea": //this for action=data ! $this->addArea(); ! break; ! ! case "editData": //this for action=data ! $this->editData(PHPWS_Text::parseInput($_REQUEST["id"])); ! break; ! ! case "deleData": //this for action=data ! $this->delArea(PHPWS_Text::parseInput($_REQUEST["id"])); ! 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; ! }//END action ! ! ! }//END class ?> \ No newline at end of file Index: phpSniff.class.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/class/phpSniff.class.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** phpSniff.class.php 25 Oct 2004 18:11:44 -0000 1.1.1.1 --- phpSniff.class.php 26 Oct 2004 07:31:52 -0000 1.2 *************** *** 1,197 **** ! <?php ! /******************************************************************************* ! $Id$ ! ! phpSniff: HTTP_USER_AGENT Client Sniffer for PHP ! Copyright (C) 2001 Roger Raymond ~ eps...@us... ! ! This library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. ! ! This library is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with this library; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! *******************************************************************************/ ! require_once('phpSniff.core.php'); ! ! //=============================================================== ! // the following defines are used to create the short ! // browser name used throughout the script. ! // change these to suit your needs ! //=============================================================== ! ! class phpSniff extends phpSniff_core ! { var $_version = '2.1.3'; ! /** ! * Configuration ! * ! * $_temp_file_path ! * default : /tmp/ ! * desc : directory writable by the server to store cookie check files. ! * : trailing slash is needed. only used if you use the check cookie routine ! * ! * $_check_cookies ! * default : null ! * desc : Allow for the script to redirect the browser in order ! * : to check for cookies. In order for this to work, this ! * : class must be instantiated before any headers are sent. ! * ! * $_default_language ! * default : en-us ! * desc : language to report as if no languages are found ! * ! * $_allow_masquerading ! * default : null ! * desc : Allow for browser to Masquerade as another. ! * : (ie: Opera identifies as MSIE 5.0) ! * ! * $_browsers ! * desc : 2D Array of browsers we wish to search for ! * : in key => value pairs. ! * : key = browser to search for [as in HTTP_USER_AGENT] ! * : value = value to return as 'browser' property ! * ! * $_javascript_versions ! * desc : 2D Array of javascript version supported by which browser ! * : in key => value pairs. ! * : key = javascript version ! * : value = search parameter for browsers that support the ! * : javascript version listed in the key (comma delimited) ! * : note: the search parameters rely on the values ! * : set in the $_browsers array ! * ! * $_browser_features ! * desc : 2D Array of browser features supported by which browser ! * : in key => value pairs. ! * : key = feature ! * : value = search parameter for browsers that support the ! * : feature listed in the key (comma delimited) ! * : note: the search parameters rely on the values ! * : set in the $_browsers array ! * ! * $_browser_quirks ! * desc : 2D Array of browser quirks present in which browser ! * : in key => value pairs. ! * : key = quirk ! * : value = search parameter for browsers that feature the ! * : quirk listed in the key (comma delimited) ! * : note: the search parameters rely on the values ! * : set in the $_browsers array ! **/ ! ! var $_temp_file_path = '/tmp/'; // with trailing slash ! var $_check_cookies = NULL; ! var $_default_language = 'en-us'; ! var $_allow_masquerading = NULL; ! var $_php_version = ''; ! ! var $_browsers = array( ! 'microsoft internet explorer' => 'IE', ! 'msie' => 'IE', ! 'netscape6' => 'NS', ! 'netscape' => 'NS', ! 'galeon' => 'GA', ! 'phoenix' => 'PX', ! 'mozilla firebird' => 'FB', ! 'firebird' => 'FB', ! 'chimera' => 'CH', ! 'camino' => 'CA', ! 'safari' => 'SF', ! 'k-meleon' => 'KM', ! 'mozilla' => 'MZ', ! 'opera' => 'OP', ! 'konqueror' => 'KQ', ! 'icab' => 'IC', ! 'lynx' => 'LX', ! 'links' => 'LI', ! 'ncsa mosaic' => 'MO', ! 'amaya' => 'AM', ! 'omniweb' => 'OW', ! 'hotjava' => 'HJ', ! 'browsex' => 'BX', ! 'amigavoyager' => 'AV', ! 'amiga-aweb' => 'AW', ! 'ibrowse' => 'IB' ! ); ! ! var $_javascript_versions = array( ! '1.5' => 'NS5+,MZ,PX,FB,GA,CH,CA,SF,KQ3+,KM', // browsers that support JavaScript 1.5 ! '1.4' => '', ! '1.3' => 'NS4.05+,OP5+,IE5+', ! '1.2' => 'NS4+,IE4+', ! '1.1' => 'NS3+,OP,KQ', ! '1.0' => 'NS2+,IE3+', ! '0' => 'LI,LX,HJ' ! ); ! ! var $_browser_features = array( ! /** ! * the following are true by default ! * (see phpSniff.core.php $_feature_set array) ! * browsers listed here will be set to false ! **/ ! 'html' => '', ! 'images' => 'LI,LX', ! 'frames' => 'LI,LX', ! 'tables' => '', ! 'java' => 'OP3,LI,LX,NS1,MO,IE1,IE2', ! 'plugins' => 'IE1,IE2,LI,LX', ! /** ! * the following are false by default ! * (see phpSniff.core.php $_feature_set array) ! * browsers listed here will be set to true ! **/ ! 'css2' => 'NS5+,IE5+,MZ,PX,FB,CH,CA,SF,GA,KQ3+,OP7+,KM', ! 'css1' => 'NS4+,IE4+,MZ,PX,FB,CH,CA,SF,GA,KQ,OP7+,KM', ! 'iframes' => 'IE3+,NS5+,MZ,PX,FB,CH,CA,SF,GA,KQ,OP7+,KM', ! 'xml' => 'IE5+,NS5+,MZ,PX,FB,CH,CA,SF,GA,KQ,OP7+,KM', ! 'dom' => 'IE5+,NS5+,MZ,PX,FB,CH,CA,SF,GA,KQ,OP7+,KM', ! 'hdml' => '', ! 'wml' => '' ! ); ! ! var $_browser_quirks = array( ! 'must_cache_forms' => 'NS,MZ,FB,PX', ! 'avoid_popup_windows' => 'IE3,LI,LX', ! 'cache_ssl_downloads' => 'IE', ! 'break_disposition_header' => 'IE5.5', ! 'empty_file_input_value' => 'KQ', ! 'scrollbar_in_way' => 'IE6' ! ); ! ! function phpSniff($UA='',$settings = true) ! { // populate the HTTP_USER_AGENT string ! // 20020425 :: rraymond ! // routine for easier configuration of the client at runtime ! if(is_array($settings)) { ! $run = true; ! extract($settings); ! $this->_check_cookies = $check_cookies; ! $this->_default_language = $default_language; ! $this->_allow_masquerading = $allow_masquerading; ! } else { ! // for backwards compatibility with 2.0.x series ! $run = $settings; ! } ! ! // 20020425 :: besfred ! if(empty($UA)) $UA = getenv('HTTP_USER_AGENT'); ! if(empty($UA)) { ! $pv = explode(".", PHP_VERSION); ! $UA = ( $pv[0] > 3 && $pv[1] > 0 ) ? $_SERVER['HTTP_USER_AGENT'] : $HTTP_SERVER_VARS['HTTP_USER_AGENT']; ! } ! // 20020910 :: rraymond ! if(empty($UA)) return false; ! ! $this->_set_browser('ua',$UA); ! if($run) $this->init(); ! } ! } ?> \ No newline at end of file --- 1,197 ---- ! <?php ! /******************************************************************************* ! $Id$ ! ! phpSniff: HTTP_USER_AGENT Client Sniffer for PHP ! Copyright (C) 2001 Roger Raymond ~ eps...@us... ! ! This library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. ! ! This library is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with this library; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! *******************************************************************************/ ! require_once('phpSniff.core.php'); ! ! //=============================================================== ! // the following defines are used to create the short ! // browser name used throughout the script. ! // change these to suit your needs ! //=============================================================== ! ! class phpSniff extends phpSniff_core ! { var $_version = '2.1.3'; ! /** ! * Configuration ! * ! * $_temp_file_path ! * default : /tmp/ ! * desc : directory writable by the server to store cookie check files. ! * : trailing slash is needed. only used if you use the check cookie routine ! * ! * $_check_cookies ! * default : null ! * desc : Allow for the script to redirect the browser in order ! * : to check for cookies. In order for this to work, this ! * : class must be instantiated before any headers are sent. ! * ! * $_default_language ! * default : en-us ! * desc : language to report as if no languages are found ! * ! * $_allow_masquerading ! * default : null ! * desc : Allow for browser to Masquerade as another. ! * : (ie: Opera identifies as MSIE 5.0) ! * ! * $_browsers ! * desc : 2D Array of browsers we wish to search for ! * : in key => value pairs. ! * : key = browser to search for [as in HTTP_USER_AGENT] ! * : value = value to return as 'browser' property ! * ! * $_javascript_versions ! * desc : 2D Array of javascript version supported by which browser ! * : in key => value pairs. ! * : key = javascript version ! * : value = search parameter for browsers that support the ! * : javascript version listed in the key (comma delimited) ! * : note: the search parameters rely on the values ! * : set in the $_browsers array ! * ! * $_browser_features ! * desc : 2D Array of browser features supported by which browser ! * : in key => value pairs. ! * : key = feature ! * : value = search parameter for browsers that support the ! * : feature listed in the key (comma delimited) ! * : note: the search parameters rely on the values ! * : set in the $_browsers array ! * ! * $_browser_quirks ! * desc : 2D Array of browser quirks present in which browser ! * : in key => value pairs. ! * : key = quirk ! * : value = search parameter for browsers that feature the ! * : quirk listed in the key (comma delimited) ! * : note: the search parameters rely on the values ! * : set in the $_browsers array ! **/ ! ! var $_temp_file_path = '/tmp/'; // with trailing slash ! var $_check_cookies = NULL; ! var $_default_language = 'en-us'; ! var $_allow_masquerading = NULL; ! var $_php_version = ''; ! ! var $_browsers = array( ! 'microsoft internet explorer' => 'IE', ! 'msie' => 'IE', ! 'netscape6' => 'NS', ! 'netscape' => 'NS', ! 'galeon' => 'GA', ! 'phoenix' => 'PX', ! 'mozilla firebird' => 'FB', ! 'firebird' => 'FB', ! 'chimera' => 'CH', ! 'camino' => 'CA', ! 'safari' =... [truncated message content] |