From f826b0ae6b8f11f8da1a5a6251e9a1fe6e6c1e85 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 2 Apr 2006 01:48:18 +0000 Subject: Added TFileUpload and TJavascriptLogger tutorials. --- .../protected/pages/Controls/FileUpload.page | 19 +++++++++++++++- .../protected/pages/Controls/JavascriptLogger.page | 25 ++++++++++++++++++++++ .../pages/Controls/Samples/TFileUpload/Home.page | 17 +++++++++++++++ .../pages/Controls/Samples/TFileUpload/Home.php | 21 ++++++++++++++++++ .../protected/pages/Controls/Standard.page | 4 ++-- 5 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.page create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.php (limited to 'demos') diff --git a/demos/quickstart/protected/pages/Controls/FileUpload.page b/demos/quickstart/protected/pages/Controls/FileUpload.page index 873d4bc7..8aa5a0fb 100644 --- a/demos/quickstart/protected/pages/Controls/FileUpload.page +++ b/demos/quickstart/protected/pages/Controls/FileUpload.page @@ -4,7 +4,24 @@

-TBD +TFileUpload displays a file upload field on a Web page. Upon postback, the text entered into the field will be treated as the (local) name of the file that is uploaded to the server.

+

+TFileUpload raises an OnFileUpload event when it is post back. The property HasFile indicates whether the file upload is successful or not. If successful, the uploaded file may be saved on the server by calling saveAs() method. +

+

+The following properties give the information about the uploaded file: +

+ +

+If the file upload is unsuccessful, the property ErrorCode gives the error code describing the cause of failure. See PHP documentation for a complete explanation of the possible error codes. +

+ + \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/JavascriptLogger.page b/demos/quickstart/protected/pages/Controls/JavascriptLogger.page index 8b3c63c8..cff2b7aa 100644 --- a/demos/quickstart/protected/pages/Controls/JavascriptLogger.page +++ b/demos/quickstart/protected/pages/Controls/JavascriptLogger.page @@ -3,4 +3,29 @@

TJavascriptLogger

+

+TJavascriptLogger provides logging for client-side javascript. It is mainly a wrapper of the javascript developed at http://gleepglop.com/javascripts/logger/. +

+ +

+To use TJavascriptLogger, simply place the following component tag in a page template. +

+ +<com:TJavascriptLogger /> + + +

+Then, the client-side javascript may contain the following statements. When they are executed, they will appear in the logger window. +

+ +Logger.info('something happend'); +Logger.warn('A warning'); +Logger.error('This is an error'); +Logger.debug('debug information'); + + +

+To toggle the visibility of the logger and console on the browser window, press ALT-D (or CTRL-D on OS X). +

+ \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.page new file mode 100644 index 00000000..30168e1a --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.page @@ -0,0 +1,17 @@ + + +

TFileUpload Sample

+ +

+Please choose a file to upload: +

+ + + + + +
+ + + +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.php new file mode 100644 index 00000000..d5cf990a --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.php @@ -0,0 +1,21 @@ +HasFile) + { + $this->Result->Text=" + You just uploaded a file: +
+ Name: {$sender->FileName} +
+ Size: {$sender->FileSize} +
+ Type: {$sender->FileType}"; + } + } +} + +?> \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page index af4d6877..9580a0d7 100644 --- a/demos/quickstart/protected/pages/Controls/Standard.page +++ b/demos/quickstart/protected/pages/Controls/Standard.page @@ -23,7 +23,7 @@ TExpression accepts a PHP expression and displays the evaluation result on a Web page. -
  • * +
  • TFileUpload represents a file upload field. It allows users to upload a file to server.
  • @@ -59,7 +59,7 @@ TInlineFrame represents an <iframe> HTML element on a Web page. -
  • * +
  • TJavascriptLogger represents a logger on a Web page that can log various JavaScript information.
  • -- cgit v1.2.3