20 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
24 function encode($textarea_id)
26 $config = parent::loadConfig(dirname(__FILE__));
27 $code =
"<img src='{$this->image_path}/wmp.gif' alt='" . _XOOPS_FORM_ALTWMP .
"' onclick='xoopsCodeWmp(\"{$textarea_id}\",\"" . htmlspecialchars(
_XOOPS_FORM_ENTERWMPURL, ENT_QUOTES) .
"\",\"" . htmlspecialchars(_XOOPS_FORM_ENTERHEIGHT, ENT_QUOTES) .
"\",\"" . htmlspecialchars(_XOOPS_FORM_ENTERWIDTH, ENT_QUOTES) .
"\");' onmouseover='style.cursor=\"hand\"'/> ";
29 function xoopsCodeWmp(
id, enterWmpPhrase, enterWmpHeightPhrase, enterWmpWidthPhrase) {
30 var selection = xoopsGetSelect(
id);
31 if (selection.length > 0) {
34 var text = prompt(enterWmpPhrase,
"");
36 var domobj = xoopsGetElementById(
id);
37 if ( text.length > 0 ) {
38 var text2 = prompt(enterWmpWidthPhrase,
"480");
39 var text3 = prompt(enterWmpHeightPhrase,
"330");
40 var result =
"[wmp="+text2+
","+text3+
"]" + text +
"[/wmp]";
41 xoopsInsertText(domobj, result);
53 $ts->patterns[] =
"/\[wmp=(['\"]?)([^\"']*),([^\"']*)\\1]([^\"]*)\[\/wmp\]/sU";
54 $rp =
"<object classid=\"clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6\" id=\"WindowsMediaPlayer\" width=\"\\2\" height=\"\\3\">\n";
55 $rp .=
"<param name=\"URL\" value=\"\\4\">\n";
56 $rp .=
"<param name=\"AutoStart\" value=\"0\">\n";
57 $rp .=
"<embed autostart=\"0\" src=\"\\4\" type=\"video/x-ms-wmv\" width=\"\\2\" height=\"\\3\" controls=\"ImageWindow\" console=\"cons\"> </embed>";
59 $ts->replacements[] = $rp;