From b9cd9367da104e5d3a4310fd1c40b841f5fbb286 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 23 Dec 2005 17:53:37 +0000 Subject: --- demos/quickstart/index.php | 16 +++++ demos/quickstart/protected/.htaccess | 1 + demos/quickstart/protected/application.xml | 7 ++ demos/quickstart/protected/pages/Construction.page | 5 ++ demos/quickstart/protected/pages/DetailPage.php | 55 ++++++++++++++++ demos/quickstart/protected/pages/Layout.php | 15 +++++ demos/quickstart/protected/pages/Layout.tpl | 32 +++++++++ demos/quickstart/protected/pages/TopicList.php | 8 +++ demos/quickstart/protected/pages/TopicList.tpl | 67 +++++++++++++++++++ .../protected/pages/chap1/AboutPrado.page | 19 ++++++ .../protected/pages/chap1/Installation.page | 11 ++++ .../protected/pages/chap1/Introduction.page | 7 ++ demos/quickstart/protected/pages/chap1/config.xml | 5 ++ demos/quickstart/protected/pages/config.xml | 8 +++ demos/quickstart/themes/Simple/style.css | 75 ++++++++++++++++++++++ 15 files changed, 331 insertions(+) create mode 100644 demos/quickstart/index.php create mode 100644 demos/quickstart/protected/.htaccess create mode 100644 demos/quickstart/protected/application.xml create mode 100644 demos/quickstart/protected/pages/Construction.page create mode 100644 demos/quickstart/protected/pages/DetailPage.php create mode 100644 demos/quickstart/protected/pages/Layout.php create mode 100644 demos/quickstart/protected/pages/Layout.tpl create mode 100644 demos/quickstart/protected/pages/TopicList.php create mode 100644 demos/quickstart/protected/pages/TopicList.tpl create mode 100644 demos/quickstart/protected/pages/chap1/AboutPrado.page create mode 100644 demos/quickstart/protected/pages/chap1/Installation.page create mode 100644 demos/quickstart/protected/pages/chap1/Introduction.page create mode 100644 demos/quickstart/protected/pages/chap1/config.xml create mode 100644 demos/quickstart/protected/pages/config.xml create mode 100644 demos/quickstart/themes/Simple/style.css (limited to 'demos') diff --git a/demos/quickstart/index.php b/demos/quickstart/index.php new file mode 100644 index 00000000..174f5d33 --- /dev/null +++ b/demos/quickstart/index.php @@ -0,0 +1,16 @@ +run(); + +?> \ No newline at end of file diff --git a/demos/quickstart/protected/.htaccess b/demos/quickstart/protected/.htaccess new file mode 100644 index 00000000..e0198322 --- /dev/null +++ b/demos/quickstart/protected/.htaccess @@ -0,0 +1 @@ +deny from all diff --git a/demos/quickstart/protected/application.xml b/demos/quickstart/protected/application.xml new file mode 100644 index 00000000..c46b2e13 --- /dev/null +++ b/demos/quickstart/protected/application.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Construction.page b/demos/quickstart/protected/pages/Construction.page new file mode 100644 index 00000000..3eec612e --- /dev/null +++ b/demos/quickstart/protected/pages/Construction.page @@ -0,0 +1,5 @@ + + +Sorry. This page is still under construction. Please check back later. + + \ No newline at end of file diff --git a/demos/quickstart/protected/pages/DetailPage.php b/demos/quickstart/protected/pages/DetailPage.php new file mode 100644 index 00000000..afd81272 --- /dev/null +++ b/demos/quickstart/protected/pages/DetailPage.php @@ -0,0 +1,55 @@ +Request->Items['src'])===null) + $this->_file=$this->determineFile($this->Request->Items['tpl'],false); + else + $this->_file=$this->determineFile($id,true); + } + + protected function determineFile($id,$isSrcFile) + { + $basePath=dirname(__FILE__).'/controls'; + + $xml=new TXmlDocument; + $xml->loadFromFile($basePath.'/config.xml'); + $pages=$xml->getElementByTagName('pages')->getElementsByTagName('page'); + $fileName=''; + foreach($pages as $page) + { + if($page->Attributes['id']===$id) + { + if($isSrcFile) + $fileName=$basePath.'/'.$page->Attributes['class'].'.php'; + else if($page->Attributes['TemplateFile']!==null) + { + $fileName=$page->Attributes['TemplateFile']; + if(($pos=strrpos($fileName,'.'))!==false) + $fileName=substr($fileName,$pos+1); + $fileName=$basePath.'/'.$fileName.'.tpl'; + } + else + $fileName=$basePath.'/'.$page->Attributes['class'].'.tpl'; + break; + } + } + if(empty($fileName) || !is_file($fileName)) + throw new THttpException(500,"File not exists!"); + return $fileName; + } + + protected function render($writer) + { + $contents=file_get_contents($this->_file); + $writer->write(highlight_string($contents,true)); + } +} + +?> \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Layout.php b/demos/quickstart/protected/pages/Layout.php new file mode 100644 index 00000000..a82d2fff --- /dev/null +++ b/demos/quickstart/protected/pages/Layout.php @@ -0,0 +1,15 @@ +TopicPanel->Visible=!$this->TopicPanel->Visible; + if($this->TopicPanel->Visible) + $sender->Text="Hide TOC"; + else + $sender->Text="Show TOC"; + } +} + +?> \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Layout.tpl b/demos/quickstart/protected/pages/Layout.tpl new file mode 100644 index 00000000..2c22adce --- /dev/null +++ b/demos/quickstart/protected/pages/Layout.tpl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/demos/quickstart/protected/pages/TopicList.php b/demos/quickstart/protected/pages/TopicList.php new file mode 100644 index 00000000..ce827cc0 --- /dev/null +++ b/demos/quickstart/protected/pages/TopicList.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/demos/quickstart/protected/pages/TopicList.tpl b/demos/quickstart/protected/pages/TopicList.tpl new file mode 100644 index 00000000..def0f9d7 --- /dev/null +++ b/demos/quickstart/protected/pages/TopicList.tpl @@ -0,0 +1,67 @@ +
+ +
+Getting Started
+Introduction
+What is PRADO?
+Installation
+
+ +
+Fundamentals
+Architecture
+Key Concepts
+Configurations
+Templates
+
+ +
+Applications
+Directory Structure
+Application Deployment
+Sample: Hello World
+Sample: Hangman Game
+
+ +
+Controls
+Simple Controls
+Validation Controls
+List Controls
+TRepeater
+TDataList
+TDataGrid
+Active Controls
+Authoring New Controls
+
+ +
+Data Access
+DataBinding
+Data Bound Controls
+Data Source Controls
+
+ +
+Avanced Features
+Overview
+Theme and Skin
+Asset
+Internationalization
+
+ +
+Security
+Overview
+Authentication
+Authorization
+ViewState Protection
+
+ +
+Performance
+Caching
+Performance Tuning
+
+ +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/chap1/AboutPrado.page b/demos/quickstart/protected/pages/chap1/AboutPrado.page new file mode 100644 index 00000000..0ffc25d3 --- /dev/null +++ b/demos/quickstart/protected/pages/chap1/AboutPrado.page @@ -0,0 +1,19 @@ + +

What is PRADO?

+

+PRADO stands for PHP Rapid Application Development +Object-oriented. +

+

+PRADO is a component-based and event-driven programming framework for developing Web applications in PHP 5. +

+

+PRADO stipulates a protocol of writing and using components to construct Web applications. A component is a software unit that is self-contained and can be reused with trivial customization. New components can be developed by either inheriting or composing from existing ones. Component-based programming brings great freedom in teamwork anf offers the ultimate extensibility and maintenability to the code. PRADO implements a set of elementary components that represent commonly used Web elements, such as input field, checkbox, dropdown list, etc. +

+

+PRADO implements an event-driven programming scheme that allows delegation of extensible behavior to components. End-user activities, such as clicking on a submit button, changing the content in an input field, are captured as server events. Methods or functions may be attached to these events so that when the events happen, they are invoked automatically to respond to the events. Compared with the traditional Web programming in which developers have to deal with the raw POST or GET variables, event-driven programming helps developers better focus on the necessary logic and reduces significantly the low-level repetitive coding. +

+

+Developing a PRADO Web application mainly involves instantiating prebuilt component types, configuring them by setting their properties, responding to their events by writing handler functions, and composing them into pages for the application. It is very similar to RAD toolkits, such as Borland Delphi and Microsoft Visual Basic, that are used to develop desktop GUI applications. +

+
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/chap1/Installation.page b/demos/quickstart/protected/pages/chap1/Installation.page new file mode 100644 index 00000000..5723fcc9 --- /dev/null +++ b/demos/quickstart/protected/pages/chap1/Installation.page @@ -0,0 +1,11 @@ + +

Installing PRADO

+

+If you are viewing this page from your own Web server, you are already done +with the installation. The instructions at the end of this page, however, +may still be useful for you to troubleshoot issues happened during your +development based on PRADO. +

+

+

+
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/chap1/Introduction.page b/demos/quickstart/protected/pages/chap1/Introduction.page new file mode 100644 index 00000000..b622b0d7 --- /dev/null +++ b/demos/quickstart/protected/pages/chap1/Introduction.page @@ -0,0 +1,7 @@ + +

Welcome to the PRADO QuickStart Tutorial

+

+This QuickStart tutorial is meant to get you quickly started to build your +own Web applications based on PRADO. +

+
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/chap1/config.xml b/demos/quickstart/protected/pages/chap1/config.xml new file mode 100644 index 00000000..6806e43a --- /dev/null +++ b/demos/quickstart/protected/pages/chap1/config.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/demos/quickstart/protected/pages/config.xml b/demos/quickstart/protected/pages/config.xml new file mode 100644 index 00000000..41d5999d --- /dev/null +++ b/demos/quickstart/protected/pages/config.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/demos/quickstart/themes/Simple/style.css b/demos/quickstart/themes/Simple/style.css new file mode 100644 index 00000000..617d76a0 --- /dev/null +++ b/demos/quickstart/themes/Simple/style.css @@ -0,0 +1,75 @@ +body { + font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Helvetica, Arial, sans-serif; + font-weight:normal; + font-size:10pt; + color:black; + margin:0px 0px 0px 0px; + padding:0px; +} + +#header { + font-size:13pt; + font-weight:bold; + background:#fff; + height:40px; + padding:5px; +} + +#menu { + padding:3px; + padding-right:10px; + background:#00487D; + color:white; + text-align:right; +} + +#menu a { + color:#BFE4FF; + text-decoration:none; +} + +#menu a:hover { + color:white; +} + +#toc { + background:#BFE4FF; + float:right; + width:200px; + padding:5px; +} + +#content { + float:left; + background:#fff; + padding:5px; +} + +#footer { + clear:both; + color: gray; + font-size:8pt; + text-align:center; + margin-top:25px; + padding:5px; +} + +.topic { + font-size: 10pt; + padding: 0px 0px 10px 0px; +} + +.topic span { + font-size: 11pt; + font-weight:bold; + color:#00487D; +} + +.topic a { + color:#00487D; + padding-left:10px; +} + +.topic a:hover{ + color:red; +} \ No newline at end of file -- cgit v1.2.3