<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="File_Edit.aspx.cs" Inherits="TotCms.Web.Office.Files.File_Edit" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>上传文档</title>
    <link href="../style/global.css" rel="stylesheet" type="text/css" />
    <link href="../../swfupload/swfupload.css" rel="stylesheet" type="text/css" />
    <script src="../../swfupload/swfupload.js" type="text/javascript"></script>
    <script src="js/handlers.js" type="text/javascript"></script>
    <script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
    <script type="text/javascript">
      var swfu;
      window.onload = function () {
        //swf upload
        swfu = new SWFUpload({
          // Backend Settings
          upload_url: "../Upload/UploadFiles.aspx",
          post_params: {
            "ASPSESSID": "<%=Session.SessionID %>"
          },

          // File Upload Settings
          file_size_limit: "100 MB",
          file_types: "*.*",
          file_types_description: "files",
          file_upload_limit: "0",    // Zero means unlimited

          // Event Handler Settings - these functions as defined in Handlers.js
          //  The handlers are not part of SWFUpload but are part of my website and control how
          //  my website reacts to the SWFUpload events.
          file_queue_error_handler: fileQueueError,
          file_dialog_complete_handler: fileDialogComplete,
          upload_progress_handler: uploadProgress,
          upload_error_handler: uploadError,
          upload_success_handler: uploadSuccess,
          upload_complete_handler: uploadComplete,

          // Button settings
          button_image_url: "../Upload/Images/XPButtonUploadText_61x22.png",
          button_placeholder_id: "spanButtonPlaceholder",
          button_width: 61,
          button_height: 22,
          button_text: '<span class="button"></span>',
          button_text_style: '.button { font-family: 宋体; font-size: 14px; } .buttonSmall { font-size: 12px; }',
          button_text_top_padding: 1,
          button_text_left_padding: 5,

          // Flash Settings
          flash_url: "../../swfupload/swfupload.swf", // Relative to this file

          custom_settings: {
            upload_target: "divFileProgressContainer",
            upload_returnobjid: "tbAttachment"
          },

          // Debug Settings
          debug: false
        });
      }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="br"></div>
    <table style="width:100%;" border="0" cellpadding="0" cellspacing="1" 
      class="border">
      <tr class="suphead">
        <td colspan="2">文档编辑</td>
    </tr>
    <tr>
      <td width="120" class="fields_text">
          上传者：</td>
      <td class="fields_input">
      <asp:Label ID="lbUserName" runat="server" Text=""></asp:Label>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          名称</td>
      <td class="fields_input">
        <asp:TextBox ID="tbTitle" runat="server"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
          ControlToValidate="tbTitle" ErrorMessage="名称不能为空"></asp:RequiredFieldValidator>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          说明：</td>
      <td class="fields_input">     
        <asp:TextBox ID="tbContent" runat="server" CssClass="text_normal" 
          TextMode="MultiLine"></asp:TextBox>
          <script type="text/javascript">
		      //<![CDATA[
            // Replace the <textarea id="Content"> with an CKEditor instance.
            var editor = CKEDITOR.replace('tbContent',
			      {
			        filebrowserBrowseUrl: '../../ckfinder/ckfinder.html', //启用浏览功能
			        filebrowserImageBrowseUrl: '../../ckfinder/ckfinder.html?Type=Images',
			        filebrowserFlashBrowseUrl: '../../ckfinder/ckfinder.html?Type=Flash',
			        filebrowserUploadUrl: '../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
			        filebrowserImageUploadUrl: '../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
			        filebrowserFlashUploadUrl: '../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
			      }
            );
		      //]]>
		      </script>
      </td>
    </tr>
    
    <tr>
      <td class="fields_text">
          上传：</td>
      <td class="fields_input">     
      <div id="swfu_container" style="margin: 0px 0px;">
        <asp:TextBox ID="tbAttachment" runat="server" CssClass="input_middle"></asp:TextBox>
        <span id="spanButtonPlaceholder"></span>
        <div id="divFileProgressContainer"></div>
      </div>      
      </td>
    </tr>
    
    <tr>
      <td align="center" height="35">&nbsp;</td>
      <td align="left" height="35"><asp:Button CssClass="button_blue" ID="Button1" runat="server" Text="确定" OnClick="Button1_Click" />      
      <input type="reset" class="button_gray" id="Button2" onclick="javascript:history.back();" value="返 回" /></td>
    </tr>
  </table>
    </form>
</body>
</html>
