summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/pages/Tutorial')
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/AddressBook.page9
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/AjaxChat.page8
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/CurrencyConverter.page63
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page6
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page63
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/id/AjaxChat.page1
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page73
7 files changed, 103 insertions, 120 deletions
diff --git a/demos/quickstart/protected/pages/Tutorial/AddressBook.page b/demos/quickstart/protected/pages/Tutorial/AddressBook.page
deleted file mode 100755
index f028a636..00000000
--- a/demos/quickstart/protected/pages/Tutorial/AddressBook.page
+++ /dev/null
@@ -1,9 +0,0 @@
-<com:TContent ID="body">
- <h1 id="22007">A Simple Address Book</h1>
- <p id="110006" class="block-content">This tutorial introduces the basics of connecting to a database
- using <a href="?page=Database.ActiveRecord">ActiveRecord</a>
- and using <a href="?page=Database.Scaffold">Active Record scaffolds </a>to quickly
- build a simple address book.
- </p>
-
-</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Tutorial/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/AjaxChat.page
index d94dfa89..92118720 100755
--- a/demos/quickstart/protected/pages/Tutorial/AjaxChat.page
+++ b/demos/quickstart/protected/pages/Tutorial/AjaxChat.page
@@ -59,7 +59,6 @@ php prado/framework/prado-cli.php -c chat
class Login extends TPage
{
}
-?&gt;
</com:TTextHighlighter>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_90029">
<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -170,7 +169,7 @@ as <tt>App_Code/chat.db</tt>.
class ChatUserRecord extends TActiveRecord
{
const TABLE='chat_users';
-
+
public $username;
public $last_activity;
@@ -431,7 +430,6 @@ and a button to send the message.
Text="Send" /&gt;
</div>
&lt;/com:TForm&gt;
-&lt;com:TJavascriptLogger /&gt;
</body>
</html>
</com:TTextHighlighter>
@@ -572,7 +570,7 @@ public function getUserMessages($user)
$content = '';
foreach($this->findAll('for_user = ?', $user) as $message)
$content .= $this->formatMessage($message);
- $this->deleteAll('for_user = ? OR created_on < ?',
+ $this->deleteAll('for_user = ? OR created_on < ?',
$user, time() - 300); //5 min inactivity
return $content;
}
@@ -581,7 +579,7 @@ protected function formatMessage($message)
{
$user = htmlspecialchars($message->from_user);
$content = htmlspecialchars($message->message);
- return "<div class=\"message\"><strong>{$user}:</strong>"
+ return "<div class=\"message\"><strong>{$user}:</strong>"
." <span>{$content}</span></div>";
}
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Tutorial/CurrencyConverter.page b/demos/quickstart/protected/pages/Tutorial/CurrencyConverter.page
index 4bec2a28..1abd68b9 100755
--- a/demos/quickstart/protected/pages/Tutorial/CurrencyConverter.page
+++ b/demos/quickstart/protected/pages/Tutorial/CurrencyConverter.page
@@ -34,9 +34,9 @@
<tt>currency-converter</tt> in your current working directory.
You may need to change to the appropriate directory
first.
- See the <a href="?page=GettingStarted.CommandLine">Command Line Tool</a>
- for more details.
- </p>
+ See the <a href="?page=GettingStarted.CommandLine">Command Line Tool</a>
+ for more details.
+ </p>
<com:TTextHighlighter Language="text" CssClass="source block-content" id="code111">
php prado/framework/prado-cli.php -c currency-converter
</com:TTextHighlighter>
@@ -52,7 +52,7 @@ php prado/framework/prado-cli.php -c currency-converter
<p id="80058" class="block-content">We start by editing the <tt>Home.page</tt> file found in the
<tt>currency-converter/protected/pages/</tt> directory. Files ending
with ".page" are page templates that contains HTML and Prado controls.
- We simply add two textboxes, three labels and one button as follows.
+ We simply add two textboxes, three labels and one button as follows.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="form1">
&lt;com:TForm&gt;
@@ -75,7 +75,7 @@ php prado/framework/prado-cli.php -c currency-converter
</div>
</fieldset>
&lt;/com:TForm&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="refresh" class="block-content">
If you refresh the page, you should see something similar to the following figure.
It may not look very pretty or orderly, but we shall change that later using CSS.
@@ -125,7 +125,7 @@ php prado/framework/prado-cli.php -c currency-converter
to add a "Home.php" to where "Home.page" is. The <tt>Home</tt> class
should extends the
<com:DocLink ClassPath="System.Web.UI.TPage" Text="TPage" />, the default base
- class for all Prado pages.
+ class for all Prado pages.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code3">
&lt;?php
@@ -133,8 +133,7 @@ class Home extends TPage
{
}
-?&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1111" class="block-content">
Prado uses PHP's <tt>__autoload</tt> method to load classes. The convention
is to use the class name with ".php" extension as filename.
@@ -151,15 +150,15 @@ class Home extends TPage
the converted total. To handle the user clicking of the "Convert" button
we simply add an <tt>OnClick</tt> property to the "Convert" button in
the "Home.page" template and add a corresponding event handler method
- in the "Home.php".
+ in the "Home.php".
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code4">
&lt;com:TButton Text="Convert" OnClick="convert_clicked" /&gt;
</com:TTextHighlighter>
- <p id="222" class="block-content">
+ <p id="222" class="block-content">
The value of the <tt>OnClick</tt>, "<tt>convert_clicked</tt>", will be the method
name in the "Home.php" that will called when the user clicks on the
- "Convert" button.
+ "Convert" button.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code5">
class Home extends TPage
@@ -171,8 +170,8 @@ class Home extends TPage
$this->total->Text = $rate * $dollars;
}
}
-</com:TTextHighlighter>
-<div id="3332" class="block-content">
+</com:TTextHighlighter>
+<div id="3332" class="block-content">
<p id="333">
If you run the application in your web browser, enter some values and click
the "Convert" button then you should see that calculated value displayed next
@@ -186,24 +185,24 @@ class Home extends TPage
</p>
<p id="80067">We shall now examine, the three lines that implements the simply currency
- conversion in the "<tt>convert_clicked</tt>" method.
- </p>
+ conversion in the "<tt>convert_clicked</tt>" method.
+ </p>
</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code6" >
$rate = floatval($this->currencyRate->Text);
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="444" class="block-content">
The statement <tt>$this->currencyRate</tt> corresponds to the
<tt>TTextBox</tt> component with <tt>ID</tt> value "currencyRate" in the
"Home.page" template. The <tt>Text</tt> property of the <tt>TTextBox</tt>
contains the value that the user entered. So, we obtain this
value by <tt>$this->currencyRate->Text</tt> which we convert the
- value to a float value.
+ value to a float value.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code7">
$dollars = floatval($this->dollars->Text);
-</com:TTextHighlighter>
-<div id="5551" class="block-content">
+</com:TTextHighlighter>
+<div id="5551" class="block-content">
<p id="555">
The next line does a similar things, it takes the user value from
the <tt>TTextBox</tt> with <tt>ID</tt> value "dollars and converts it to
@@ -212,9 +211,9 @@ $dollars = floatval($this->dollars->Text);
<p id="80068">The third line calculates the new amount and set this value in the
<tt>Text</tt> property of the <tt>TLabel</tt> with <tt>ID="total"</tt>.
- Thus, we display the new amount to the user in the label.
+ Thus, we display the new amount to the user in the label.
</p>
-</div>
+</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code8">
$this->total->Text = $rate * $dollars;
</com:TTextHighlighter>
@@ -233,14 +232,14 @@ $this->total->Text = $rate * $dollars;
<li>the user enters a value,</li>
<li>the currency rate is a valid number,</li>
<li>the currency rate is positive.</li>
- </ol>
+ </ol>
<p id="666" class="block-content">
To ensure 1 we add one
<com:DocLink ClassPath="System.Web.UI.WebControls.TRequiredFieldValidator" Text="TRequiredFieldValidator" />. To ensure 2 and 3, we add one
<com:DocLink ClassPath="System.Web.UI.WebControls.TCompareValidator" Text="TCompareValidator" />. We may add these validators any where within
the "Home.page" template. Further details regarding these validator and other
validators can be found in the
- <a href="?page=Controls.Validation">Validation Controls</a> page.
+ <a href="?page=Controls.Validation">Validation Controls</a> page.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9">
&lt;com:TRequiredFieldValidator
@@ -258,12 +257,12 @@ $this->total->Text = $rate * $dollars;
<ol id="o222" class="block-content">
<li>the user enters a value,</li>
<li>the value is a valid number (not including any currency or dollar signs).</li>
- </ol>
+ </ol>
<p id="777" class="block-content">
To ensure 1 we just add another <tt>TRequiredFieldValidator</tt>, for 2
we could use a
<com:DocLink ClassPath="System.Web.UI.WebControls.TDataTypeValidator" Text="TDataTypeValidator" />. For simplicity we only allow the user to enter
- a number for the amount they wish to convert.
+ a number for the amount they wish to convert.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9a">
&lt;com:TRequiredFieldValidator
@@ -283,7 +282,7 @@ $this->total->Text = $rate * $dollars;
using both javascript and server side. The server side validation
is <b>always performed</b>. For the server side, we
should skip the calculation if the validators are not satisfied. This can
- done as follows.
+ done as follows.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code10" >
public function convert_clicked($sender, $param)
@@ -313,7 +312,7 @@ public function convert_clicked($sender, $param)
In addition, we can change the "totals" <tt>TLabel</tt> with the
Active Control counter part,
<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveLabel" Text="TActiveLabel" />, such that the server side can update the browser without
- reloading the page.
+ reloading the page.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code11">
<div class="total-field">
@@ -323,11 +322,11 @@ public function convert_clicked($sender, $param)
<div class="convert-button">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" /&gt;
</div>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1232" class="block-content">
The server side logic remains the same, we just need to import the
Active Controls name space as they are not included by default. We
- add the following line to the begin of "Home.php".
+ add the following line to the begin of "Home.php".
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code12">
Prado::using('System.Web.UI.ActiveControls.*');
@@ -345,7 +344,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<p id="80076" class="block-content">To indicate that the calculation is in progress, we can change the text
of the "total" label as follows. We add a <tt>ClientSide.OnLoading</tt> property
to the "Convert" button (since this button is responsible for requesting
- the calculation).
+ the calculation).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code13">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" &gt;
@@ -383,7 +382,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<p id="80080" class="block-content">We simply create a CSS file named "common.css" and save it in the
<tt>themes/Basic</tt> directory. Then we add the following code
- to the beginning of "Home.page" (we add a little more HTML as well).
+ to the beginning of "Home.page" (we add a little more HTML as well).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code14">
&lt;%@ Theme="Basic" %&gt;
@@ -392,7 +391,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
&lt;com:THead Title="Currency Converter" /&gt;
<body>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="4334" class="block-content">
The first line <tt>&lt;%@ Theme="Basic" %&gt;</tt> defines the
theme to be used for this page. The
diff --git a/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page
index 66bb0e43..568e920f 100755
--- a/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page
+++ b/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page
@@ -58,7 +58,6 @@ php prado/framework/prado-cli.php -c chat
class Login extends TPage
{
}
-?&gt;
</com:TTextHighlighter>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_90029">
<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -430,7 +429,6 @@ and a button to send the message.
Text="Send" /&gt;
</div>
&lt;/com:TForm&gt;
-&lt;com:TJavascriptLogger /&gt;
</body>
</html>
</com:TTextHighlighter>
@@ -571,7 +569,7 @@ public function getUserMessages($user)
$content = '';
foreach($this->findAll('for_user = ?', $user) as $message)
$content .= $this->formatMessage($message);
- $this->deleteAll('for_user = ? OR created_on < ?',
+ $this->deleteAll('for_user = ? OR created_on < ?',
$user, time() - 300); //5 min inactivity
return $content;
}
@@ -580,7 +578,7 @@ protected function formatMessage($message)
{
$user = htmlspecialchars($message->from_user);
$content = htmlspecialchars($message->message);
- return "<div class=\"message\"><strong>{$user}:</strong>"
+ return "<div class=\"message\"><strong>{$user}:</strong>"
." <span>{$content}</span></div>";
}
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page b/demos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page
index 2cce2336..6b8c7bc3 100755
--- a/demos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page
+++ b/demos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page
@@ -34,9 +34,9 @@
<tt>currency-converter</tt> in your current working directory.
You may need to change to the appropriate directory
first.
- See the <a href="?page=GettingStarted.CommandLine">Command Line Tool</a>
- for more details.
- </p>
+ See the <a href="?page=GettingStarted.CommandLine">Command Line Tool</a>
+ for more details.
+ </p>
<com:TTextHighlighter Language="text" CssClass="source block-content" id="code111">
php prado/framework/prado-cli.php -c currency-converter
</com:TTextHighlighter>
@@ -52,7 +52,7 @@ php prado/framework/prado-cli.php -c currency-converter
<p id="80058" class="block-content">We start by editing the <tt>Home.page</tt> file found in the
<tt>currency-converter/protected/pages/</tt> directory. Files ending
with ".page" are page templates that contains HTML and Prado controls.
- We simply add two textboxes, three labels and one button as follows.
+ We simply add two textboxes, three labels and one button as follows.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="form1">
&lt;com:TForm&gt;
@@ -75,7 +75,7 @@ php prado/framework/prado-cli.php -c currency-converter
</div>
</fieldset>
&lt;/com:TForm&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="refresh" class="block-content">
If you refresh the page, you should see something similar to the following figure.
It may not look very pretty or orderly, but we shall change that later using CSS.
@@ -125,7 +125,7 @@ php prado/framework/prado-cli.php -c currency-converter
to add a "Home.php" to where "Home.page" is. The <tt>Home</tt> class
should extends the
<com:DocLink ClassPath="System.Web.UI.TPage" Text="TPage" />, the default base
- class for all Prado pages.
+ class for all Prado pages.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code3">
&lt;?php
@@ -133,8 +133,7 @@ class Home extends TPage
{
}
-?&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1111" class="block-content">
Prado uses PHP's <tt>__autoload</tt> method to load classes. The convention
is to use the class name with ".php" extension as filename.
@@ -151,15 +150,15 @@ class Home extends TPage
the converted total. To handle the user clicking of the "Convert" button
we simply add an <tt>OnClick</tt> property to the "Convert" button in
the "Home.page" template and add a corresponding event handler method
- in the "Home.php".
+ in the "Home.php".
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code4">
&lt;com:TButton Text="Convert" OnClick="convert_clicked" /&gt;
</com:TTextHighlighter>
- <p id="222" class="block-content">
+ <p id="222" class="block-content">
The value of the <tt>OnClick</tt>, "<tt>convert_clicked</tt>", will be the method
name in the "Home.php" that will called when the user clicks on the
- "Convert" button.
+ "Convert" button.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code5">
class Home extends TPage
@@ -171,8 +170,8 @@ class Home extends TPage
$this->total->Text = $rate * $dollars;
}
}
-</com:TTextHighlighter>
-<div id="3332" class="block-content">
+</com:TTextHighlighter>
+<div id="3332" class="block-content">
<p id="333">
If you run the application in your web browser, enter some values and click
the "Convert" button then you should see that calculated value displayed next
@@ -186,24 +185,24 @@ class Home extends TPage
</p>
<p id="80067">We shall now examine, the three lines that implements the simply currency
- conversion in the "<tt>convert_clicked</tt>" method.
- </p>
+ conversion in the "<tt>convert_clicked</tt>" method.
+ </p>
</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code6" >
$rate = floatval($this->currencyRate->Text);
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="444" class="block-content">
The statement <tt>$this->currencyRate</tt> corresponds to the
<tt>TTextBox</tt> component with <tt>ID</tt> value "currencyRate" in the
"Home.page" template. The <tt>Text</tt> property of the <tt>TTextBox</tt>
contains the value that the user entered. So, we obtain this
value by <tt>$this->currencyRate->Text</tt> which we convert the
- value to a float value.
+ value to a float value.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code7">
$dollars = floatval($this->dollars->Text);
-</com:TTextHighlighter>
-<div id="5551" class="block-content">
+</com:TTextHighlighter>
+<div id="5551" class="block-content">
<p id="555">
The next line does a similar things, it takes the user value from
the <tt>TTextBox</tt> with <tt>ID</tt> value "dollars and converts it to
@@ -212,9 +211,9 @@ $dollars = floatval($this->dollars->Text);
<p id="80068">The third line calculates the new amount and set this value in the
<tt>Text</tt> property of the <tt>TLabel</tt> with <tt>ID="total"</tt>.
- Thus, we display the new amount to the user in the label.
+ Thus, we display the new amount to the user in the label.
</p>
-</div>
+</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code8">
$this->total->Text = $rate * $dollars;
</com:TTextHighlighter>
@@ -233,14 +232,14 @@ $this->total->Text = $rate * $dollars;
<li>the user enters a value,</li>
<li>the currency rate is a valid number,</li>
<li>the currency rate is positive.</li>
- </ol>
+ </ol>
<p id="666" class="block-content">
To ensure 1 we add one
<com:DocLink ClassPath="System.Web.UI.WebControls.TRequiredFieldValidator" Text="TRequiredFieldValidator" />. To ensure 2 and 3, we add one
<com:DocLink ClassPath="System.Web.UI.WebControls.TCompareValidator" Text="TCompareValidator" />. We may add these validators any where within
the "Home.page" template. Further details regarding these validator and other
validators can be found in the
- <a href="?page=Controls.Validation">Validation Controls</a> page.
+ <a href="?page=Controls.Validation">Validation Controls</a> page.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9">
&lt;com:TRequiredFieldValidator
@@ -258,12 +257,12 @@ $this->total->Text = $rate * $dollars;
<ol id="o222" class="block-content">
<li>the user enters a value,</li>
<li>the value is a valid number (not including any currency or dollar signs).</li>
- </ol>
+ </ol>
<p id="777" class="block-content">
To ensure 1 we just add another <tt>TRequiredFieldValidator</tt>, for 2
we could use a
<com:DocLink ClassPath="System.Web.UI.WebControls.TDataTypeValidator" Text="TDataTypeValidator" />. For simplicity we only allow the user to enter
- a number for the amount they wish to convert.
+ a number for the amount they wish to convert.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9a">
&lt;com:TRequiredFieldValidator
@@ -283,7 +282,7 @@ $this->total->Text = $rate * $dollars;
using both javascript and server side. The server side validation
is <b>always performed</b>. For the server side, we
should skip the calculation if the validators are not satisfied. This can
- done as follows.
+ done as follows.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code10" >
public function convert_clicked($sender, $param)
@@ -310,7 +309,7 @@ public function convert_clicked($sender, $param)
In addition, we can change the "totals" <tt>TLabel</tt> with the
Active Control counter part,
<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveLabel" Text="TActiveLabel" />, such that the server side can update the browser without
- reloading the page.
+ reloading the page.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code11">
<div class="total-field">
@@ -320,11 +319,11 @@ public function convert_clicked($sender, $param)
<div class="convert-button">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" /&gt;
</div>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1232" class="block-content">
The server side logic remains the same, we just need to import the
Active Controls name space as they are not included by default. We
- add the following line to the begin of "Home.php".
+ add the following line to the begin of "Home.php".
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code12">
Prado::using('System.Web.UI.ActiveControls.*');
@@ -342,7 +341,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<p id="80076" class="block-content">To indicate that the calculation is in progress, we can change the text
of the "total" label as follows. We add a <tt>ClientSide.OnLoading</tt> property
to the "Convert" button (since this button is responsible for requesting
- the calculation).
+ the calculation).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code13">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" &gt;
@@ -380,7 +379,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<p id="80080" class="block-content">We simply create a CSS file named "common.css" and save it in the
<tt>themes/Basic</tt> directory. Then we add the following code
- to the beginning of "Home.page" (we add a little more HTML as well).
+ to the beginning of "Home.page" (we add a little more HTML as well).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code14">
&lt;%@ Theme="Basic" %&gt;
@@ -389,7 +388,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
&lt;com:THead Title="Currency Converter" /&gt;
<body>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="4334" class="block-content">
The first line <tt>&lt;%@ Theme="Basic" %&gt;</tt> defines the
theme to be used for this page. The
diff --git a/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page
index 00222bca..50759868 100755
--- a/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page
+++ b/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page
@@ -55,7 +55,6 @@ php prado/framework/prado-cli.php -c chat
class Login extends TPage
{
}
-?&gt;
</com:TTextHighlighter>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_90029">
<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN"
diff --git a/demos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page b/demos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page
index d8f8e2b4..c1eae035 100755
--- a/demos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page
+++ b/demos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page
@@ -1,8 +1,8 @@
<com:TContent ID="body">
<h1 id="16001">Membangun Pengubah Kurs Sederhana</h1>
<p id="80053" class="block-content">Tutorial ini memperkenalkan kerangka kerja aplikasi web Prado dan mengajarkan Anda bagaimana untuk
- membangun aplikasi web sederhana dalam beberapa langkah sederhana. Tutorial
- ini menganggap bahwa Anda terbiasa dengan PHP dan Anda telah mengakses
+ membangun aplikasi web sederhana dalam beberapa langkah sederhana. Tutorial
+ ini menganggap bahwa Anda terbiasa dengan PHP dan Anda telah mengakses
server web yang dapat melayani naskah PHP5.
</p>
@@ -25,9 +25,9 @@
<p id="80056" class="block-content">Cara tercepat dan termudah untuk membuat aplikasi web Prado baru adalah menggunakan piranti perintah <tt>prado-cli.php</tt> yang ditemukan dalam direktori <tt>framework</tt>
pada distribusi Prado. Kita membuat aplikasi baru dengan menjalankan perintah berikut dalam prompt perintah atau konsol Anda. Perintah membuat direktori baru bernama <tt>currency-converter</tt> dalam direktori kerja Anda saat ini.
Anda perlu mengubahnya ke direktori yang benar terlebih dahulu.
- Lihat <a href="?page=GettingStarted.CommandLine">Piranti Baris Perintah</a>
- untuk lebih jelasnya.
- </p>
+ Lihat <a href="?page=GettingStarted.CommandLine">Piranti Baris Perintah</a>
+ untuk lebih jelasnya.
+ </p>
<com:TTextHighlighter Language="text" CssClass="source block-content" id="code111">
php prado/framework/prado-cli.php -c currency-converter
</com:TTextHighlighter>
@@ -39,7 +39,7 @@ php prado/framework/prado-cli.php -c currency-converter
<h1 id="16003">Membuat Antarmuka Pengguna Pengubah Kurs</h1>
<p id="80058" class="block-content">Kita mulai dengan mengedit file <tt>Home.page</tt> yang ditemukan dalam direktori <tt>currency-converter/protected/pages/</tt>. File yang berakhiran dengan ".page" adalah template halaman yang berisi HTML dan kontrol Prado.
- Kita cukup menambah dua kotak teks, tiga label dan satu tombol seperti berikut.
+ Kita cukup menambah dua kotak teks, tiga label dan satu tombol seperti berikut.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="form1">
&lt;com:TForm&gt;
@@ -62,7 +62,7 @@ php prado/framework/prado-cli.php -c currency-converter
</div>
</fieldset>
&lt;/com:TForm&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="refresh" class="block-content">
Jika Anda menyegarkan halaman, Anda akan melihat sesuatu mirip dengan gambar berikut.
Ia mungkin terlihat tidak cukup bagus atau berurut, tapi kita akan mengubahnya nanti dengan menggunakan CSS.
@@ -82,7 +82,7 @@ php prado/framework/prado-cli.php -c currency-converter
<com:DocLink ClassPath="System.Web.UI.WebControls.TTextBox" Text="TTextBox" />
yang pada dasarnya mendefinisikan sebuah label dan kotak teks bagi pengguna aplikasi
untuk memasukan nilai pertukaran kurs.
- Nilai properti <tt>ForControl</tt> property menentukan komponen mana label
+ Nilai properti <tt>ForControl</tt> property menentukan komponen mana label
diperuntukan. Ini membolehkan pengguna aplikasi mengklik pada label
untuk memfokuskan pada field (hal yang baik). Anda mungkin telah menggunakan elemen
biasa HTML <tt>&lt;label&gt;</tt> untuk melakukan hal yang sama, tapi
@@ -109,7 +109,7 @@ php prado/framework/prado-cli.php -c currency-converter
<p id="80063" class="block-content">Jika Anda mencoba mengklik pada tombol "Convert" kemudian halaman akan menyegarkan
dan tidak melakukan apapun. Agar tombol melakukan beberapa pekerjaan, kita perlu
menambahkan "Home.php" ke di mana "Home.page" berada. Kelas <tt>Home</tt> harus
- memperluas <com:DocLink ClassPath="System.Web.UI.TPage" Text="TPage" />, basis kelas standar untuk semua halaman Prado.
+ memperluas <com:DocLink ClassPath="System.Web.UI.TPage" Text="TPage" />, basis kelas standar untuk semua halaman Prado.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code3">
&lt;?php
@@ -117,8 +117,7 @@ class Home extends TPage
{
}
-?&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1111" class="block-content">
Prado menggunakan metode PHP <tt>__autoload</tt> untuk mengambil kelas. Konvensi
adalah untuk menggunakan nama kelas dengan ekstensi ".php" sebagai nama file.
@@ -134,14 +133,14 @@ class Home extends TPage
nilai dalam kotak teks, melakukan beberapa perhitungan dan menyajikan kepada pengguna dengan
total nilai yang dikonversi. Untuk menangani pengguna mengklik pada tombo "Convert",
kita cukup menambahkan sebuah properti <tt>OnClick</tt> ke tombol "Convert" dalam
- template "Home.page" dan menambahkan metode pengendali event terkait dalam "Home.php".
+ template "Home.page" dan menambahkan metode pengendali event terkait dalam "Home.php".
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code4">
&lt;com:TButton Text="Convert" OnClick="convert_clicked" /&gt;
</com:TTextHighlighter>
- <p id="222" class="block-content">
+ <p id="222" class="block-content">
Nilai dari <tt>OnClick</tt>, "<tt>convert_clicked</tt>", akan menjadi nama metode
- dalam "Home.php" yang akan dipanggil saat pengguna mengklik tombol "Convert".
+ dalam "Home.php" yang akan dipanggil saat pengguna mengklik tombol "Convert".
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code5">
class Home extends TPage
@@ -153,8 +152,8 @@ class Home extends TPage
$this->total->Text = $rate * $dollars;
}
}
-</com:TTextHighlighter>
-<div id="3332" class="block-content">
+</com:TTextHighlighter>
+<div id="3332" class="block-content">
<p id="333">
Jika Anda menjalankan aplikasi dalam web browser Anda, masukkan beberapa nilai
dan klik tombol "Convert" kemudian Anda akan melihat nilai yang dihitung ditampilkan
@@ -168,24 +167,24 @@ class Home extends TPage
</p>
<p id="80067">Sekarang kita akan memeriksa, tiga baris yang mengimplementasikan konversi
- kurs sederhana dalam metode "<tt>convert_clicked</tt>".
- </p>
+ kurs sederhana dalam metode "<tt>convert_clicked</tt>".
+ </p>
</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code6" >
$rate = floatval($this->currencyRate->Text);
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="444" class="block-content">
Pernyataan <tt>$this->currencyRate</tt> berhubungan dengan komponen
<tt>TTextBox</tt> dengan nilai <tt>ID</tt> "currencyRate" dalam template
"Home.page". Properti <tt>Text</tt> dari <tt>TTextBox</tt> berisi
nilai yang dimasukan oleh pengguna. Maka kita memperoleh nilai ini dengan
<tt>$this->currencyRate->Text</tt> yang kita konversi nilainya ke nilai
- pecahan.
+ pecahan.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code7">
$dollars = floatval($this->dollars->Text);
-</com:TTextHighlighter>
-<div id="5551" class="block-content">
+</com:TTextHighlighter>
+<div id="5551" class="block-content">
<p id="555">
Baris berikutnya melakukan hal yang mirip, ia mengambil nilai pengguna
dari <tt>TTextBox</tt> dengan nilai <tt>ID</tt> "dollars dang mengubahnya
@@ -194,9 +193,9 @@ $dollars = floatval($this->dollars->Text);
<p id="80068">Baris ketiga menghitung jumlah baru dan menyetel nilai ini dalam properti
<tt>Text</tt> dari <tt>TLabel</tt> dengan <tt>ID="total"</tt>.
- Selanjutnya, kita tampilkan jumlah baru ke pengguna dalam label.
+ Selanjutnya, kita tampilkan jumlah baru ke pengguna dalam label.
</p>
-</div>
+</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code8">
$this->total->Text = $rate * $dollars;
</com:TTextHighlighter>
@@ -210,11 +209,11 @@ $this->total->Text = $rate * $dollars;
<li>pengguna memasukan sebuah nilai,</li>
<li>kurs mata uang adalah angka yang benar,</li>
<li>kurs mata uang adalah positif.</li>
- </ol>
+ </ol>
<p id="666" class="block-content">
Untuk memastikan poin 1 kita menambahkan satu
<com:DocLink ClassPath="System.Web.UI.WebControls.TRequiredFieldValidator" Text="TRequiredFieldValidator" />. Untuk memastikan poin 2 dan 3, kita menambahkan satu <com:DocLink ClassPath="System.Web.UI.WebControls.TCompareValidator" Text="TCompareValidator" />. Kita dapat menambahkan validator ini di mana saja di dalam template "Home.page". Perincian selanjutnya mengenai validator ini dan validator lainnya dapat ditemukan dalam halaman
- <a href="?page=Controls.Validation">Validation Controls</a>.
+ <a href="?page=Controls.Validation">Validation Controls</a>.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9">
&lt;com:TRequiredFieldValidator
@@ -232,11 +231,11 @@ $this->total->Text = $rate * $dollars;
<ol id="o222" class="block-content">
<li>pengguna memasukan sebuah nilai,</li>
<li>nilai adalah angka yang benar (tidak menyertakan tanda kurs atau dolar).</li>
- </ol>
+ </ol>
<p id="777" class="block-content">
Untuk memastikan 1 kita cukup menambahkan <tt>TRequiredFieldValidator</tt> lainnya, untuk 2
kita dapat menggunakan
- <com:DocLink ClassPath="System.Web.UI.WebControls.TDataTypeValidator" Text="TDataTypeValidator" />. Untuk memudahkan kita hanya membolehkan pengguna untuk memasukan sebuah angka untuk jumlah yang ingin mereka ubah.
+ <com:DocLink ClassPath="System.Web.UI.WebControls.TDataTypeValidator" Text="TDataTypeValidator" />. Untuk memudahkan kita hanya membolehkan pengguna untuk memasukan sebuah angka untuk jumlah yang ingin mereka ubah.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9a">
&lt;com:TRequiredFieldValidator
@@ -249,8 +248,8 @@ $this->total->Text = $rate * $dollars;
</com:TTextHighlighter>
</p>
- <p id="80072" class="block-content">Sekarang jika Anda mencoba memasukan beberapa data tidak benar dalam aplikasi atau membiarkan field kosong
- validators akan diaktifkan dan menyajikan pesan kesalahan kepada pengguna. Catatan bahwa pesan kesalahan disajikan tanpa mengambil ulang halaman. Validator Prado standarnya memvalidasi javascript dan di dalam server. Validasi di dalam server <b>selalu dilakukan</b>. Untuk sisi server, kita harus melewati perhitungan jika validator tidak memuaskan. Ini dapat dilakukan seperti berikut.
+ <p id="80072" class="block-content">Sekarang jika Anda mencoba memasukan beberapa data tidak benar dalam aplikasi atau membiarkan field kosong
+ validators akan diaktifkan dan menyajikan pesan kesalahan kepada pengguna. Catatan bahwa pesan kesalahan disajikan tanpa mengambil ulang halaman. Validator Prado standarnya memvalidasi javascript dan di dalam server. Validasi di dalam server <b>selalu dilakukan</b>. Untuk sisi server, kita harus melewati perhitungan jika validator tidak memuaskan. Ini dapat dilakukan seperti berikut.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code10" >
public function convert_clicked($sender, $param)
@@ -276,7 +275,7 @@ memperbaiki pengalaman pengguna dengan meningkatkan tanggapan aplikasi. Satu car
<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveButton" Text="TActiveButton" />,
yang dapat memicu event klik di dalam server tanpa mengambil ulang halaman.
Sebagai tambahan, kita dapat mengubah "total" <tt>TLabel</tt> dengan pasangan Kontrol Aktif,
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveLabel" Text="TActiveLabel" />, dengan demikian di dalam server dapat memutakhirkan browser tanpa mengambil ulang halaman.
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveLabel" Text="TActiveLabel" />, dengan demikian di dalam server dapat memutakhirkan browser tanpa mengambil ulang halaman.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code11">
<div class="total-field">
@@ -286,10 +285,10 @@ memperbaiki pengalaman pengguna dengan meningkatkan tanggapan aplikasi. Satu car
<div class="convert-button">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" /&gt;
</div>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1232" class="block-content">
Logika di dalam server tetap sama, kita hanya perlu mengimpor
- ruang nama Kontrol Aktif karena secara standar tidak disertakan. Kita menambahkan baris berikut ke awal "Home.php".
+ ruang nama Kontrol Aktif karena secara standar tidak disertakan. Kita menambahkan baris berikut ke awal "Home.php".
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code12">
Prado::using('System.Web.UI.ActiveControls.*');
@@ -300,7 +299,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
Selanjutnya kita bisa memperbaiki pengalaman pengguna dengan mengunah label teks "total" menjadi "calculating..." saat pengguna mengklik tombol "Convert". Label teks "total" masih dimutakhirkan dengan jumlah perhitungan baru seperti sebelumnya.
</p>
- <p id="80076" class="block-content">Untuk mengindikasikan bahwa perhitungan sedang berlangsung, kita dapat mengubah label teks "total" sebagai berikut. Kita menambahkan properti <tt>ClientSide.OnLoading</tt> ke tombol "Convert" (karena tombol ini bertanggung jawab terhadap permintaan perhitungan).
+ <p id="80076" class="block-content">Untuk mengindikasikan bahwa perhitungan sedang berlangsung, kita dapat mengubah label teks "total" sebagai berikut. Kita menambahkan properti <tt>ClientSide.OnLoading</tt> ke tombol "Convert" (karena tombol ini bertanggung jawab terhadap permintaan perhitungan).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code13">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" &gt;
@@ -325,7 +324,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
</p>
<p id="80080" class="block-content">Kita cukup dengan membuat file CSS bernama "common.css" dan menyimpannya dalam direktori
- <tt>themes/Basic</tt>. Kemudian kita menambahkan kode berikut ke awal "Home.page" (kita menambahkan sedikit kode HTML juga).
+ <tt>themes/Basic</tt>. Kemudian kita menambahkan kode berikut ke awal "Home.page" (kita menambahkan sedikit kode HTML juga).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code14">
&lt;%@ Theme="Basic" %&gt;
@@ -334,10 +333,10 @@ Prado::using('System.Web.UI.ActiveControls.*');
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
&lt;com:THead Title="Currency Converter" /&gt;
<body>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="4334" class="block-content">
Baris pertama <tt>&lt;%@ Theme="Basic" %&gt;</tt> mendefinisikan tema
- yang dipakai untuk halaman ini.
+ yang dipakai untuk halaman ini.
<com:DocLink ClassPath="System.Web.UI.WebControls.THead" Text="THead" />
merujuk ke elemen HTML <tt>&lt;head&gt;</tt>. Sebagai tambahan terhadap
tampilan properti <tt>Title</tt> pada <tt>THead</tt>, semua file CSS