#1649: Editor will not change the category
--------------------------------------------+-------------------------------
Reporter: blsplus | Owner:
Type: New Feature | Status: new
Priority: Normal | Milestone:
Component: Project : MediaWiki+FCKeditor | Version:
Resolution: | Keywords: Discussion
--------------------------------------------+-------------------------------
Comment (by moisadoru):
This will do it:
{{{
function replaceCategories($text){
$s1 =
'/\[\[\s*[\w]*\s*:\s*[\w]*\s*\|\s*([\w]*)\s*:([\w\s]*)\]\]/';
$r1 = '[[$1:$2]]';
return preg_replace($s1, $r1, $text);
}
function fixCategories($parset, $text) {
$text = replaceCategories($text);
return true;
}
function fixCategoriesSave($article, $user, $text) {
$text = replaceCategories($text);
return true;
}
function fixCategoriesSaveConflict() {
global $fckPageEditor;
$fckPageEditor->textbox2 =
replaceCategories($fckPageEditor->textbox2);
$fckPageEditor->textbox1 =
replaceCategories($fckPageEditor->textbox1);
return true;
}
$wgHooks['ArticleAfterFetchContent'][] = 'fixCategories';
$wgHooks['ArticleSave'][] = 'fixCategoriesSave';
$wgHooks['EditPageBeforeConflictDiff'][] = 'fixCategoriesSaveConflict';
}}}
Please see bug [http://dev.fckeditor.net/ticket/1385] for details
regarding the "EditPageBeforeConflictDiff" hook.
--
Ticket URL: <http://dev.fckeditor.net/ticket/1649#comment:4>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac