From: Yves K. <yku...@us...> - 2004-11-10 00:25:27
|
Update of /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19265/modules/xwysiwyg/mod/xwysiwyg/class Modified Files: xwysiwyg.php Log Message: toggle form templated now browser check in options-template Index: xwysiwyg.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/class/xwysiwyg.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** xwysiwyg.php 7 Nov 2004 00:29:41 -0000 1.11 --- xwysiwyg.php 10 Nov 2004 00:24:52 -0000 1.12 *************** *** 28,32 **** if (!isset($browser_css) && file_exists($_SESSION['OBJ_layout']->theme_dir."style.css")) $css = "/".$_SESSION['OBJ_layout']->theme_address . "style.css"; ! return $css; } --- 28,32 ---- if (!isset($browser_css) && file_exists($_SESSION['OBJ_layout']->theme_dir."style.css")) $css = "/".$_SESSION['OBJ_layout']->theme_address . "style.css"; ! return "http://".PHPWS_SOURCE_HTTP.$css; } *************** *** 42,47 **** ! function isSupported($section_name){ ! $answer = array(); $supported = FALSE; require_once(PHPWS_SOURCE_DIR.'mod/xwysiwyg/class/phpSniff.class.php');//include the browser checking code --- 42,46 ---- ! function sniffer($text=NULL){ $supported = FALSE; require_once(PHPWS_SOURCE_DIR.'mod/xwysiwyg/class/phpSniff.class.php');//include the browser checking code *************** *** 53,58 **** if($client->browser_is($search)) $supported = TRUE; } ! $settings = PHPWS_xwysiwyg::readConfig(); ! $allowed = FALSE; if($_SESSION["OBJ_user"]->isDeity()) $allowed = TRUE; elseif((!$_SESSION["OBJ_user"]->isUser())AND(!$_SESSION["OBJ_user"]->isDeity())AND($settings['view_anon'])) $allowed = TRUE; --- 52,67 ---- if($client->browser_is($search)) $supported = TRUE; } ! if($text){ ! if($supported) $supported = "<span style=\"color:green;\">".$_SESSION['translate']->it("Your Browser IS supported")."</span>"; ! else $supported = "<span style=\"color:red;\">".$_SESSION['translate']->it("Your Browser is NOT supported")."</span>"; ! } ! return $supported; ! } ! ! function isSupported($section_name){ ! $supported = PHPWS_xwysiwyg::sniffer(); ! $settings = PHPWS_xwysiwyg::readConfig(); ! $allowed = FALSE; ! $answer = array(); if($_SESSION["OBJ_user"]->isDeity()) $allowed = TRUE; elseif((!$_SESSION["OBJ_user"]->isUser())AND(!$_SESSION["OBJ_user"]->isDeity())AND($settings['view_anon'])) $allowed = TRUE; *************** *** 249,253 **** } ! $form = new EZform("options"); $form->add("module", "hidden", "xwysiwyg"); $form->add("action", "hidden", "admin"); --- 258,262 ---- } ! $form = new EZform("xw_options"); $form->add("module", "hidden", "xwysiwyg"); $form->add("action", "hidden", "admin"); *************** *** 294,300 **** $formTags['PLUG_IMAGE_TEXT'] = $_SESSION['translate']->it("Enable ImageManager-Plugin"); // $formTags['PLUG_SPELL_TEXT'] = "n.a. yet ".$_SESSION['translate']->it("Enable SpellChecker-Plugin"); ! $formTags['MESSAGE'] = $this->updateOptions($settings); ! $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(); --- 303,310 ---- $formTags['PLUG_IMAGE_TEXT'] = $_SESSION['translate']->it("Enable ImageManager-Plugin"); // $formTags['PLUG_SPELL_TEXT'] = "n.a. yet ".$_SESSION['translate']->it("Enable SpellChecker-Plugin"); ! $formTags['MESSAGE'] = PHPWS_xwysiwyg::updateOptions($settings); ! $formTags['TOGGLE'] = PHPWS_xwysiwyg::toggleButton($settings['editor']); ! $formTags['BROWSER'] = PHPWS_xwysiwyg::sniffer("text"); ! $formTags['EDITOR'] = $_SESSION['translate']->it("You use [var1] now", "<strong>".$settings['editor']."</strong>"); $this->content .= PHPWS_Template::processTemplate($formTags, "xwysiwyg", "ha_options.tpl"); $this->content .= $this->showArea(); *************** *** 320,324 **** } ! $form = new EZform("options"); $form->add("module", "hidden", "xwysiwyg"); $form->add("action", "hidden", "admin"); --- 330,334 ---- } ! $form = new EZform("xw_options"); $form->add("module", "hidden", "xwysiwyg"); $form->add("action", "hidden", "admin"); *************** *** 344,350 **** $formTags['REQUEST_MODE_TEXT'] = $_SESSION['translate']->it("Enable Request-Mode"); $formTags['FCK_SKIN_TEXT'] = $_SESSION['translate']->it("Select your Skin"); ! $formTags['MESSAGE'] = $this->updateOptions($settings); ! $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(); --- 354,361 ---- $formTags['REQUEST_MODE_TEXT'] = $_SESSION['translate']->it("Enable Request-Mode"); $formTags['FCK_SKIN_TEXT'] = $_SESSION['translate']->it("Select your Skin"); ! $formTags['MESSAGE'] = PHPWS_xwysiwyg::updateOptions($settings); ! $formTags['TOGGLE'] = PHPWS_xwysiwyg::toggleButton($settings['editor']); ! $formTags['BROWSER'] = PHPWS_xwysiwyg::sniffer("text"); ! $formTags['EDITOR'] = $_SESSION['translate']->it("You use [var1] now", "<strong>".$settings['editor']."</strong>"); $this->content .= PHPWS_Template::processTemplate($formTags, "xwysiwyg", "fck_options.tpl"); $this->content .= $this->showArea(); *************** *** 358,364 **** if(isset($_REQUEST['func'])AND($_REQUEST['func'] == "update")) { if($GLOBALS['core']->sqlUpdate($settings, "mod_xwysiwyg_conf")) { ! $message = "<span style=\"color:green;font-weight:bold\">".$_SESSION['translate']->it("Settings saved successfully")."</span><br />"; } else { $message = "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem saving to the database")."</span><br />"; } ! } else { $message = "<span style=\"color:blue;font-weight:bold\">".$_SESSION['translate']->it("Make your selections")."</span><br />"; } return $message; } --- 369,375 ---- if(isset($_REQUEST['func'])AND($_REQUEST['func'] == "update")) { if($GLOBALS['core']->sqlUpdate($settings, "mod_xwysiwyg_conf")) { ! $message = "<span style=\"color:green;\">".$_SESSION['translate']->it("Settings saved successfully")."</span><br />"; } else { $message = "<span class=\"errortext\">".$_SESSION['translate']->it("There was a problem saving to the database")."</span><br />"; } ! } else { $message = "<span style=\"color:blue;\">".$_SESSION['translate']->it("Make your selections")."</span><br />"; } return $message; } *************** *** 389,402 **** function toggleButton($editor) { //need xhtml compatibility ! $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; } --- 400,414 ---- function toggleButton($editor) { //need xhtml compatibility ! $form = new EZform("xw_toggle"); ! $form->add("module", "hidden", "xwysiwyg"); ! $form->add("action", "hidden", "toggle"); if($editor=="htmlarea") ! $form->add("editor", "hidden", "fck"); else ! $form->add("editor", "hidden", "htmlarea"); ! $form->add("SUBMIT", "submit", $_SESSION['translate']->it("Change")); ! $formTags = $form->getTemplate(); ! $toggle = PHPWS_Template::processTemplate($formTags, "xwysiwyg", "toggle.tpl"); ! return $toggle; } |