crop.tpl.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header','admin');
  4. ?>
  5. <script type="text/javascript" src="<?php echo JS_PATH?>crop/swfobject.js"></script>
  6. <script>
  7. // 获取页面上的flash实例。
  8. // @param flashID 这个参数是:flash 的 ID 。本例子的flash ID是 "myFlashID" ,在本页面搜索一下 "myFlashID" 可看到。
  9. function getFlash(flashID)
  10. {
  11. // 判断浏览器类型
  12. if (navigator.appName.indexOf("Microsoft") != -1)
  13. {
  14. return window[flashID];
  15. }
  16. else
  17. {
  18. return document[flashID];
  19. }
  20. }
  21. // flash 上传图片完成时回调的函数。
  22. function uploadComplete(pic)
  23. {
  24. if(parent.document.getElementById('<?php echo $_GET['input']?>')) {
  25. var input = parent.document.getElementById('<?php echo $_GET['input']?>');
  26. } else {
  27. var input = parent.right.document.getElementById('<?php echo $_GET['input']?>');
  28. }
  29. <?php if (!empty($_GET['preview'])):?>
  30. if(parent.document.getElementById('<?php echo $_GET['preview']?>')) {
  31. var preview = parent.document.getElementById('<?php echo $_GET['preview']?>');
  32. } else {
  33. var preview = parent.right.document.getElementById('<?php echo $_GET['preview']?>');
  34. }
  35. <?php else:?>
  36. var preview = '';
  37. <?php endif;?>
  38. if(pic) {
  39. input.value = pic;
  40. if (preview) preview.src = pic;
  41. }
  42. window.top.art.dialog({id:'crop'}).close();
  43. }
  44. function uploadfile() {
  45. getFlash('myFlashID').upload();
  46. }
  47. var swfVersionStr = "10.0.0";
  48. var xiSwfUrlStr = "<?php echo JS_PATH?>crop/images/playerProductInstall.swf";
  49. var flashvars = {};
  50. // 图片地址
  51. flashvars.picurl = "<?php echo $picurl?>";
  52. // 上传地址,使用了 base64 加密
  53. flashvars.uploadurl = "<?php echo base64_encode("index.php?m=attachment&c=attachments&a=crop_upload&module=$module&catid=$catid&file=".urlencode($picurl));?>";
  54. var params = {};
  55. params.quality = "high";
  56. params.bgcolor = "#ffffff";
  57. params.allowscriptaccess = "always";
  58. params.allowfullscreen = "true";
  59. var attributes = {};
  60. attributes.id = "myFlashID";
  61. attributes.name = "myFlashID";
  62. attributes.align = "middle";
  63. swfobject.embedSWF(
  64. "<?php echo JS_PATH?>crop/images/Main.swf", "flashContent",
  65. "680", "480",
  66. swfVersionStr, xiSwfUrlStr,
  67. flashvars, params, attributes);
  68. <!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
  69. swfobject.createCSS("#flashContent", "display:block;text-align:left;");
  70. </script>
  71. </head>
  72. <body>
  73. <div id="flashContent">
  74. <p>
  75. To view this page ensure that Adobe Flash Player version
  76. 10.0.0 or greater is installed.
  77. </p>
  78. <script type="text/javascript">
  79. var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
  80. document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
  81. + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
  82. </script>
  83. </div>
  84. <noscript>
  85. <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="680" height="480" id="myFlashID">
  86. <param name="movie" value="<?php echo JS_PATH?>crop/images/Main.swf" />
  87. <param name="quality" value="high" />
  88. <param name="bgcolor" value="#ffffff" />
  89. <param name="allowScriptAccess" value="always" />
  90. <param name="allowFullScreen" value="true" />
  91. <!--[if !IE]>-->
  92. <object type="application/x-shockwave-flash" data="<?php echo JS_PATH?>crop/images/Main.swf" width="680" height="480">
  93. <param name="quality" value="high" />
  94. <param name="bgcolor" value="#ffffff" />
  95. <param name="allowScriptAccess" value="always" />
  96. <param name="allowFullScreen" value="true" />
  97. <!--<![endif]-->
  98. <!--[if gte IE 6]>-->
  99. <p>
  100. Either scripts and active content are not permitted to run or Adobe Flash Player version
  101. 10.0.0 or greater is not installed.
  102. </p>
  103. <!--<![endif]-->
  104. <a href="http://www.adobe.com/go/getflashplayer">
  105. <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
  106. </a>
  107. <!--[if !IE]>-->
  108. </object>
  109. <!--<![endif]-->
  110. </object>
  111. </noscript>
  112. </body>
  113. </html>