diff options
author | xue <> | 2005-12-24 17:13:54 +0000 |
---|---|---|
committer | xue <> | 2005-12-24 17:13:54 +0000 |
commit | 0401be173cd1f80785c09f3a1dfae79d54441197 (patch) | |
tree | 43d2c945b400d87532e05b90d8274f150478a24c | |
parent | 13e381d9f638d14157697d5229ffb2d99038c691 (diff) |
-rw-r--r-- | demos/quickstart/protected/pages/TopicList.tpl | 17 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/chap1/Installation.page | 18 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/config.xml | 4 | ||||
-rw-r--r-- | demos/quickstart/themes/Simple/style.css | 51 | ||||
-rw-r--r-- | 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 @@ <div class="topic">
<span>Fundamentals</span><br/>
-<a href="?page=Construction">Architecture</a><br/>
-<a href="?page=Construction">Key Concepts</a><br/>
-<a href="?page=Construction">Configurations</a><br/>
-<a href="?page=Construction">Templates</a><br/>
+<a href="?page=chap2.Architecture">Architecture</a><br/>
+<a href="?page=chap2.KeyConcepts">Key Concepts</a><br/>
+<a href="?page=chap2.Structure">Application Structure</a><br/>
+<a href="?page=chap2.Configurations">Configurations</a><br/>
+<a href="?page=chap2.Templates">Templates</a><br/>
</div>
<div class="topic">
-<span>Applications</span><br/>
-<a href="?page=chap2.Structure">Directory Structure</a><br/>
-<a href="?page=chap2.Deployment">Application Deployment</a><br/>
-<a href="?page=chap2.HelloWorld">Sample: Hello World</a><br/>
-<a href="?page=chap2.HangmanGame">Sample: Hangman Game</a><br/>
+<span>Samples</span><br/>
+<a href="?page=chap3.HelloWorld">Hello World</a><br/>
+<a href="?page=chap3.Hangman">Hangman Game</a><br/>
</div>
<div class="topic">
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 @@ <com:TContent ID="body" >
<h4>Installing PRADO</h4>
<p>
-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.
</p>
<p>
+Installation of PRADO is very easy. Follow the following steps,
+<ol>
+<li>Go to <a href="http://www.pradosoft.com/">pradosoft.com</a> to grab a latest version of PRADO.</li>
+<li>Unpack the PRADO release file using <i>unzip</i> on Linux or <i>winzip</i> on Windows. A directory named <i>prado</i> will be created under the working directory.</li>
+<li>Copy or upload everything under the <i>prado</i> directory to the DocumentRoot directory (or a subdirectory) of the Web server.</li>
+<li>Your installation of PRADO is done and you can start to play with the demo applications included in the PRADO release via URL <i>http://web-server-address/demos/</i>. This QuickStart Tutorial is one of such applications.</li>
+</ol>
+</p>
+<p>
+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.
+</p>
+<p>
+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.
</p>
</com:TContent>
\ 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 @@ <paths>
<alias id="Pages" path="." />
</paths>
- <pages MasterClass="Pages.Layout" Theme="Simple" />
+ <pages MasterClass="Pages.Layout" Theme="Simple">
+ <page id="ViewSource" MasterClass="" />
+ </pages>
</configuration>
\ 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,'<prop:')===0) // opening property
{
@@ -582,17 +582,7 @@ class TTemplate extends TComponent implements ITemplate if($matchStart>$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 |