23 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
27 function encode($textarea_id)
29 $config = parent::loadConfig(dirname(__FILE__));
30 $code =
"<img src='{$this->image_path}/wiki.gif' alt='" .
_XOOPS_FORM_ALTWIKI .
"' onclick='xoopsCodeWiki(\"{$textarea_id}\",\"" . htmlspecialchars(
_XOOPS_FORM_ENTERWIKITERM, ENT_QUOTES) .
"\");' onmouseover='style.cursor=\"hand\"'/> ";
32 function xoopsCodeWiki(
id, enterWikiPhrase){
33 if (enterWikiPhrase == null) {
34 enterWikiPhrase =
"Enter the word to be linked to Wiki:";
36 var selection = xoopsGetSelect(
id);
37 if (selection.length > 0) {
40 var text = prompt(enterWikiPhrase,
"");
42 var domobj = xoopsGetElementById(
id);
43 if ( text != null && text !=
"" ) {
44 var result =
"[[" + text +
"]]";
45 xoopsInsertText(domobj, result);
57 $ts->patterns[] =
"/\[\[([^\]]*)\]\]/esU";
58 $ts->replacements[] = __CLASS__ .
"::decode( '\\1' )";
61 function decode($text)
63 $config = parent::loadConfig(dirname(__FILE__));
64 if (empty($text) || empty(
$config[
'link'])) {
67 $charset = !empty(
$config[
'charset']) ?
$config[
'charset'] :
"UTF-8";