XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
mms.php
Go to the documentation of this file.
1 <?php
20 defined('XOOPS_ROOT_PATH') or die('Restricted access');
21 
23 {
24  function encode($textarea_id)
25  {
26  $config = parent::loadConfig(dirname(__FILE__));
27  $code = "<img src='{$this->image_path}/mmssrc.gif' alt='" . _XOOPS_FORM_ALTMMS . "' onclick='xoopsCodeMms(\"{$textarea_id}\",\"" . htmlspecialchars(_XOOPS_FORM_ENTERMMSURL, ENT_QUOTES) . "\",\"" . htmlspecialchars(_XOOPS_FORM_ENTERHEIGHT, ENT_QUOTES) . "\",\"" . htmlspecialchars(_XOOPS_FORM_ENTERWIDTH, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"hand\"'/>&nbsp;";
28  $javascript = <<<EOH
29  function xoopsCodeMms(id,enterMmsPhrase, enterMmsHeightPhrase, enterMmsWidthPhrase)
30  {
31  var selection = xoopsGetSelect(id);
32  if (selection.length > 0) {
33  var selection="mms://"+selection;
34  var text = selection;
35  } else {
36  var text = prompt(enterMmsPhrase+" mms or http", "mms://");
37  }
38  var domobj = xoopsGetElementById(id);
39  if ( text.length > 0 && text != "mms://") {
40  var text2 = prompt(enterMmsWidthPhrase, "480");
41  var text3 = prompt(enterMmsHeightPhrase, "330");
42  var result = "[mms="+text2+","+text3+"]" + text + "[/mms]";
43  xoopsInsertText(domobj, result);
44  }
45  domobj.focus();
46  }
47 EOH;
48  return array(
49  $code,
50  $javascript);
51  }
52 
53  function load(&$ts)
54  {
55  $ts->patterns[] = "/\[mms=(['\"]?)([^\"']*),([^\"']*)\\1]([^\"]*)\[\/mms\]/sU";
56  $rp = "<OBJECT id=videowindow1 height='\\3' width='\\2' classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'>";
57  $rp .= "<PARAM NAME=\"URL\" VALUE=\"\\4\">";
58  $rp .= "<PARAM NAME=\"rate\" VALUE=\"1\">";
59  $rp .= "<PARAM NAME=\"balance\" VALUE=\"0\">";
60  $rp .= "<PARAM NAME=\"currentPosition\" VALUE=\"0\">";
61  $rp .= "<PARAM NAME=\"defaultFrame\" VALUE=\"\">";
62  $rp .= "<PARAM NAME=\"playCount\" VALUE=\"1\">";
63  $rp .= "<PARAM NAME=\"autoStart\" VALUE=\"0\">";
64  $rp .= "<PARAM NAME=\"currentMarker\" VALUE=\"0\">";
65  $rp .= "<PARAM NAME=\"invokeURLs\" VALUE=\"-1\">";
66  $rp .= "<PARAM NAME=\"baseURL\" VALUE=\"\">";
67  $rp .= "<PARAM NAME=\"volume\" VALUE=\"50\">";
68  $rp .= "<PARAM NAME=\"mute\" VALUE=\"0\">";
69  $rp .= "<PARAM NAME=\"uiMode\" VALUE=\"full\">";
70  $rp .= "<PARAM NAME=\"stretchToFit\" VALUE=\"0\">";
71  $rp .= "<PARAM NAME=\"windowlessVideo\" VALUE=\"0\">";
72  $rp .= "<PARAM NAME=\"enabled\" VALUE=\"-1\">";
73  $rp .= "<PARAM NAME=\"enableContextMenu\" VALUE=\"-1\">";
74  $rp .= "<PARAM NAME=\"fullScreen\" VALUE=\"0\">";
75  $rp .= "<PARAM NAME=\"SAMIStyle\" VALUE=\"\">";
76  $rp .= "<PARAM NAME=\"SAMILang\" VALUE=\"\">";
77  $rp .= "<PARAM NAME=\"SAMIFilename\" VALUE=\"\">";
78  $rp .= "<PARAM NAME=\"captioningID\" VALUE=\"\">";
79  $rp .= "<PARAM NAME=\"enableErrorDialogs\" VALUE=\"0\">";
80  $rp .= "<PARAM NAME=\"_cx\" VALUE=\"12700\">";
81  $rp .= "<PARAM NAME=\"_cy\" VALUE=\"8731\">";
82  $rp .= "</OBJECT>";
83  $ts->replacements[] = $rp;
84 
85  return true;
86  }
87 }
88 ?>