flexWidget.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * The view file for CFlexWidget.
  4. *
  5. * @author Qiang Xue <qiang.xue@gmail.com>
  6. * @link http://www.yiiframework.com/
  7. * @copyright 2008-2013 Yii Software LLC
  8. * @license http://www.yiiframework.com/license/
  9. * @package system.web.widgets.views
  10. * @since 1.0
  11. */
  12. ?>
  13. <script type="text/javascript">
  14. /*<![CDATA[*/
  15. // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
  16. var hasProductInstall = DetectFlashVer(6, 0, 65);
  17. // Version check based upon the values defined in globals
  18. var hasRequestedVersion = DetectFlashVer(9, 0, 0);
  19. // Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
  20. if ( hasProductInstall && !hasRequestedVersion ) {
  21. // MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
  22. // This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
  23. // DO NOT MODIFY THE FOLLOWING FOUR LINES
  24. // Location visited after installation is complete if installation is required
  25. var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
  26. var MMredirectURL = window.location;
  27. document.title = document.title.slice(0, 47) + " - Flash Player Installation";
  28. var MMdoctitle = document.title;
  29. AC_FL_RunContent(
  30. "src", "<?php echo $this->baseUrl ?>/playerProductInstall",
  31. "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
  32. "width", "<?php echo $this->width; ?>",
  33. "height", "<?php echo $this->height; ?>",
  34. "align", "<?php echo $this->align; ?>",
  35. "id", "<?php echo $this->name; ?>",
  36. "quality", "<?php echo $this->quality; ?>",
  37. "bgcolor", "<?php echo $this->bgColor; ?>",
  38. "name", "<?php echo $this->name; ?>",
  39. "allowScriptAccess","<?php echo $this->allowScriptAccess ?>",
  40. "allowFullScreen","<?php echo $this->allowFullScreen ?>",
  41. "type", "application/x-shockwave-flash",
  42. "pluginspage", "http://www.adobe.com/go/getflashplayer"
  43. );
  44. } else if (hasRequestedVersion) {
  45. // if we've detected an acceptable version
  46. // embed the Flash Content SWF when all tests are passed
  47. AC_FL_RunContent(
  48. "src", "<?php echo $this->baseUrl ?>/<?php echo $this->name ?>",
  49. "width", "<?php echo $this->width ?>",
  50. "height", "<?php echo $this->height ?>",
  51. "align", "<?php echo $this->align ?>",
  52. "id", "<?php echo $this->name ?>",
  53. "quality", "<?php echo $this->quality ?>",
  54. "bgcolor", "<?php echo $this->bgColor ?>",
  55. "name", "<?php echo $this->name ?>",
  56. "flashvars","<?php echo $this->flashVarsAsString; ?>",
  57. "allowScriptAccess","<?php echo $this->allowScriptAccess ?>",
  58. "allowFullScreen","<?php echo $this->allowFullScreen ?>",
  59. "type", "application/x-shockwave-flash",
  60. "pluginspage", "http://www.adobe.com/go/getflashplayer"
  61. );
  62. } else { // flash is too old or we can't detect the plugin
  63. var alternateContent = '<?php echo CJavaScript::quote($this->altHtmlContent); ?>';
  64. document.write(alternateContent); // insert non-flash content
  65. }
  66. /*]]>*/
  67. </script>
  68. <noscript>
  69. <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  70. id="<?php echo $this->name ?>"
  71. width="<?php echo $this->width ?>"
  72. height="<?php echo $this->height ?>"
  73. codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
  74. <param name="movie" value="<?php echo $this->baseUrl ?>/<?php echo $this->name ?>.swf" />
  75. <param name="quality" value="<?php echo $this->quality ?>" />
  76. <param name="bgcolor" value="<?php echo $this->bgColor ?>" />
  77. <param name="flashVars" value="<?php echo $this->flashVarsAsString ?>" />
  78. <param name="allowScriptAccess" value="<?php echo $this->allowScriptAccess ?>" />
  79. <param name="allowFullScreen" value="<?php echo $this->allowFullScreen ?>" />
  80. <embed src="<?php echo $this->baseUrl ?>/<?php echo $this->name ?>.swf"
  81. quality="<?php echo $this->quality ?>"
  82. bgcolor="<?php echo $this->bgColor ?>"
  83. width="<?php echo $this->width ?>"
  84. height="<?php echo $this->height ?>"
  85. name="<?php echo $this->name ?>"
  86. align="<?php echo $this->align ?>"
  87. play="true"
  88. loop="false"
  89. quality="<?php echo $this->quality ?>"
  90. allowScriptAccess="<?php echo $this->allowScriptAccess ?>"
  91. allowFullScreen="<?php echo $this->allowFullScreen ?>"
  92. type="application/x-shockwave-flash"
  93. pluginspage="http://www.adobe.com/go/getflashplayer">
  94. </embed>
  95. </object>
  96. </noscript>