SDVA($PmFCK, array( 'EditFckAction' => 'editfck', 'Width' => '100%', 'Height' => '400', 'BaseImagePath' => 'http://'.$_SERVER[HTTP_HOST], 'BasePath' =>'/wiki/pub/fckeditor/FCKeditor/', 'UserFilesPath' => '/wiki/uploads/', 'ToolBar'=> 'PmWiki', 'EditorAreaCSS' => '/wiki/pub/fckeditor/pm_fckstyles.css', 'StylesXmlPath' => '/wiki/pub/fckeditor/pm_fckstyles.xml', 'CustomConfigurationsPath' => '/wiki/pub/fckeditor/pm_fckconfig.js', 'TextTranslation' => array(summary => 'Summary:', author => 'Author:', minor => 'This is a minor edit', editfck => "WysIsWyg Edit") )); SDVA($HandleActions,array($PmFCK['EditFckAction'] => 'HandleEditFck')); SDVA($HandleAuth,array($PmFCK['EditFckAction'] => 'edit')); SDVA($MarkupToDisable, array(count($MarkupToDisable) =>'if', 'redirect', 'include', 'nogroupfooter', 'nogroupheader', 'groupheader', 'groupfooter', 'noright', 'noleft', 'notitle', 'nofooter', 'noaction', 'spacewikiwords', 'messages', 'linebreaks', 'linkwikiwords', 'noheader', 'varindex', 'pagelist', 'searchresults', 'input', 'comment', 'title')); function HandleEditFck($pagename, $auth = 'edit') { global $IsPagePosted, $EditFields, $ChangeSummary, $EditFunctions, $EnablePost, $EnablePostAuthorRequired, $FmtV, $Now, $EditRedirectFmt, $Author, $PageEditForm, $HandleEditFmt, $PageStartFmt, $PageEditFmt, $PageEndFmt,$PmFCK,$MarkupToDisable,$MarkupTable,$MarkupRules,$MessagesFmt; SDV($EditRedirectFmt, '$FullName'); if (@$_POST['cancel']) { Redirect(FmtPageName($EditRedirectFmt, $pagename)); return; } Lock(2); $IsPagePosted = false; $page = RetrieveAuthPage($pagename, $auth, true); if (!$page) Abort("?cannot edit $pagename"); PCache($pagename,$page); $new = $page; if (isset($_POST['FCKeditor1'])) $new['text']=HTMLToMarkups($pagename,str_replace("\r",'',stripmagic($_POST['FCKeditor1']))); $new['csum'] = $ChangeSummary; if ($ChangeSummary) $new["csum:$Now"] = $ChangeSummary; $EnablePost &= preg_grep('/^post/', array_keys(@$_POST)); // $Editfunctions if (IsEnabled($EnablePostAuthorRequired,0)) { RequireAuthor($pagename, $page, $new); } SaveAttributes($pagename,$page,$new); PostPage($pagename,$page,$new); PostRecentChanges($pagename,$page,$new); Lock(0); if ($IsPagePosted && !@$_POST['postedit']) { Redirect(FmtPageName($EditRedirectFmt, $pagename)); return; } $FmtV['$DiffClassMinor'] = (@$_POST['diffclass']=='minor') ? "checked='checked'" : ''; $FmtV['$EditText'] = str_replace('$','$',htmlspecialchars(@$new['text'],ENT_NOQUOTES)); $FmtV['$EditBaseTime'] = $Now; /* if (@$PageEditForm) { $form = ReadPage(FmtPageName($PageEditForm, $pagename), READPAGE_CURRENT); // $FmtV['$EditForm'] = MarkupToHTML($pagename, $form['text']); }*/ // Config $oFCKeditor = new FCKeditor('FCKeditor1'); $oFCKeditor->Config['EditorAreaCSS'] = $PmFCK['EditorAreaCSS']; $oFCKeditor->Config['StylesXmlPath'] = $PmFCK['StylesXmlPath']; $oFCKeditor->Config['CustomConfigurationsPath'] = $PmFCK['CustomConfigurationsPath']; $oFCKeditor->BasePath = $PmFCK['BasePath']; $oFCKeditor->Width = $PmFCK['Width']; $oFCKeditor->Height = $PmFCK['Height'] ; $oFCKeditor->Config['ToolBar'] = $PmFCK['ToolBar']; $TmpMarkupTable=$MarkupTable; // Disable selected markups during the conversion $TmpMarkupRules=$MarkupRules; DisableMarkup($MarkupToDisable); $html= MarkupToHTML($pagename,$new['text']); // Convert Wiki Markups to normal HTML, using the standard fonction $html = preg_replace("/
]*)><\/p>/i", "",$html); $MarkupTable=$TmpMarkupTable; // Restore the markups for the page to be properly displayed $MarkupRules=$TmpMarkupRules; $oFCKeditor->Value = $html; $PageEditFmt= "