PageRenderTime 49ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/samples/demos/featuresdemo/index.php

http://swfupload.googlecode.com/
PHP | 372 lines | 355 code | 10 blank | 7 comment | 1 complexity | b5060904992eb9b9feae3a3fddb15053 MD5 | raw file
  1. <?php session_start(); ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head>
  5. <title>SWFUpload Demos - Features Demo</title>
  6. <link href="../css/default.css" rel="stylesheet" type="text/css" />
  7. <link href="css/featuresdemo.css" rel="stylesheet" type="text/css" />
  8. <script type="text/javascript" src="../swfupload/swfupload.js"></script>
  9. <script type="text/javascript" src="js/featuresdemo.js"></script>
  10. <script type="text/javascript" src="js/handlers.js"></script>
  11. <script type="text/javascript">
  12. var suo;
  13. window.onload = function() {
  14. // Check to see if SWFUpload is available
  15. if (typeof(SWFUpload) === "undefined") {
  16. return;
  17. }
  18. // Instantiate a SWFUpload Instance
  19. suo = new SWFUpload({
  20. // Backend Settings
  21. upload_url: "upload.php?get_name=get_value",
  22. assume_success_timeout: 10,
  23. post_params: { "post_name1": "post_value1", "post_name2": "post_value2" }, // Here are some POST values to send. These can be changed dynamically
  24. file_post_name: "Filedata", // This is the "name" of the file item that the server-side script will receive. Setting this doesn't work in the Linux Flash Player
  25. requeue_on_error: false,
  26. http_success : [123, 444],
  27. // File Upload Settings
  28. file_size_limit : "100 MB",
  29. file_types : "*.*",
  30. file_types_description : "All Files",
  31. file_upload_limit : 10,
  32. button_image_url : "images/button_270x22.png",
  33. button_width : 270,
  34. button_height : 22,
  35. button_action : SWFUpload.BUTTON_ACTION.SELECT_FILES,
  36. button_placeholder_id : "spanButtonPlaceholder",
  37. button_text : '<span class="btnText">Select Files...</span>',
  38. button_text_style : ".btnText { font-size: 10; font-weight: bold; font-family: MS Shell Dlg; }",
  39. button_text_top_padding : 3,
  40. button_text_left_padding : 100,
  41. // Event Handler Settings
  42. swfupload_loaded_handler : FeaturesDemoHandlers.swfUploadLoaded,
  43. button_action_handler : FeaturesDemoHandlers.buttonAction,
  44. file_dialog_start_handler : FeaturesDemoHandlers.fileDialogStart,
  45. file_queued_handler : FeaturesDemoHandlers.fileQueued,
  46. file_queue_error_handler : FeaturesDemoHandlers.fileQueueError,
  47. file_dialog_complete_handler : FeaturesDemoHandlers.fileDialogComplete,
  48. upload_start_handler : FeaturesDemoHandlers.uploadStart,
  49. upload_progress_handler : FeaturesDemoHandlers.uploadProgress,
  50. upload_error_handler : FeaturesDemoHandlers.uploadError,
  51. upload_success_handler : FeaturesDemoHandlers.uploadSuccess,
  52. upload_complete_handler : FeaturesDemoHandlers.uploadComplete,
  53. debug_handler : FeaturesDemoHandlers.debug,
  54. // Flash Settings
  55. flash_url : "../swfupload/swfupload.swf", // Relative to this file
  56. // Debug Settings
  57. debug: true // For the purposes of this demo I wan't debug info shown
  58. });
  59. };
  60. </script>
  61. </head>
  62. <body>
  63. <div id="header">
  64. <h1 id="logo"><a href="../">SWFUpload</a></h1>
  65. <div id="version">v2.2.0</div>
  66. </div>
  67. <div id="content">
  68. <h2>Features Demo</h2>
  69. <form>
  70. The Features Demo allows you to experiment with all the features and settings that SWFUpload v2.0 offers.<br />
  71. <br />
  72. You can change all the settings except 'upload_url'.<br />
  73. <br />
  74. <strong>Your PHP Session ID is <?php echo session_id(); ?>.</strong> This is provided so you can see the Flash Player Cookie
  75. bug in action. Compare this Session ID to the Session ID and Cookies displayed in the Server Data section
  76. after an upload is complete (SWFUpload FP9 only).<br />
  77. <br />
  78. SWFUpload has <span id="spanLoadStatus" style="font-weight: bold;">not loaded</span><br />
  79. <table class="layout">
  80. <tr>
  81. <td style="width: 316px;">
  82. <div class="fieldset">
  83. <span class="legend">Queue</span>
  84. <div>
  85. <select id="selQueue" size="15" style="width: 270px;">
  86. </select>
  87. </div>
  88. <div>
  89. <table class="btn">
  90. <tr>
  91. <td colspan="3"><span id="spanButtonPlaceholder"></span></td>
  92. </tr>
  93. </table>
  94. </div>
  95. <div>
  96. <table class="btn">
  97. <tr>
  98. <td class="btn-left"></td>
  99. <td class="btn-center"><button id="btnStartSelectedFile" type="button" class="action">Start Selected File</button></td>
  100. <td class="btn-right"></td>
  101. </tr>
  102. </table>
  103. </div>
  104. <div>
  105. <table class="btn">
  106. <tr>
  107. <td class="btn-left"></td>
  108. <td class="btn-center"><button id="btnStopUpload" type="button" class="action">Stop Upload</button></td>
  109. <td class="btn-right"></td>
  110. </tr>
  111. </table>
  112. </div>
  113. <div>
  114. <table class="btn">
  115. <tr>
  116. <td class="btn-left"></td>
  117. <td class="btn-center"><button id="btnCancelSelectedFile" type="button" class="action">Cancel Selected File</button></td>
  118. <td class="btn-right"></td>
  119. </tr>
  120. </table>
  121. </div>
  122. <div>
  123. <table class="btn">
  124. <tr>
  125. <td class="btn-left"></td>
  126. <td class="btn-center"><button id="btnCancelSelectedFileNoEvent" type="button" class="action">Cancel Selected File (no event)</button></td>
  127. <td class="btn-right"></td>
  128. </tr>
  129. </table>
  130. </div>
  131. </div>
  132. <div class="fieldset" id="fsStaticSettings">
  133. <span class="legend">Static Settings</span>
  134. <div>
  135. <div class="checkbox">
  136. <input id="cbPreventSWFCaching" type="checkbox" />
  137. <label for="cbPreventSWFCaching">prevent_swf_caching</label>
  138. </div>
  139. <table class="btn">
  140. <tr>
  141. <td class="btn-left"></td>
  142. <td class="btn-center"><button id="btnReloadSWFUpload" type="button">Reload SWFUpload</button></td>
  143. <td class="btn-right"></td>
  144. </tr>
  145. </table>
  146. </div>
  147. </div>
  148. </td>
  149. <td style="width: 316px;">
  150. <div class="fieldset">
  151. <span class="legend">Post Params</span>
  152. <div>
  153. <label for="txtAddFileParamName"><strong>File Post Param</strong> (Select a file first)</label>
  154. <div style="margin-left: 10px; margin-bottom: 10px;">
  155. <table>
  156. <tr>
  157. <td></td>
  158. <td><strong>Name</strong></td>
  159. <td><strong>Value</strong></td>
  160. <td></td>
  161. </tr>
  162. <tr>
  163. <td style="vertical-align: middle; text-align: right;">Add:</td>
  164. <td><input id="txtAddFileParamName" type="text" class="textbox" style="width: 100px;" />
  165. </td>
  166. <td><input id="txtAddFileParamValue" type="text" class="textbox" style="width: 100px;" />
  167. </td>
  168. <td><button id="btnAddFileParam" type="button"></button></td>
  169. </tr>
  170. <tr>
  171. <td style="vertical-align: middle;">Remove:</td>
  172. <td><input id="txtRemoveFileParamName" type="text" class="textbox" style="width: 100px;" /></td>
  173. <td><button id="btnRemoveFileParam" type="button"></button></td>
  174. <td></td>
  175. </tr>
  176. </table>
  177. </div>
  178. </div>
  179. <label for="txtAddParamName" style="font-weight: bolder;">Global Post Params</label>
  180. <div style="margin-left: 10px;">
  181. <div>
  182. <select id="selParams" size="5">
  183. </select>
  184. <button id="btnRemoveParam" type="button"></button>
  185. </div>
  186. <table>
  187. <tr>
  188. <td></td>
  189. <td><strong>Name</strong></td>
  190. <td><strong>Value</strong></td>
  191. <td></td>
  192. </tr>
  193. <tr>
  194. <td style="vertical-align: middle;">Add:</td>
  195. <td><input id="txtAddParamName" type="text" class="textbox" />
  196. </td>
  197. <td><input id="txtAddParamValue" type="text" class="textbox" />
  198. </td>
  199. <td><button id="btnAddParam" type="button"></button></td>
  200. </tr>
  201. </table>
  202. </div>
  203. </div>
  204. <div class="fieldset">
  205. <span class="legend">Instance Information</span>
  206. <div>
  207. <label for="txtMovieName">movieName</label>
  208. <input id="txtMovieName" type="text" class="textbox" />
  209. </div>
  210. <div>
  211. <label for="txtFlashHTML">Flash HTML</label>
  212. <textarea id="txtFlashHTML" wrap="soft" style="height: 100px;"></textarea>
  213. </div>
  214. </div>
  215. </td>
  216. <td style="width: 316px;"><div class="fieldset">
  217. <span class="legend">Dynamic Settings</span>
  218. <div id="divDynamicSettingForm">
  219. <table>
  220. <tr>
  221. <td>
  222. <div>
  223. <label for="txtUploadTarget">upload_url</label>
  224. <input id="txtUploadTarget" type="text" class="textbox" />
  225. </div>
  226. <div>
  227. <label for="txtHTTPSuccess">http_success</label>
  228. <input id="txtHTTPSuccess" type="text" class="textbox" />
  229. </div>
  230. <div>
  231. <label for="txtAssumeSuccessTimeout">assume_success_timeout</label>
  232. <input id="txtAssumeSuccessTimeout" type="text" class="textbox" />
  233. </div>
  234. <div>
  235. <label for="txtFilePostName">file_post_name</label>
  236. <input id="txtFilePostName" type="text" class="textbox" />
  237. </div>
  238. <div>
  239. <label for="txtFileTypes">file_types</label>
  240. <input id="txtFileTypes" type="text" class="textbox" />
  241. </div>
  242. <div>
  243. <label for="txtFileTypesDescription">file_types_description</label>
  244. <input id="txtFileTypesDescription" type="text" class="textbox" />
  245. </div>
  246. <div>
  247. <label for="txtFileSizeLimit">file_size_limit</label>
  248. <input id="txtFileSizeLimit" type="text" class="textbox" />
  249. </div>
  250. <div>
  251. <label for="txtFileUploadLimit">file_upload_limit</label>
  252. <input id="txtFileUploadLimit" type="text" class="textbox" />
  253. </div>
  254. <div>
  255. <label for="txtFileQueueLimit">file_queue_limit</label>
  256. <input id="txtFileQueueLimit" type="text" class="textbox" />
  257. </div>
  258. <div class="checkbox">
  259. <input id="cbUseQueryString" type="checkbox" />
  260. <label for="cbUseQueryString">use_query_string</label>
  261. </div>
  262. <div class="checkbox">
  263. <input id="cbRequeueOnError" type="checkbox" />
  264. <label for="cbRequeueOnError">requeue_on_error</label>
  265. </div>
  266. <div class="checkbox">
  267. <input id="cbDebug" type="checkbox" />
  268. <label for="cbDebug">debug</label>
  269. </div>
  270. </td>
  271. <td>
  272. <div class="checkbox">
  273. <label>button_action</label>
  274. <div style="margin-left: 10px;">
  275. <input id="rbButtonActionSelectFile" type="radio" name="button_action" /> <label for="rbButtonActionSelectFile" style="display: inline;">Select File</label><br />
  276. <input id="rbButtonActionSelectFiles" type="radio" name="button_action" /> <label for="rbButtonActionSelectFiles" style="display: inline;">Select Files</label><br />
  277. <input id="rbButtonActionStartUpload" type="radio" name="button_action" /> <label for="rbButtonActionStartUpload" style="display: inline;">Start Upload</label><br />
  278. <input id="rbButtonActionJavaScript" type="radio" name="button_action" /> <label for="rbButtonActionJavaScript" style="display: inline;">JavaScript</label><br />
  279. </div>
  280. </div>
  281. <div class="checkbox">
  282. <input id="cbButtonDisabled" type="checkbox" />
  283. <label for="cbButtonDisabled">button_disabled</label>
  284. </div>
  285. <div>
  286. <label for="txtButtonImageUrl">button_image_url</label>
  287. <input id="txtButtonImageUrl" type="text" class="textbox" />
  288. </div>
  289. <div>
  290. <label for="txtButtonText">button_text</label>
  291. <input id="txtButtonText" type="text" class="textbox" />
  292. </div>
  293. <div>
  294. <label for="txtButtonWidth">button_width</label>
  295. <input id="txtButtonWidth" type="text" class="textbox" />
  296. </div>
  297. <div>
  298. <label for="txtButtonHeight">button_height</label>
  299. <input id="txtButtonHeight" type="text" class="textbox" />
  300. </div>
  301. <div>
  302. <label for="txtButtonTextStyle">button_text_style</label>
  303. <input id="txtButtonTextStyle" type="text" class="textbox" />
  304. </div>
  305. <div>
  306. <label for="txtButtonTextLeftPadding">button_text_left_padding</label>
  307. <input id="txtButtonTextLeftPadding" type="text" class="textbox" />
  308. </div>
  309. <div>
  310. <label for="txtButtonTextTopPadding">button_text_top_padding</label>
  311. <input id="txtButtonTextTopPadding" type="text" class="textbox" />
  312. </div>
  313. </td>
  314. </tr>
  315. </table>
  316. </div>
  317. <div>
  318. <table class="btn">
  319. <tr>
  320. <td class="btn-left"></td>
  321. <td class="btn-center"><button id="btnUpdateDynamicSettings" type="button">Update Dynamic Settings</button></td>
  322. <td class="btn-right"></td>
  323. </tr>
  324. </table>
  325. </div>
  326. </div>
  327. </td>
  328. </tr>
  329. <tr>
  330. <td colspan="3"><div class="fieldset">
  331. <span class="legend">Events</span>
  332. <table style="width: 100%;">
  333. <tr>
  334. <td style="width: 50%"><div>
  335. <label for="selEventsQueue">Queue</label>
  336. <select id="selEventsQueue" size="10" style="width: 100%;">
  337. </select>
  338. </div></td>
  339. <td style="width: 50%; overflow: hidden;"><div>
  340. <label for="selEventsFile">File</label>
  341. <select id="selEventsFile" size="10" style="width: 100%;">
  342. </select>
  343. </div></td>
  344. </tr>
  345. </table>
  346. </div>
  347. <div class="fieldset">
  348. <span class="legend">Debug</span>
  349. <div>
  350. <textarea id="SWFUpload_Console" wrap="off"></textarea>
  351. </div>
  352. </div>
  353. <div class="fieldset">
  354. <span class="legend">Server Data</span>
  355. <div id="divServerData"></div>
  356. </div></td>
  357. </tr>
  358. </table>
  359. </form>
  360. </div>
  361. </body>
  362. </html>