From 0401be173cd1f80785c09f3a1dfae79d54441197 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 24 Dec 2005 17:13:54 +0000 Subject: --- demos/quickstart/protected/pages/TopicList.tpl | 17 ++++--- .../protected/pages/chap1/Installation.page | 18 +++++-- demos/quickstart/protected/pages/config.xml | 4 +- demos/quickstart/themes/Simple/style.css | 51 +++++++++++++++++++- framework/Web/UI/TTemplateManager.php | 55 ++++++++-------------- 5 files changed, 95 insertions(+), 50 deletions(-) diff --git a/demos/quickstart/protected/pages/TopicList.tpl b/demos/quickstart/protected/pages/TopicList.tpl index def0f9d7..479dcb0d 100644 --- a/demos/quickstart/protected/pages/TopicList.tpl +++ b/demos/quickstart/protected/pages/TopicList.tpl @@ -9,18 +9,17 @@
Fundamentals
-Architecture
-Key Concepts
-Configurations
-Templates
+Architecture
+Key Concepts
+Application Structure
+Configurations
+Templates
-Applications
-Directory Structure
-Application Deployment
-Sample: Hello World
-Sample: Hangman Game
+Samples
+Hello World
+Hangman Game
diff --git a/demos/quickstart/protected/pages/chap1/Installation.page b/demos/quickstart/protected/pages/chap1/Installation.page index 5723fcc9..77fd0b26 100644 --- a/demos/quickstart/protected/pages/chap1/Installation.page +++ b/demos/quickstart/protected/pages/chap1/Installation.page @@ -1,11 +1,21 @@

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. +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.

+Installation of PRADO is very easy. Follow the following steps, +

    +
  1. Go to pradosoft.com to grab a latest version of PRADO.
  2. +
  3. Unpack the PRADO release file using unzip on Linux or winzip on Windows. A directory named prado will be created under the working directory.
  4. +
  5. Copy or upload everything under the prado directory to the DocumentRoot directory (or a subdirectory) of the Web server.
  6. +
  7. Your installation of PRADO is done and you can start to play with the demo applications included in the PRADO release via URL http://web-server-address/demos/. This QuickStart Tutorial is one of such applications.
  8. +
+

+

+If you encounter any problems with the demo applications, please use the PRADO requirement checker script to check if your server configuration fullfils the conditions required by PRADO. +

+

+The minimum requirement by PRADO is that the Web server support PHP 5. PRADO has been tested with Apache Web server on Windows and Linux. Highly possibly it may also run on other platforms with other Web servers, as long as PHP 5 is supported.

\ No newline at end of file diff --git a/demos/quickstart/protected/pages/config.xml b/demos/quickstart/protected/pages/config.xml index 41d5999d..929b26e7 100644 --- a/demos/quickstart/protected/pages/config.xml +++ b/demos/quickstart/protected/pages/config.xml @@ -4,5 +4,7 @@ - + + + \ No newline at end of file diff --git a/demos/quickstart/themes/Simple/style.css b/demos/quickstart/themes/Simple/style.css index 617d76a0..ea77ef62 100644 --- a/demos/quickstart/themes/Simple/style.css +++ b/demos/quickstart/themes/Simple/style.css @@ -70,6 +70,55 @@ body { padding-left:10px; } -.topic a:hover{ +.topic a:hover { color:red; +} + +.code { + padding:10px; + border-style:solid; + border-width:1px; + border-color:#cccccc; + background-color:#ffffee; +} + +.runbar a:link, .runbar a:visited { + background-color:#BFE4FF; + font-size: 12px; + font-weight: bold; + padding: 3px; + padding-left: 6px; + padding-right: 6px; + border-top: 1px solid white; + border-left: 1px solid white; + border-bottom: 1px solid #aaaaaa; + border-right: 1px solid #aaaaaa; + text-decoration: none; +} + +.runbar a:link.active, .runbar a:visited.active, .runbar a:hover { + background-color:#BFE4FF; + font-size: 12px; + font-weight: bold; + padding: 3px; + padding-left: 6px; + padding-right: 6px; + border-top: 1px solid #aaaaaa; + border-left: 1px solid #aaaaaa; + border-bottom: 1px solid white; + border-right: 1px solid white; +} + +#sourceList { + background-color:#BFE4FF; + margin:10px; + border:1px solid silver; + padding:10px; +} + +#sourceView { + background-color:#ffffee; + margin:10px; + border:1px solid silver; + padding:10px; } \ No newline at end of file diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index f7307ded..7aa6f3b0 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -140,7 +140,7 @@ class TTemplate extends TComponent implements ITemplate * '<%@\s*(\w+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>' - directives * '<%=?(.*?)%> | <%#(.*?)%>' - expressions */ - const REGEX_RULES='/||<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>|<%[#=]?(.*?)%>/msS'; + const REGEX_RULES='/||<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>|<%[%#~\\$=](.*?)%>/msS'; /** * Different configurations of component property/event/attribute @@ -536,10 +536,10 @@ class TTemplate extends TComponent implements ITemplate $textStart=$matchEnd+1; if($str[2]==='=') // expression $tpl[$c++]=array($container,'TExpression',array('Expression'=>$match[5][0])); - else if($str[2]==='#') // binding expression - $tpl[$c++]=array($container,'TLiteral',array('Text'=>array(0,$match[5][0]))); - else // statements + else if($str[2]==='%') // statements $tpl[$c++]=array($container,'TStatements',array('Statements'=>$match[5][0])); + else + $tpl[$c++]=array($container,'TLiteral',array('Text'=>$this->parseAttribute($str))); } else if(strpos($str,'$textStart && $container>=0) { $value=substr($input,$textStart,$matchStart-$textStart); - if(preg_match('/^<%.*?%>$/msS',$value)) - { - if($value[2]==='#') // databind - $tpl[$container][2][$prop]=array(0,substr($value,3,strlen($value)-5)); - else if($value[2]==='=') // a dynamic initialization - $tpl[$container][2][$prop]=array(1,substr($value,3,strlen($value)-5)); - else - $tpl[$container][2][$prop]=$value; - } - else - $tpl[$container][2][$prop]=$value; + $tpl[$container][2][$prop]=$this->parseAttribute($value); $textStart=$matchEnd+1; } $expectPropEnd=false; @@ -660,30 +650,25 @@ class TTemplate extends TComponent implements ITemplate $name=strtolower($matches[$i][1]); $value=$matches[$i][2]; if($value[0]==='\'' || $value[0]==='"') - { $value=substr($value,1,strlen($value)-2); - if(!preg_match('/(<%#.*?%>|<%=.*?%>|<%~.*?%>|<%\\$.*?%>)/msS',$value)) - { - $attributes[$name]=$value; - continue; - } - } - if($value[0]==='<') - { - if($value[2]==='#') // databind - $attributes[$name]=array(self::CONFIG_DATABIND,substr($value,3,strlen($value)-5)); - else if($value[2]==='=') // a dynamic initialization - $attributes[$name]=array(self::CONFIG_EXPRESSION,substr($value,3,strlen($value)-5)); - else if($value[2]==='~') // a URL - $attributes[$name]=array(self::CONFIG_ASSET,trim(substr($value,3,strlen($value)-5))); - else if($value[2]==='$') - $attributes[$name]=array(self::CONFIG_PARAMETER,trim(substr($value,3,strlen($value)-5))); - else - $attributes[$name]=substr($value,2,strlen($value)-4); - } + $attributes[$name]=$this->parseAttribute($value); } return $attributes; } + + protected function parseAttribute($value) + { + if(!preg_match('/(<%#.*?%>|<%=.*?%>|<%~.*?%>|<%\\$.*?%>)/msS',$value)) + return $value; + else if($value[2]==='#') // databind + return array(self::CONFIG_DATABIND,substr($value,3,strlen($value)-5)); + else if($value[2]==='=') // a dynamic initialization + return array(self::CONFIG_EXPRESSION,substr($value,3,strlen($value)-5)); + else if($value[2]==='~') // a URL + return array(self::CONFIG_ASSET,trim(substr($value,3,strlen($value)-5))); + else if($value[2]==='$') + return array(self::CONFIG_PARAMETER,trim(substr($value,3,strlen($value)-5))); + } } ?> \ No newline at end of file -- cgit v1.2.3