diff options
Diffstat (limited to 'demos')
133 files changed, 1867 insertions, 1013 deletions
diff --git a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page index 28ad4b21..0d9fc026 100755 --- a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page +++ b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page @@ -45,11 +45,11 @@ We use template to organize the presentational layout of the feedback form. In t <h1>Contact</h1>
<p>Please fill out the following form to let me know your feedback on my blog. Thanks!</p>
-<com:TForm>
+<com:TForm>
<span>Your Name:</span>
<com:TRequiredFieldValidator ControlToValidate="Name"
- ErrorMessage="Please provide your name."
+ ErrorMessage="Please provide your name."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Name" />
@@ -57,10 +57,10 @@ We use template to organize the presentational layout of the feedback form. In t <br/>
<span>Your Email:</span>
<com:TRequiredFieldValidator ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
+ ErrorMessage="Please provide your email address."
Display="Dynamic" />
<com:TEmailAddressValidator ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
+ ErrorMessage="You entered an invalid email address."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Email" />
@@ -68,11 +68,11 @@ We use template to organize the presentational layout of the feedback form. In t <br/>
<span>Feedback:</span>
<com:TRequiredFieldValidator ControlToValidate="Feedback"
- ErrorMessage="Please provide your feedback."
+ ErrorMessage="Please provide your feedback."
Display="Dynamic" />
<br/>
-<com:TTextBox ID="Feedback"
- TextMode="MultiLine"
+<com:TTextBox ID="Feedback"
+ TextMode="MultiLine"
Rows="10"
Columns="40" />
@@ -99,13 +99,13 @@ Besides <tt>TTextBox</tt> controls, the template also uses many validator contro <com:TTextHighlighter CssClass="source" Language="prado">
<span>Your Email:</span>
-<com:TRequiredFieldValidator
+<com:TRequiredFieldValidator
ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
+ ErrorMessage="Please provide your email address."
Display="Dynamic" />
-<com:TEmailAddressValidator
+<com:TEmailAddressValidator
ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
+ ErrorMessage="You entered an invalid email address."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Email" />
@@ -152,28 +152,27 @@ class Contact extends TPage /**
* Event handler for the OnClick event of the submit button.
* @param TButton the button triggering the event
- * @param TEventParameter event parameter (null here)
+ * @param TEventParameter event parameter (null here)
*/
public function submitButtonClicked($sender, $param)
{
if ($this->IsValid) // check if input validation is successful
{
// obtain the user name, email, feedback from the textboxes
- $name = $this->Name->Text;
+ $name = $this->Name->Text;
$email = $this->Email->Text;
$feedback = $this->Feedback->Text;
-
+
// send an email to administrator with the above information
$this->mailFeedback($name, $email, $feedback);
}
}
-
+
protected function mailFeedback($name, $email, $feedback)
{
// implementation of sending the feedback email
}
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/Setup.page b/demos/blog-tutorial/protected/pages/Day1/Setup.page index e8316253..582d0399 100755 --- a/demos/blog-tutorial/protected/pages/Day1/Setup.page +++ b/demos/blog-tutorial/protected/pages/Day1/Setup.page @@ -52,7 +52,6 @@ require_once('path/to/prado.php'); $application = new TApplication;
// run the application and handle user requests
$application->run();
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -148,8 +147,8 @@ To change the location of the root page directory and change the name of homepag <?xml version="1.0" encoding="utf-8"?>
<application id="blog" mode="Debug">
<services>
- <service id="page"
- class="TPageService"
+ <service id="page"
+ class="TPageService"
BasePath="path.to.pages"
DefaultPage="NewHome"
/>
diff --git a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page index 9cd0410b..6115ef22 100755 --- a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page +++ b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page @@ -66,7 +66,6 @@ The class file <tt>MainLayout.php</tt> is very simple: class MainLayout extends TTemplateControl
{
}
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -145,7 +144,6 @@ class Contact extends TPage // ...
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page index e85d8bfe..0105f656 100755 --- a/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page +++ b/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page @@ -45,11 +45,11 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu <h1>Contact</h1>
<p>Veuillez remplir le formulaire suivant pour me laisser vos impressions au sujet de mon blog. Merci !</p>
-<com:TForm>
+<com:TForm>
<span>Votre nom:</span>
<com:TRequiredFieldValidator ControlToValidate="Name"
- ErrorMessage="Veuillez indiquer votre nom."
+ ErrorMessage="Veuillez indiquer votre nom."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Name" />
@@ -57,10 +57,10 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu <br/>
<span>Votre email:</span>
<com:TRequiredFieldValidator ControlToValidate="Email"
- ErrorMessage="Veuillez indiquer votre email."
+ ErrorMessage="Veuillez indiquer votre email."
Display="Dynamic" />
<com:TEmailAddressValidator ControlToValidate="Email"
- ErrorMessage="Vous avez saisi un email invalide."
+ ErrorMessage="Vous avez saisi un email invalide."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Email" />
@@ -68,11 +68,11 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu <br/>
<span>Commentaires:</span>
<com:TRequiredFieldValidator ControlToValidate="Feedback"
- ErrorMessage="Veuillez saisir un commentaire."
+ ErrorMessage="Veuillez saisir un commentaire."
Display="Dynamic" />
<br/>
-<com:TTextBox ID="Feedback"
- TextMode="MultiLine"
+<com:TTextBox ID="Feedback"
+ TextMode="MultiLine"
Rows="10"
Columns="40" />
@@ -99,13 +99,13 @@ Avant le contrôle <tt>TTextBox</tt>, le gabarit utilise aussi plusieurs validat <com:TTextHighlighter CssClass="source" Language="prado">
<span>Your Email:</span>
-<com:TRequiredFieldValidator
+<com:TRequiredFieldValidator
ControlToValidate="Email"
- ErrorMessage="Veuillez indiquer votre email."
+ ErrorMessage="Veuillez indiquer votre email."
Display="Dynamic" />
-<com:TEmailAddressValidator
+<com:TEmailAddressValidator
ControlToValidate="Email"
- ErrorMessage="Vous avez saisi un email invalide."
+ ErrorMessage="Vous avez saisi un email invalide."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Email" />
@@ -152,28 +152,27 @@ class Contact extends TPage /**
* Gestionnaire d'évènement pour OnClick (bouton submit).
* @param TButton le bouton qui a générer l'évènement
- * @param TEventParameter les paramètres de l'évènement (null dans ce cas)
+ * @param TEventParameter les paramètres de l'évènement (null dans ce cas)
*/
public function submitButtonClicked($sender, $param)
{
if ($this->IsValid) // vérifie que les validations sont Ok
{
// récupère le nom de l'utilisateur, son email et son commentaire
- $name = $this->Name->Text;
+ $name = $this->Name->Text;
$email = $this->Email->Text;
$feedback = $this->Feedback->Text;
-
- // envoie un email à l'administrateur avec les informations
+
+ // envoie un email à l'administrateur avec les informations
$this->mailFeedback($name, $email, $feedback);
}
}
-
+
protected function mailFeedback($name, $email, $feedback)
{
// implémentation de l'envoi de l'email
}
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page b/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page index 22a7891c..0be1c1f0 100755 --- a/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page +++ b/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page @@ -49,11 +49,10 @@ require_once('path/to/prado.php'); $application = new TApplication;
// run the application and handle user requests
$application->run();
-?>
</com:TTextHighlighter>
<com:InfoBox>
-Le nom du script ne doit pas être obligatoirement <tt>index.php</tt>. Il peut porter n'importe quel nom à partir du moment ou le serveur peut l'interpréter comme étant un script PHP5. Par exemple, sur certains hébergements mutualisés, le script devra porter le nom <tt>index.php5</tt>, ce qui permettra au serveur Web de le traiter correctement.
+Le nom du script ne doit pas être obligatoirement <tt>index.php</tt>. Il peut porter n'importe quel nom à partir du moment ou le serveur peut l'interpréter comme étant un script PHP5. Par exemple, sur certains hébergements mutualisés, le script devra porter le nom <tt>index.php5</tt>, ce qui permettra au serveur Web de le traiter correctement.
</com:InfoBox>
<h3>Le fichier de configuration de l'application</h3>
@@ -145,8 +144,8 @@ Pour changer l'emplacement du dossier racine des pages et le nom de la page d'ac <?xml version="1.0" encoding="utf-8"?>
<application id="blog" mode="Debug">
<services>
- <service id="page"
- class="TPageService"
+ <service id="page"
+ class="TPageService"
BasePath="path.to.pages"
DefaultPage="NewHome"
/>
diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page index cefff770..539b8376 100755 --- a/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page +++ b/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page @@ -68,7 +68,6 @@ Le fichier de classe <tt>MainLayout.php</tt> est très simple : class MainLayout extends TTemplateControl
{
}
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -147,13 +146,12 @@ class Contact extends TPage // ...
}
-?>
</com:TTextHighlighter>
<p>
Ci-dessus, nous indiquons d'utiliser le gabarit principal <tt>MasterClass</tt> dans la méthode <tt>onPreInit()</tt> qui est héritée de <tt>TPage</tt>. Cette méthode est appelé par PRADO juste après que l'instance de la page soit créée. Nous pouvons ainsi déclarer au moment où la page est requise quel gabarit principal utiliser. Par exemple, quand la page est requise par un utilisateur enregistré, nous pouvons utiliser le gabarit A, et le gabarit B si l'utilisateur qui demande la page est un invité.
</p>
- +
<p>
Nous pouvons aussi spécifier quel gabarit principal utiliser dans le fichier de <a href="http://www.pradosoft.com/demos/quickstart/?page=Configurations.AppConfig">configuration de l'application</a> ou encore dans le fichier de <a href="http://www.pradosoft.com/demos/quickstart/?page=Configurations.PageConfig">configuration de la page</a>. Ci-dessous, le fichier de configuration de l'application modifié pour notre blog.
</p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page index 65be6417..caee30d0 100755 --- a/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page +++ b/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page @@ -45,11 +45,11 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir <h1>Contact</h1>
<p>Please fill out the following form to let me know your feedback on my blog. Thanks!</p>
-<com:TForm>
+<com:TForm>
<span>Your Name:</span>
<com:TRequiredFieldValidator ControlToValidate="Name"
- ErrorMessage="Please provide your name."
+ ErrorMessage="Please provide your name."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Name" />
@@ -57,10 +57,10 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir <br/>
<span>Your Email:</span>
<com:TRequiredFieldValidator ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
+ ErrorMessage="Please provide your email address."
Display="Dynamic" />
<com:TEmailAddressValidator ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
+ ErrorMessage="You entered an invalid email address."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Email" />
@@ -68,11 +68,11 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir <br/>
<span>Feedback:</span>
<com:TRequiredFieldValidator ControlToValidate="Feedback"
- ErrorMessage="Please provide your feedback."
+ ErrorMessage="Please provide your feedback."
Display="Dynamic" />
<br/>
-<com:TTextBox ID="Feedback"
- TextMode="MultiLine"
+<com:TTextBox ID="Feedback"
+ TextMode="MultiLine"
Rows="10"
Columns="40" />
@@ -99,13 +99,13 @@ Selain kontrol <tt>TTextBox</tt>, template juga menggunakan banyak kontrol valid <com:TTextHighlighter CssClass="source" Language="prado">
<span>Your Email:</span>
-<com:TRequiredFieldValidator
+<com:TRequiredFieldValidator
ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
+ ErrorMessage="Please provide your email address."
Display="Dynamic" />
-<com:TEmailAddressValidator
+<com:TEmailAddressValidator
ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
+ ErrorMessage="You entered an invalid email address."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Email" />
@@ -152,28 +152,27 @@ class Contact extends TPage /**
* Pengendali event untuk event OnClick pada tombol submit.
* @param TButton tombol yang memicu event
- * @param TEventParameter parameter event (null di sini)
+ * @param TEventParameter parameter event (null di sini)
*/
public function submitButtonClicked($sender, $param)
{
if ($this->IsValid) // memeriksa apakan validasi input berhasil
{
// mendapatkan nama pengguna, email, umpan balik dari kotak teks
- $name = $this->Name->Text;
+ $name = $this->Name->Text;
$email = $this->Email->Text;
$feedback = $this->Feedback->Text;
-
+
// mengirimkan email ke administrator dengan informasi di atas
$this->mailFeedback($name, $email, $feedback);
}
}
-
+
protected function mailFeedback($name, $email, $feedback)
{
// implementasi pengiriman email umpan balik
}
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/id/Setup.page b/demos/blog-tutorial/protected/pages/Day1/id/Setup.page index edc469d5..45ae8cf5 100755 --- a/demos/blog-tutorial/protected/pages/Day1/id/Setup.page +++ b/demos/blog-tutorial/protected/pages/Day1/id/Setup.page @@ -52,7 +52,6 @@ require_once('path/to/prado.php'); $application = new TApplication;
// jalankan aplikasi dan tangani permintaan pengguna
$application->run();
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -148,8 +147,8 @@ Untuk membuat lokasi akar direktori halaman dan mengubah nama homepage, seseoran <?xml version="1.0" encoding="utf-8"?>
<application id="blog" mode="Debug">
<services>
- <service id="page"
- class="TPageService"
+ <service id="page"
+ class="TPageService"
BasePath="path.to.pages"
DefaultPage="NewHome"
/>
diff --git a/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page index d505beed..0c40181b 100755 --- a/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page +++ b/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page @@ -66,7 +66,6 @@ File kelas <tt>MainLayout.php</tt> sangat sederhana: class MainLayout extends TTemplateControl
{
}
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -145,7 +144,6 @@ class Contact extends TPage // ...
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog/protected/Common/BlogDataModule.php b/demos/blog/protected/Common/BlogDataModule.php index a6312dcb..384ee83d 100755 --- a/demos/blog/protected/Common/BlogDataModule.php +++ b/demos/blog/protected/Common/BlogDataModule.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: BlogDataModule.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** @@ -236,7 +235,7 @@ class BlogDataModule extends TModule public function queryPosts($postFilter,$categoryFilter,$orderBy,$limit) { - //FIXME this is insecure by design since it misses proper escaping + //FIXME this is insecure by design since it misses proper escaping $filter=''; if($postFilter!=='') $filter.=" AND $postFilter"; @@ -301,7 +300,7 @@ class BlogDataModule extends TModule public function queryPostCount($postFilter,$categoryFilter) { - //FIXME this is insecure by design since it misses proper escaping + //FIXME this is insecure by design since it misses proper escaping $filter=''; if($postFilter!=='') $filter.=" AND $postFilter"; @@ -424,7 +423,7 @@ class BlogDataModule extends TModule public function queryComments($filter,$orderBy,$limit) { - //FIXME this is insecure by design since it misses proper escaping + //FIXME this is insecure by design since it misses proper escaping if($filter!=='') $filter='WHERE '.$filter; $sql="SELECT * FROM tblComments $filter $orderBy $limit"; diff --git a/demos/blog/protected/Common/BlogErrorHandler.php b/demos/blog/protected/Common/BlogErrorHandler.php index fd5a7044..5446a5ee 100755 --- a/demos/blog/protected/Common/BlogErrorHandler.php +++ b/demos/blog/protected/Common/BlogErrorHandler.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: BlogErrorHandler.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('System.Exceptions.TErrorHandler'); diff --git a/demos/blog/protected/Common/BlogException.php b/demos/blog/protected/Common/BlogException.php index 39825f4f..e857cc3d 100755 --- a/demos/blog/protected/Common/BlogException.php +++ b/demos/blog/protected/Common/BlogException.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: BlogException.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Common/BlogPage.php b/demos/blog/protected/Common/BlogPage.php index e6da9a8c..2c394e46 100755 --- a/demos/blog/protected/Common/BlogPage.php +++ b/demos/blog/protected/Common/BlogPage.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: BlogPage.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Common/BlogUser.php b/demos/blog/protected/Common/BlogUser.php index 93990f69..3ce8af1b 100755 --- a/demos/blog/protected/Common/BlogUser.php +++ b/demos/blog/protected/Common/BlogUser.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: BlogUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('System.Security.TUser'); diff --git a/demos/blog/protected/Common/BlogUserManager.php b/demos/blog/protected/Common/BlogUserManager.php index 898402fa..c9419d73 100755 --- a/demos/blog/protected/Common/BlogUserManager.php +++ b/demos/blog/protected/Common/BlogUserManager.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: BlogUserManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('System.Security.IUserManager'); diff --git a/demos/blog/protected/Common/XListMenu.php b/demos/blog/protected/Common/XListMenu.php index a3ad4308..5289167f 100755 --- a/demos/blog/protected/Common/XListMenu.php +++ b/demos/blog/protected/Common/XListMenu.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: XListMenu.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('System.Web.UI.WebControls.TListControl'); diff --git a/demos/blog/protected/Layouts/MainLayout.php b/demos/blog/protected/Layouts/MainLayout.php index c2fbe04c..618691a1 100755 --- a/demos/blog/protected/Layouts/MainLayout.php +++ b/demos/blog/protected/Layouts/MainLayout.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: MainLayout.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Admin/AdminMenu.php b/demos/blog/protected/Pages/Admin/AdminMenu.php index f4c89724..01ca60c0 100755 --- a/demos/blog/protected/Pages/Admin/AdminMenu.php +++ b/demos/blog/protected/Pages/Admin/AdminMenu.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: AdminMenu.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Admin/ConfigMan.php b/demos/blog/protected/Pages/Admin/ConfigMan.php index be5e3983..4a938c94 100755 --- a/demos/blog/protected/Pages/Admin/ConfigMan.php +++ b/demos/blog/protected/Pages/Admin/ConfigMan.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: ConfigMan.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Admin/PostMan.php b/demos/blog/protected/Pages/Admin/PostMan.php index 9fa6b7d4..c69788c1 100755 --- a/demos/blog/protected/Pages/Admin/PostMan.php +++ b/demos/blog/protected/Pages/Admin/PostMan.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: PostMan.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Admin/UserMan.php b/demos/blog/protected/Pages/Admin/UserMan.php index 44fd2fc7..de3f7065 100755 --- a/demos/blog/protected/Pages/Admin/UserMan.php +++ b/demos/blog/protected/Pages/Admin/UserMan.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: UserMan.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/ErrorReport.php b/demos/blog/protected/Pages/ErrorReport.php index dc92c887..e8614943 100755 --- a/demos/blog/protected/Pages/ErrorReport.php +++ b/demos/blog/protected/Pages/ErrorReport.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: ErrorReport.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Posts/EditCategory.php b/demos/blog/protected/Pages/Posts/EditCategory.php index 67c03204..01beee7f 100755 --- a/demos/blog/protected/Pages/Posts/EditCategory.php +++ b/demos/blog/protected/Pages/Posts/EditCategory.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: EditCategory.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Posts/EditPost.php b/demos/blog/protected/Pages/Posts/EditPost.php index 7345a3cc..d2cc119b 100755 --- a/demos/blog/protected/Pages/Posts/EditPost.php +++ b/demos/blog/protected/Pages/Posts/EditPost.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: EditPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Posts/ListPost.php b/demos/blog/protected/Pages/Posts/ListPost.php index eba9f675..51e581d3 100755 --- a/demos/blog/protected/Pages/Posts/ListPost.php +++ b/demos/blog/protected/Pages/Posts/ListPost.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: ListPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Posts/MyPost.php b/demos/blog/protected/Pages/Posts/MyPost.php index e1851772..c0724f92 100755 --- a/demos/blog/protected/Pages/Posts/MyPost.php +++ b/demos/blog/protected/Pages/Posts/MyPost.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: MyPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Posts/NewCategory.php b/demos/blog/protected/Pages/Posts/NewCategory.php index 98eba96d..3043d657 100755 --- a/demos/blog/protected/Pages/Posts/NewCategory.php +++ b/demos/blog/protected/Pages/Posts/NewCategory.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: NewCategory.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Posts/NewPost.php b/demos/blog/protected/Pages/Posts/NewPost.php index c1127547..d4e2f855 100755 --- a/demos/blog/protected/Pages/Posts/NewPost.php +++ b/demos/blog/protected/Pages/Posts/NewPost.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: NewPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Posts/ViewPost.php b/demos/blog/protected/Pages/Posts/ViewPost.php index 05890794..3c549673 100755 --- a/demos/blog/protected/Pages/Posts/ViewPost.php +++ b/demos/blog/protected/Pages/Posts/ViewPost.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: ViewPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Users/EditUser.php b/demos/blog/protected/Pages/Users/EditUser.php index 862539f9..e3e2e1b0 100755 --- a/demos/blog/protected/Pages/Users/EditUser.php +++ b/demos/blog/protected/Pages/Users/EditUser.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: EditUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Users/NewUser.php b/demos/blog/protected/Pages/Users/NewUser.php index 24932f03..f407c44b 100755 --- a/demos/blog/protected/Pages/Users/NewUser.php +++ b/demos/blog/protected/Pages/Users/NewUser.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: NewUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Pages/Users/ViewUser.php b/demos/blog/protected/Pages/Users/ViewUser.php index 671e2c0a..61e4c689 100755 --- a/demos/blog/protected/Pages/Users/ViewUser.php +++ b/demos/blog/protected/Pages/Users/ViewUser.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: ViewUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Portlets/AccountPortlet.php b/demos/blog/protected/Portlets/AccountPortlet.php index 89a2294f..1ef0b820 100755 --- a/demos/blog/protected/Portlets/AccountPortlet.php +++ b/demos/blog/protected/Portlets/AccountPortlet.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: AccountPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('Application.Portlets.Portlet'); diff --git a/demos/blog/protected/Portlets/ArchivePortlet.php b/demos/blog/protected/Portlets/ArchivePortlet.php index 9deb36f1..858b6b3f 100755 --- a/demos/blog/protected/Portlets/ArchivePortlet.php +++ b/demos/blog/protected/Portlets/ArchivePortlet.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: ArchivePortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('Application.Portlets.Portlet'); diff --git a/demos/blog/protected/Portlets/CategoryPortlet.php b/demos/blog/protected/Portlets/CategoryPortlet.php index df243df3..c5ed10d3 100755 --- a/demos/blog/protected/Portlets/CategoryPortlet.php +++ b/demos/blog/protected/Portlets/CategoryPortlet.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: CategoryPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('Application.Portlets.Portlet'); diff --git a/demos/blog/protected/Portlets/CommentPortlet.php b/demos/blog/protected/Portlets/CommentPortlet.php index df07fb1e..6225ff45 100755 --- a/demos/blog/protected/Portlets/CommentPortlet.php +++ b/demos/blog/protected/Portlets/CommentPortlet.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: CommentPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('Application.Portlets.Portlet'); diff --git a/demos/blog/protected/Portlets/LoginPortlet.php b/demos/blog/protected/Portlets/LoginPortlet.php index 8b118390..de48363e 100755 --- a/demos/blog/protected/Portlets/LoginPortlet.php +++ b/demos/blog/protected/Portlets/LoginPortlet.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: LoginPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('Application.Portlets.Portlet'); diff --git a/demos/blog/protected/Portlets/Portlet.php b/demos/blog/protected/Portlets/Portlet.php index 0df8ce2e..ae1b04c1 100755 --- a/demos/blog/protected/Portlets/Portlet.php +++ b/demos/blog/protected/Portlets/Portlet.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: Portlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ /** diff --git a/demos/blog/protected/Portlets/SearchPortlet.php b/demos/blog/protected/Portlets/SearchPortlet.php index 018ad883..9c6646a8 100755 --- a/demos/blog/protected/Portlets/SearchPortlet.php +++ b/demos/blog/protected/Portlets/SearchPortlet.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: SearchPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ Prado::using('Application.Portlets.Portlet'); diff --git a/demos/chat/protected/pages/Home.page b/demos/chat/protected/pages/Home.page index b896cd28..7740c062 100755 --- a/demos/chat/protected/pages/Home.page +++ b/demos/chat/protected/pages/Home.page @@ -1,5 +1,5 @@ <!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Prado Chat Demo</title>
@@ -17,14 +17,14 @@ <com:TPlaceHolder ID="userList" />
</div>
<div class="message-input">
- <com:TActiveTextBox ID="userinput"
+ <com:TActiveTextBox ID="userinput"
Columns="40" Rows="2" TextMode="MultiLine" />
- <com:TActiveImageButton ID="sendButton" CssClass="send-button"
+ <com:TActiveImageButton ID="sendButton" CssClass="send-button"
ImageUrl=<%~ send.gif %> OnClick="processMessage"/>
</div>
-<com:TTimeTriggeredCallback OnCallback="refresh"
+<com:TTimeTriggeredCallback OnCallback="refresh"
Interval="2" StartTimerOnLoad="true" />
<com:TClientScript>
@@ -39,7 +39,6 @@ });
</com:TClientScript>
</com:TForm>
- <com:TJavascriptLogger Visible="false"/>
<div id="footer">
Copyright © 2007 <a href="http://www.pradosoft.com">PradoSoft</a>.
diff --git a/demos/quickstart/protected/controls/Layout.tpl b/demos/quickstart/protected/controls/Layout.tpl index b9e36e40..c3e67272 100755 --- a/demos/quickstart/protected/controls/Layout.tpl +++ b/demos/quickstart/protected/controls/Layout.tpl @@ -50,7 +50,7 @@ </table>
<div id="footer">
-Copyright © 2005-2013 <a href="http://www.pradosoft.com">PradoSoft</a>.
+Copyright © 2005-2014 <a href="http://www.pradosoft.com">PradoSoft</a>.
<br/><br/>
<%= Prado::poweredByPrado() %>
<a href="http://validator.w3.org/check?uri=referer"><img border="0" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
diff --git a/demos/quickstart/protected/controls/SampleLayout.tpl b/demos/quickstart/protected/controls/SampleLayout.tpl index 5a5ca898..ba286f0f 100755 --- a/demos/quickstart/protected/controls/SampleLayout.tpl +++ b/demos/quickstart/protected/controls/SampleLayout.tpl @@ -19,7 +19,7 @@ </div>
<div class="samplemenu">
<div class="copyright">
- Copyright © 2005-2013 <a href="http://www.pradosoft.com">PradoSoft</a>
+ Copyright © 2005-2014 <a href="http://www.pradosoft.com">PradoSoft</a>
</div>
</div>
diff --git a/demos/quickstart/protected/controls/TopicList.tpl b/demos/quickstart/protected/controls/TopicList.tpl index edc0ff3b..b8563c50 100644 --- a/demos/quickstart/protected/controls/TopicList.tpl +++ b/demos/quickstart/protected/controls/TopicList.tpl @@ -8,6 +8,7 @@ <li><a href="?page=GettingStarted.Installation">Installation</a></li>
<li><a href="?page=GettingStarted.NewFeatures">New Features</a></li>
<li><a href="?page=GettingStarted.Upgrading">Upgrading from v2.x and v1.x</a></li>
+ <li><a href="?page=GettingStarted.Upgrading32">Upgrading from v3.2</a></li>
<li><a href="?page=GettingStarted.Wsat">Web Site Administration Tool</a></li>
<li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
</ul>
@@ -19,7 +20,6 @@ <li><a href="?page=GettingStarted.HelloWorld">Creating First PRADO Application</a></li>
<li><a href="?page=Fundamentals.Hangman">Sample: Hangman Game</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">Currency Converter</a></li>
- <li><a href="?page=Tutorial.AddressBook">Address Book</a></li>
<li><a href="?page=Tutorial.AjaxChat">AJAX Chat Client</a></li>
</ul>
</div>
@@ -28,7 +28,8 @@ <div>Fundamentals</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Architecture</a></li>
- <li><a href="?page=Fundamentals.Components">Components</a></li>
+ <li><a href="?page=Fundamentals.Components1">Components: Part I</a></li>
+ <li><a href="?page=Fundamentals.Components2">Components: Part II</a></li>
<li><a href="?page=Fundamentals.Controls">Controls</a></li>
<li><a href="?page=Fundamentals.Pages">Pages</a></li>
<li><a href="?page=Fundamentals.Modules">Modules</a></li>
@@ -57,7 +58,9 @@ <li><a href="?page=Controls.Validation">Validation Controls</a></li>
<li><a href="?page=Controls.List">List Controls</a></li>
<li><a href="?page=Controls.Data">Data Controls</a></li>
+ <li><a href="?page=ActiveControls.Introduction">AJAX: Introduction</a></li>
<li><a href="?page=ActiveControls.Home">Active Controls (AJAX)</a></li>
+ <li><a href="?page=JuiControls.Home">Jui Controls (jQuery UI)</a></li>
<li><a href="?page=Controls.NewControl">Writing New Controls</a></li>
</ul>
</div>
diff --git a/demos/quickstart/protected/controls/es/SampleLayout.tpl b/demos/quickstart/protected/controls/es/SampleLayout.tpl index 24f0575a..d6d4d9b4 100755 --- a/demos/quickstart/protected/controls/es/SampleLayout.tpl +++ b/demos/quickstart/protected/controls/es/SampleLayout.tpl @@ -19,7 +19,7 @@ </div>
<div class="samplemenu">
<div class="copyright">
- Copyright © 2005-2013 <a href="http://www.pradosoft.com">PradoSoft</a>
+ Copyright © 2005-2014 <a href="http://www.pradosoft.com">PradoSoft</a>
</div>
</div>
diff --git a/demos/quickstart/protected/controls/es/TopicList.tpl b/demos/quickstart/protected/controls/es/TopicList.tpl index c2725733..b0129826 100644 --- a/demos/quickstart/protected/controls/es/TopicList.tpl +++ b/demos/quickstart/protected/controls/es/TopicList.tpl @@ -1,7 +1,7 @@ <div id="toc">
<div class="topic">
-<div>Comenzar</div>
+<div>Comenzar</div>
<ul>
<li><a href="?page=GettingStarted.Introduction">Introducción</a></li>
<li><a href="?page=GettingStarted.AboutPrado">¿Que es PRADO?</a></li>
@@ -28,7 +28,7 @@ <div>Básicos</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Arquitectura</a></li>
- <li><a href="?page=Fundamentals.Components">Componentes</a></li>
+ <li><a href="?page=Fundamentals.Components1">Componentes</a></li>
<li><a href="?page=Fundamentals.Controls">Controles</a></li>
<li><a href="?page=Fundamentals.Pages">Páginas</a></li>
<li><a href="?page=Fundamentals.Modules">Mádulos</a></li>
diff --git a/demos/quickstart/protected/controls/fr/SampleLayout.tpl b/demos/quickstart/protected/controls/fr/SampleLayout.tpl index e421604c..e6fd2347 100755 --- a/demos/quickstart/protected/controls/fr/SampleLayout.tpl +++ b/demos/quickstart/protected/controls/fr/SampleLayout.tpl @@ -19,7 +19,7 @@ </div>
<div class="samplemenu">
<div class="copyright">
- Copyright © 2005-2013 <a href="http://www.pradosoft.com">PradoSoft</a>
+ Copyright © 2005-2014 <a href="http://www.pradosoft.com">PradoSoft</a>
</div>
</div>
diff --git a/demos/quickstart/protected/controls/fr/TopicList.tpl b/demos/quickstart/protected/controls/fr/TopicList.tpl index 3020b24f..f7bd5f5a 100644 --- a/demos/quickstart/protected/controls/fr/TopicList.tpl +++ b/demos/quickstart/protected/controls/fr/TopicList.tpl @@ -27,7 +27,7 @@ <div>Fundamentaux</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Architecture</a></li>
- <li><a href="?page=Fundamentals.Components">Composants</a></li>
+ <li><a href="?page=Fundamentals.Components1">Composants</a></li>
<li><a href="?page=Fundamentals.Controls">Contrôles</a></li>
<li><a href="?page=Fundamentals.Pages">Pages</a></li>
<li><a href="?page=Fundamentals.Modules">Modules</a></li>
diff --git a/demos/quickstart/protected/controls/id/TopicList.tpl b/demos/quickstart/protected/controls/id/TopicList.tpl index 75fa8614..bedf6c6f 100644 --- a/demos/quickstart/protected/controls/id/TopicList.tpl +++ b/demos/quickstart/protected/controls/id/TopicList.tpl @@ -28,7 +28,7 @@ <div>Fundamental</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Arsitektur</a></li>
- <li><a href="?page=Fundamentals.Components">Komponen</a></li>
+ <li><a href="?page=Fundamentals.Components1">Komponen</a></li>
<li><a href="?page=Fundamentals.Controls">Kontrol</a></li>
<li><a href="?page=Fundamentals.Pages">Halaman</a></li>
<li><a href="?page=Fundamentals.Modules">Modul</a></li>
diff --git a/demos/quickstart/protected/controls/ja/TopicList.tpl b/demos/quickstart/protected/controls/ja/TopicList.tpl index dbfc7eb4..456e13c4 100644 --- a/demos/quickstart/protected/controls/ja/TopicList.tpl +++ b/demos/quickstart/protected/controls/ja/TopicList.tpl @@ -28,7 +28,7 @@ <div>動作原理</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">アーキテクチャ</a></li>
- <li><a href="?page=Fundamentals.Components">コンポーネント</a></li>
+ <li><a href="?page=Fundamentals.Components1">コンポーネント</a></li>
<li><a href="?page=Fundamentals.Controls">コントロール</a></li>
<li><a href="?page=Fundamentals.Pages">ページ</a></li>
<li><a href="?page=Fundamentals.Modules">モジュール</a></li>
diff --git a/demos/quickstart/protected/controls/pl/TopicList.tpl b/demos/quickstart/protected/controls/pl/TopicList.tpl index 33d8a126..c57cba76 100644 --- a/demos/quickstart/protected/controls/pl/TopicList.tpl +++ b/demos/quickstart/protected/controls/pl/TopicList.tpl @@ -19,7 +19,7 @@ <li><a href="?page=GettingStarted.HelloWorld">Tworzenie pierwszej aplikacji PRADO</a></li>
<li><a href="?page=Fundamentals.Hangman">Przykład: gra wisielec</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">Konwenter walut</a></li>
- <li><a href="?page=Tutorial.AddressBook">Książka adresowa</a></li>
+ <li><a href="?page=Tutorial.AddressBook">Książka adresowa</a></li>
<li><a href="?page=Tutorial.AjaxChat">AJAX-owy klient czat</a></li>
</ul>
</div>
@@ -28,7 +28,7 @@ <div>Postawy</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Architektura</a></li>
- <li><a href="?page=Fundamentals.Components">Komponenty</a></li>
+ <li><a href="?page=Fundamentals.Components1">Komponenty</a></li>
<li><a href="?page=Fundamentals.Controls">Kontrolki</a></li>
<li><a href="?page=Fundamentals.Pages">Strony</a></li>
<li><a href="?page=Fundamentals.Modules">Moduły</a></li>
diff --git a/demos/quickstart/protected/controls/zh/TopicList.tpl b/demos/quickstart/protected/controls/zh/TopicList.tpl index 6a4c6e17..160455b4 100644 --- a/demos/quickstart/protected/controls/zh/TopicList.tpl +++ b/demos/quickstart/protected/controls/zh/TopicList.tpl @@ -27,7 +27,7 @@ <div>基础概念</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">框架结构</a></li>
- <li><a href="?page=Fundamentals.Components">部件</a></li>
+ <li><a href="?page=Fundamentals.Components1">部件</a></li>
<li><a href="?page=Fundamentals.Controls">控件</a></li>
<li><a href="?page=Fundamentals.Pages">页面</a></li>
<li><a href="?page=Fundamentals.Modules">模块</a></li>
diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page b/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page index d4167f6e..6385b658 100755 --- a/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page @@ -24,70 +24,4 @@ events of an <tt>TActiveButton</tt>.</p> <com:RunBar PagePath="ActiveControls.Samples.TActiveButton.Home" />
-<h2 id="122027">TActiveButton Class Diagram</h2>
-<p id="610414" class="block-content">The class diagram for <tt>TActiveButton</tt> is illustrated in the figure below.
-Most active control that can perform callback request have a similar structure.
-</p>
-
-<img src=<%~ TActiveButtonClass.png %> class="figure"
- alt="TActiveButton class diagram" title="TActiveButton class diagram" />
-
-<p id="610415" class="block-content"><tt>TActiveButton</tt> is an extension of <a href="?page=Controls.Button">TButton</a>
-and implements two additional interfaces <tt>ICallbackEventHandler</tt> and
-<tt>IActiveControl</tt>. The <tt>TActiveButton</tt> contains an instance of
-<a href="?page=ActiveControls.BaseActiveControl">TBaseActiveCallbackControl</a>
-available through the <tt>ActiveControl</tt> property of <tt>TActiveButton</tt>.
-The following example set the callback parameter of the <tt>TActiveButton</tt> when
-a callback request is dispatched.
-</p>
-<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code1">
-<com:TActiveButton
- Text="Click Me"
- OnCallback="button_callback"
- ActiveControl.CallbackParameter="value" />
-</com:TTextHighlighter>
-<p id="610416" class="block-content">In the <tt>OnCallback</tt> event handler method, the <tt>CallbackParameter</tt>
-is available in the <tt>$param</tt> object.</p>
-<com:TTextHighlighter Language="php" CssClass="source block-content" id="code2">
-public function button_callback($sender, $param)
-{
- echo $param->CallbackParameter; //outputs "value"
-}
-</com:TTextHighlighter>
-
-<h2 id="122028">Adding Client Side Behaviour</h2>
-
-<p id="610417" class="block-content">With in the <tt>ActiveControl</tt> property is an instance of
-<a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a> available
-as a property <tt>ClientSide</tt> of <tt>TActiveButton</tt>.
-The <tt>ClientSide</tt> property contains sub-properties, such as <tt>RequestTimeOut</tt>,
-and client-side javascript event handler, such as <tt>OnLoading</tt>,
-that are used by the client-side when making a callback request.
-The following example demonstrates the toggling of a "loading" indicator
-when the client-side is making a callback request.
-</p>
-
-<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code3">
-<com:TClientScript PradoScripts="effects" />
-<span id="callback_status">Loading...</span>
-
-<com:TActiveButton
- Text="Click Me"
- OnCallback="button_callback"
- ActiveControl.CallbackParameter="value" >
- <prop:ClientSide
- OnLoading="Element.show('callback_status')"
- OnComplete="Element.hide('callback_status')" />
-</com:TActiveButton>
-</com:TTextHighlighter>
-
-<p id="610418" class="block-content">The example loads the "effects" javascript library using the
-<a href="?page=Controls.ClientScript">TClientScript</a> component.
-The <tt>ClientSide.OnLoading</tt> property value contains
-javascript statement that uses the "effects" library to show the "Loading..."
-span tag. Similarly, <tt>ClientSide.OnComplete</tt> property
-value contains the javascript statement that hides the "Loading..." span tag.
-See <a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a> for
-further details on client-side property details.
-</p>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveRatingList.page b/demos/quickstart/protected/pages/ActiveControls/ActiveRatingList.page new file mode 100644 index 00000000..7b6fb83d --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveRatingList.page @@ -0,0 +1,32 @@ +<com:TContent ID="body" > + +<h1>TActiveRatingList</h1> +<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveRatingList" /> + +<p class="block-content"> +<tt>TActiveRatingList</tt> is the active counterpart to the original <tt>TRatingList</tt> control. +</p> + +<p class="block-content"> +The <tt>AutoPostBack</tt> property is set to true by default. +Thus, when a radio button is clicked a <tt>OnCallback</tt> event is +raised after <tt>OnSelectedIndexChanged</tt> event. +</p> + +<p class="block-content"> +With <tt>ActiveControl.EnableUpdate</tt> +set to true (default is true), changes to the selection will be updated +on the client side. +</p> + +<p class="block-content"> +List items can <b>not</b> be changed dynamically during a callback request. +</p> + +<p class="block-content"> +Please refer to the original documentation of <a href="?page=Controls.List">TRatingList</a> for usage. +</p> + +<com:RunBar PagePath="ActiveControls.Samples.TActiveRatingList.Home" /> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/ActiveControls/Home.page b/demos/quickstart/protected/pages/ActiveControls/Home.page index 9586f421..25590089 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Home.page @@ -1,15 +1,8 @@ <com:TContent ID="body" >
<h1 id="128031">Active Controls (AJAX enabled Controls)</h1>
-<p id="640423" class="block-content">See the <a href="?page=ActiveControls.Introduction">Introduction</a>
+<p id="640423" class="block-content">
+Active controls extends standard PRADO controls adding the ability to automatically update themselves on callbacks without the need of ad-hoc javascript calls. See the <a href="?page=ActiveControls.Introduction">Introduction</a>
for a quick overview of the concept behind active controls (AJAX enabled controls).
-Most active controls have a property of
-<a href="?page=ActiveControls.BaseActiveControl">ActiveControl</a> and
-a sub-property <a href="?page=ActiveControls.CallbackClientSide">ClientSide</a>
-that provides many properties to customize the controls. The
-<a href="?page=TCallbackClientScript">CallbackClient</a> property of the
-<tt>TPage</tt> class provides many methods to update and alter the client-side content
-during a callback request. Active controls is reliant on a collection
-of <a href="?page=ActiveControl.ClientSideJavascript">javascript classes</a>.
</p>
<p id="640424" class="block-content">For a quick demo of active controls, try the <a href="?page=ActiveControls.ActiveButton">
@@ -104,11 +97,6 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria </li>
<li>
- <a href="">TActiveRatingList</a>
- is an EXPERIMENTAL class that displays clickable images that represent a TRadioButtonList.
- </li>
-
- <li>
<a href="?page=ActiveControls.ActiveTextBox">TActiveTextBox</a>
represents a text input field on a Web page.
It can collect single-line, multi-line or password text input from users.
@@ -144,6 +132,11 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria TActiveRadioButtonList displays a group of radiobuttons. Each radio button
can perform a callback request.
</li>
+
+ <li>
+ <a href="?page=ActiveControls.ActiveRatingList">TActiveRatingList</a>
+ is an EXPERIMENTAL class that displays clickable images that represent a TRadioButtonList.
+ </li>
</ul>
<h2 id="134001">Active Data Controls</h2>
@@ -201,9 +194,9 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria monitors (using a timer) an attribute of an HTML element and triggers a callback request
when the attribute value changes.
</li>
-
+
<li>
- <a href="?page=ActiveControls.DragDrop">TDropContainer & TDraggable</a> represents drag and drop containers.
+ <a href="?page=ActiveControls.DragDrop">TDropContainer & TDraggable</a> represents drag and drop containers.
The former will make its child controls "draggable" while the latter will raise a callback when a draggable
control is dropped on it.
</li>
@@ -357,7 +350,7 @@ if Javascript was disabled on the client's browser.</p> </td>
<td>Yes</td><td>No</td>
</tr>
-
+
<tr><td>
<a href="?page=ActiveControls.DragDrop">TDropContainer</a>
</td>
@@ -370,95 +363,7 @@ if Javascript was disabled on the client's browser.</p> <td>No</td><td>No</td>
</tr>
-
-</table>
-
-<h2 id="128036">Active Control Basic Infrastructure Classes</h2>
-<p id="640427" class="block-content">The following classes provide the basic infrastructure classes required to
-realize the active controls. They can be useful to develop new active controls, but Prado users tipically don't need
-to use them.</p>
-<ul id="u4" class="block-content">
- <li>
- <h3 id="190038">TActiveControlAdapter</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveControlAdapter" />
- <p class="block-content">
- <tt>TActiveControlAdapter</tt> customizes the parent TControl class for active control classes.
- It tracks changes in the viewstate values of the control and update
- differences of the client-side HTML element attributes.
- </p>
- </li>
-
- <li>
- <h3 id="190039">TActiveListControlAdapter</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveListControlAdapter" />
- <p class="block-content">
- <tt>TActiveListControlAdapter</tt> allows the adapted list controls to change the selections
- on the client-side during a callback request.
- </p>
- </li>
-
- <li>
- <h3 id="190040">TActivePageAdapter</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActivePageAdapter" />
- <p class="block-content">
- <tt>TActivePageAdapter</tt> process the page life-cycle for callback requests.
- </p>
- </li>
-
- <li>
- <h3 id="190041">TBaseActiveControl</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TBaseActiveControl" />
- <p class="block-content">
- <tt>TBaseActiveControl</tt> class provided additional basic properties common for every
- active control. An instance of <tt>TBaseActiveControl</tt> or its decendent
- <tt>TBaseActiveCallbackControl</tt> is created by <tt>TActiveControlAdapter::getBaseActiveControl()</tt>
- method.
- The <tt>EnableUpdate</tt> property determines wether the active
- control is allowed to update the contents of the client-side when the callback
- response returns.
- </p>
- </li>
-
- <li>
- <h3 id="190042">TCallbackResponseAdapter</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TCallbackResponseAdapter" />
- <p class="block-content">
- <tt>TCallbackResponseAdapter</tt> alters the <tt>THttpResponse</tt>'s outputs.
- A <tt>TCallbackResponseWriter</tt> is used instead of the <tt>TTextWrite</tt> when
- <tt>createHtmlWriter</tt> is called. Each call to createHtmlWriter will create
- a new <tt>TCallbackResponseWriter</tt>. When <tt>flushContent()</tt> is called each
- instance of <tt>TCallbackResponseWriter</tt>'s content is flushed.
- The callback response data can be set using the <tt>ResponseData</tt> property.
- </p>
- </li>
-
-</ul>
-
-<h2 id="190037">Active Control Infrastructure Advanced Classes</h2>
-<p class="block-content">The following classes provide advanced properties and events needed to realize the active controls.
-A Prado user can use them to customize active controls behaviour and interact directly with the client side during a callback.
-</p>
-<ul class="block-content">
- <li>
- <a href="?page=ActiveControls.CallbackClientScript">TCallbackClientScript</a>
- methods to manipulate the client-side HTML elements, also includes methods
- to invoke javascript Effects on HTML elements.
- </li>
- <li>
- <a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a>
- is used to specify client-side callback request options and client-side event handlers.
- </li>
-
- <li>
- <a href="?page=ActiveControls.CallbackEventParameter">TCallbackEventParameter</a>
- provides the parameter passed during the callback request.
- </li>
-
- <li>
- <a href="?page=ActiveControls.CallbackOptions">TCallbackOptions</a>
- allows a common set of callback client-side options to be attached to one or more active controls.
- </li>
-</ul>
+</table>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Introduction.page b/demos/quickstart/protected/pages/ActiveControls/Introduction.page index 70cb9cbf..edc0b5bc 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Introduction.page +++ b/demos/quickstart/protected/pages/ActiveControls/Introduction.page @@ -1,7 +1,204 @@ <com:TContent ID="body">
-<h1 id="130037">Overview of Active Controls</h1>
-
-TODO:
+<h1 id="130037">AJAX: Introduction</h1>
+<p class="block-content">
+A classic webpage can only transfer data back to the server using an http postback request that requires a full page reload. This is a problem for web applications, since a synchronous page reload breaks the user interaction: the user must wait for the response to arrive and the page will lose its current status (the scrolling position, the currently focused control, etc..).
+</p>
<img src=<%~ postback-callback.png %> class="figure" />
+<p class="block-content">
+A common solution to this problem is the use of AJAX (Asynchronous JavaScript and XML) callbacks. After the first full page load, the web application can make subsequents requests using javascript. The callback requests are asynchronous, so the user can continue to interact with the page while the response is loading. The response contains a list of changes that will be applied to the page "on the fly", like replacing existing elements with new content or add some css style to an existing element.
+</p>
+
+<h2>Interacting with a page on callback</h2>
+
+<p class="block-content">
+PRADO has builtin support for AJAX callbacks in the form of <i>Active Controls</i>. These controls can trigger a callback request and have their properties (value, css style, attributes, ..) updated during a callback.
+Before digging inside the list of Active Controls, it's good to have a look to how a page can be aware if the current request is a callback and how to interact with the page rendered on the client browser.
+<br/>
+The <tt>IsCallBack</tt> property of the <tt>TPage</tt> class exposes whether the current request being handled is the consequence of a callback, and the <a href="?page=ActiveControls.CallbackClientScript">CallbackClient</a> property provides many methods to update and alter the client-side content during a callback request.
+</p>
+
+<com:TTextHighlighter CssClass="source block-content">
+public function onClick($sender, $param)
+{
+ if($this->IsCallback)
+ {
+ $this->getCallbackClient()->hide($this->TextBox1);
+ }
+}
+</com:TTextHighlighter>
+
+<h1>Active Controls (AJAX enabled Controls)</h1>
+<p class="block-content">
+Active controls extends standard PRADO controls adding the ability to automatically update themselves on callbacks without the need of ad-hoc javascript calls. Active controls are reliant on a collection of javascript classes that gets added to the page automatically when needed.
+</p>
+
+<p class="block-content">
+Most active controls have a <tt>ActiveControl.EnableUpdate</tt> property that determines whether the active control is allowed to update the contents of the client-side when the callback response returns. Depending on the control different properties can be updated.
+</p>
+
+<p class="block-content">
+Some active controls can trigger a callback as a consequence of a clientside event (a button click, a checkbox being checked, a DOM event). The callback will first raise the normal serverside event associated to the control (eg: OnClick for a <tt>TButton</tt> or OnSelectedIndexChanged for a <tt>TRadioButtonList</tt>) and then the <tt>OnCallBack</tt> event.
+The <tt>AutoPostBack</tt> property typically defaults to true for these controls.
+</p>
+</p>
+
+<p class="block-content">
+Active controls have a <a href="?page=ActiveControls.CallbackClientSide">ClientSide</a> property that provides many subproperties to customize the controls and to hook some javascript code to the callback lifecycle, like showing a "Loading" logo at the start of a callback and hide it at the end.
+</p>
+
+<h2 id="122027">TActiveButton Class Diagram</h2>
+<p id="610414" class="block-content">The class diagram for <tt>TActiveButton</tt> is illustrated in the figure below.
+Most active control that can perform callback request have a similar structure.
+</p>
+
+<img src=<%~ TActiveButtonClass.png %> class="figure"
+ alt="TActiveButton class diagram" title="TActiveButton class diagram" />
+
+<p id="610415" class="block-content"><tt>TActiveButton</tt> is an extension of <a href="?page=Controls.Button">TButton</a>
+and implements two additional interfaces <tt>ICallbackEventHandler</tt> and
+<tt>IActiveControl</tt>. The <tt>TActiveButton</tt> contains an instance of
+<a href="?page=ActiveControls.BaseActiveControl">TBaseActiveCallbackControl</a>
+available through the <tt>ActiveControl</tt> property of <tt>TActiveButton</tt>.
+The following example set the callback parameter of the <tt>TActiveButton</tt> when
+a callback request is dispatched.
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code1">
+<com:TActiveButton
+ Text="Click Me"
+ OnCallback="button_callback"
+ ActiveControl.CallbackParameter="value" />
+</com:TTextHighlighter>
+<p id="610416" class="block-content">In the <tt>OnCallback</tt> event handler method, the <tt>CallbackParameter</tt>
+is available in the <tt>$param</tt> object.</p>
+<com:TTextHighlighter Language="php" CssClass="source block-content" id="code2">
+public function button_callback($sender, $param)
+{
+ echo $param->CallbackParameter; //outputs "value"
+}
+</com:TTextHighlighter>
+
+<h2 id="122028">Adding Client Side Behaviour</h2>
+
+<p id="610417" class="block-content">With in the <tt>ActiveControl</tt> property is an instance of
+<a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a> available
+as a property <tt>ClientSide</tt> of <tt>TActiveButton</tt>.
+The <tt>ClientSide</tt> property contains sub-properties, such as <tt>RequestTimeOut</tt>,
+and client-side javascript event handler, such as <tt>OnLoading</tt>,
+that are used by the client-side when making a callback request.
+The following example demonstrates the toggling of a "loading" indicator
+when the client-side is making a callback request.
+</p>
+
+<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code3">
+<com:TClientScript PradoScripts="effects" />
+<span id="callback_status">Loading...</span>
+
+<com:TActiveButton
+ Text="Click Me"
+ OnCallback="button_callback"
+ ActiveControl.CallbackParameter="value" >
+ <prop:ClientSide
+ OnLoading="Element.show('callback_status')"
+ OnComplete="Element.hide('callback_status')" />
+</com:TActiveButton>
+</com:TTextHighlighter>
+
+<p id="610418" class="block-content">The example loads the "effects" javascript library using the
+<a href="?page=Controls.ClientScript">TClientScript</a> component.
+The <tt>ClientSide.OnLoading</tt> property value contains
+javascript statement that uses the "effects" library to show the "Loading..."
+span tag. Similarly, <tt>ClientSide.OnComplete</tt> property
+value contains the javascript statement that hides the "Loading..." span tag.
+See <a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a> for
+further details on client-side property details.
+</p>
+
+<h2 id="128036">Active Control Basic Infrastructure Classes</h2>
+<p id="640427" class="block-content">The following classes provide the basic infrastructure classes required to
+realize the active controls. They can be useful to develop new active controls, but Prado users tipically don't need
+to use them.</p>
+<ul id="u4" class="block-content">
+ <li>
+ <h3 id="190038">TActiveControlAdapter</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveControlAdapter" />
+ <p class="block-content">
+ <tt>TActiveControlAdapter</tt> customizes the parent TControl class for active control classes.
+ It tracks changes in the viewstate values of the control and update
+ differences of the client-side HTML element attributes.
+ </p>
+ </li>
+
+ <li>
+ <h3 id="190039">TActiveListControlAdapter</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveListControlAdapter" />
+ <p class="block-content">
+ <tt>TActiveListControlAdapter</tt> allows the adapted list controls to change the selections
+ on the client-side during a callback request.
+ </p>
+ </li>
+
+ <li>
+ <h3 id="190040">TActivePageAdapter</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActivePageAdapter" />
+ <p class="block-content">
+ <tt>TActivePageAdapter</tt> process the page life-cycle for callback requests.
+ </p>
+ </li>
+
+ <li>
+ <h3 id="190041">TBaseActiveControl</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TBaseActiveControl" />
+ <p class="block-content">
+ <tt>TBaseActiveControl</tt> class provided additional basic properties common for every
+ active control. An instance of <tt>TBaseActiveControl</tt> or its decendent
+ <tt>TBaseActiveCallbackControl</tt> is created by <tt>TActiveControlAdapter::getBaseActiveControl()</tt>
+ method.
+ The <tt>EnableUpdate</tt> property determines wether the active
+ control is allowed to update the contents of the client-side when the callback
+ response returns.
+ </p>
+ </li>
+
+ <li>
+ <h3 id="190042">TCallbackResponseAdapter</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TCallbackResponseAdapter" />
+ <p class="block-content">
+ <tt>TCallbackResponseAdapter</tt> alters the <tt>THttpResponse</tt>'s outputs.
+ A <tt>TCallbackResponseWriter</tt> is used instead of the <tt>TTextWrite</tt> when
+ <tt>createHtmlWriter</tt> is called. Each call to createHtmlWriter will create
+ a new <tt>TCallbackResponseWriter</tt>. When <tt>flushContent()</tt> is called each
+ instance of <tt>TCallbackResponseWriter</tt>'s content is flushed.
+ The callback response data can be set using the <tt>ResponseData</tt> property.
+ </p>
+ </li>
+
+</ul>
+
+<h2 id="190037">Active Control Infrastructure Advanced Classes</h2>
+<p class="block-content">The following classes provide advanced properties and events needed to realize the active controls.
+A Prado user can use them to customize active controls behaviour and interact directly with the client side during a callback.
+</p>
+<ul class="block-content">
+ <li>
+ <a href="?page=ActiveControls.CallbackClientScript">TCallbackClientScript</a>
+ methods to manipulate the client-side HTML elements, also includes methods
+ to invoke javascript Effects on HTML elements.
+ </li>
+
+ <li>
+ <a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a>
+ is used to specify client-side callback request options and client-side event handlers.
+ </li>
+
+ <li>
+ <a href="?page=ActiveControls.CallbackEventParameter">TCallbackEventParameter</a>
+ provides the parameter passed during the callback request.
+ </li>
+
+ <li>
+ <a href="?page=ActiveControls.CallbackOptions">TCallbackOptions</a>
+ allows a common set of callback client-side options to be attached to one or more active controls.
+ </li>
+</ul>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php index 30ef750b..7d3163dc 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php @@ -9,12 +9,12 @@ class Home extends TPage parent::onInit($param); if (!$this->getIsPostBack() && !$this->getIsCallBack()) { - + $this->populateProductList(); $this->populateShoppingList(); } } - + private function getProductData () { return array ( @@ -30,38 +30,41 @@ class Home extends TPage ) ); } - + private function getProduct ($key) { foreach ($this->getProductData() as $product) if ($product['ProductId']==$key) return $product; - return null; + return null; } - + protected function populateProductList () { $this->ProductList->DataSource=$this->getProductData(); $this->ProductList->Databind(); } - + protected function populateShoppingList () { $this->ShoppingList->DataSource=$this->getShoppingListData(); $this->ShoppingList->Databind(); - + } - - + + public function getShoppingListData () { + $a=$this->getViewState('ShoppingList', array ()); + var_export($a); return $this->getViewState('ShoppingList', array ()); } - + public function setShoppingListData ($value) { + var_export($value); $this->setViewState('ShoppingList', TPropertyValue::ensureArray($value), array ()); } - + public function addItemToCart ($sender, $param) { $control=$param->getDroppedControl(); @@ -82,9 +85,9 @@ class Home extends TPage $shoppingList[$key]['ProductCount']=1; } $this->setShoppingListData($shoppingList); - + } - + public function removeItemFromCart ($sender, $param) { $control=$param->getDroppedControl(); @@ -99,13 +102,13 @@ class Home extends TPage unset($shoppingList[$key]); } $this->setShoppingListData($shoppingList); - + } - + public function redrawCart ($sender, $param) { $this->populateShoppingList(); $this->cart->render($param->NewWriter); - + } } diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page index 1e030102..8482ae14 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page @@ -43,5 +43,4 @@ A button causing validation with <tt>OnCallback</tt>: </table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page index 139306f6..89543ef0 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page @@ -71,6 +71,5 @@ A checkbox validated by a required field validator: </table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page index 8ef69a9a..1d16235e 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page @@ -16,6 +16,5 @@ Custom validator using callbacks: </td></tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page index a3f10613..a7767e2d 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page @@ -66,5 +66,4 @@ Body contents </tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page index 79a4f540..57e08e1c 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page @@ -99,5 +99,4 @@ Choose page: jQuery('#wait').hide() </prop:ClientSide.OnComplete> </com:TActivePager> -<com:TJavascriptLogger/> </com:TContent> diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page index 360b6b0f..f3bfe843 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page @@ -20,5 +20,4 @@ anyway since they are placed inside the active panel. </com:TActivePanel>
</td></tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.page new file mode 100644 index 00000000..332ccb63 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.page @@ -0,0 +1,71 @@ +<com:TContent ID="body"> +<h1>TActiveRatingList Samples</h1> + +<table class="sampletable"> + +<tr><td class="samplenote"> +A simple TActiveRatingList and its caption: +</td><td class="sampleaction"> + +<com:TLabel ID="label1" Text="Rate it:" /> +<com:TActiveRatingList CaptionID="label1"> + <com:TListItem Text="Fair" /> + <com:TListItem Text="Average" /> + <com:TListItem Text="Good" /> + <com:TListItem Text="Excellent" /> +</com:TActiveRatingList> + +</td></tr> + +<tr><td class="samplenote"> +TActiveRatingList in vertical mode, SelectedIndex=2 +</td><td class="sampleaction"> + +<com:TLabel ID="label2" Text="Rate it:" /> +<com:TActiveRatingList CaptionID="label2" SelectedIndex="2" RepeatDirection="Vertical" Style="caption-side: right;"> + <com:TListItem Text="Poor" /> + <com:TListItem Text="Fair" /> + <com:TListItem Text="Average" /> + <com:TListItem Text="Good" /> + <com:TListItem Text="Excellent" /> + <com:TListItem Text="Super" /> +</com:TActiveRatingList> + +</td></tr> + +<tr><td class="samplenote"> +TActiveRatingList with RatingStyle=blocks, AutoPostback=true, SelectedValue=Good +</td><td class="sampleaction"> + +<com:TLabel ID="label3" Text="Rate it:" /> +<com:TActiveRatingList ID="Rating3" CaptionID="label3" RatingStyle="blocks" SelectedValue="Good" AutoPostBack="true" OnSelectedIndexChanged="rating3_selectionChanged"> + <com:TListItem Text="Poor" /> + <com:TListItem Text="Fair" /> + <com:TListItem Text="Average" /> + <com:TListItem Text="Good" /> + <com:TListItem Text="Excellent" /> + <com:TListItem Text="Super" /> +</com:TActiveRatingList> +<br/> +A label to check callback results: <com:TActiveLabel ID="labelResult3" /> + +</td></tr> + +<tr><td class="samplenote"> +TActiveRatingList with AllowInput=false, Rating=4.6 +</td><td class="sampleaction"> + +<com:TLabel ID="label4" Text="Rate it:" /> +<com:TActiveRatingList CaptionID="label4" AllowInput="false" Rating="4.6"> + <com:TListItem Text="Poor" /> + <com:TListItem Text="Fair" /> + <com:TListItem Text="Average" /> + <com:TListItem Text="Good" /> + <com:TListItem Text="Excellent" /> + <com:TListItem Text="Super" /> +</com:TActiveRatingList> + +</td></tr> + +</table> +</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.php new file mode 100644 index 00000000..5e8ed1bd --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.php @@ -0,0 +1,9 @@ +<?php + +class Home extends TPage +{ + protected function rating3_selectionChanged($sender, $param) + { + $this->labelResult3->Text=$this->Rating3->SelectedValue; + } +}
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page index 0b3f84fb..49b5bcb6 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page @@ -14,6 +14,5 @@ </com:TTable>
<com:TActiveLabel id="lblResult"/>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page index 81d53e13..3790d74b 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page @@ -2,7 +2,7 @@ <style type="text/css">
<!--
-.acomplete { position: relative; }
+.acomplete { position: relative; z-index: 5; background-color: #EDF5FF; border: 1px solid #243356; }
.acomplete ul, .acomplete li { margin: 0px; padding: 0px; list-style: none; color: #333; }
.acomplete li { padding: 4px; border-top: 1px solid #ccc; }
.acomplete .selected { background-color: #ffc; }
@@ -16,7 +16,7 @@ <tr><td class="samplenote">
Simple Autocompleter:
</td><td class="sampleaction">
-<com:TJuiAutoComplete
+<com:TAutoComplete
ID="AutoComplete"
OnSuggest="suggestNames"
OnSuggestionSelected="suggestionSelected1"
@@ -24,32 +24,31 @@ Simple Autocompleter: Suggestions.DataKeyField="id" >
<prop:Suggestions.ItemTemplate>
- <%# $this->Data['name'] %>
+ <li><%# $this->Data['name'] %></li>
</prop:Suggestions.ItemTemplate>
-</com:TJuiAutoComplete>
+</com:TAutoComplete>
<com:TActiveLabel ID="Selection1" />
</td></tr>
<tr><td class="samplenote">
Autocompleter with multiple selection:
</td><td class="sampleaction">
-<com:TJuiAutoComplete
+<com:TAutoComplete
ID="AutoComplete2"
OnSuggest="suggestNames"
OnSuggestionSelected="suggestionSelected2"
+ Separator=","
ResultPanel.CssClass="acomplete"
Suggestions.DataKeyField="id" >
<prop:Suggestions.ItemTemplate>
- <%# $this->Data['name'] %>
+ <li><%# $this->Data['name'] %></li>
</prop:Suggestions.ItemTemplate>
-</com:TJuiAutoComplete>
+</com:TAutoComplete>
(Use ',' to separate the selected suggestions)
<com:TActiveLabel ID="Selection2" />
</td></tr>
</table>
-<com:TJavascriptLogger />
-
-</com:TContent>
+</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php index f8cd904f..a3b9529b 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php @@ -1,5 +1,4 @@ <?php -Prado::using('System.Web.UI.JuiControls.*'); // $Id: Home.php 3189 2012-07-12 12:16:21Z ctrlaltca $ class Home extends TPage { @@ -8,7 +7,7 @@ class Home extends TPage $token=$param->getToken(); // Sender is the Suggestions repeater $sender->DataSource=$this->getDummyData($token); - $sender->dataBind(); + $sender->dataBind(); } public function suggestionSelected1($sender,$param) { diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page index 539909a9..84521acb 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page @@ -7,12 +7,37 @@ </p>
<h2>Actions</h2>
-<com:TRadioButtonList ID="radio1">
+<com:TClientScript PradoScripts="jqueryui" />
+<com:TStyleSheet>
+ .red_background {
+ background-color: red;
+ }
+</com:TStyleSheet>
+
+<com:TRadioButtonList ID="radio1" RepeatColumns="2">
<com:TListItem Value="1" Text="alert() me of something" />
<com:TListItem Value="2" Text="toggle Checkbox 1" />
<com:TListItem Value="3" Text="hide Label 1" />
<com:TListItem Value="4" Text="show Label 1" />
- <com:TListItem Value="5" Text="focus TextBox 1" />
+ <com:TListItem Value="5" Text="toggle Label 1 visibility" />
+ <com:TListItem Value="6" Text="toggle Label 1 (fade)" />
+ <com:TListItem Value="7" Text="toggle Label 1 (slide)" />
+ <com:TListItem Value="8" Text="highlight Label 1 (requires jQuery UI)" />
+ <com:TListItem Value="9" Text="focus TextBox 1" />
+ <com:TListItem Value="10" Text="scroll to CheckBox 1" />
+ <com:TListItem Value="11" Text="add red_background class to TextBox 1" />
+ <com:TListItem Value="12" Text="remove red_background class from TextBox 1" />
+ <com:TListItem Value="13" Text="animated resize TextBox 1" />
+ <com:TListItem Value="14" Text="set the 'disable' attribute on TextBox 1" />
+ <com:TListItem Value="15" Text="change the background color of Panel 1" />
+ <com:TListItem Value="16" Text="prepend and append some content inside Panel 1" />
+ <com:TListItem Value="17" Text="prepend and append some content outside Panel 1" />
+ <com:TListItem Value="18" Text="replace Panel 1 with some plain text" />
+ <com:TListItem Value="19" Text="remove TextBox 1" />
+ <com:TListItem Value="20" Text="fade out TextBox 1" />
+ <com:TListItem Value="21" Text="fade in TextBox 1" />
+ <com:TListItem Value="22" Text="trigger a click event on Panel 1" />
+ <com:TListItem Value="23" Text="call a specific effect on TextBox 1 (toggle)" />
</com:TRadioButtonList>
<br/><com:TActiveButton ID="button1" OnCallback="buttonCallback" Text="callback!" />
@@ -32,8 +57,17 @@ <td>TextBox 1:</td>
<td><com:TTextBox ID="txt1" Text="Sample text" /></td>
</tr>
+ <tr>
+ <td>Panel 1:</td>
+ <td>
+ <com:TPanel ID="pan1" Style="width:100px;height:100px;background:green" Attributes.OnClick="alert('clicked on Panel1')" >
+ Panel contents
+ </com:TPanel>
+ </td>
+ </tr>
</table>
-<com:TJavascriptLogger />
-
+<div style="height:900px">
+Thw following space is intentionally left blank for the scrolling test
+</div>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php index eeacb660..50a69911 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php @@ -8,7 +8,7 @@ class Home extends TPage switch($this->radio1->SelectedValue) { case 1: - $this->getCallbackClient()->evaluateScript("<script> alert('something'); </script>"); + $this->getCallbackClient()->evaluateScript("alert('something');"); break; case 2: $this->getCallbackClient()->check($this->check1, !$this->check1->Checked); @@ -20,8 +20,74 @@ class Home extends TPage $this->getCallbackClient()->show($this->label1); break; case 5: + $this->getCallbackClient()->toggle($this->label1); + break; + case 6: + $this->getCallbackClient()->toggle($this->label1, 'fade'); + break; + case 7: + $this->getCallbackClient()->toggle($this->label1, 'slide'); + break; + case 8: + $this->getCallbackClient()->highlight($this->label1); + break; + case 9: $this->getCallbackClient()->focus($this->txt1); break; + case 10: + $this->getCallbackClient()->scrollTo($this->check1, array('duration' => 1000, 'offset' => 10)); + break; + case 11: + $this->getCallbackClient()->addCssClass($this->txt1, 'red_background'); + break; + case 12: + $this->getCallbackClient()->removeCssClass($this->txt1, 'red_background'); + break; + case 13: + $this->getCallbackClient()->jQuery($this->txt1, 'animate', array( + array( 'width' => '+=100', + 'height' => '+=50' + ), + array( + 'duration' => 1000, + ) + )); + break; + case 14: + $this->getCallbackClient()->setAttribute($this->txt1, 'disabled', true); + break; + case 15: + $this->getCallbackClient()->setStyle($this->pan1, array('background-color' => 'blue')); + break; + case 16: + $this->getCallbackClient()->prependContent($this->pan1, 'prepend<br/>'); + $this->getCallbackClient()->appendContent($this->pan1, '<br/>append'); + break; + case 17: + $this->getCallbackClient()->insertContentBefore($this->pan1, 'before'); + $this->getCallbackClient()->insertContentAfter($this->pan1, 'after'); + break; + case 18: + $this->getCallbackClient()->replaceContent($this->pan1, 'No more Panel 1'); + break; + case 19: + $this->getCallbackClient()->remove($this->txt1); + break; + case 20: + $this->getCallbackClient()->fadeOut($this->txt1); + break; + case 21: + $this->getCallbackClient()->fadeIn($this->txt1); + break; + case 22: + $this->getCallbackClient()->click($this->pan1); + // alternative + // $this->getCallbackClient()->raiseClientEvent($this->pan1, 'click'); + break; + case 23: + $this->getCallbackClient()->jQuery($this->txt1, 'toggle'); + break; + } } } diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page index 0d13bb90..0f94fd79 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page @@ -68,6 +68,5 @@ connection error has occured. </table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page index cfb041ea..8c6ccd02 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page @@ -72,6 +72,5 @@ The same TCallbackOptions can be shared among different controls, even of differ </td></tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Advanced/Error.page b/demos/quickstart/protected/pages/Advanced/Error.page index 24c7ead0..391997fb 100755 --- a/demos/quickstart/protected/pages/Advanced/Error.page +++ b/demos/quickstart/protected/pages/Advanced/Error.page @@ -71,7 +71,7 @@ The naming convention for the template files used for all other exceptions is as Again, if the preferred language is not found, PRADO will try to use <tt>exception.html</tt>, instead.
</p>
<div class="note">
-<b class="tip">CAUTION:</b> When saving a template file, please make sure the file is saved using UTF-8 encoding. On Windows, you may use <tt>Notepad.exe</tt> to accomplish such saving.
+<b class="tip">CAUTION:</b> When saving a template file, please make sure the file is saved using UTF-8 encoding. On Windows, you may use <tt>Notepad++</tt> to accomplish such saving.
</div>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php b/demos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php index 4eba37ee..0fea7ac2 100755 --- a/demos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php +++ b/demos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php @@ -2,17 +2,15 @@ /** * Language List * @author $Author: weizhuo $ - * @version $Id: LanguageList.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package prado.examples */ /** * * @author $Author: weizhuo $ - * @version $Id: LanguageList.php 3189 2012-07-12 12:16:21Z ctrlaltca $ */ -class LanguageList extends TTemplateControl +class LanguageList extends TTemplateControl { - + } diff --git a/demos/quickstart/protected/pages/Configurations/Templates1.page b/demos/quickstart/protected/pages/Configurations/Templates1.page index 22b693a6..6c2870f2 100755 --- a/demos/quickstart/protected/pages/Configurations/Templates1.page +++ b/demos/quickstart/protected/pages/Configurations/Templates1.page @@ -3,7 +3,7 @@ <p id="180166" class="block-content">
Templates are used to specify the presentational layout of controls. A template can contain static text, components, or controls that contribute to the ultimate presentation of the associated control. By default, an instance of <tt>TTemplateControl</tt> or its subclass may automatically load and instantiate a template from a file whose name is the same as the control class name. For page templates, the file name suffix must be <tt>.page</tt>; for other regular template controls, the suffix is <tt>.tpl</tt>.
</p>
-<p id="180167" class="block-content">The template format is like HTML, with a few PRADO-specifc tags, including <a href="#ct">component tags</a>, <a href="#tct">template control tags</a>, <a href="#cot">comment tags</a>, <a href="?page=Configurations.Templates2#dct">dynamic content tags</a>, and <a href="?page=Configurations.Templates3#dpt">dynamic property tags</a>. .
+<p id="180167" class="block-content">The template format is like HTML, with a few PRADO-specifc tags, including <a href="#ct">component tags</a>, <a href="#tct">template control tags</a>, <a href="#cot">comment tags</a>, <a href="?page=Configurations.Templates2#dct">dynamic content tags</a>, and <a href="?page=Configurations.Templates3#dpt">dynamic property tags</a>.
</p>
<a name="ct"></a>
diff --git a/demos/quickstart/protected/pages/Controls/Data.page b/demos/quickstart/protected/pages/Controls/Data.page index 3843b332..829a4ef5 100755 --- a/demos/quickstart/protected/pages/Controls/Data.page +++ b/demos/quickstart/protected/pages/Controls/Data.page @@ -2,6 +2,12 @@ <h1 id="5001">Data Controls</h1>
+<p class="block-content">
+Data controls are used to display a repeated content like a list or a table. The content is generated from a collection of items containing the data, called the <tt>DataSource</tt>, and a template describing the appearance, called <tt>Renderer</tt>.
+<br/>
+The process of assigning a DataSource to a Data control and render the template for each item is called <tt>data binding</tt>.
+</p>
+
<ul id="u1" class="block-content">
<li>
<a href="?page=Controls.DataList">TDataList</a> is used to display or modify a list of data items.
diff --git a/demos/quickstart/protected/pages/Controls/List.page b/demos/quickstart/protected/pages/Controls/List.page index ae8d86bf..5e78bb13 100755 --- a/demos/quickstart/protected/pages/Controls/List.page +++ b/demos/quickstart/protected/pages/Controls/List.page @@ -108,4 +108,6 @@ Since v3.1.1, <tt>TDropDownList</tt> starts to support prompt text (something li This is an EXPERIMENTAL class that displays clickable images that represent a TRadioButtonList.
</p>
+<com:RunBar PagePath="Controls.Samples.TRatingList.Home" />
+
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/NewControl.page b/demos/quickstart/protected/pages/Controls/NewControl.page index 10c789db..9a680f43 100755 --- a/demos/quickstart/protected/pages/Controls/NewControl.page +++ b/demos/quickstart/protected/pages/Controls/NewControl.page @@ -10,7 +10,7 @@ In general, there are two ways of writing new controls: composition of existing <h2 id="5402">Composition of Existing Controls</h2>
<p id="660430" class="block-content">
-Composition is the easiest way of creating new controls. It mainly involves instantiating existing controls, configuring them and making them the constituent components. The properties of the constituent components are exposed through <a href="?page=Fundamentals.Components">subproperties</a>.
+Composition is the easiest way of creating new controls. It mainly involves instantiating existing controls, configuring them and making them the constituent components. The properties of the constituent components are exposed through <a href="?page=Fundamentals.Components1">subproperties</a>.
</p>
<p id="660431" class="block-content">
One can compose a new control in two ways. One is to extend <tt>TCompositeControl</tt> and override the <tt>TControl::createChildControls()</tt> method. The other is to extend <tt>TTemplateControl</tt> (or its child classes) and write a control template. The latter is easier to use and can organize the layout constituent components more intuitively, while the former is more efficient because it does not require parsing of the template.
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page index de419172..6e6cb54d 100755 --- a/demos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page @@ -67,6 +67,5 @@ will be clicked because it is set as the default button of the panel. </com:TPanel>
</td></tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.page new file mode 100644 index 00000000..5790f840 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.page @@ -0,0 +1,71 @@ +<com:TContent ID="body"> +<h1>TRatingList Samples</h1> + +<table class="sampletable"> + +<tr><td class="samplenote"> +A simple TRatingList and its caption: +</td><td class="sampleaction"> + +<com:TLabel ID="label1" Text="Rate it:" /> +<com:TRatingList CaptionID="label1"> + <com:TListItem Text="Fair" /> + <com:TListItem Text="Average" /> + <com:TListItem Text="Good" /> + <com:TListItem Text="Excellent" /> +</com:TRatingList> + +</td></tr> + +<tr><td class="samplenote"> +TRatingList in vertical mode, SelectedIndex=2 +</td><td class="sampleaction"> + +<com:TLabel ID="label2" Text="Rate it:" /> +<com:TRatingList CaptionID="label2" SelectedIndex="2" RepeatDirection="Vertical" Style="caption-side: right;"> + <com:TListItem Text="Poor" /> + <com:TListItem Text="Fair" /> + <com:TListItem Text="Average" /> + <com:TListItem Text="Good" /> + <com:TListItem Text="Excellent" /> + <com:TListItem Text="Super" /> +</com:TRatingList> + +</td></tr> + +<tr><td class="samplenote"> +TRatingList with RatingStyle=blocks, AutoPostback=true, SelectedValue=Good +</td><td class="sampleaction"> + +<com:TLabel ID="label3" Text="Rate it:" /> +<com:TRatingList ID="Rating3" CaptionID="label3" RatingStyle="blocks" SelectedValue="Good" AutoPostBack="true" OnSelectedIndexChanged="rating3_selectionChanged"> + <com:TListItem Text="Poor" /> + <com:TListItem Text="Fair" /> + <com:TListItem Text="Average" /> + <com:TListItem Text="Good" /> + <com:TListItem Text="Excellent" /> + <com:TListItem Text="Super" /> +</com:TRatingList> +<br/> +A label to check postback results: <com:TLabel ID="labelResult3" /> + +</td></tr> + +<tr><td class="samplenote"> +TRatingList with AllowInput=false, Rating=4.6 +</td><td class="sampleaction"> + +<com:TLabel ID="label4" Text="Rate it:" /> +<com:TRatingList CaptionID="label4" AllowInput="false" Rating="4.6"> + <com:TListItem Text="Poor" /> + <com:TListItem Text="Fair" /> + <com:TListItem Text="Average" /> + <com:TListItem Text="Good" /> + <com:TListItem Text="Excellent" /> + <com:TListItem Text="Super" /> +</com:TRatingList> + +</td></tr> + +</table> +</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.php new file mode 100644 index 00000000..5e8ed1bd --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.php @@ -0,0 +1,9 @@ +<?php + +class Home extends TPage +{ + protected function rating3_selectionChanged($sender, $param) + { + $this->labelResult3->Text=$this->Rating3->SelectedValue; + } +}
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page index 9bd86078..c7506c67 100755 --- a/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page @@ -12,7 +12,6 @@ Highlighting PHP statements: $str = 'one|two|three|four';
// will output an array
print_r(explode('|', $str, 2));
-?>
</com:TTextHighlighter>
</td></tr>
diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page index 463f90a5..bac51351 100755 --- a/demos/quickstart/protected/pages/Controls/Standard.page +++ b/demos/quickstart/protected/pages/Controls/Standard.page @@ -1,7 +1,9 @@ <com:TContent ID="body" >
<h1 id="52001">Standard Controls</h1>
-<p id="260001" class="block-content">* the tutorial for this control is not completed yet.</p>
+<p class="block-content">
+ Standard controls are the most basic controls in PRADO. They can represent a simple html tag like an <input> or even more comple controls like a date picker or a WYSIWYG text area. Standard controls are in the <tt>System.Web.UI.WebControls</tt> namespace.
+</p>
<ul id="u1" class="block-content">
<li>
<a href="?page=Controls.Accordion">TAccordion</a> displays an accordion consisting of multiple views. At any time, only one view is visible.
diff --git a/demos/quickstart/protected/pages/Controls/TextHighlighter.page b/demos/quickstart/protected/pages/Controls/TextHighlighter.page index 1babbb33..5d3428f9 100755 --- a/demos/quickstart/protected/pages/Controls/TextHighlighter.page +++ b/demos/quickstart/protected/pages/Controls/TextHighlighter.page @@ -17,7 +17,6 @@ To use <tt>TTextHighlighter</tt>, simply enclose the contents to be syntax highl <?php
$str = 'one|two|three|four';
print_r(explode('|', $str, 2)); // will output an array
-?>
</com:TTextHighlighter>
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Controls/id/NewControl.page b/demos/quickstart/protected/pages/Controls/id/NewControl.page index ea083f6c..85c6eff0 100755 --- a/demos/quickstart/protected/pages/Controls/id/NewControl.page +++ b/demos/quickstart/protected/pages/Controls/id/NewControl.page @@ -10,7 +10,7 @@ Secara umum, ada dua cara penulisan kontrol baru: komposisi kontrol yang sudah a <h2 id="5402">Komposisi Kontrol yang Sudah Ada</h2>
<p id="660430" class="block-content">
-Komposisi adalah cara termudah membuat kontrol baru. Ia melibatkan terutama penurunan kontrol yang sudah ada, mengkonfigurasinya dan menjadikannya unsur komponen. Properti dari unsur komponen diperlihatkan melalui <a href="?page=Fundamentals.Components">subproperti</a>.
+Komposisi adalah cara termudah membuat kontrol baru. Ia melibatkan terutama penurunan kontrol yang sudah ada, mengkonfigurasinya dan menjadikannya unsur komponen. Properti dari unsur komponen diperlihatkan melalui <a href="?page=Fundamentals.Components1">subproperti</a>.
</p>
<p id="660431" class="block-content">
Seseorang dapat menciptakan sebuah kontrol baru dalam dua cara. Pertama adalah memperluas <tt>TCompositeControl</tt> dan mengganti metode <tt>TControl::createChildControls()</tt>. Kedua adalah memperluas <tt>TTemplateControl</tt> (atau kelas anaknya) dan menulis template kontrol. Yang terakhir lebih mudah digunakan dan bisa mengatur tata letak unsur komponen lebih intuitif, sementara pembentuk lebih efisien karena ia tidak perlu menguraikan template.
diff --git a/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page b/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page index b2b500b0..b1bb4ce7 100755 --- a/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page +++ b/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page @@ -17,7 +17,6 @@ Untuk menggunakan <tt>TTextHighlighter</tt>, cukup kurung konten yang sintaksnya <?php
$str = 'one|two|three|four';
print_r(explode('|', $str, 2)); // akan mengeluarkan array
-?>
</com:TTextHighlighter>
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page index 537c65e0..cf1485bd 100755 --- a/demos/quickstart/protected/pages/Database/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page @@ -129,7 +129,7 @@ You may specify qualified table names. E.g. for MySQL, <tt>TABLE = "`database1`. </div> <div class="note"><b class="note">Note:</b> -Since version <b>3.1.3</b> you can also use a method <tt>table()</tt> to define the table name. +Since version <b>3.1.3</b> you can also use a method <tt>table()</tt> to define the table name. This allows you to dynamically specify which table should be used by the ActiveRecord. <com:TTextHighlighter Language="php" CssClass="source block-content"> class TeamRecord extends TActiveRecord @@ -159,7 +159,7 @@ class UserRecord extends TActiveRecord { } } </com:TTextHighlighter> -<p id="710010" class="block-content">More details regarding TComponent can be found in the <a href="?page=Fundamentals.Components">Components documentation</a>. +<p id="710010" class="block-content">More details regarding TComponent can be found in the <a href="?page=Fundamentals.Components1">Components documentation</a>. Later we shall use the getter/setters to allow for lazy loading of relationship objects. </p> @@ -1128,7 +1128,7 @@ class PlayerRecord extends BaseFkRecord <p id="710046" class="block-content">We first need to change the <tt>$skills=array()</tt> declaration to a private property <tt>$_skills</tt> (notice the underscore) and set it to null instead. This allows us to define the <tt>skills</tt> property using getter/setter methods -(see <a href="?page=Fundamentals.Components">Components</a> for details). The <tt>getSkills()</tt> +(see <a href="?page=Fundamentals.Components1">Components</a> for details). The <tt>getSkills()</tt> getter method for the <tt>skills</tt> property will lazy load the corresponding skills foreign record when it is used as follows. Notice that we only do a lazy load when its <tt>$player_id</tt> is not null (that is, when the record is already fetched from the database or player id was already set). diff --git a/demos/quickstart/protected/pages/Database/id/ActiveRecord.page b/demos/quickstart/protected/pages/Database/id/ActiveRecord.page index 454aa3f9..8e81678e 100755 --- a/demos/quickstart/protected/pages/Database/id/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/id/ActiveRecord.page @@ -3,7 +3,7 @@ <com:SinceVersion Version="3.1a" /> <p id="690478" class="block-content">Rekaman Aktif adalah obyek yang melapisi baris dalam tabel atau view database, melindungi akses database dan menambahkan logika domain pada data tersebut. - Dasar dari Rekaman Aktif adalah kelas bisnis, sebagai contoh, kelas + Dasar dari Rekaman Aktif adalah kelas bisnis, sebagai contoh, kelas <tt>Products</tt>, yang hampir menyamai struktur rekaman dari tabel database dibawahnya. Setiap Rekaman Aktif akan bertanggung jawab atas penyimpanan dan pengambilan data ke dan dari database. </p> @@ -14,22 +14,22 @@ </div> <h2 id="138047">Kapan Menggunakannya</h2> -<p id="690479" class="block-content">Rekaman Aktif adalah pilihan yang baik untuk logika domain yang tidak terlalu rumit, +<p id="690479" class="block-content">Rekaman Aktif adalah pilihan yang baik untuk logika domain yang tidak terlalu rumit, seperti membuat, membaca, memutakhirkan, dan menghapus. Derivasi dan validasi didasarkan pada satu rekaman yang bekerja denga baik dalam struktur ini. Rekaman Aktif mempunyai kuntungan utama dalam hal kesederhanaan. Mudah untuk membangun Rekaman Aktif, dan mudah untuk dimengerti.</p> <p id="690480" class="block-content">Akan tetapi, seiring dengan perkembangan logika bisnis Anda dalm hal kompleksitas, Anda akan segera ingin menggunakan hubungan langsung obyek Anda, koleksi, turunan, dan seterusnya. Ini tidak mudah diterapkan ke dalam Rekaman Aktif, dan menambahkannya sedikit demi sedikit menjadi sangat kacau. Argumen lain terhadap Rekaman Aktif adalah kenyataan bahwa ia menyandingkan desin obyek ke desain database. Ini menjadikannya lebih sulit untuk merefraktorisasi karena proyek terus berjalan.</p> - - <p id="690481" class="block-content">Alternatifnya adalah menggunakan Pemeta Data yang yang memisahkan aturan dari obyek bisnis dan bagaimana obyek ini disimpan. + + <p id="690481" class="block-content">Alternatifnya adalah menggunakan Pemeta Data yang yang memisahkan aturan dari obyek bisnis dan bagaimana obyek ini disimpan. Prado menyediakan pilihan tambahan antara Rekaman Aktif dan - <a href="?page=Database.SqlMap">Pemeta Data SqlMap</a>. - Pemeta Data SqlMap bisa dipakai untuk mengambil obyek Rekaman Aktif, hasilnya; obyek Rekaman Aktif ini bisa dipakai untuk memutakhirkan database. + <a href="?page=Database.SqlMap">Pemeta Data SqlMap</a>. + Pemeta Data SqlMap bisa dipakai untuk mengambil obyek Rekaman Aktif, hasilnya; obyek Rekaman Aktif ini bisa dipakai untuk memutakhirkan database. "Hubungan" antara Rekaman Aktif dan <a href="?page=Database.SqlMap">SqlMap</a> digambarkan dalam diagram berikut. Lebih rinci mengenai Pemeta Data SqlMap dapat ditemukan dalam <a href="http://www.pradosoft.com/demos/sqlmap/">Manual SqlMap</a>. <img src=<%~ sqlmap_active_record.png %> alt="Rekaman Aktif dan SqlMap DataMapper" id="fig:diagram.png" class="figure"/> </p> - + <p id="690482" class="block-content"> Kelas Rekaman Aktif berfungsi untuk melakukan tugas-tugas berikut. </p> @@ -41,22 +41,22 @@ </ul> <h2>Implikasi Desain</h2> <p> -Implementasi Prado terhadap Rekaman Aktif tidak memelihara identitas referensial. Setiap obyek diperoleh menggunakan Rekaman Aktif pada data dalam database. Sebagai contoh, jika Anda meminta kustomer tertentu dan mendapatkan kembali obyek <tt>Customer</tt>, kali berikutnya Anda meminta kustomer itu, Anda akan kembali mendapatkan turunan lain dari obyek <tt>Customer</tt>. Ini berarti bahwa perbandingan tepat (misalnya menggunakan <tt>===</tt>) akan mengembalikan false, sementara perbandingan bebas (misalnya menggunakan <tt>==</tt>) akan mengembalikan true jika nilai obyek sama menurut perbandingan bebas. +Implementasi Prado terhadap Rekaman Aktif tidak memelihara identitas referensial. Setiap obyek diperoleh menggunakan Rekaman Aktif pada data dalam database. Sebagai contoh, jika Anda meminta kustomer tertentu dan mendapatkan kembali obyek <tt>Customer</tt>, kali berikutnya Anda meminta kustomer itu, Anda akan kembali mendapatkan turunan lain dari obyek <tt>Customer</tt>. Ini berarti bahwa perbandingan tepat (misalnya menggunakan <tt>===</tt>) akan mengembalikan false, sementara perbandingan bebas (misalnya menggunakan <tt>==</tt>) akan mengembalikan true jika nilai obyek sama menurut perbandingan bebas. <p> <p> Implikasi desain ini terkait dengan pertanyaan berikut. -<i>"Anda pikir kustomer sebagai obyek, di mana hanya satu, +<i>"Anda pikir kustomer sebagai obyek, di mana hanya satu, atau Anda pikir obyek yang Anda operasikan sebagai <b>duplikat</b> dari database?"</i> -Pemetaan O/R lain akan mengartikan bahwa hanya ada satu obyek Kustomer dengan custID 100, dan secara literal ia adalah kustomer. -Jika Anda mendapatkan kustomer dan mengubah field-nya, maka Anda sekarang telah mengubah kustomer itu. -<i>"Itu berbatasan dengan: Anda telah mengubah duplikat kustomer ini, tapi bukan pada duplikat itu. +Pemetaan O/R lain akan mengartikan bahwa hanya ada satu obyek Kustomer dengan custID 100, dan secara literal ia adalah kustomer. +Jika Anda mendapatkan kustomer dan mengubah field-nya, maka Anda sekarang telah mengubah kustomer itu. +<i>"Itu berbatasan dengan: Anda telah mengubah duplikat kustomer ini, tapi bukan pada duplikat itu. Dan jika dua orang memutakhirkan kustomer pada dua duplikat obyek, siapapun yang memutakhirkan pertama kali, atau mungkin yang terakhir yang menang."</i> [A. Hejlsberg 2003] </p> <h2 id="142010">Database yang Didukung</h2> <p id="p1" class="block-content"> -Implementasi Rekaman Aktif memanfaatkan kelas <a href="?page=Database.DAO">Prado DAO</a> untuk akses data. -Implementasi Rekaman Aktif saat ini mendukung database sebagai berikut. +Implementasi Rekaman Aktif memanfaatkan kelas <a href="?page=Database.DAO">Prado DAO</a> untuk akses data. +Implementasi Rekaman Aktif saat ini mendukung database sebagai berikut. </p> <ul> <li><a href="http://www.mysql.com">MySQL 4.1 atau lebih tinggi</a></li> @@ -69,8 +69,8 @@ Implementasi Rekaman Aktif saat ini mendukung database sebagai berikut. <h1 id="138048">Mendefinisikan Rekaman Aktif</h1> <p id="690483" class="block-content">Mari kita anggap tabel - "<tt>users</tt>" berikut yang berisi dua kolom bernama "<tt>username</tt>" dan "<tt>email</tt>", - di mana "<tt>username</tt>" juga merupakan kunci primer. + "<tt>users</tt>" berikut yang berisi dua kolom bernama "<tt>username</tt>" dan "<tt>email</tt>", + di mana "<tt>username</tt>" juga merupakan kunci primer. <com:TTextHighlighter Language="sql" CssClass="source block-content" id="code_690147"> CREATE TABLE users ( @@ -88,7 +88,7 @@ class UserRecord extends TActiveRecord public $username; //kolom bernama "username" dalam tabel "users" public $email; - + /** * @return TActiveRecord active record finder instance */ @@ -116,7 +116,7 @@ Anda dapat menetapkan nama-nama tabel yang memenuhi syarat. Contohnya untuk MySQ <com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690149"> class UserRecord extends TActiveRecord { ... //definisi yang sudah ada seprti di atas - + private $_level; public function setLevel($value) { $this->_level=TPropertyValue::ensureInteger($value,0); @@ -126,18 +126,18 @@ class UserRecord extends TActiveRecord { } } </com:TTextHighlighter> -<p id="710010" class="block-content">Lebih jelas mengenai TComponent dapat ditemukan dalam <a href="?page=Fundamentals.Components">Dokumentasi komponen</a>. +<p id="710010" class="block-content">Lebih jelas mengenai TComponent dapat ditemukan dalam <a href="?page=Fundamentals.Components1">Dokumentasi komponen</a>. Nantinya kita harus dapat menggunakan pengambil/penyetel guna membolehkan pengambilan malas atas obyek yang berhubungan. </p> <div class="info"><b class="note">Info:</b> <tt>TActiveRecord</tt> juga dapat bekerja dengan view database dengan menetapkan konstan <tt>TABLE</tt> terkait ke nama view. Akan tetapi, obyek yang dikembalikan dari view hanya-baca, memanggil metode -<tt>save()</tt> atau <tt>delete()</tt> akan memunculkan eksepsi. +<tt>save()</tt> atau <tt>delete()</tt> akan memunculkan eksepsi. </div> <p id="690486" class="block-content"> - Metode statis <tt>finder()</tt> mengembalilkan turunan <tt>UserRecord</tt> + Metode statis <tt>finder()</tt> mengembalilkan turunan <tt>UserRecord</tt> yang dapat dipakai untuk mengambil rekaman dari database. Pengambilan rekaman menggunakan metode finder akan didiskusikan nanti. Metode statis <tt>TActiveRecord::finder()</tt> mengambil nama kelas Rekaman Aktif sebagai parameter. </p> @@ -152,7 +152,7 @@ obyek yang dikembalikan dari view hanya-baca, memanggil metode $dsn = 'pgsql:host=localhost;dbname=test'; //Postgres SQL $conn = new TDbConnection($dsn, 'dbuser','dbpass'); TActiveRecordManager::getInstance()->setDbConnection($conn); -</com:TTextHighlighter> +</com:TTextHighlighter> <p id="710011" class="block-content">Alternatifnya, Anda dapat membuat basis kelas dan mengganti metode <tt>getDbConnection()</tt> untuk mengembalikan koneksi database. Ini adalah cara sederhana untuk mengijinkan koneksi database multipel. Kode berikut mendemonstrasikan penetapan koneksi database dalam sebuah basis kelas (tidak perlu menyetel koneksi DB di manapun juga). @@ -178,13 +178,13 @@ class MyDb2Record extends TActiveRecord return $conn; } } -</com:TTextHighlighter> +</com:TTextHighlighter> <h3 class="prado-specific">Menggunakan <tt>application.xml</tt> di dalam Kerangka Kerja Prado</h3> <div class="prado-specific"> <p id="690488" class="block-content"> - Koneksi database standar dapat juga dikonfigurasi menggunakan tag <tt><module></tt> dalam <a href="?page=Configurations.AppConfig">application.xml</a> + Koneksi database standar dapat juga dikonfigurasi menggunakan tag <tt><module></tt> dalam <a href="?page=Configurations.AppConfig">application.xml</a> atau <a href="?page=Configurations.PageConfig">config.xml</a> seperti berikut. <com:TTextHighlighter Language="xml" CssClass="source block-content" id="code_690151"> <modules> @@ -192,8 +192,8 @@ class MyDb2Record extends TActiveRecord <database ConnectionString="pgsql:host=localhost;dbname=test" Username="dbuser" Password="dbpass" /> </module> -</modules> -</com:TTextHighlighter> +</modules> +</com:TTextHighlighter> <div class="tip"><b class="note">Tip:</b> Atribut <tt>EnableCache</tt> ketika disetel ke "true" akan melakukan cache meta data tabel, yakni nama kolom tabel, indeks dan batasan yang disimpan dalam cache dan dipakai ulang. Anda harus membersihkan atau mematikan cache jika Anda ingin melihat perubahan terhadap definisi tabel Anda. <a href="?page=Advanced.Performance#6402">Modul cache</a> juga harus didefinisikan agar cache berfungsi. </div> @@ -207,13 +207,13 @@ class MyDb2Record extends TActiveRecord Username="dbuser" Password="dbpass" /> </module> - <module class="System.Data.ActiveRecord.TActiveRecordConfig" + <module class="System.Data.ActiveRecord.TActiveRecordConfig" ConnectionID="db1" EnableCache="true" /> <module class="System.Data.SqlMap.TSqlMapConfig" ConnectionID="db1" ... /> -</modules> -</com:TTextHighlighter> +</modules> +</com:TTextHighlighter> </p> </div> @@ -299,10 +299,10 @@ $criteria->Offset = 20; <div class="note"><b class="note">Catatan:</b> Untuk MSSQL dan saat <tt>Limit</tt> serta <tt>Offset</tt> berisi nilai integer positif. Query aktual yang dijalankan diubah oleh kelas -<com:DocLink ClassPath="System.Data.ActiveRecord.Common.Mssql.TMssqlCommandBuilder" +<com:DocLink ClassPath="System.Data.ActiveRecord.Common.Mssql.TMssqlCommandBuilder" Text="TMssqlCommandBuilder" /> -berdasarkan pada +berdasarkan pada <a href="http://troels.arvin.dk/db/rdbms/#select-limit-offset">http://troels.arvin.dk/db/rdbms/</a> untuk mengemulasikan kondisi <tt>Limit</tt> dan <tt>Offset</tt>. </div> @@ -332,11 +332,11 @@ $finder->find('Username = ? AND Password = ?', $name, $pass); $finder->findAllByAge($age); $finder->findAll('Age = ?', $age); </com:TTextHighlighter> - + <div class="tip"><b class="note">Tip:</b> Anda juga dapat menggunakan kombinasi <tt>AND</tt> dan <tt>OR</tt> sebagai kondisi dalam metode dinamis. </div> - + <h3 id="138060"><tt>findBySql()</tt> dan <tt>findAllBySql()</tt></h3> <p id="690497" class="block-content">Mencari rekaman menggunakan SQL penuh di mana <tt>findBySql()</tt> mengembalikan Rekaman Aktif dan <tt>findAllBySql()</tt>mengembalikan array obyek rekaman. Untuk setiap kolom yang dikembalikan, kelas Rekaman Aktif terkait harus mendefinisikan variabel atau properti untuk setiap nama kolom terkait. @@ -371,7 +371,7 @@ Obyek dimutakhirkan dengan kunci primer dari tabel itu yang berisi definisi yang Sebagai contoh, jika Anda menyisipkan sebuah rekaman baru ke dalam tabel MySQL yang kolomnya didefinisikan dengan "autoincrement", obyek Rekaman Aktif akan dimutakhirkan dengan nilai yang ditambahkan.</div> <p id="690500" class="block-content"> -Untuk memutakhirkan rekaman dalam database, cukup ubah satu atau lebih properti obyek Rekaman Aktif yang sudah diambil dari database dan kemudian panggil metode <tt>save()</tt>. +Untuk memutakhirkan rekaman dalam database, cukup ubah satu atau lebih properti obyek Rekaman Aktif yang sudah diambil dari database dan kemudian panggil metode <tt>save()</tt>. <com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690162"> $user = UserRecord::finder()->findByName('admin'); @@ -392,7 +392,7 @@ Kapan saja Anda memanggil metode <tt>save()</tt> pada obyek TActiveRecord, obyek <h2 id="138052">Menghapus rekaman yang sudah ada</h2> <p id="690502" class="block-content"> Untuk menghapus rekaman yang sudah ada dan diambil, cukup panggil metode <tt>delete()</tt>. - Anda juga dapat menghapus rekaman dalam database dengan kunci primer tanpa mengambil rekaman apapun menggunakan metode <tt>deleteByPk()</tt> (dan metode yang sama <tt>deleteAllByPks()</tt>). + Anda juga dapat menghapus rekaman dalam database dengan kunci primer tanpa mengambil rekaman apapun menggunakan metode <tt>deleteByPk()</tt> (dan metode yang sama <tt>deleteAllByPks()</tt>). Sebagai contoh, untuk menghapus satu atau beberapa rekaman dengan menggunakan satu atau lebih kunci primer. </p> <com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690163"> @@ -457,8 +457,8 @@ TActiveRecord menawarkan dua event, <tt>OnCreateCommand</tt> dan <tt>OnExecuteCo </p> <p id="710015" class="block-content"> -Event <tt>OnExecuteCommand</tt> dimunculkan ketika perintah dijalankan dan hasil dari database dikembalikan. Obyek parameter <tt>TDataGatewayResultEventParameter</tt> -dari properti <tt>Result</tt> berisi data yang dikembalikan dari database. +Event <tt>OnExecuteCommand</tt> dimunculkan ketika perintah dijalankan dan hasil dari database dikembalikan. Obyek parameter <tt>TDataGatewayResultEventParameter</tt> +dari properti <tt>Result</tt> berisi data yang dikembalikan dari database. Data yang dikembalikan dapat diubah dengan setelan properti <tt>Result</tt>. </p> @@ -491,7 +491,7 @@ function logger($sender,$param) } TActiveRecord::finder('MyRecord')->OnExecuteCommand[] = 'logger'; $obj->OnExecuteCommand[] = array($logger, 'log'); //setiap PHP callback yg benar. -</com:TTextHighlighter> +</com:TTextHighlighter> <h1 id="ar_relations">Hubungan Rekaman Aktif</h1> <com:SinceVersion Version="3.1rc1" /> @@ -507,7 +507,7 @@ Dalam bagian berikut kita akan menganggap hubungan tabel antara <img src=<%~ ar_relations.png %> class="figure" /> -<p id="710018" class="block-content">Tujuannya adalah untuk mendapatkan model obyek yang mewakili ke beberapa derajat hubungan entitas dalam gambar di atas. +<p id="710018" class="block-content">Tujuannya adalah untuk mendapatkan model obyek yang mewakili ke beberapa derajat hubungan entitas dalam gambar di atas. </p> <img src=<%~ ar_objects.png %> class="figure" /> @@ -534,7 +534,7 @@ CREATE TABLE bar </div> <h2 id="142012">Pemetaan Kunci Asing</h2> -<p class="block-content">Hubungan entitas antara tabel <tt>Teams</tt> dan <tt>Players</tt> adalah apa yang dikenal sebagai hubungan 1-M. Yaitu, satu Tim dapat berisi 0 atau lebih Pemain. Dalam batasan hubungan obyek, kita katakan bahwa obyek <tt>TeamRecord</tt> <b>memiliki banyak</b> obyek <tt>PlayerRecord</tt>. +<p class="block-content">Hubungan entitas antara tabel <tt>Teams</tt> dan <tt>Players</tt> adalah apa yang dikenal sebagai hubungan 1-M. Yaitu, satu Tim dapat berisi 0 atau lebih Pemain. Dalam batasan hubungan obyek, kita katakan bahwa obyek <tt>TeamRecord</tt> <b>memiliki banyak</b> obyek <tt>PlayerRecord</tt>. (Perhatikan kebalikan dari arah hubungan antara tabel dan obyek.) <p id="710019" class="block-content"> @@ -548,7 +548,7 @@ class TeamRecord extends TActiveRecord const TABLE='Teams'; public $name; public $location; - + public $players=array(); // deklarasi ini tidak diperlukan lagi sejak v3.1.2 //mendefinisikan anggota $player yang memiliki hubungan banyak dengan PlayerRecord @@ -616,7 +616,7 @@ Metode <tt>with_xxx()</tt> (di mana <tt>xxx</tt> adalah nama properti hubungan, <div class="note"><b class="note">Catatan:</b> Penting untuk dimengerti bahwa obyek terkait diambil menggunakan query tambahan. Query pertama mengambil obyek sumber, misalnya <tt>TeamRecord</tt> dalam contoh kode di atas. -Query kedua dipakai untuk mengambil obyek <tt>PlayerRecord</tt> terkait. +Query kedua dipakai untuk mengambil obyek <tt>PlayerRecord</tt> terkait. Penggunaan dua query mirip dengan query tunggal menggunakan Left-Outer join dengan eksepsi bahwa hasil null pada tabel kanan tidak dikembalikan. Konsekuensi pemakaian dua tau lebih query adalah kondisi agregat dan join tidak layak menggunakan Rekaman Aktif. Untuk query di luar lingkup Rekaman Aktif, <a href="?page=Database.SqlMap">Pemeta Data SqlMap</a> diapat dupertimbangkan. </div> @@ -634,9 +634,9 @@ Kode berikut mendefinisikan kelas <tt>PlayerRecord</tt> lengkap dengan 3 hubunga class PlayerRecord extends TActiveRecord { const TABLE='Players'; - public $player_id; - public $age; - public $team_name; + public $player_id; + public $age; + public $team_name; public $team; // deklarasi ini tidak diperlukan lagi sejak v3.1.2 public $skills=array(); // deklarasi ini tidak diperlukan lagi sejak v3.1.2 @@ -656,9 +656,9 @@ class PlayerRecord extends TActiveRecord } </com:TTextHighlighter> <p id="710026" class="block-content"> -Properti <tt>$RELATIONS</tt> dari <tt>PlayerRecord</tt> mendefinisikan properti <tt>$team</tt> <b>milik</b> <tt>TeamRecord</tt>. -Array <tt>$RELATIONS</tt> juga mendefinisikan dua hubungan lainnya yang nanti akan kita uji dalam seksi di bawah ini. -Dalam <tt>array(self::BELONGS_TO, 'TeamRecord')</tt>, elemen pertama mendefinisikan tipe hubungan, dalam hal ini <strong><tt>self::BELONGS_TO</tt></strong> dan +Properti <tt>$RELATIONS</tt> dari <tt>PlayerRecord</tt> mendefinisikan properti <tt>$team</tt> <b>milik</b> <tt>TeamRecord</tt>. +Array <tt>$RELATIONS</tt> juga mendefinisikan dua hubungan lainnya yang nanti akan kita uji dalam seksi di bawah ini. +Dalam <tt>array(self::BELONGS_TO, 'TeamRecord')</tt>, elemen pertama mendefinisikan tipe hubungan, dalam hal ini <strong><tt>self::BELONGS_TO</tt></strong> dan elemen kedua adalah string <tt>'TeamRecord'</tt> yang terkait ke nama kelas dari kelas <tt>TeamRecord</tt>. Obyek pemain dengan obyek tim terkait dapat diambil serperti berikut. </p> @@ -703,7 +703,7 @@ class ProfileRecord extends TActiveRecord <p id="710029" class="block-content">Intinya, ada hubungan "<b>belongs to</b>" untuk obyek yang mengaitkan entitas yang memmpunyai kolom yakni kunci asing. Dalam keadaan tertentu, kita melihat bahwa tabel <tt>Profiles</tt> mempunyai batasan kunci asing pada kolom <tt>player_id</tt> yang terkait ke tabel <tt>Players</tt> kolom <tt>player_id</tt>. Selanjutnya, obyek <tt>ProfileRecord</tt> memiliki properti (<tt>$player</tt>) yang adalah <b>milik</b> obyek <tt>PlayerRecord</tt>. -Demikian juga, tabel <tt>Players</tt> mempunyai batasan kunci asing pada kolom <tt>team_name</tt> yang terkait ke tabel <tt>Teams</tt> kolom <tt>name</tt>. +Demikian juga, tabel <tt>Players</tt> mempunyai batasan kunci asing pada kolom <tt>team_name</tt> yang terkait ke tabel <tt>Teams</tt> kolom <tt>name</tt>. Kemudian, obyek <tt>PlayerRecord</tt> mempunyai properti (<tt>$team</tt>) yang adalah <b>milik</b> obyek <tt>TeamRecord</tt>. </p> @@ -756,13 +756,13 @@ dua elemen tambahan ini mirip seperti parameter yang dikirimkan ke metode <tt>fi Obyek dapat dengan mudah menangani field multi nilai dengan menggunakan koleksi sebagai nilai field. Database relasional tidak memiliki fitur ini dan dibatasi hanya ke field nilai-tunggal. Ketika Anda memetakan asosiasi satu-ke-banyak, Anda bisa menangani ini menggunakan hubungan <b>has many</b>, intinya menggunakan kunci asing untuk nilai-tunggal akhir dari asosiasi. Tapi asosiasi banyak-ke-banyak tidak bisa melakukan ini karena tidak ada nilai-tunggal akhir ke kunci asing yang dipegangnya. </p> <p id="710033" class="block-content"> -Jawabannya adalah resolusi klasik yang telah dipakai oleh orang selama dekade ini yakni: buat tabel ekstra (tabel asosiasi) untuk merekam asosiasi. +Jawabannya adalah resolusi klasik yang telah dipakai oleh orang selama dekade ini yakni: buat tabel ekstra (tabel asosiasi) untuk merekam asosiasi. Ide dasarnya adalah menggunakan tabel asosiasi untuk menyimpan asosiasi. Tabel ini memiliki ID kunci asing untuk dua tabel yang dikaitkan bersama, masing-masing memiliki pasangan dari obyek yang diasosiasikan. </p> <p id="710034" class="block-content"> Tabel asosiasi tidak mempunyai kaitan obyek dalam-memori dan kunci primernya adalah gabungan dari dua kunci primer dari tabel yang diasosiasikan. -Dalam batasan yang sederhana, tuntuk mengambil data dari tabel asosiasi, Anda melakukan dua query (secara umum, ini juga bisa dicapai menggunakan satu query yang terdiri dari join). -Anggap pengambilan koleksi <tt>SkillRecord</tt> untuk daftar obyek <tt>PlayerRecord</tt>. +Dalam batasan yang sederhana, tuntuk mengambil data dari tabel asosiasi, Anda melakukan dua query (secara umum, ini juga bisa dicapai menggunakan satu query yang terdiri dari join). +Anggap pengambilan koleksi <tt>SkillRecord</tt> untuk daftar obyek <tt>PlayerRecord</tt>. Dalam hal ini, Anda melakukan query dalam dua tahap. Tahap pertama meng-query tabel <tt>Players</tt> untuk mencari seluruh baris dari pemain yang Anda inginkan. Tahap kedua mencari obyek <tt>SkillRecord</tt> ID pemain terkait untuk setiap barisnya dalam tabel asosiasi <tt>Player_Skills</tt> menggunakan sebuah inner join. </p> @@ -794,7 +794,7 @@ class SkillRecord extends TActiveRecord <p id="710036" class="block-content"> Properti statis <tt>$RELATIONS</tt> dari SkillRecord mendefinisikan bahwa properti <tt>$players</tt> memiliki banyak <tt>PlayerRecord</tt>s melalui tabel asosiasi '<tt>Player_Skills</tt>'. Dalam <tt>array(self::MANY_TO_MANY, 'PlayerRecord', 'Player_Skills')</tt>, elemen pertama mendefinisikan tipe hubungan, dalam hal ini <strong><tt>self::HAS_MANY</tt></strong>, -elemen kedua adalah string <tt>'PlayerRecord'</tt> yang terkait ke nama kelas dari kelas <tt>PlayerRecord</tt>, dan elemen ketiga adalah nama dari nama tabel asosiasi. +elemen kedua adalah string <tt>'PlayerRecord'</tt> yang terkait ke nama kelas dari kelas <tt>PlayerRecord</tt>, dan elemen ketiga adalah nama dari nama tabel asosiasi. </p> <div class="note"><b class="note">Catatan:</b> @@ -815,22 +815,22 @@ Metode <tt>with_xxx()</tt> (di mana <tt>xxx</tt> adalah nama properti hubungan, <p id="710039" class="block-content"> Untuk tabel asosiasi yang mererefensi dirinya sendiri, yaitu titik asosiasi ke tabel yang sama. Sebagai contoh, anggap tabel <tt>items</tt> dengan item terkait M-N melalui tabel asosiasi <tt>related_items</tt>. Sintaks dalam contoh berikut adalah benar untuk database PostgreSQL. Untuk database lain, lihat dokumentasinya masing-masing untuk mendefinisikan batasan kunci asing. <com:TTextHighlighter Language="sql" CssClass="source block-content"> -CREATE TABLE items +CREATE TABLE items ( - "item_id" SERIAL, + "item_id" SERIAL, "name" VARCHAR(128) NOT NULL, PRIMARY KEY("item_id") ); -CREATE TABLE "related_items" +CREATE TABLE "related_items" ( - "item_id" INTEGER NOT NULL, - "related_item_id" INTEGER NOT NULL, - CONSTRAINT "related_items_pkey" PRIMARY KEY("item_id", "related_item_id"), + "item_id" INTEGER NOT NULL, + "related_item_id" INTEGER NOT NULL, + CONSTRAINT "related_items_pkey" PRIMARY KEY("item_id", "related_item_id"), CONSTRAINT "related_items_item_id_fkey" FOREIGN KEY ("item_id") REFERENCES "items"("item_id") ON DELETE CASCADE ON UPDATE NO ACTION - NOT DEFERRABLE, + NOT DEFERRABLE, CONSTRAINT "related_items_related_item_id_fkey" FOREIGN KEY ("related_item_id") REFERENCES "items"("item_id") ON DELETE CASCADE @@ -839,7 +839,7 @@ CREATE TABLE "related_items" ); </com:TTextHighlighter> -<p id="710040" class="block-content">Nama tabel asosiasi dalam elemen ketiga dari array hubungan dapat berisi nama kolom tabel asing. Kolom yang didefinisikan dalam tabel asosiasi harus juga didefinisikan dalam kelas rekaman (contohnya properti <tt>$related_item_id</tt> terkait ke kolom <tt>related_item_id</tt> dalam tabel <tt>related_items</tt>). +<p id="710040" class="block-content">Nama tabel asosiasi dalam elemen ketiga dari array hubungan dapat berisi nama kolom tabel asing. Kolom yang didefinisikan dalam tabel asosiasi harus juga didefinisikan dalam kelas rekaman (contohnya properti <tt>$related_item_id</tt> terkait ke kolom <tt>related_item_id</tt> dalam tabel <tt>related_items</tt>). </p> <com:TTextHighlighter Language="php" CssClass="source block-content"> class Item extends TActiveRecord @@ -849,18 +849,18 @@ class Item extends TActiveRecord public $details; //id item asing tambahan didefinisikan dalam tabel asosiasi - public $related_item_id; + public $related_item_id; public $related_items=array(); // deklarasi ini tidak diperlukan lagi sejak v3.1.2 public static $RELATIONS=array ( - 'related_items' => array(self::MANY_TO_MANY, + 'related_items' => array(self::MANY_TO_MANY, 'Item', 'related_items.related_item_id'), ); } </com:TTextHighlighter> <div class="tip"><b class="note">Tip:</b> -Kunci gabungan dalam tabel asing dapat ditetapkan sebagai nilai dipisahkan koma diantara kurung buka/tutup. Contohnya <tt>'related_items.(id1,id2)'</tt>. +Kunci gabungan dalam tabel asing dapat ditetapkan sebagai nilai dipisahkan koma diantara kurung buka/tutup. Contohnya <tt>'related_items.(id1,id2)'</tt>. </div> <!--- @@ -882,7 +882,7 @@ Karena kelas <tt>TeamRecord</tt> berisi hubungan <b>has many</b> dengan <tt>Play </p> <p id="710043" class="block-content">Untuk menghapus obyek asing tertentu (atau setiap obyek Rekaman Aktif), cukup panggil metode obyek <tt>delete()</tt>. Anda dapat menyiapkan batas kunci asing tabel database seperti saat menghapus data tertentu dalam database ia akan menghapus data yang direferensi juga (ia juga dapat dicapai dengan menggunakan pemicu database). Contohnya seperti mempunyai batasan "<tt>ON DELETE CASCADE</tt>". -Menghapus kunci obyek asing dengan menyetel nilai properti ke null atau menghapus obyek dari array <b>TIDAK</b> akan menghapus data terkait dalam database. +Menghapus kunci obyek asing dengan menyetel nilai properti ke null atau menghapus obyek dari array <b>TIDAK</b> akan menghapus data terkait dalam database. </p> <p id="710044" class="block-content">Untuk menghapus asosiasi hubungan banyak-ke-banyak melalui tabel asosiasi, Rekaman Aktif yang terkait tabel asosiasi yang bisas dipakai. Kemudian asosiasi dapat dihapus dengan memanggil metode <tt>deleteByPk()</tt>, sebagai contoh: @@ -908,7 +908,7 @@ class PlayerRecord extends BaseFkRecord //... properti dan metode lainnya seperti sebelumnya private $_skills; //ubah ke private dan standar sebagai null - + public function getSkills() { if($this->_skills===null && $this->player_id !==null) @@ -932,7 +932,7 @@ class PlayerRecord extends BaseFkRecord } </com:TTextHighlighter> <p id="710046" class="block-content">Pertama kita perlu mengubah deklarasi <tt>$skills=array()</tt> ke properti private <tt>$_skills</tt> (perhatikan garis bawah) dan sebaliknya setel ke null. Ini membolehkan kita untuk mendefinisikan properti <tt>skills</tt> menggunakan metode pengambil/penyetel -(lihat <a href="?page=Fundamentals.Components">Komponen</a> untuk lebih jelasnya). Metode pengambil <tt>getSkills()</tt> untuk properti <tt>skills</tt> akan mengambil malas rekaman skill terkait saat ia dipakai sebagai berikut. Catatan bahwa kita hanya melakukan pengambilan malas ketika <tt>$player_id</tt> tidak null (yakni, ketika rekaman sudah diambil dari database ataau id player sudah disetel). +(lihat <a href="?page=Fundamentals.Components1">Komponen</a> untuk lebih jelasnya). Metode pengambil <tt>getSkills()</tt> untuk properti <tt>skills</tt> akan mengambil malas rekaman skill terkait saat ia dipakai sebagai berikut. Catatan bahwa kita hanya melakukan pengambilan malas ketika <tt>$player_id</tt> tidak null (yakni, ketika rekaman sudah diambil dari database ataau id player sudah disetel). </p> <com:TTextHighlighter Language="php" CssClass="source block-content"> $player = PlayerRecord::finder()->findByPk(1); @@ -943,13 +943,13 @@ $player->skills[] = new SkillRecord(); //menambah skill <p id="710047" class="block-content">The <tt>setSkills()</tt> memastikan bahwa properti <tt>skills</tt> akan selalu berupa TList. Menggunakan TList yang membolehkan kita untuk menyetel elemen properti <tt>skills</tt> seolah-olah mereka -sebuah array. Contohnya <tt>$player->skills[] = new SkillRecord()</tt>. Jika <tt>array</tt> dipakai, kesalahan PHP -akan dikeluarkan. +sebuah array. Contohnya <tt>$player->skills[] = new SkillRecord()</tt>. Jika <tt>array</tt> dipakai, kesalahan PHP +akan dikeluarkan. </p> <h2>Pemetaan Kolom</h2> <p> -Sejak v3.1.1, Rekaman Aktif mulai mendukung pemetaan kolom. Pemetaan kolom membolehkan para +Sejak v3.1.1, Rekaman Aktif mulai mendukung pemetaan kolom. Pemetaan kolom membolehkan para pengembang untuk mengalamatkan kolom dalam Rekaman Aktif menggunakan konvensi penamaan lebih konsisten. Dalam keadaan tertentu, menggunakan pemetaan kolom, seseorang dapat mengakses kolom menggunakan apapun namanya yang disukainya, daripada nama terbatas yang didefinisikan dalam diff --git a/demos/quickstart/protected/pages/Database/pl/ActiveRecord.page b/demos/quickstart/protected/pages/Database/pl/ActiveRecord.page index 97a054fe..3a073e57 100755 --- a/demos/quickstart/protected/pages/Database/pl/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/pl/ActiveRecord.page @@ -2,7 +2,7 @@ <h1 id="138046">Rekord Aktywny (ang. Active Record)</h1> <com:SinceVersion Version="3.1a" /> <p id="690478" class="block-content">Rekordy Aktywne są obiektami, które opakowują wiersz w bazie danych lub widoku, - obudowują (ang. encapsulate) dostęp do bazy danych oraz dziedziny logiki dla tych danych. + obudowują (ang. encapsulate) dostęp do bazy danych oraz dziedziny logiki dla tych danych. Podstawą Rekordu Aktywnego są klasy biznesowe np. klasa <tt>Produkty</tt>, które są bardzo podobne do struktury rekordu należącego do bazy danych. Każdy Rekord Aktywny jest odpowiedzialny za zapisywanie i łądowanie danych do i z bazy danych.</p> @@ -13,18 +13,18 @@ <h2 id="138047">Kiedy używać?</h2> <p id="690479" class="block-content">Rekord Aktywne jest dobrym wyborem dla dziedziny logiki, która nie jest zbyt złożona, tak jak tworzenie, odczyty, aktualizacje oraz usuwanie. - Pochocne (ang. derivations) oraz sprawdzenia bazujące na pojedyńczym rekordzie sprawdzają się dobrze w tej konstrukcji. + Pochocne (ang. derivations) oraz sprawdzenia bazujące na pojedyńczym rekordzie sprawdzają się dobrze w tej konstrukcji. Rekord Aktywne ma podstawową zaletę, którą jest prostota. Łatwo jest stworzyć Rekord Aktywny, łatwo go również zrozuieć. </p> - <p id="690480" class="block-content">Jednakże, jeśli twoja logika biznesowa staje się coraz bardziej złożona, wkrótce będziesz chciał + <p id="690480" class="block-content">Jednakże, jeśli twoja logika biznesowa staje się coraz bardziej złożona, wkrótce będziesz chciał używać bezpośrednich relacji, zbiorów, dziedziczenia twojego obiektu i tak dalej. Nie da się tego łatwo odwzorować za pomocą Rekordu Aktywnego, a dodawanie ich po kawałku staje się bardzo kłopotliwe. Innym argumentem przeciw Rekordowi Aktywnemu jest fakt, że łączy model obiektowy z modelem baz danych. To czyni trudniejszym refaktoring, gdy projekt idzie naprzód. </p> <p id="690481" class="block-content">Alternatywą jest używanie wzorca Data Mapper (mapa danych), który odseparowuje role obiektu biznesowego od tego jak te obiekty są przechowywane. - Prado dostarcza + Prado dostarcza Prado provides a darmowy wybór pomiędzy rekordem aktywnym a <a href="?page=Database.SqlMap">SqlMap Data Mapper</a>. SqlMap Data Mapper może być uzywany do wczytania obiektów Rekordu Aktywnego, i na odwrót, te Rekordy Aktywne mogą zostać użyte do aktualizacji bazy danych. Związek pomiędzy Rekordem Aktywnym a <a href="?page=Database.SqlMap">SqlMap</a> przedstawiony jest na kolejnym diagramie. Więcej informacji związanych z SqlMap Data Mapper można znaleźć w @@ -33,7 +33,7 @@ </p> <p id="690482" class="block-content"> - Klasa Rekordu aktywnego posiada funkcjonalność do przeprowadzenia następujących zadań: + Klasa Rekordu aktywnego posiada funkcjonalność do przeprowadzenia następujących zadań: </p> <ul id="u1" class="block-content"> <li>Tworzenie, zwracanie, aktualizowani i usuwanie recordów (CRUD)</li> @@ -51,16 +51,16 @@ zwróci fałsz, natomiast luźne porównianie (np. używając <tt>==</tt>) zwró <p> Jest to implikacja modelu wynikająca z następującego pytania: <i>"Czy myślisz o kliencie jako o obiekcie, którego któy jest tylko jeden, czy też myślisz o obiekcie na którym działasz jako o <b>kopii</b> bazy danych.</i> -Inne mapowania O/R implikują, że istnieje tylko jeden obiekt Klienta z KlientID 100 +Inne mapowania O/R implikują, że istnieje tylko jeden obiekt Klienta z KlientID 100 Other O/R mappings will imply that there is only one Customer object with custID 100 i to dosłownie jest ten klient. -Jeśli pobierzesz klienta i zmienisz pole w nim, wtedy masz zmienionego tego klienta. +Jeśli pobierzesz klienta i zmienisz pole w nim, wtedy masz zmienionego tego klienta. <i>"To kontroastuje z: zmieniłeś tą kopię klienta ale nie tamtą kopię. Jeśli dwóch ludzi zaktualizuje kleinta z dwóch kopii obiektu, kto zaktualizuje pierwszy lub być może ostanie wygrywa."</i> [A. Hejlsberg 2003] </p> <h2 id="142010">Wspierane bazy danych</h2> <p id="p1" class="block-content"> -Implementacja Aktywnego Rekordu wykorzystuje kalsy <a href="?page=Database.DAO">Prado DAO</a> by uzyskać dostęp do danych. Aktualna implementacja Aktywnego Rekordu wspiera następujace bazy danych +Implementacja Aktywnego Rekordu wykorzystuje kalsy <a href="?page=Database.DAO">Prado DAO</a> by uzyskać dostęp do danych. Aktualna implementacja Aktywnego Rekordu wspiera następujace bazy danych </p> <ul> <li><a href="http://www.mysql.com">MySQL 4.1 i wyższe</a></li> @@ -104,7 +104,7 @@ class UserRecord extends TActiveRecord </p> <p id="690485" class="block-content">Każda kolumna tablicy "<tt>users</tt>" musi posiadać odpowiadającą jej właściwość o tej samej nazwie co kolumna w tablicy w klasie <tt>UserRecord</tt>. Oczywiście, możesz zdefiniować dodatkowe zmienne lub właściwości, które nie istnieją w strukturze tablicy. - Stała <tt>TABLE</tt> jest opcjonalna w klasie , kiedy nazwa klasy jest taka sama jak nazwa tablicy w bazie danych, w przeciwnym przypadku <tt>TABLE</tt> + Stała <tt>TABLE</tt> jest opcjonalna w klasie , kiedy nazwa klasy jest taka sama jak nazwa tablicy w bazie danych, w przeciwnym przypadku <tt>TABLE</tt> musi określać nazwę tablicy, która odpowiada klasie Rekordu Aktywnego. </p> @@ -114,7 +114,7 @@ Możesz określić kwalifikowane (ang. qualified) nazwy tablic np dla MySQL, <tt <p class="block-content" id="ar_as_component"> Odkąd <tt>TActiveRecord</tt> rozszerza <tt>TComponent</tt>, metody setter i getter mogą zostać zdefiniowane - by umożliwić kontrolę nad tym jak zmienne są ustawiane i zwracane. Na przykłąd dodanie właściwości <tt>$level</tt> + by umożliwić kontrolę nad tym jak zmienne są ustawiane i zwracane. Na przykłąd dodanie właściwości <tt>$level</tt> do klasy UserRecord: </p> <com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690149"> @@ -130,13 +130,13 @@ class UserRecord extends TActiveRecord { } } </com:TTextHighlighter> -<p id="710010" class="block-content">Więcej szczegółów dotyczących TComponent można znaleźć <a href="?page=Fundamentals.Components">dokumentacji komponentów</a>. +<p id="710010" class="block-content">Więcej szczegółów dotyczących TComponent można znaleźć <a href="?page=Fundamentals.Components1">dokumentacji komponentów</a>. Później użyjemy metod getter/setters by umożliwić opóźnione ładowanie (ang. lazy loading) obiektów relacji. </p> <div class="info"><b class="note">Info:</b> <tt>TActiveRecord</tt> może również działać z widokami poprzez przypisanie do stałej <tt>TABLE</tt> - odpowiedniej nazwy widoku. Jednakże obiektu zwracane przez widoki są tylko do odczytu, wywołanie metod <tt>save()</tt> lub <tt>delete()</tt> + odpowiedniej nazwy widoku. Jednakże obiektu zwracane przez widoki są tylko do odczytu, wywołanie metod <tt>save()</tt> lub <tt>delete()</tt> spowoduje wywołanie wyjątku. </div> @@ -149,7 +149,7 @@ spowoduje wywołanie wyjątku. <h2 id="138049">Ustanawianie połączenia z bazą danych</h2> <p id="690487" class="block-content"> Domyślne połączenie z bazą dla Rekordu Aktywnego może zostać ustawione następujaco. - Zobacz <a href="?page=Database.DAO">Ustanawianie połączenia z bazą</a> + Zobacz <a href="?page=Database.DAO">Ustanawianie połączenia z bazą</a> by uzyskać ogólnie dalsze szczegóły odnośnie tworzenia połączenia z bazą danych. </p> <com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690150"> @@ -160,7 +160,7 @@ TActiveRecordManager::getInstance()->setDbConnection($conn); </com:TTextHighlighter> <p id="710011" class="block-content">Alternatywnie, możesz stworzyć klasę bazową i nadpisać metodę <tt>getDbConnection()</tt> -do zwracania połączenia z bazą. To jest prosty spodób, by umożliwić wielkokrotne połączenia do wielu baz danych. +do zwracania połączenia z bazą. To jest prosty spodób, by umożliwić wielkokrotne połączenia do wielu baz danych. Następujący kod demonstruje definiowanie połączenia z bazą danych w klasie bazowej (nie ma potrzeby by ustawiać połączenie DB gdziekolwiek indziej). </p> <com:TTextHighlighter Language="php" CssClass="source block-content"> @@ -203,7 +203,7 @@ class MyDb2Record extends TActiveRecord </com:TTextHighlighter> <div class="tip"><b class="note">Wskazówka:</b> Atrybut <tt>EnableCache</tt> gdy ustawiony na "true" będzie keszował metadane tablicy, to oznacza, że nazwy kolumn, indeksy i ograniczenia (ang. constraints) - są zapisywane w keszu i używane ponownie. Musisz wyczyścić lub wyłączyć kesz jeśli chcesz zobaczyć wprowadzone zmiany do definicji twoich tablic. + są zapisywane w keszu i używane ponownie. Musisz wyczyścić lub wyłączyć kesz jeśli chcesz zobaczyć wprowadzone zmiany do definicji twoich tablic. <a href="?page=Advanced.Performance#6402">Moduł keszowania</a> musi być również zdefiniowany dla keszu by zadziałał. </div> </p> @@ -229,14 +229,14 @@ class MyDb2Record extends TActiveRecord <h2 id="138050">Ładowanie danych z tablicy</h2> <p id="690490" class="block-content"> - Klasa <tt>TActiveRecord</tt> dostarcza wielu wygodnych metod do wyszukiwania rekordów z bazy danych. + Klasa <tt>TActiveRecord</tt> dostarcza wielu wygodnych metod do wyszukiwania rekordów z bazy danych. Najprostszym jest znajdowanie jednego rekordu poprzez dopasowanie klucza głównego lub klucza złożonego (ang. composite key) (klucz główny skłądający się z wielu kolumn). Zobacz <com:DocLink ClassPath="System.Data.ActiveRecord.TActiveRecord" /> by dowiedzieć się więcej. </p> <div class="info"><b class="note">Info:</b> -Wszystkie metody wyszukujące, które mogą zwrócić tylko 1 rekord zwrócą <tt>null</tt> jeśli nie znajdą pasujących danych. +Wszystkie metody wyszukujące, które mogą zwrócić tylko 1 rekord zwrócą <tt>null</tt> jeśli nie znajdą pasujących danych. Wszystkie metody wyszukujące, które zwracają tablicę rekordów zwrócą pustą tablicęm jeśli nie znajdą pasujących danych. </div> @@ -352,8 +352,8 @@ Możesz również użyć połączenia <tt>AND</tt> oraz <tt>OR</tt> jako warunek </div> <h3 id="138060"><tt>findBySql()</tt> oraz <tt>findAllBySql()</tt></h3> -<p id="690497" class="block-content">Znajdują rekordy używając pełnego zapytania SQL z tym, że <tt>findBySql()</tt> -zwraca Rekord Aktywny a <tt>findAllBySql()</tt>zwraca tablicę obiektów rekordów. +<p id="690497" class="block-content">Znajdują rekordy używając pełnego zapytania SQL z tym, że <tt>findBySql()</tt> +zwraca Rekord Aktywny a <tt>findAllBySql()</tt>zwraca tablicę obiektów rekordów. Dla każdej zwróconej kolumny, odpowiadająca klasa Rekordu Aktywnego musi posiadać zdefiniowaną zmienną lub właściwość odpowiadającą nazwie kolumny. <com:TTextHighlighter Language="php" CssClass="source block-content"> class UserRecord2 extends UserRecord @@ -382,7 +382,7 @@ $user2 = new UserRecord($data); //stwórz przekazując istniejące dane $user2->save(); //wstaw nowy rekord </com:TTextHighlighter> <div class="tip"><b class="note">Wskazówka:</b> -Obiekty są aktualizowe automatycznie o wartość klucza głównego dla tych tablic, które zawierają definicję +Obiekty są aktualizowe automatycznie o wartość klucza głównego dla tych tablic, które zawierają definicję określającą automatyczne tworzenie klucza głównego dla nowo tworzonych rekordów (przyp. tłum. autoincrement). Na przykład jeśli wstawiasz nowy rekord do tablicy MySQL która posiada kolumnę zdefiniowaną jako to obiekt Rekordu Aktywnego zostanie zaktualizowant o nową zwiększoną wartość.</div> @@ -403,10 +403,10 @@ Obiekt Rekordu Aktywnego posiada prosty cykl życia zilustrowany następujący d <img src=<%~ object_states.png %> alt="Active Records Life Cycle" id="fig:cycle.png" class="figure"/> <p id="690501" class="block-content"> Widzimy, że nowe obiekty Rekordu Aktywnego są tworzone zarówno przez jedną z metod <tt>find*()</tt> -lub poprzez stworzenie nowej instancji poprzez użycie polecenia PHP <tt>new</tt>. Obiekty stworzone przez metodę <tt>find*()</tt> +lub poprzez stworzenie nowej instancji poprzez użycie polecenia PHP <tt>new</tt>. Obiekty stworzone przez metodę <tt>find*()</tt> zaczynają ze stanem <tt>czysty (ang. clean)</tt>. Nowa instancja TActiveRecord stworzona inaczej niż za pomocą metod <tt>find*()</tt> zaczyna ze stanem <tt>nowy (ang. new)</tt>. -Kiedykolwiek wywołasz metodę <tt>save()</tt> na obiekcie TActiveRecord, obiekt przyjmuje stan <tt>czysty</tt>. -Obiekty będące <tt>czystymi</tt> stają się <tt>brudne (ang. dirty)</tt> kiedy jeden lub więcej ze stwoich wewnętrznych stanów ulegnie zmianie. +Kiedykolwiek wywołasz metodę <tt>save()</tt> na obiekcie TActiveRecord, obiekt przyjmuje stan <tt>czysty</tt>. +Obiekty będące <tt>czystymi</tt> stają się <tt>brudne (ang. dirty)</tt> kiedy jeden lub więcej ze stwoich wewnętrznych stanów ulegnie zmianie. Wywoałanie metody <tt>delete()</tt> obiektu kończy cykl życia, żadne inne akcje nie mogą być wywołane na obiekcie. </p> @@ -451,7 +451,7 @@ $finder->deleteBy_Username_And_Password($name,$pass); </com:TTextHighlighter> <h2 id="138053">Tranzakcje</h2> -<p id="690504" class="block-content">Wszystkie obiekkty Rekordu Aktywnego zawierają właściwość <tt>DbConnection</tt>, +<p id="690504" class="block-content">Wszystkie obiekkty Rekordu Aktywnego zawierają właściwość <tt>DbConnection</tt>, która może być używana by uzyskać obiekt tranzakcyjny. <com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690165"> $finder = UserRecord::finder(); @@ -486,8 +486,8 @@ Zdarzenie <tt>OnExecuteCommand</tt> jest wywoływane kiedy polecenie jest wykona </p> <h3 id="142016">Przykład z logowaniem</h3> -<p id="710016" class="block-content">Używając <tt>OnExecuteCommand</tt> możemy przypiąć uchwyt zdarzenia by logować całe -zapytanie SQL wwywoływane dla danej instancji lub klasy TActiveRecord. Na przykład definiujemy klasę bazową i nadpisujemy +<p id="710016" class="block-content">Używając <tt>OnExecuteCommand</tt> możemy przypiąć uchwyt zdarzenia by logować całe +zapytanie SQL wwywoływane dla danej instancji lub klasy TActiveRecord. Na przykład definiujemy klasę bazową i nadpisujemy metodę <tt>getDbConnection()</tt> lub konstruktor. </p> @@ -537,12 +537,12 @@ W następnych sekcjach będziemy rozważać nastepujące relacje pomiędzy tabel <img src=<%~ ar_objects.png %> class="figure" /> <p class="block-content"> -Istnieje rozbieżność pomiędzy relacjami w obiektach i relacjami w tablicach. +Istnieje rozbieżność pomiędzy relacjami w obiektach i relacjami w tablicach. Po pierwsze jest różnica w reprezentacji. Obiekty trzymają powiązanie poprzez przechowywanie referencji, które są trzymane poprzez zarządzające pamięcią środowiko uruchomieniowe. Bazy relacyjne trzymają powiązanie poprzez utworzenie klucza do innej tablicy. - Po drugie, obiekty mogą łatwo uzywać kolekcji by trzymać wielokrotnie referencje z jednego pola, -to handle multiple references from a single field, gdyż normalizacja zmusza wszystkie powiązania relacji encji by były pojedyńczymi wartościami. -To prowadzi do odwrócenia struktury danych pomiędzy obiektami i tablicami. + Po drugie, obiekty mogą łatwo uzywać kolekcji by trzymać wielokrotnie referencje z jednego pola, +to handle multiple references from a single field, gdyż normalizacja zmusza wszystkie powiązania relacji encji by były pojedyńczymi wartościami. +To prowadzi do odwrócenia struktury danych pomiędzy obiektami i tablicami. Podejście zastosowane w modelu Rekordu Aktywnego Prado uzywa ograniczeń kluczów obcych tablicy do wyprowadzenia relacji obiektów. To implikuje fakt wspierania ograniczeń kluczów obcych dla bazy danych. </p> @@ -564,8 +564,8 @@ CREATE TABLE bar </com:TTextHighlighter> </div> -<h2 id="142012">Mapowanie kluczów obcych</h2> -<p class="block-content">Relacja pól pomiędzy tablicami <tt>Teams</tt> and <tt>Players</tt> jest znana jako relacja jeden-do-wielu (ang. 1-M). Oznacza to, że jeden Team moze zawierać zero lub więcej Players. Z punktu widzenia relacji obiektów +<h2 id="142012">Mapowanie kluczów obcych</h2> +<p class="block-content">Relacja pól pomiędzy tablicami <tt>Teams</tt> and <tt>Players</tt> jest znana jako relacja jeden-do-wielu (ang. 1-M). Oznacza to, że jeden Team moze zawierać zero lub więcej Players. Z punktu widzenia relacji obiektów powiemy, że obiekt <tt>TeamRecord</tt> <b>posiada wiele</b> (ang. has many) obiektów <tt>PlayerRecord</tt>. (Zauważ odwrócenie kierunku relacji pomiędzy tablicami a obiektami) </p> @@ -1074,7 +1074,7 @@ class PlayerRecord extends BaseFkRecord <p id="710046" class="block-content">We first need to change the <tt>$skills=array()</tt> declaration to a private property <tt>$_skills</tt> (notice the underscore) and set it to null instead. This allows us to define the <tt>skills</tt> property using getter/setter methods -(see <a href="?page=Fundamentals.Components">Components</a> for details). The <tt>getSkills()</tt> +(see <a href="?page=Fundamentals.Components1">Components</a> for details). The <tt>getSkills()</tt> getter method for the <tt>skills</tt> property will lazy load the corresponding skills foreign record when it is used as follows. Notice that we only do a lazy load when its <tt>$player_id</tt> is not null (that is, when the record is already fetched from the database or player id was already set). diff --git a/demos/quickstart/protected/pages/Fundamentals/Applications.page b/demos/quickstart/protected/pages/Fundamentals/Applications.page index 8e0b9e9a..71901170 100755 --- a/demos/quickstart/protected/pages/Fundamentals/Applications.page +++ b/demos/quickstart/protected/pages/Fundamentals/Applications.page @@ -7,7 +7,11 @@ An application is an instance of <tt>TApplication</tt> or its derived class. It <p id="160158" class="block-content">
Applications are configured via <a href="?page=Configurations.AppConfig">application configurations</a>. They are usually created in entry scripts like the following,
<com:TTextHighlighter CssClass="source block-content" id="code_160071">
+// load the prado entry script
require_once('/path/to/prado.php');
+// or, if using composer:
+require_once('vendor/autoload.php');
+
$application = new TApplication;
$application->run();
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Architecture.page b/demos/quickstart/protected/pages/Fundamentals/Architecture.page index 10f16c3f..c6bee7de 100755 --- a/demos/quickstart/protected/pages/Fundamentals/Architecture.page +++ b/demos/quickstart/protected/pages/Fundamentals/Architecture.page @@ -2,12 +2,31 @@ <h1 id="601">Architecture</h1>
<p id="100111" class="block-content">
-PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO,
+PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO:
</p>
<img src="<%~classtree.gif%>" />
<p id="100112" class="block-content">
-When a PRADO application is processing a page request, its static object diagram can be shown as follows,
+When a PRADO application is processing a page request, its static object diagram can be shown as follows:
</p>
<img src="<%~objectdiagram.gif%>" />
-</com:TContent>
+
+<p class="block-content">
+Once the main <tt>Application</tt> object gets created, it load the <a href="?page=Configurations.AppConfig">application configuration</a>.
+The minimal configuration defines a set of basic <a href="?page=Fundamentals.Modules">modules</a> to parse the <tt>Request</tt>, create a proper <tt>Response</tt>, mantain the user <tt>Session</tt>, handle any <tt>Error</tt> and publish the needed <tt>Assets</tt> (images, css, javascript, etc). These helpers module will be available from anywhere inside the application code.
+<br/>
+Additionally, any 3rd-party or <tt>custom module</tt> can be loaded, and external <tt>Parameters</tt> can be loaded from external configurations.
+</p>
+
+<p class="block-content">
+Once the basic infrastructure has been set up, the <tt>Request</tt> module parses the request trying to identify the requested route. Different routes can be handled by different services, but the default route for http requests is the <tt>Page Service</tt>.
+<br/>
+The <a href="?page=Configurations.AppConfig">Page Service</a>'s role is to instanciate the requested <tt>Page</tt>, run it, apply any defined <tt>Theme</tt> and grab the result in order to build the <tt>Response</tt>.
+</p>
+
+<p class="block-content">
+A <a href="?page=Fundamentals.Pages">Page</a> can be a simple script (.php), a <tt>Template</tt> (.page), or both. PRADO uses a very powerful <a href="?page=Configurations.Templates1">template engine</a> where <tt>Controls</tt> can be instanciated directly.
+<br/>
+A <a href="?page=Fundamentals.Controls">Control</a> is an self-contained widget that fullfills a specific task; they can be a simple script (.php), a <tt>Template</tt> (.page), or both.
+</p>
+</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Fundamentals/Components.page b/demos/quickstart/protected/pages/Fundamentals/Components.page deleted file mode 100755 index 11235b56..00000000 --- a/demos/quickstart/protected/pages/Fundamentals/Components.page +++ /dev/null @@ -1,360 +0,0 @@ -<com:TContent ID="body" >
-<h1 id="701">Components</h1>
-<p id="110113" class="block-content">
-A component is an instance of <tt>TComponent</tt> or its child class. The base class <tt>TComponent</tt> implements the mechanism of component properties and events.
-</p>
-
-<h2 id="702">Component Properties</h2>
-<p id="110114" class="block-content">
-A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in <tt>TControl</tt>, we define its <tt>ID</tt> property using the following getter and setter methods,
-<com:TTextHighlighter CssClass="source block-content" id="code_110056">
-class TControl extends TComponent {
- public function getID() {
- ...
- }
- public function setID($value) {
- ...
- }
-}
-</com:TTextHighlighter>
-</p>
-<p id="110115" class="block-content">
-To get or set the <tt>ID</tt> property, do as follows, just like working with a variable,
-<com:TTextHighlighter CssClass="source block-content" id="code_110057">
-$id = $component->ID;
-$component->ID = $id;
-</com:TTextHighlighter>
-This is equivalent to the following,
-<com:TTextHighlighter CssClass="source block-content" id="code_110058">
-$id = $component->getID();
-$component->setID( $id );
-</com:TTextHighlighter>
-</p>
-<p id="110116" class="block-content">
-A property is read-only if it has a getter method but no setter method. Since PHP method names are case-insensitive, property names are also case-insensitive. A component class inherits all its ancestor classes' properties.
-</p>
-
-<h3 id="706">Subproperties</h3>
-<p id="110117" class="block-content">
-A subproperty is a property of some object-typed property. For example, <tt>TWebControl</tt> has a <tt>Font</tt> property which is of <tt>TFont</tt> type. Then the <tt>Name</tt> property of <tt>Font</tt> is referred to as a subproperty (with respect to <tt>TWebControl</tt>).
-</p>
-<p id="110118" class="block-content">
-To get or set the <tt>Name</tt> subproperty, use the following method,
-<com:TTextHighlighter CssClass="source block-content" id="code_110059">
-$name = $component->getSubProperty('Font.Name');
-$component->setSubProperty('Font.Name', $name);
-</com:TTextHighlighter>
-This is equivalent to the following,
-<com:TTextHighlighter CssClass="source block-content" id="code_110060">
-$name = $component->getFont()->getName();
-$component->getFont()->setName( $name );
-</com:TTextHighlighter>
-</p>
-
-<h3 id="26001">Js-friendly properties</h3>
-<p class="block-content">
-A JavaScript-friendly property is a property that can accept both simple strings and raw javascript.
-Prado automatically encodes all properties sent clientside inside javascript blocks to avoid security problems (like injections or cross site scripting).
-If a property is known to always contain only safe javascript code and its value needs to bypass this encoding, that property can be defined in a special way that will make Prado mark its value as "safe".
-Js-friendly properties are identified by their name starting with 'js' (case insensitive):
-<com:TTextHighlighter CssClass="source block-content">
-// getter, defines a readable property 'Text'
-function getJsText() { … }
-// setter, defines a writable property 'Text', with $value being the value to be set to the property
-function setJsText(TJavaScriptLiteral $value) { … }
-</com:TTextHighlighter>
-Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name:
-<com:TTextHighlighter CssClass="source block-content">
-// set some simple text as property value
-$component->Text = 'text';
-// set some javascript code as property value
-$component->JsText = 'raw javascript';
-</com:TTextHighlighter>
-In the first case, the property value will automatically gets encoded when sent clientside inside a javascript block.
-In the second case, the property will be 'marked' as being a safe javascript statement and will not be encoded when rendered inside a javascript block.
-This special handling makes use of the <tt>TJavaScriptLiteral</tt> class.
-</p>
-
-
-<h2 id="703">Component Events</h2>
-<p id="110119" class="block-content">
-Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component.
-</p>
-<p id="110120" class="block-content">
-A component event is defined by the existence of a method whose name starts with the word <tt>on</tt>. The event name is the method name and is thus case-insensitve. For example, in <tt>TButton</tt>, we have
-<com:TTextHighlighter CssClass="source block-content" id="code_110061">
-class TButton extends TWebControl {
- public function onClick( $param ) {
- ...
- }
-}
-</com:TTextHighlighter>
-This defines an event named <tt>OnClick</tt>, and a handler can be attached to the event using one of the following ways,
-<com:TTextHighlighter CssClass="source block-content" id="code_110062">
-$button->OnClick = $callback;
-$button->OnClick->add( $callback );
-$button->OnClick[] = $callback;
-$button->attachEventHandler( 'OnClick' , $callback );
-</com:TTextHighlighter>
-</p>
- The variable <tt>$callback</tt> contains the definition of the event handler that can be either a string referring to a global function name, or an array whose first element refers to an object and second element a method name/path that is reachable by the object, e.g.
- </p>
-<ul>
-<li>'buttonClicked' : buttonClicked($sender,$param);</li>
-<li>array($object,'buttonClicked') : $object->buttonClicked($sender,$param);</li>
-<li>array($object,'MainContent.SubmitButton.buttonClicked') : $object->MainContent->SubmitButton->buttonClicked($sender,$param);</li>
-</ul>
-<com:SinceVersion Version="3.2.3" />
-<h2 id="26001">Global events</h2>
-<p id="130001" class="block-content">
-With the addition of behaviors, a more expansive event model is needed. There
-are two new event types (global and dynamic events) as well as a more comprehensive
-behavior model that includes class wide behaviors.
-</p>
-<p id="130002" class="block-content">
-A global event is defined by all events whose name starts with 'fx'.
-The event name is potentially a method name and is thus case-insensitive. All 'fx' events
-are valid as the whole 'fx' event/method space is global in nature. Any object may patch into
-any global event by defining that event as a method. Global events have priorities
-just like 'on' events; so as to be able to order the event execution. Due to the
-nature of all events which start with 'fx' being valid, in effect, every object
-has every 'fx' global event. It is simply an issue of tapping into the desired
-global event.
-</p>
-<p id="130003" class="block-content">
-A global event that starts with 'fx' can be called even if the object does not
-implement the method of the global event. A call to a non-existing 'fx' method
-will, at minimal, function and return null. If a method argument list has a first
-parameter, it will be returned instead of null. This allows filtering and chaining.
-'fx' methods do not automatically install and uninstall. To install and uninstall an
-object's global event listeners, call the object's <tt>listen</tt> and
-<tt>unlisten</tt> methods, respectively. An object may auto-install its global event
-during <tt>__construct</tt> by overriding <tt>getAutoGlobalListen</tt> and returning true.
-</p>
-<p id="130004" class="block-content">
-As of PHP version 5.3, nulled objects without code references will still continue to persist
-in the global event queue because <tt>__destruct</tt> is not automatically called. In the common
-__destruct method, if an object is listening to global events, then <tt>unlisten</tt> is called.
-<tt>unlisten</tt> is required to be manually called before an object is
-left without references if it is currently listening to any global events. This includes
-class wide behaviors.
-</p>
-<p id="130005" class="block-content">
-An object that contains a method that starts with 'fx' will have those functions
-automatically receive those events of the same name after <tt>listen</tt> is called on the object.
-</p>
-<p id="130006" class="block-content">
-An object may listen to a global event without defining an 'fx' method of the same name by
-adding an object method to the global event list. For example
-</p>
-<com:TTextHighlighter CssClass="source block-content">
-$component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback);
-$component->attachEventHandler('fxGlobalCheck',array($object, 'someMethod'));
-</com:TTextHighlighter>
-<h2 id="26002">Events between Objects and their behaviors, Dynamic Events</h2>
-<p id="130007" class="block-content">
-An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
-'fx' global events, every object has every dynamic event. Any call to a method that
-starts with 'dy' will be handled, regardless of whether it is implemented. These
-events are for communicating with attached behaviors.
-</p>
-<p id="130008" class="block-content">
-Dynamic events can be used in a variety of ways. They can be used to tell behaviors
-when a non-behavior method is called. Dynamic events could be used as data filters.
-They could also be used to specify when a piece of code is to be run, eg. should the
-loop process be performed on a particular piece of data. In this way, some control
-is handed to the behaviors over the process and/or data.
-</p>
-<p id="130009" class="block-content">
-If there are no handlers for an 'fx' or 'dy' event, it will return the first
-parameter of the argument list. If there are no arguments, these events
-will return null. If there are handlers an 'fx' method will be called directly
-within the object. Global 'fx' events are triggered by calling <tt>raiseEvent</tt>.
-For dynamic events where there are behaviors that respond to the dynamic events, a
-<tt>TCallChain</tt> is developed. A call chain allows the behavior dynamic event
-implementations to call further implementing behaviors within a chain.
-</p>
-<p id="130010" class="block-content">
-If an object implements <tt>IDynamicMethods</tt>, all global and object dynamic
-events will be sent to <tt>__dycall</tt>. In the case of global events, all
-global events will trigger this method. In the case of behaviors, all undefined
-dynamic events which are called will be passed through to this method.
-</p>
-<p id="130011" class="block-content">
-<h2 id="26003">Behaviors</h2>
-<p id="130012" class="block-content">
-There are two types of behaviors. There are individual object behaviors and
-there are class wide behaviors. Class behaviors depend upon object behaviors.
-</p>
-<p id="130013" class="block-content">
-When a new class implements <tt>IBehavior</tt> or <tt>IClassBehavior</tt> or
-extends <tt>TBehavior</tt> or <tt>TClassBehavior</tt>, it may be added to an
-object by calling the object's <tt>attachBehavior</tt>. The behaviors associated
-name can then be used to <tt>enableBehavior</tt> or <tt>disableBehavior</tt>
-the specific behavior.
-</p>
-<p id="130014" class="block-content">
-All behaviors may be turned on and off via <tt>enableBehaviors</tt> and
-<tt>disableBehaviors</tt>, respectively. To check if behaviors are on or off
-a call to <tt>getBehaviorsEnabled</tt> will provide the variable.
-</p>
-<p id="130015" class="block-content">
-Attaching and detaching whole sets of behaviors is done using
-<tt>attachBehaviors</tt> and <tt>detachBehaviors</tt>. <tt>clearBehaviors</tt>
-removes all of an object's behaviors.
-</p>
-<p id="130016" class="block-content">
-<tt>asa</tt> returns a behavior of a specific name. <tt>isa</tt> is the
-behavior inclusive function that acts as the PHP operator <tt>instanceof</tt>.
-A behavior could provide the functionality of a specific class thus causing
-the host object to act similarly to a completely different class. A behavior
-would then implement <tt>IInstanceCheck</tt> to provide the identity of the
-different class.
-</p>
-<p id="130017" class="block-content">
-Class behaviors are similar to object behaviors except that the class behavior
-is the implementation for all instances of the class. A class behavior
-will have the object upon which is being called be prepended to the parameter
-list. This way the object is known across the class behavior implementation.
-</p>
-<p id="130018" class="block-content">
-Class behaviors are attached using <tt>attachClassBehavior</tt> and detached
-using <tt>detachClassBehavior</tt>. Class behaviors are important in that
-they will be applied to all new instances of a particular class. In this way
-class behaviors become default behaviors to a new instances of a class in
-<tt>__construct</tt>. Detaching a class behavior will remove the behavior
-from the default set of behaviors created for an object when the object
-is instanced.
-</p>
-<p id="130019" class="block-content">
-Class behaviors are also added to all existing instances via the global 'fx'
-event mechanism. When a new class behavior is added, the event
-<tt>fxAttachClassBehavior</tt> is raised and all existing instances that are
-listening to this global event (primarily after <tt>listen</tt> is called)
-will have this new behavior attached. A similar process is used when
-detaching class behaviors. Any objects listening to the global 'fx' event
-<tt>fxDetachClassBehavior</tt> will have a class behavior removed.
-</p>
-<h2 id="26004">Dynamic Intra-Object Events</h2>
-<p id="130020" class="block-content">
-Dynamic events start with 'dy'. This mechanism is used to allow objects
-to communicate with their behaviors directly. The entire 'dy' event space
-is valid. All attached, enabled behaviors that implement a dynamic event
-are called when the host object calls the dynamic event. If there is no
-implementation or behaviors, this returns null when no parameters are
-supplied and will return the first parameter when there is at least one
-parameter in the dynamic event.
-</p>
-<com:TTextHighlighter CssClass="source block-content">
- null == $this->dyBehaviorEvent();
- 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event
-</com:TTextHighlighter>
-<p id="130021" class="block-content">
-Dynamic events can be chained together within behaviors to allow for data
-filtering. Dynamic events are implemented within behaviors by defining the
-event as a method.
-</p>
-<com:TTextHighlighter CssClass="source block-content">
-class TObjectBehavior extends TBehavior {
- public function dyBehaviorEvent($param1, $callchain) {
- //Do something, eg: $param1 += 13;
- return $callchain->dyBehaviorEvent($param1);
- }
-}
-</com:TTextHighlighter>
-<p id="130022" class="block-content">
-This implementation of a behavior and dynamic event will flow through to the
-next behavior implementing the dynamic event. The first parameter is always
-return when it is supplied. Otherwise a dynamic event returns null.
-</p>
-<p id="130023" class="block-content">
-In the case of a class behavior, the object is also prepended to the dynamic
-event.
-</p>
-<com:TTextHighlighter CssClass="source block-content">
-class TObjectClassBehavior extends TClassBehavior {
- public function dyBehaviorEvent($hostobject, $param1, $callchain) {
- //Do something, eg: $param1 += $hostobject->getNumber();
- return $callchain->dyBehaviorEvent($param1);
- }
-}
-</com:TTextHighlighter>
-</p>
-<p id="130024" class="block-content">
-When calling a dynamic event, only the parameters are passed. The host object
-and the call chain are built into the framework.
-</p>
-
-<h2 id="26005">Global Event and Dynamic event catching</h2>
-
-<p id="130025" class="block-content">
-Given that all global 'fx' events and dynamic 'dy' events are valid and
-operational, there is a mechanism for catching events called that are not
-implemented (similar to the built-in PHP method <tt>__call</tt>). When
-a dynamic or global event is called but a behavior does not implement it,
-yet desires to know when an undefined dynamic event is run, the behavior
-implements the interface <tt>IDynamicMethods</tt> and method <tt>__dycall</tt>.
-</p>
-<p id="130026" class="block-content">
-In the case of dynamic events, <tt>__dycall</tt> is supplied with the method
-name and its parameters. When a global event is raised, via <tt>raiseEvent</tt>,
-the method is the event name and the parameters are supplied.
-</p>
-<p id="130027" class="block-content">
-When implemented, this catch-all mechanism is called for event global event event
-when implemented outside of a behavior. Within a behavior, it will also be called
-when the object to which the behavior is attached calls any unimplemented dynamic
-event. This is the fall-back mechanism for informing a class and/or behavior
-of when an global and/or undefined dynamic event is executed.
-</p>
-
-<h2 id="704">Namespaces</h2>
-<p id="110121" class="block-content">
-A namespace refers to a logical grouping of some class names so that they can be differentiated from other class names even if their names are the same. Since PHP does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. To differentiate from user defined classes, all PRADO classes are prefixed with a letter 'T' (meaning 'Type'). Users are advised not to name their classes like this. Instead, they may prefix their class names with any other letter(s).
-</p>
-<p id="110122" class="block-content">
-A namespace in PRADO is considered as a directory containing one or several class files. A class may be specified without ambiguity using such a namespace followed by the class name. Each namespace in PRADO is specified in the following format,
-<div class="source">
-PathAlias.Dir1.Dir2
-</div>
-where <tt>PathAlias</tt> is an alias of some directory, while <tt>Dir1</tt> and <tt>Dir2</tt> are subdirectories under that directory. A class named <tt>MyClass</tt> defined under <tt>Dir2</tt> may now be fully qualified as <tt>PathAlias.Dir1.Dir2.MyClass</tt>.
-</p>
-<p id="110123" class="block-content">
-To use a namespace in code, do as follows,
-<com:TTextHighlighter CssClass="source block-content" id="code_110063">
-Prado::using('PathAlias.Dir1.Dir2.*');
-</com:TTextHighlighter>
-which appends the directory referred to by <tt>PathAlias.Dir1.Dir2</tt> into PHP include path so that classes defined under that directory may be instantiated without the namespace prefix. You may also include an individual class definition by
-<com:TTextHighlighter CssClass="source block-content" id="code_110064">
-Prado::using('PathAlias.Dir1.Dir2.MyClass');
-</com:TTextHighlighter>
-which will include the class file if <tt>MyClass</tt> is not defined.
-</p>
-<p id="110124" class="block-content">
-For more details about defining path aliases, see <a href="?page=Configurations.AppConfig">application configuration</a> section.
-</p>
-
-<h2 id="705">Component Instantiation</h2>
-<p id="110125" class="block-content">
-Component instantiation means creating instances of component classes. There are two types of component instantation: static instantiation and dynamic instantiation. The created components are called static components and dynamic components, respectively.
-</p>
-
-<h3 id="707">Dynamic Component Instantiation</h3>
-<p id="110126" class="block-content">
-Dynamic component instantiation means creating component instances in PHP code. It is the same as the commonly referred object creation in PHP. A component can be dynamically created using one of the following two methods in PHP,
-<com:TTextHighlighter CssClass="source block-content" id="code_110065">
-$component = new ComponentClassName;
-$component = Prado::createComponent('ComponentType');
-</com:TTextHighlighter>
-where <tt>ComponentType</tt> refers to a class name or a type name in namespace format (e.g. <tt>System.Web.UI.TControl</tt>). The second approach is introduced to compensate for the lack of namespace support in PHP.
-</p>
-
-<h3 id="708">Static Component Instantiation</h3>
-<p id="110127" class="block-content">
-Static component instantiation is about creating components via <a href="?page=Configurations.Overview">configurations</a>. The actual creation work is done by the PRADO framework. For example, in an <a href="?page=Configurations.AppConfig">application configuration</a>, one can configure a module to be loaded when the application runs. The module is thus a static component created by the framework. Static component instantiation is more commonly used in <a href="?page=Configurations.Templates1">templates</a>. Every component tag in a template specifies a component that will be automatically created by the framework when the template is loaded. For example, in a page template, the following tag will lead to the creation of a <tt>TButton</tt> component on the page,
-<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_110066">
-<com:TButton Text="Register" />
-</com:TTextHighlighter>
-</p>
-
-</com:TContent>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Components1.page b/demos/quickstart/protected/pages/Fundamentals/Components1.page new file mode 100755 index 00000000..a610045d --- /dev/null +++ b/demos/quickstart/protected/pages/Fundamentals/Components1.page @@ -0,0 +1,157 @@ +<com:TContent ID="body" > +<h1 id="701">Components: Part I</h1> +<p id="110113" class="block-content"> +A component is an instance of <tt>TComponent</tt> or its child class. The base class <tt>TComponent</tt> implements the mechanism of component properties and events. +</p> + +<h2 id="702">Component Properties</h2> +<p id="110114" class="block-content"> +A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in <tt>TControl</tt>, we define its <tt>ID</tt> property using the following getter and setter methods, +<com:TTextHighlighter CssClass="source block-content" id="code_110056"> +class TControl extends TComponent { + public function getID() { + ... + } + public function setID($value) { + ... + } +} +</com:TTextHighlighter> +</p> +<p id="110115" class="block-content"> +To get or set the <tt>ID</tt> property, do as follows, just like working with a variable, +<com:TTextHighlighter CssClass="source block-content" id="code_110057"> +$id = $component->ID; +$component->ID = $id; +</com:TTextHighlighter> +This is equivalent to the following, +<com:TTextHighlighter CssClass="source block-content" id="code_110058"> +$id = $component->getID(); +$component->setID( $id ); +</com:TTextHighlighter> +</p> +<p id="110116" class="block-content"> +A property is read-only if it has a getter method but no setter method. Since PHP method names are case-insensitive, property names are also case-insensitive. A component class inherits all its ancestor classes' properties. +</p> + +<h3 id="706">Subproperties</h3> +<p id="110117" class="block-content"> +A subproperty is a property of some object-typed property. For example, <tt>TWebControl</tt> has a <tt>Font</tt> property which is of <tt>TFont</tt> type. Then the <tt>Name</tt> property of <tt>Font</tt> is referred to as a subproperty (with respect to <tt>TWebControl</tt>). +</p> +<p id="110118" class="block-content"> +To get or set the <tt>Name</tt> subproperty, use the following method, +<com:TTextHighlighter CssClass="source block-content" id="code_110059"> +$name = $component->getSubProperty('Font.Name'); +$component->setSubProperty('Font.Name', $name); +</com:TTextHighlighter> +This is equivalent to the following, +<com:TTextHighlighter CssClass="source block-content" id="code_110060"> +$name = $component->getFont()->getName(); +$component->getFont()->setName( $name ); +</com:TTextHighlighter> +</p> + +<h3 id="26001">Js-friendly properties</h3> +<p class="block-content"> +A JavaScript-friendly property is a property that can accept both simple strings and raw javascript. +Prado automatically encodes all properties sent clientside inside javascript blocks to avoid security problems (like injections or cross site scripting). +If a property is known to always contain only safe javascript code and its value needs to bypass this encoding, that property can be defined in a special way that will make Prado mark its value as "safe". +Js-friendly properties are identified by their name starting with 'js' (case insensitive): +<com:TTextHighlighter CssClass="source block-content"> +// getter, defines a readable property 'Text' +function getJsText() { … } +// setter, defines a writable property 'Text', with $value being the value to be set to the property +function setJsText(TJavaScriptLiteral $value) { … } +</com:TTextHighlighter> +Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name: +<com:TTextHighlighter CssClass="source block-content"> +// set some simple text as property value +$component->Text = 'text'; +// set some javascript code as property value +$component->JsText = 'raw javascript'; +</com:TTextHighlighter> +In the first case, the property value will automatically gets encoded when sent clientside inside a javascript block. +In the second case, the property will be 'marked' as being a safe javascript statement and will not be encoded when rendered inside a javascript block. +This special handling makes use of the <tt>TJavaScriptLiteral</tt> class. +</p> + + +<h2 id="703">Component Events</h2> +<p id="110119" class="block-content"> +Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component. +</p> +<p id="110120" class="block-content"> +A component event is defined by the existence of a method whose name starts with the word <tt>on</tt>. The event name is the method name and is thus case-insensitve. For example, in <tt>TButton</tt>, we have +<com:TTextHighlighter CssClass="source block-content" id="code_110061"> +class TButton extends TWebControl { + public function onClick( $param ) { + ... + } +} +</com:TTextHighlighter> +This defines an event named <tt>OnClick</tt>, and a handler can be attached to the event using one of the following ways, +<com:TTextHighlighter CssClass="source block-content" id="code_110062"> +$button->OnClick = $callback; +$button->OnClick->add( $callback ); +$button->OnClick[] = $callback; +$button->attachEventHandler( 'OnClick' , $callback ); +</com:TTextHighlighter> +</p> + The variable <tt>$callback</tt> contains the definition of the event handler that can be either a string referring to a global function name, or an array whose first element refers to an object and second element a method name/path that is reachable by the object, e.g. + </p> +<ul> +<li>'buttonClicked' : buttonClicked($sender,$param);</li> +<li>array($object,'buttonClicked') : $object->buttonClicked($sender,$param);</li> +<li>array($object,'MainContent.SubmitButton.buttonClicked') : $object->MainContent->SubmitButton->buttonClicked($sender,$param);</li> +</ul> + +<h2 id="704">Namespaces</h2> +<p id="110121" class="block-content"> +A namespace refers to a logical grouping of some class names so that they can be differentiated from other class names even if their names are the same. Since PHP does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. To differentiate from user defined classes, all PRADO classes are prefixed with a letter 'T' (meaning 'Type'). Users are advised not to name their classes like this. Instead, they may prefix their class names with any other letter(s). +</p> +<p id="110122" class="block-content"> +A namespace in PRADO is considered as a directory containing one or several class files. A class may be specified without ambiguity using such a namespace followed by the class name. Each namespace in PRADO is specified in the following format, +<div class="source"> +PathAlias.Dir1.Dir2 +</div> +where <tt>PathAlias</tt> is an alias of some directory, while <tt>Dir1</tt> and <tt>Dir2</tt> are subdirectories under that directory. A class named <tt>MyClass</tt> defined under <tt>Dir2</tt> may now be fully qualified as <tt>PathAlias.Dir1.Dir2.MyClass</tt>. +</p> +<p id="110123" class="block-content"> +To use a namespace in code, do as follows, +<com:TTextHighlighter CssClass="source block-content" id="code_110063"> +Prado::using('PathAlias.Dir1.Dir2.*'); +</com:TTextHighlighter> +which appends the directory referred to by <tt>PathAlias.Dir1.Dir2</tt> into PHP include path so that classes defined under that directory may be instantiated without the namespace prefix. You may also include an individual class definition by +<com:TTextHighlighter CssClass="source block-content" id="code_110064"> +Prado::using('PathAlias.Dir1.Dir2.MyClass'); +</com:TTextHighlighter> +which will include the class file if <tt>MyClass</tt> is not defined. +</p> +<p id="110124" class="block-content"> +For more details about defining path aliases, see <a href="?page=Configurations.AppConfig">application configuration</a> section. +</p> + +<h2 id="705">Component Instantiation</h2> +<p id="110125" class="block-content"> +Component instantiation means creating instances of component classes. There are two types of component instantation: static instantiation and dynamic instantiation. The created components are called static components and dynamic components, respectively. +</p> + +<h3 id="707">Dynamic Component Instantiation</h3> +<p id="110126" class="block-content"> +Dynamic component instantiation means creating component instances in PHP code. It is the same as the commonly referred object creation in PHP. A component can be dynamically created using one of the following two methods in PHP, +<com:TTextHighlighter CssClass="source block-content" id="code_110065"> +$component = new ComponentClassName; +$component = Prado::createComponent('ComponentType'); +</com:TTextHighlighter> +where <tt>ComponentType</tt> refers to a class name or a type name in namespace format (e.g. <tt>System.Web.UI.TControl</tt>). The second approach is introduced to compensate for the lack of namespace support in PHP. +</p> + +<h3 id="708">Static Component Instantiation</h3> +<p id="110127" class="block-content"> +Static component instantiation is about creating components via <a href="?page=Configurations.Overview">configurations</a>. The actual creation work is done by the PRADO framework. For example, in an <a href="?page=Configurations.AppConfig">application configuration</a>, one can configure a module to be loaded when the application runs. The module is thus a static component created by the framework. Static component instantiation is more commonly used in <a href="?page=Configurations.Templates1">templates</a>. Every component tag in a template specifies a component that will be automatically created by the framework when the template is loaded. For example, in a page template, the following tag will lead to the creation of a <tt>TButton</tt> component on the page, +<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_110066"> +<com:TButton Text="Register" /> +</com:TTextHighlighter> +</p> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/Fundamentals/Components2.page b/demos/quickstart/protected/pages/Fundamentals/Components2.page new file mode 100644 index 00000000..7fc3e010 --- /dev/null +++ b/demos/quickstart/protected/pages/Fundamentals/Components2.page @@ -0,0 +1,207 @@ +<com:TContent ID="body" > +<h1 id="701">Components: Part II</h1> +<com:SinceVersion Version="3.2.3" /> +<h2 id="26001">Global events</h2> +<p id="130001" class="block-content"> +With the addition of behaviors, a more expansive event model is needed. There +are two new event types (global and dynamic events) as well as a more comprehensive +behavior model that includes class wide behaviors. +</p> +<p id="130002" class="block-content"> +A global event is defined by all events whose name starts with 'fx'. +The event name is potentially a method name and is thus case-insensitive. All 'fx' events +are valid as the whole 'fx' event/method space is global in nature. Any object may patch into +any global event by defining that event as a method. Global events have priorities +just like 'on' events; so as to be able to order the event execution. Due to the +nature of all events which start with 'fx' being valid, in effect, every object +has every 'fx' global event. It is simply an issue of tapping into the desired +global event. +</p> +<p id="130003" class="block-content"> +A global event that starts with 'fx' can be called even if the object does not +implement the method of the global event. A call to a non-existing 'fx' method +will, at minimal, function and return null. If a method argument list has a first +parameter, it will be returned instead of null. This allows filtering and chaining. +'fx' methods do not automatically install and uninstall. To install and uninstall an +object's global event listeners, call the object's <tt>listen</tt> and +<tt>unlisten</tt> methods, respectively. An object may auto-install its global event +during <tt>__construct</tt> by overriding <tt>getAutoGlobalListen</tt> and returning true. +</p> +<p id="130004" class="block-content"> +As of PHP version 5.3, nulled objects without code references will still continue to persist +in the global event queue because <tt>__destruct</tt> is not automatically called. In the common +__destruct method, if an object is listening to global events, then <tt>unlisten</tt> is called. +<tt>unlisten</tt> is required to be manually called before an object is +left without references if it is currently listening to any global events. This includes +class wide behaviors. +</p> +<p id="130005" class="block-content"> +An object that contains a method that starts with 'fx' will have those functions +automatically receive those events of the same name after <tt>listen</tt> is called on the object. +</p> +<p id="130006" class="block-content"> +An object may listen to a global event without defining an 'fx' method of the same name by +adding an object method to the global event list. For example +</p> +<com:TTextHighlighter CssClass="source block-content"> +$component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback); +$component->attachEventHandler('fxGlobalCheck',array($object, 'someMethod')); +</com:TTextHighlighter> +<h2 id="26002">Events between Objects and their behaviors, Dynamic Events</h2> +<p id="130007" class="block-content"> +An intra-object/behavior event is defined by methods that start with 'dy'. Just as with +'fx' global events, every object has every dynamic event. Any call to a method that +starts with 'dy' will be handled, regardless of whether it is implemented. These +events are for communicating with attached behaviors. +</p> +<p id="130008" class="block-content"> +Dynamic events can be used in a variety of ways. They can be used to tell behaviors +when a non-behavior method is called. Dynamic events could be used as data filters. +They could also be used to specify when a piece of code is to be run, eg. should the +loop process be performed on a particular piece of data. In this way, some control +is handed to the behaviors over the process and/or data. +</p> +<p id="130009" class="block-content"> +If there are no handlers for an 'fx' or 'dy' event, it will return the first +parameter of the argument list. If there are no arguments, these events +will return null. If there are handlers an 'fx' method will be called directly +within the object. Global 'fx' events are triggered by calling <tt>raiseEvent</tt>. +For dynamic events where there are behaviors that respond to the dynamic events, a +<tt>TCallChain</tt> is developed. A call chain allows the behavior dynamic event +implementations to call further implementing behaviors within a chain. +</p> +<p id="130010" class="block-content"> +If an object implements <tt>IDynamicMethods</tt>, all global and object dynamic +events will be sent to <tt>__dycall</tt>. In the case of global events, all +global events will trigger this method. In the case of behaviors, all undefined +dynamic events which are called will be passed through to this method. +</p> +<p id="130011" class="block-content"> +<h2 id="26003">Behaviors</h2> +<p id="130012" class="block-content"> +There are two types of behaviors. There are individual object behaviors and +there are class wide behaviors. Class behaviors depend upon object behaviors. +</p> +<p id="130013" class="block-content"> +When a new class implements <tt>IBehavior</tt> or <tt>IClassBehavior</tt> or +extends <tt>TBehavior</tt> or <tt>TClassBehavior</tt>, it may be added to an +object by calling the object's <tt>attachBehavior</tt>. The behaviors associated +name can then be used to <tt>enableBehavior</tt> or <tt>disableBehavior</tt> +the specific behavior. +</p> +<p id="130014" class="block-content"> +All behaviors may be turned on and off via <tt>enableBehaviors</tt> and +<tt>disableBehaviors</tt>, respectively. To check if behaviors are on or off +a call to <tt>getBehaviorsEnabled</tt> will provide the variable. +</p> +<p id="130015" class="block-content"> +Attaching and detaching whole sets of behaviors is done using +<tt>attachBehaviors</tt> and <tt>detachBehaviors</tt>. <tt>clearBehaviors</tt> +removes all of an object's behaviors. +</p> +<p id="130016" class="block-content"> +<tt>asa</tt> returns a behavior of a specific name. <tt>isa</tt> is the +behavior inclusive function that acts as the PHP operator <tt>instanceof</tt>. +A behavior could provide the functionality of a specific class thus causing +the host object to act similarly to a completely different class. A behavior +would then implement <tt>IInstanceCheck</tt> to provide the identity of the +different class. +</p> +<p id="130017" class="block-content"> +Class behaviors are similar to object behaviors except that the class behavior +is the implementation for all instances of the class. A class behavior +will have the object upon which is being called be prepended to the parameter +list. This way the object is known across the class behavior implementation. +</p> +<p id="130018" class="block-content"> +Class behaviors are attached using <tt>attachClassBehavior</tt> and detached +using <tt>detachClassBehavior</tt>. Class behaviors are important in that +they will be applied to all new instances of a particular class. In this way +class behaviors become default behaviors to a new instances of a class in +<tt>__construct</tt>. Detaching a class behavior will remove the behavior +from the default set of behaviors created for an object when the object +is instanced. +</p> +<p id="130019" class="block-content"> +Class behaviors are also added to all existing instances via the global 'fx' +event mechanism. When a new class behavior is added, the event +<tt>fxAttachClassBehavior</tt> is raised and all existing instances that are +listening to this global event (primarily after <tt>listen</tt> is called) +will have this new behavior attached. A similar process is used when +detaching class behaviors. Any objects listening to the global 'fx' event +<tt>fxDetachClassBehavior</tt> will have a class behavior removed. +</p> +<h2 id="26004">Dynamic Intra-Object Events</h2> +<p id="130020" class="block-content"> +Dynamic events start with 'dy'. This mechanism is used to allow objects +to communicate with their behaviors directly. The entire 'dy' event space +is valid. All attached, enabled behaviors that implement a dynamic event +are called when the host object calls the dynamic event. If there is no +implementation or behaviors, this returns null when no parameters are +supplied and will return the first parameter when there is at least one +parameter in the dynamic event. +</p> +<com:TTextHighlighter CssClass="source block-content"> + null == $this->dyBehaviorEvent(); + 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event +</com:TTextHighlighter> +<p id="130021" class="block-content"> +Dynamic events can be chained together within behaviors to allow for data +filtering. Dynamic events are implemented within behaviors by defining the +event as a method. +</p> +<com:TTextHighlighter CssClass="source block-content"> +class TObjectBehavior extends TBehavior { + public function dyBehaviorEvent($param1, $callchain) { + //Do something, eg: $param1 += 13; + return $callchain->dyBehaviorEvent($param1); + } +} +</com:TTextHighlighter> +<p id="130022" class="block-content"> +This implementation of a behavior and dynamic event will flow through to the +next behavior implementing the dynamic event. The first parameter is always +return when it is supplied. Otherwise a dynamic event returns null. +</p> +<p id="130023" class="block-content"> +In the case of a class behavior, the object is also prepended to the dynamic +event. +</p> +<com:TTextHighlighter CssClass="source block-content"> +class TObjectClassBehavior extends TClassBehavior { + public function dyBehaviorEvent($hostobject, $param1, $callchain) { + //Do something, eg: $param1 += $hostobject->getNumber(); + return $callchain->dyBehaviorEvent($param1); + } +} +</com:TTextHighlighter> +</p> +<p id="130024" class="block-content"> +When calling a dynamic event, only the parameters are passed. The host object +and the call chain are built into the framework. +</p> + +<h2 id="26005">Global Event and Dynamic event catching</h2> + +<p id="130025" class="block-content"> +Given that all global 'fx' events and dynamic 'dy' events are valid and +operational, there is a mechanism for catching events called that are not +implemented (similar to the built-in PHP method <tt>__call</tt>). When +a dynamic or global event is called but a behavior does not implement it, +yet desires to know when an undefined dynamic event is run, the behavior +implements the interface <tt>IDynamicMethods</tt> and method <tt>__dycall</tt>. +</p> +<p id="130026" class="block-content"> +In the case of dynamic events, <tt>__dycall</tt> is supplied with the method +name and its parameters. When a global event is raised, via <tt>raiseEvent</tt>, +the method is the event name and the parameters are supplied. +</p> +<p id="130027" class="block-content"> +When implemented, this catch-all mechanism is called for event global event event +when implemented outside of a behavior. Within a behavior, it will also be called +when the object to which the behavior is attached calls any unimplemented dynamic +event. This is the fall-back mechanism for informing a class and/or behavior +of when an global and/or undefined dynamic event is executed. +</p> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/Fundamentals/Pages.page b/demos/quickstart/protected/pages/Fundamentals/Pages.page index 19900937..58f4f06d 100755 --- a/demos/quickstart/protected/pages/Fundamentals/Pages.page +++ b/demos/quickstart/protected/pages/Fundamentals/Pages.page @@ -5,13 +5,27 @@ Pages are top-most controls that have no parent. The presentation of pages are directly displayed to end-users. Users access pages by sending page service requests.
</p>
<p id="130138" class="block-content">
-Each page must have a <a href="?page=Configurations.Templates1">template</a> file. The file name suffix must be <tt>.page</tt>. The file name (without suffix) is the page name. PRADO will try to locate a page class file under the directory containing the page template file. Such a page class file must have the same file name (suffixed with <tt>.php</tt>) as the template file. If the class file is not found, the page will take class <tt>TPage</tt>.
+Each page can have a <a href="?page=Configurations.Templates1">template</a> file. The file name suffix must be <tt>.page</tt>. The file name (without suffix) is the page name. PRADO will try to locate a page class file under the directory containing the page template file. Such a page class file must have the same file name (suffixed with <tt>.php</tt>) as the template file. If the class file is not found, the page will take class <tt>TPage</tt>.
</p>
<h2 id="902">PostBack</h2>
<p id="130139" class="block-content">
A form submission is called <i>postback</i> if the submission is made to the page containing the form. Postback can be considered an event happened on the client side, raised by the user. PRADO will try to identify which control on the server side is responsible for a postback event. If one is determined, for example, a <tt>TButton</tt>, we call it the postback event sender which will translate the postback event into some specific server-side event (e.g. <tt>OnClick</tt> and <tt>OnCommand</tt> events for <tt>TButton</tt>).
+<br/>
+<tt>TPage</tt> has a <tt>IsPostBack</tt> property exposing whether the current request being handled is the first request for this page or the consequence of a postback.
+</p>
+<h2>CallBack</h2>
+<p class="block-content">
+A <i>callback</i> is a special form submission that, instead of requiring a full page reload on the browser, gets executed in the background through an ajax call. So, a callback is considered a postback too, but not vice versa.
+<br/>
+A callback is handled as a normal postback but, instead of re-rendering the entire page, only the specific changes occured on the page gets sent back to the client and merged with the current browser page. A typical callback response consists of:
+<ol>
+ <li>one or more pieces of html code that will replace existing content on the page;</li>
+ <li>the javascript instructions needed to update the page;</li>
+ <li>some specific fields used by prado to mantain the pagestate and add the needed external resources (stylesheets, javascript files, etc..).</li>
+</ol>
+<tt>TPage</tt> has a <tt>IsCallBack</tt> property exposing whether the current request being handled is the consequence of a callback. Since a callback is also a postback, both <tt>IsPostBack</tt> and <tt>IsCallBack</tt> are true during callback requests.
</p>
<h2 id="903">Page Lifecycles</h2>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Services.page b/demos/quickstart/protected/pages/Fundamentals/Services.page index 5e5889df..ee19a159 100755 --- a/demos/quickstart/protected/pages/Fundamentals/Services.page +++ b/demos/quickstart/protected/pages/Fundamentals/Services.page @@ -16,7 +16,7 @@ Developers may implement additional services for their applications. To make a s <h2 id="1102">Page Service</h2>
<p id="150154" class="block-content">
-PRADO implements <tt>TPageService</tt> to process users' page requests. Pages are stored under a directory specified by the <tt>BasePath</tt> property of the page service. The property defaults to <tt>pages</tt> directory under the application base path. You may change this default by configuring the service in the application configuration.
+PRADO implements <tt>TPageService</tt> to process users' page requests. Pages are stored under a directory specified by the <tt>BasePath</tt> property of the page service. The property defaults to <tt>Pages</tt> directory under the application base path. You may change this default by configuring the service in the application configuration.
</p>
<p id="150155" class="block-content">
Pages may be organized into subdirectories under the <tt>BasePath</tt>. In each directory, there may be a page configuration file named <tt>config.xml</tt>, which contains configurations effective only when a page under that directory or a sub-directory is requested. For more details, see the <a href="?page=Configurations.PageConfig">page configuration</a> section.
@@ -30,5 +30,8 @@ http://hostname/index.php?page=Users.Register </com:TTextHighlighter>
where the first example takes advantage of the fact that the page service is the default service and <tt>Home</tt> is the default page.
</p>
+<p class="block-content">
+More advanced url routes, like masking real page names and permitting the use of dynamic parameters can be created using the <a href="?page=Configurations.UrlMapping">Url mapping</a> module.
+</p>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page b/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page index 22437158..1a416a32 100755 --- a/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page +++ b/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page @@ -51,12 +51,12 @@ Most PHP frameworks mainly focuses on separating presentation and logic and prom <h2 id="4004">Is PRADO Stable Enough?</h2>
<p id="20004" class="block-content">
-Yes. PRADO was initially released in August 2004. Many test suites have been written and conducted frequently to ensure its quality. It has been used by thousands of developers and many Web applications have been developed based on it. Bugs and feature requests are managed through TRAC system and we have a great user community and development team to ensure all questions are answered in a timely fashion.
+Yes. PRADO was initially released in August 2004. Many test suites have been written and conducted frequently to ensure its quality. It has been used by thousands of developers and many Web applications have been developed based on it. Bugs and feature requests are managed through GitHub and we have a great user community and development team to ensure all questions are answered in a timely fashion.
</p>
<h2 id="205">History of PRADO</h2>
<p id="20014" class="block-content">
-The very original inspiration of PRADO came from Apache Tapestry. During the design and implementation, I borrowed many ideas from Borland Delphi and Microsoft ASP.NET. The first version of PRADO came out in June 2004 and was written in PHP 4. Driven by the Zend PHP 5 coding contest, I rewrote PRADO in PHP 5, which proved to be a wise move, thanks to the new object model provided by PHP 5. PRADO won the grand prize in the Zend contest, earning the highest votes from both the public and the judges' panel.
+The very original inspiration of PRADO came from Apache Tapestry. During the design and implementation, Qiang Xue borrowed many ideas from Borland Delphi and Microsoft ASP.NET. The first version of PRADO came out in June 2004 and was written in PHP 4. Driven by the Zend PHP 5 coding contest, Qiang rewrote PRADO in PHP 5, which proved to be a wise move, thanks to the new object model provided by PHP 5. PRADO won the grand prize in the Zend contest, earning the highest votes from both the public and the judges' panel.
</p>
<p id="20015" class="block-content">
In August 2004, PRADO started to be hosted on SourceForge as an open source project. Soon after, the project site <a href="http://www.xisc.com/">xisc.com</a> was announced to public. With the fantastic support of PRADO developer team and PRADO users, PRADO evolved to version 2.0 in mid 2005. In this version, Wei Zhuo contributed to PRADO with the excellent I18N and L10N support.
@@ -64,6 +64,12 @@ In August 2004, PRADO started to be hosted on SourceForge as an open source proj <p id="20016" class="block-content">
In May 2005, we decided to completely rewrite the PRADO framework to resolve a few fundamental issues found in version 2.0 and to catch up with some cool features available in Microsoft ASP.NET 2.0. After nearly a year's hard work with over 50,000 lines of new code, version 3.0 was finally made available in April 2006.
</p>
+<p class="block-content">
+In October 2008, the original development team released a new framework called <a href="http://www.yiiframework.com/">Yii</a>. Inheriting most of the PRADO code, Yii left the pages/events concept, focusing on a pure MVC design pattern. Since 2009 a lot of people contributed to PRADO fixing issues, developing new features or backporting them from Yii.
+</p>
+<p class="block-content">
+To promote a model of community-driven development, the project repositories were moved first on <a href="http://code.google.com/p/prado3/">Google Code</a> and then, in September 2013, on <a href="http://github.com/pradosoft/prado">GitHub</a>.
+</p>
<p id="20017" class="block-content">
Starting from version 3.0, significant efforts are allocated to ensure the quality and stability of PRADO. If we say PRADO v2.x and v1.x are proof-of-concept work, we can say PRADO 3.x has grown up to a project that is suitable for serious business application development.
</p>
diff --git a/demos/quickstart/protected/pages/GettingStarted/CommandLine.page b/demos/quickstart/protected/pages/GettingStarted/CommandLine.page index bc8f2f55..07609da5 100644 --- a/demos/quickstart/protected/pages/GettingStarted/CommandLine.page +++ b/demos/quickstart/protected/pages/GettingStarted/CommandLine.page @@ -15,7 +15,7 @@ the command line. <h2 id="503">Usage</h2>
<p id="70048" class="block-content">
If you type <tt>php path/to/framework/prado-cli.php</tt>, you should see
-the following information. Alternatively, if you are not on Windows,
+the following information. Alternatively, if you are not on Windows,
you may try to change the <tt>prado-cli.php</tt> into an executable
and execute it as a script</p>
<com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70006">
@@ -85,7 +85,7 @@ we <b>leave out the semicolon</b> to show the results. <com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70010">
>> $db->queryPostByID(1)
</com:TTextHighlighter>
-There should not be any errors and you should see the following.
+There should not be any errors and you should see the following.
<com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70011">
PostRecord#1
(
@@ -130,7 +130,7 @@ At the prompt, enter the following two commands to create <tt>UserRecord</tt> an </com:TTextHighlighter>
<p>
-Here we used the <a href="?page=Fundamentals.Components">namespace format</a> again to specify the classes to be created. The path <tt>Application.database.UserRecord</tt> indicates that we want the <tt>UserRecord</tt> class file to be <tt>protected/database/UserRecord.php</tt>.
+Here we used the <a href="?page=Fundamentals.Components1">namespace format</a> again to specify the classes to be created. The path <tt>Application.database.UserRecord</tt> indicates that we want the <tt>UserRecord</tt> class file to be <tt>protected/database/UserRecord.php</tt>.
</p>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/Installation.page b/demos/quickstart/protected/pages/GettingStarted/Installation.page index 7919e733..956f53c2 100755 --- a/demos/quickstart/protected/pages/GettingStarted/Installation.page +++ b/demos/quickstart/protected/pages/GettingStarted/Installation.page @@ -5,16 +5,17 @@ If you are viewing this page from your own Web server, you are already done with the installation.
</p>
<p id="30019">
-The minimum requirement by PRADO is that the Web server support PHP 5.2. 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.2 is supported.
+The minimum requirement by PRADO is that the Web server support PHP 5.3.3. PRADO has been tested with Apache Web server on Windows, MacOSX and various Linux distro. Highly possibly it may also run on other platforms with other Web servers, as long as PHP 5.3.3 is supported.
</p>
</div>
-<div id="install-steps" class="block-content">
<p id="30020">
-Installation of PRADO mainly involves downloading and unpacking.
+PRADO can be installed as a standalone package or using <a href="http://getcomposer.org/">composer</a>
</p>
+<div id="install-steps" class="block-content">
+<h3>Standalone package</h3>
<ol>
-<li>Go to <a href="http://www.pradosoft.com/">pradosoft.com</a> to grab the latest version of PRADO.</li>
+<li>Go to <a href="http://www.pradosoft.com/download/">pradosoft.com</a> to grab the latest version of PRADO.</li>
<li>Unpack the PRADO release file to a Web-accessible directory.
</ol>
</div>
@@ -25,5 +26,37 @@ Your installation of PRADO is done and you can start to play with the demo appli <p id="30022">
If you encounter any problems with the demo applications, please use the PRADO requirement checker script, accessible via <tt>http://web-server-address/prado/requirements/index.php</tt>, to check first if your server configuration fulfills the conditions required by PRADO.
</p>
+
+<div id="install-steps" class="block-content">
+<h3>Composer install</h3>
+<ol>
+<li>If you don't have installed composer already, install it globally:
+<com:TTextHighlighter CssClass="source block-content">
+$ curl -s http://getcomposer.org/installer | php
+$ php composer.phar install
+</com:TTextHighlighter>
+</li>
+<li>Create a composer.json file for your project:
+<com:TTextHighlighter CssClass="source block-content">
+{
+ "require": {
+ "pradosoft/prado": "~3.2"
+ }
+}
+</com:TTextHighlighter>
+</li>
+<li>Now run the actual installation:
+<com:TTextHighlighter CssClass="source block-content">
+$ composer install
+</com:TTextHighlighter>
+</li>
+<li>In your project include the autoloader, and you will have access to the library classes:
+<com:TTextHighlighter CssClass="source block-content">
+<?php
+require_once('vendor/autoload.php');
+</com:TTextHighlighter>
+</li>
+</ol>
</div>
+
</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page b/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page new file mode 100644 index 00000000..e6e2b1cf --- /dev/null +++ b/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page @@ -0,0 +1,234 @@ +<com:TContent ID="body" > + +<h1>Upgrading from v3.2</h1> + +<div class="block-content"> +<p class="block-content"> +Since version 3.3, PRADO uses <a href="http://jquery.com/">jQuery</a> as its default javascript framework. +Previously, up to version 3.2, PRADO used <a href="http://prototypejs.org/">Prototype</a> and <a href="http://script.aculo.us/">Scriptaculous</a> as its default javascript framework. +</p> +<p class="block-content"> +PRADO relies a lot on clientside javascript code to implement its <a href="?page=Controls.Standard">standard controls</a>, to handle clientside <a href="?page=Controls.Validation">validators</a>, and to create a seamless <a href="?page=ActiveControls.Introduction">ajax</a> experience using <a href="?page=ActiveControls.Home">active controls</a>. +All this javascript code, originally developed on Prototype, has been rewritten in order to use jQuery instead. The choice was mainly driven by the lack of development and decline of the Prototype community, while jQuery has become the de-facto standard library for javascript. +</p> +<p class="block-content"> +While the PRADO javascript code is ready to work with jQuery, legacy javascript code in existing applications can require some porting to make it work properly. +We summarize in the following the most significant changes in v3.3 to help developers upgrade their v3.2 PRADO applications more easily, if needed. +</p> +</div> + +<h2>Basic Prototype to jQuery javascript porting</h2> +<p class="block-content"> +The number one rule on writing jQuery javascript code is to read the <a href="http://api.jquery.com/">jQuery documentation</a>. Porting code from Prototype to jQuery needs some effort: here's a basic lookup table to port existing code: +</p> +<table class="tabular"> + <tr> + <th></th> + <th>Prototype (OLD)</th> + <th>jQuery (NEW)</th> + </tr> + <tr> + <td>Get element by id</td> + <td>$('element_id')</td> + <td>// get the base DOM element + <br/>$('#element_id').get(0) + <br/>// get the the extended element + <br/>$('#element_id').eq(0) + </td> + </tr> + <tr> + <td>Get element by css selector</td> + <td>$$('.class')</td> + <td>$('.class')</td> + </tr> + <tr> + <td>Apply a function to multiple elements</td> + <td>$$('.class').each(Element.remove)</td> + <td>$('.class').remove()</td> + </tr> + <tr> + <td>Create or extend a class</td> + <td>Class.create(Prado.WebUI.Control, { ... }) + <br/>Class.extend(Prado.WebUI.Control, { ... }) + </td> + <td>jQuery.klass(Prado.WebUI.Control, { ... })</td> + </tr> + <tr> + <td>Extend an object</td> + <td>Object.extend(...)</td> + <td>jQuery.extend(...)</td> + </tr> + <tr> + <td>Bind an event to a callback event handler</td> + <td>Event.observe(element, 'click', callback)</td> + <td>$(element).on('click', callback)</td> + </tr> + <tr> + <td>Unbind an event from a callback event handler</td> + <td>Event.stopObserving(element, 'click', callback)</td> + <td>$(element).off('click', callback)</td> + </tr> + <tr> + <td>Stop event propagation</td> + <td>Event.stop(event)</td> + <td>// stop event bubbling chain + <br/>event.stopPropagation() + <br/>// prevent form submit + <br/>event.preventDefault() + </td> + </tr> + <tr> + <td>Detect keypress event</td> + <td>if(kc == Event.KEY_RETURN || + <br/>kc == Event.KEY_SPACEBAR || + <br/>kc == Event.KEY_TAB)</td> + <td>// use the numeric codes + <br/>if(kc == 13 || + <br/>kc == 32 || + <br/>kc == 9) + </td> + </tr> + <tr> + <td>Execute a function when the page has finished loading</td> + <td>document.observe("dom:loaded", function(event) { ... })</td> + <td>$( document ).ready(function() { ... })</td> + </tr> + <tr> + <td>Create an animation effect with a "finish" callback</td> + <td>new Effect.Fade(element, { + <br/>duration: 400, + <br/>afterFinish: function() { + <br/>// Animation complete. + <br/>});</td> + <td>$(element).fadeOut( 400, function() { + <br/>// Animation complete. + <br/>});</td> + </tr> + <tr> + <td>Declare a function to be used as event handler binding its "this" property</td> + <td>this.functionName.bindAsEventListener(this)</td> + <td>this.functionName.bind(this)</td> + </tr> + <tr> + <td>Css class functions (add, remove, test for css class)</td> + <td>addClassName() + <br/>removeClassName() + <br/>hasClassName() + </td> + <td>addClass() + <br/>removeClass() + <br/>hasClass() + </td> + </tr> + <tr> + <td>Get event target inside an event handler</td> + <td>Event.element(event)</td> + <td>event.target</td> + </tr> + <tr> + <td>Get event mouse position</td> + <td>Event.pointerX(event) + <br/>Event.pointerY(event) + </td> + <td>event.pageX + <br/>event.pageY + </td> + </tr> + <tr> + <td>Fire events</td> + <td>Event.fireEvent(this.control, "change")</td> + <td>$(element).trigger("change")</td> + </tr> + <tr> + <td>Get element size</td> + <td>element.getWidth() + <br/>element.getHeight() + </td> + <td>element.width + <br/>element.height + </td> + </tr> + <tr> + <td>Hook on ajax events</td> + <td>Ajax.Responders.register({ + <br/>"onLoading" : my_function + <br/>}); + <br/>Ajax.Responders.register({ + <br/>"onSuccess" : my_function + <br/>}); + </td> + <td>$( document ).ajaxSend(my_function); + <br/>$( document ).ajaxSuccess(my_function); + </td> + </tr> +</table> + +<h2>PRADO specific code changes</h2> +<p class="block-content"> +PRADO +Porting prado to jQuery some method signatures has changed, or have been adapted: +</p> +<table class="tabular"> + <tr> + <th></th> + <th>Prototype (OLD)</th> + <th>jQuery (NEW)</th> + </tr> + <tr> + <td>Implementing the postback handler for a PostBackControl; + <br/>the function signature has changed (parameters are inverted):</td> + <td>onPostBack : function(event, options)</td> + <td>onPostBack : function(options, event)</td> + </tr> + <tr> + <td>Execute a postback</td> + <td>Prado.PostBack(options, event);</td> + <td>// Create a new object + <br/>new Prado.PostBack(options, event); + </td> + </tr> + <tr> + <td>Test browser software method has been removed</td> + <td>Prado.Browser().ie</td> + <td>// Test for browser support for specific capabilities instead + <br/>jQuery.support + <br/>// or, better, use <a href="http://modernizr.com/">Modernizr</a> + </td> + </tr> + <tr> + <td>Focus an element</td> + <td>Prado.Element.focus(element)</td> + <td>$(element).focus()</td> + </tr> +</table> + +<h2>Specific controls changes</h2> +<p class="block-content"> +Some Prado controls were based on specific extensions of the Prototype + Scriptaculous javascript framework, and they have been deprecated now that jQuery has become the primary js framework in PRADO. +PRADO 3.3 introduces jQuery-based counterpart for these controls and encourage everyone to port their code to the new controls, but the old controls are still supposed to work with some minor annoyance: +<ul> + <li>Prototype and Scriptaculous will be loaded along jQuery</li> + <li>jQuery will execute in "no conflict" mode, so the $() helper won't call anymore jQuery but Prototype.</li> +</ul> +Following is the list of deprecated controls: +</p> + +<h4>TAutoComplete</h4> +<p class="block-content"> +<tt>TAutoComplete</tt> is deprecated, use <tt>TJuiAutoComplete</tt> instead. Main changes in porting existing code using TAutoComplete to TJuiAutoComplete: +<ul> + <li>the <tt>Frequency</tt> property doesn't exists anymore</li> + <li>the <tt>minChars</tt> property is called <tt>minLength</tt></li> + <li>only the <tt>ItemTemplate</tt> is supported for the <tt>Suggestions</tt> repeater (no HeaderTemplate, FooterTemplate, etc..)</li> + <li><tt>ItemTemplate</tt> doesn't need to render the <li> tag anymore, but only the content itself</li> + <li>multiple selections are not supported</li> +</ul> +</p> + +<h4>TDraggable and TDropContainer</h4> +<p class="block-content"> +<tt>TDraggable</tt> and <tt>TDropContainer</tt> have been deprecated and replaced respectively by <tt>TJuiDraggable</tt> and <tt>TJuiDroppable</tt>. +The options for the new controls are available at <a href="http://api.jqueryui.com/">jQueryUI's API documentation</a>. +</p> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Home.page b/demos/quickstart/protected/pages/JuiControls/Home.page new file mode 100644 index 00000000..dee08dfe --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Home.page @@ -0,0 +1,49 @@ +<com:TContent ID="body" > +<h1>Jui Controls (jQuery UI)</h1> +<p class="block-content"> +Jui controls are the PRADO port of the standard <a href="http://jqueryui.com/">jQuery UI</a> widgets. They can be used as standard <a href="?page=ActiveControls.Introduction">Active Controls</a>, but will automatically load the needed jQuery UI javascript libraries. Jui controls have a <tt>Options</tt> property used to pass options to the underlying javascript object. For informations of the specific options of each widget, follow the <a href="http://api.jqueryui.com/category/widgets/">API Documentation</a> for the specific widget. +</p> + +<h2>PRADO Jui interactions controls</h2> +<ul id="u1" class="block-content"> + <li> + <a href="?page=JuiControls.TJuiDraggable">TJuiDraggable</a> + is an element that can be moved using the mouse. + <com:RunBar PagePath="JuiControls.Samples.TJuiDraggable.Home" /> + </li> + + <li> + <a href="?page=JuiControls.TJuiDroppable">TJuiDroppable</a> + is an area where TJuiDraggable elements can be released. + <com:RunBar PagePath="JuiControls.Samples.TJuiDroppable.Home" /> + </li> + + <li> + <a href="?page=JuiControls.TJuiResizable">TJuiResizable</a> + is an element that cna be resized using the mouse. + <com:RunBar PagePath="JuiControls.Samples.TJuiResizable.Home" /> + </li> + + <li> + <a href="?page=JuiControls.TJuiSelectable">TJuiSelectable</a> + displays a list of elements that can be selected individually. + <com:RunBar PagePath="JuiControls.Samples.TJuiSelectable.Home" /> + </li> + + <li> + <a href="?page=JuiControls.TJuiSortable">TJuiSortable</a> + displays a list of elements that can be selected individually. + <com:RunBar PagePath="JuiControls.Samples.TJuiSortable.Home" /> + </li> +</ul> + +<h2>PRADO Jui controls</h2> +<ul id="u2" class="block-content"> + <li> + <a href="?page=JuiControls.TJuiAutocomplete">TJuiAutocomplete</a> + displays a textbox where the user can choose from a list of suggestions. + <com:RunBar PagePath="JuiControls.Samples.TJuiAutocomplete.Home" /> + </li> +</ul> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page new file mode 100644 index 00000000..6912389d --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page @@ -0,0 +1,25 @@ +<com:TContent ID="body"> +<h1>TJuiDraggable Samples</h1> + +<com:TStyleSheet> + .ui-draggable { + width: 100px; + height:100px; + background-color: lime; + border: 1px solid black; + padding: 1em; + } +</com:TStyleSheet> +<table class="sampletable"> + +<tr><td class="samplenote"> +Default options with a little css applied: +</td><td class="sampleaction" style="height:600px"> + <com:TJuiDraggable> + Drag me around + </com:TJuiDraggable> +</td></tr> + +</table> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.page new file mode 100644 index 00000000..59cd3838 --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.page @@ -0,0 +1,48 @@ +<com:TContent ID="body"> +<h1>TJuiDraggable Samples</h1> + +<com:TStyleSheet> + .ui-draggable { + width: 100px; + height:100px; + background-color: lime; + border: 1px solid black; + padding: 1em; + } + .ui-droppable { + width: 150px; + height:150px; + border: 1px solid black; + padding: 1em; + margin: 1em; + } + .drop-yellow { + background-color: yellow; + } + .drop-red { + background-color: red; + } +</com:TStyleSheet> +<table class="sampletable"> + +<tr><td class="samplenote"> +Default options with a little css applied: +</td><td class="sampleaction" style="height:600px"> + <com:TJuiDraggable> + Drag me around + </com:TJuiDraggable> + + <com:TJuiDroppable OnDrop="drop1_ondrop" CssClass="drop-yellow"> + Drop it here! + <br/><com:TActiveLabel ID="label1" /> + </com:TJuiDroppable ID="drop1"> + + <com:TJuiDroppable OnDrop="drop2_ondrop" CssClass="drop-red"> + Drop it here! + <br/><com:TActiveLabel ID="label2" /> + </com:TJuiDroppable ID="drop1"> +</td></tr> + +</table> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.php new file mode 100644 index 00000000..cdbe85ba --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.php @@ -0,0 +1,16 @@ +<?php + +class Home extends TPage +{ + public function drop1_ondrop($sender, $param) + { + $draggable=$param->getDroppedControl()->ID; + $this->label1->Text="Dropped ".$draggable." at: <br/>Top=".$param->getOffsetTop()." Left=".$param->getOffsetLeft(); + } + + public function drop2_ondrop($sender, $param) + { + $draggable=$param->getDroppedControl()->ID; + $this->label2->Text="Dropped ".$draggable." at: <br/>Top=".$param->getOffsetTop()." Left=".$param->getOffsetLeft(); + } +} diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page new file mode 100644 index 00000000..b5a207c0 --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page @@ -0,0 +1,25 @@ +<com:TContent ID="body"> +<h1>TJuiResizable Samples</h1> + +<com:TStyleSheet> + .resizable { + width: 150px; + height: 150px; + padding: 0.5em; + background: #fff; + border: 1px solid #000; + } + </com:TStyleSheet> +<table class="sampletable"> + +<tr><td class="samplenote"> +Default options with a little css applied: +</td><td class="sampleaction"> + <com:TJuiResizable CssClass="resizable"> + Resize me! + </com:TJuiResizable> +</td></tr> + +</table> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.page new file mode 100644 index 00000000..4af5d637 --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.page @@ -0,0 +1,38 @@ +<com:TContent ID="body"> +<h1>TJuiSelectable Samples</h1> + +<com:TStyleSheet> + .ui-selectable { + list-style: none; + cursor: pointer; + } + .ui-selectable li { + border: 1px solid transparent; + padding: 3px; + border-radius:3px; + } + + .ui-selectable li:hover { + background: #FECA40; + border: 1px solid black; + } + + .ui-selecting { + background: #FECA40; + } + .ui-selected { + background: #F39814; color: white; + } +</com:TStyleSheet> +<table class="sampletable"> + +<tr><td class="samplenote"> +Default options with a little css applied: +</td><td class="sampleaction"> + <com:TJuiSelectable ID="repeater1" onSelectedIndexChanged="repeater1_onSelectedIndexChanged"/> + <com:TActiveLabel ID="label1" /> +</td></tr> + +</table> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.php new file mode 100644 index 00000000..cf8d40f1 --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.php @@ -0,0 +1,32 @@ +<?php + +class Home extends TPage +{ + protected $data = array( + 'PRADO', + 'quickstart', + 'tutorial', + 'sample', + 'for the', + 'TJuiSortable', + 'control', + ); + + public function onLoad($param) + { + if(!$this->IsPostback) + { + $this->repeater1->DataSource=$this->data; + $this->repeater1->dataBind(); + } + } + + public function repeater1_onSelectedIndexChanged($sender, $param) + { + $this->label1->Text="Selected items:"; + $items = $param->getSelectedIndexes(); + + foreach($items as $index) + $this->label1->Text.=' '.$this->data[$index]; + } +} diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page new file mode 100644 index 00000000..2e1d2f55 --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page @@ -0,0 +1,32 @@ +<com:TContent ID="body"> +<h1>TJuiSortable Samples</h1> + +<com:TStyleSheet> + .ui-sortable { + list-style: none; + cursor: pointer; + } + + .ui-sortable li { + border: 1px solid transparent; + padding: 3px; + border-radius:3px; + } + + .ui-sortable li:hover { + background: lime; + border: 1px solid black; + } +</com:TStyleSheet> +<table class="sampletable"> + +<tr><td class="samplenote"> +Default options with a little css applied: +</td><td class="sampleaction"> + <com:TJuiSortable ID="repeater1" onSort="repeater1_onSort"/> + <com:TActiveLabel ID="label1" /> +</td></tr> + +</table> + +</com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php new file mode 100644 index 00000000..4b3a0ff4 --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php @@ -0,0 +1,31 @@ +<?php + +class Home extends TPage +{ + protected $data = array( + 'PRADO', + 'quickstart', + 'tutorial', + 'sample', + 'for the', + 'TJuiSortable', + 'control', + ); + + public function onLoad($param) + { + if(!$this->IsPostback) + { + $this->repeater1->DataSource=$this->data; + $this->repeater1->dataBind(); + } + } + + public function repeater1_onSort($sender, $param) + { + $this->label1->Text="Items order:"; + $order = $param->getOrder(); + foreach($order as $index) + $this->label1->Text.=' '.$this->data[$index]; + } +} diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/config.xml b/demos/quickstart/protected/pages/JuiControls/Samples/config.xml new file mode 100644 index 00000000..315e42af --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/config.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: config.xml 1405 2006-09-10 01:03:56Z wei $ --> +<configuration> + <paths> + <using namespace="System.Web.UI.JuiControls.*" /> + </paths> + <pages MasterClass="SampleLayout" /> +</configuration>
\ No newline at end of file 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 { } -?> </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" /> </div> </com:TForm> -<com:TJavascriptLogger /> </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"> <com:TForm> @@ -75,7 +75,7 @@ php prado/framework/prado-cli.php -c currency-converter </div> </fieldset> </com:TForm> -</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"> <?php @@ -133,8 +133,7 @@ class Home extends TPage { } -?> -</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"> <com:TButton Text="Convert" OnClick="convert_clicked" /> </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"> <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"> <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"> <com:TActiveButton Text="Convert" OnClick="convert_clicked" /> </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"> <com:TActiveButton Text="Convert" OnClick="convert_clicked" > @@ -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"> <%@ Theme="Basic" %> @@ -392,7 +391,7 @@ Prado::using('System.Web.UI.ActiveControls.*'); <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <com:THead Title="Currency Converter" /> <body> -</com:TTextHighlighter>
+</com:TTextHighlighter> <p id="4334" class="block-content"> The first line <tt><%@ Theme="Basic" %></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 { } -?> </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" /> </div> </com:TForm> -<com:TJavascriptLogger /> </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"> <com:TForm> @@ -75,7 +75,7 @@ php prado/framework/prado-cli.php -c currency-converter </div> </fieldset> </com:TForm> -</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"> <?php @@ -133,8 +133,7 @@ class Home extends TPage { } -?> -</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"> <com:TButton Text="Convert" OnClick="convert_clicked" /> </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"> <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"> <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"> <com:TActiveButton Text="Convert" OnClick="convert_clicked" /> </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"> <com:TActiveButton Text="Convert" OnClick="convert_clicked" > @@ -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"> <%@ Theme="Basic" %> @@ -389,7 +388,7 @@ Prado::using('System.Web.UI.ActiveControls.*'); <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <com:THead Title="Currency Converter" /> <body> -</com:TTextHighlighter>
+</com:TTextHighlighter> <p id="4334" class="block-content"> The first line <tt><%@ Theme="Basic" %></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
{
}
-?>
</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"> <com:TForm> @@ -62,7 +62,7 @@ php prado/framework/prado-cli.php -c currency-converter </div> </fieldset> </com:TForm> -</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><label></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"> <?php @@ -117,8 +117,7 @@ class Home extends TPage { } -?> -</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"> <com:TButton Text="Convert" OnClick="convert_clicked" /> </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"> <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"> <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"> <com:TActiveButton Text="Convert" OnClick="convert_clicked" /> </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"> <com:TActiveButton Text="Convert" OnClick="convert_clicked" > @@ -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"> <%@ Theme="Basic" %> @@ -334,10 +333,10 @@ Prado::using('System.Web.UI.ActiveControls.*'); <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <com:THead Title="Currency Converter" /> <body> -</com:TTextHighlighter>
+</com:TTextHighlighter> <p id="4334" class="block-content"> Baris pertama <tt><%@ Theme="Basic" %></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><head></tt>. Sebagai tambahan terhadap tampilan properti <tt>Title</tt> pada <tt>THead</tt>, semua file CSS diff --git a/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page b/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page index 80a155cb..55d55c31 100755 --- a/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page +++ b/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page @@ -46,7 +46,6 @@ class PersonTest extends UnitTestCase $this->assertNotNull($person, "Person not returned");
}
}
-?>
</com:TTextHighlighter>
<p>Well, the example sure looks easy enough! We ask a method to "select all", and
@@ -54,7 +53,7 @@ it returns a list of person objects. But, what code do we need to write to pass this test?</p>
<div class="note"><b class="tip">Note:</b>
- Save the <tt>PersonTest.php</tt> into a <tt>tests</tt> directory.
+ Save the <tt>PersonTest.php</tt> into a <tt>tests</tt> directory.
The unit tests are written for the <a href="http://simpletest.sf.net">SimpleTest Unit Testing framework</a>.
</div>
@@ -74,7 +73,6 @@ error_reporting(E_ALL); $test = new GroupTest('All tests');
$test->addTestFile('Tests/PersonTest.php'); $test->run(new HtmlReporter());
-?>
</com:TTextHighlighter>
<p>To run the tests, point your browser to the "<tt>run_test.php</tt>" script file
@@ -108,7 +106,6 @@ class Person $this->_birthDate = $value;
}
}
-?>
</com:TTextHighlighter>
<p>OK, that was fun! The <tt>$this->assertXXX(...)</tt> methods are built into
@@ -125,7 +122,7 @@ method executes our SQL statement (or stored procedure) and returns the result as a list. Each row in the result becomes an entry in the list. Along with
<tt>queryForList()</tt>, there are also <tt>delete()</tt>, <tt>insert()</tt>,
<tt>queryForObject()</tt>, <tt>queryForPagedList()</tt> and a few other methods in the
-<a href="?page=Manual.DataMapperAPI">SQLMap API</a>.
+<a href="?page=Manual.DataMapperAPI">SQLMap API</a>.
<p>Looking at unit test example, we see that the <tt>queryForList()</tt> method
takes the name of the statement we want to run. OK. Easy enough. But where
diff --git a/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page b/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page index 706b5220..b128c413 100755 --- a/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page +++ b/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page @@ -58,7 +58,6 @@ error_reporting(E_ALL); require_once('/path/to/prado/framework/prado.php');
$application=new TApplication;
$application->run();
-?>
</com:TTextHighlighter>
<p>Now we are ready to setup a page to display our list of people.
@@ -106,7 +105,6 @@ class Home extends TPage $this->loadData();
}
}
-?>
</com:TTextHighlighter>
<p>If we run this now, we'll get a list like the one shown the figure below.</p>
diff --git a/demos/time-tracker/protected/App_Code/Dao/BaseDao.php b/demos/time-tracker/protected/App_Code/Dao/BaseDao.php index b37fb5df..571a9d1a 100755 --- a/demos/time-tracker/protected/App_Code/Dao/BaseDao.php +++ b/demos/time-tracker/protected/App_Code/Dao/BaseDao.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: BaseDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -14,7 +13,6 @@ * Base DAO class. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: BaseDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ diff --git a/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php b/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php index dbaf0e80..0110ae5e 100755 --- a/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php +++ b/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: ProjectDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -14,7 +13,6 @@ * Project DAO class. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: ProjectDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ diff --git a/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php b/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php index 631b1f8c..c02a78a5 100755 --- a/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php +++ b/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: ProjectRecord.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -14,7 +13,6 @@ * Time Tracker Project class. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: ProjectRecord.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ diff --git a/demos/time-tracker/protected/App_Code/Dao/UserDao.php b/demos/time-tracker/protected/App_Code/Dao/UserDao.php index 495da072..51d04c58 100755 --- a/demos/time-tracker/protected/App_Code/Dao/UserDao.php +++ b/demos/time-tracker/protected/App_Code/Dao/UserDao.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: UserDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -17,7 +16,6 @@ * this token can be used to perform persistent cookie login. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: UserDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ diff --git a/demos/time-tracker/protected/App_Code/DaoManager.php b/demos/time-tracker/protected/App_Code/DaoManager.php index 9602ced0..90655ac8 100755 --- a/demos/time-tracker/protected/App_Code/DaoManager.php +++ b/demos/time-tracker/protected/App_Code/DaoManager.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: DaoManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -18,7 +17,6 @@ Prado::using('System.Data.SqlMap.TSqlMapConfig'); * A Registry for Dao and an implementation of that type. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: DaoManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ diff --git a/demos/time-tracker/protected/App_Code/TimeTrackerException.php b/demos/time-tracker/protected/App_Code/TimeTrackerException.php index 424c7d30..87398952 100755 --- a/demos/time-tracker/protected/App_Code/TimeTrackerException.php +++ b/demos/time-tracker/protected/App_Code/TimeTrackerException.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TimeTrackerException.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -15,7 +14,6 @@ * "exceptions.txt" * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TimeTrackerException.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ @@ -27,6 +25,6 @@ class TimeTrackerException extends TException protected function getErrorMessageFile() { return dirname(__FILE__).'/exceptions.txt'; - } + } } diff --git a/demos/time-tracker/protected/App_Code/TimeTrackerUser.php b/demos/time-tracker/protected/App_Code/TimeTrackerUser.php index da98e786..5215b31c 100755 --- a/demos/time-tracker/protected/App_Code/TimeTrackerUser.php +++ b/demos/time-tracker/protected/App_Code/TimeTrackerUser.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TimeTrackerUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -20,14 +19,13 @@ Prado::using('System.Security.TUserManager'); * User class for Time Tracker application. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TimeTrackerUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ class TimeTrackerUser extends TUser { private $_emailAddress; - + /** * @param string user email address */ @@ -35,7 +33,7 @@ class TimeTrackerUser extends TUser { $this->_emailAddress = $value; } - + /** * @return string user email address */ diff --git a/demos/time-tracker/protected/App_Code/TrackerAuthManager.php b/demos/time-tracker/protected/App_Code/TrackerAuthManager.php index 48962167..08daae3f 100755 --- a/demos/time-tracker/protected/App_Code/TrackerAuthManager.php +++ b/demos/time-tracker/protected/App_Code/TrackerAuthManager.php @@ -4,7 +4,6 @@ * a string token saved in the cookie. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TrackerAuthManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ @@ -14,24 +13,24 @@ class TrackerAuthManager extends TAuthManager * @const string signon token cookie name. */ const SignonCookieName = 'time-tracker-signon'; - + /** * Performs the real authentication work. Overrides and calls parent - * implementation. Trys to authenticate using token saved in cookie. + * implementation. Trys to authenticate using token saved in cookie. * @param mixed parameter to be passed to OnAuthenticate event */ public function onAuthenticate($param) { parent::onAuthenticate($param); - $currentUser = $this->Application->User; + $currentUser = $this->Application->User; if(!$currentUser || $currentUser->IsGuest) $this->authenticateFromCookie($param); } - + /** * If the user is not set or is still a guest, try to authenticate the user * using a string token saved in the cookie if any. - * @param mixed parameter to be passed to OnAuthenticate event + * @param mixed parameter to be passed to OnAuthenticate event */ protected function authenticateFromCookie($param) { @@ -45,7 +44,7 @@ class TrackerAuthManager extends TAuthManager $this->updateCredential($user); } } - + /** * Changes the user credentials. * @param TUser new user details. @@ -54,9 +53,9 @@ class TrackerAuthManager extends TAuthManager { $user->IsGuest = false; $this->updateSessionUser($user); - $this->Application->User = $user; + $this->Application->User = $user; } - + /** * Generate a token to be saved in the cookie for later authentication. * @param TimeTrackerUser user details. @@ -70,7 +69,7 @@ class TrackerAuthManager extends TAuthManager $cookie->Expire = strtotime('+1 month'); $this->Response->Cookies[] = $cookie; } - + /** * Logs out the user and delete the token from cookie. */ diff --git a/demos/time-tracker/protected/App_Code/UserManager.php b/demos/time-tracker/protected/App_Code/UserManager.php index 20b34d47..eabbe315 100755 --- a/demos/time-tracker/protected/App_Code/UserManager.php +++ b/demos/time-tracker/protected/App_Code/UserManager.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: UserManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -14,7 +13,6 @@ * User manager module class for time tracker application. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: UserManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ diff --git a/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php b/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php index 3a67afb0..12a8a23e 100755 --- a/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php +++ b/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TimeTrackerUserTypeHandler.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -15,7 +14,6 @@ * The TimeTrackerUser requires an instance of IUserManager in constructor. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TimeTrackerUserTypeHandler.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ diff --git a/demos/time-tracker/protected/pages/TimeTracker/Login.php b/demos/time-tracker/protected/pages/TimeTracker/Login.php index 941cb4b7..8de63ad8 100755 --- a/demos/time-tracker/protected/pages/TimeTracker/Login.php +++ b/demos/time-tracker/protected/pages/TimeTracker/Login.php @@ -6,18 +6,16 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: Login.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ /** * Login page class. - * - * Validate the user credentials and redirect to requested page + * + * Validate the user credentials and redirect to requested page * if successful. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: Login.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ @@ -26,7 +24,7 @@ class Login extends TPage /** * Validates the username and password. * @param TControl custom validator that created the event. - * @param TServerValidateEventParameter validation parameters. + * @param TServerValidateEventParameter validation parameters. */ public function validateUser($sender, $param) { @@ -34,7 +32,7 @@ class Login extends TPage if(!$authManager->login($this->username->Text,$this->password->Text)) $param->IsValid=false;; } - + /** * Redirect to the requested page if login is successful. * @param TControl button control that created the event. diff --git a/demos/time-tracker/protected/pages/TimeTracker/Logout.php b/demos/time-tracker/protected/pages/TimeTracker/Logout.php index 9f4de556..bab924f2 100755 --- a/demos/time-tracker/protected/pages/TimeTracker/Logout.php +++ b/demos/time-tracker/protected/pages/TimeTracker/Logout.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: Logout.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -14,7 +13,6 @@ * Logout page class. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: Logout.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ @@ -27,7 +25,7 @@ class Logout extends TPage { $this->Application->getModule('auth')->logout(); $url = $this->Service->constructUrl($this->Service->DefaultPage); - $this->Response->redirect($url); + $this->Response->redirect($url); } } diff --git a/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php b/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php index 51df0583..ab612baf 100755 --- a/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php +++ b/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: SiteMap.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -14,7 +13,6 @@ * SiteMap menu is rendered depending on user roles. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: SiteMap.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ @@ -26,7 +24,7 @@ class SiteMap extends TTemplateControl public function onPreRender($param) { parent::onPreRender($param); - + $page = explode('.',$this->Request->ServiceParameter); $active = null; switch($page[count($page)-1]) @@ -47,7 +45,7 @@ class SiteMap extends TTemplateControl $active = $this->LogMenu; break; } - + //add 'active' string to place holder body. if(!is_null($active)) $active->Controls[] = 'active'; diff --git a/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php b/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php index 2c73752a..34e69713 100755 --- a/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php +++ b/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php @@ -6,18 +6,16 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: UserCreate.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ /** * Create new user wizard page class. Validate that the usernames are unique and * set the new user credentials as the current application credentials. - * + * * If logged in as admin, the user role can be change during creation. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: UserCreate.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ @@ -30,11 +28,11 @@ class UserCreate extends TPage { if(!$this->IsPostBack) { - $this->role->SelectedValue = + $this->role->SelectedValue = $this->Application->Parameters['NewUserRoles']; } } - + /** * Verify that the username is not taken. * @param TControl custom validator that created the event. @@ -46,11 +44,11 @@ class UserCreate extends TPage if($userDao->usernameExists($this->username->Text)) { $param->IsValid = false; - $sender->ErrorMessage = + $sender->ErrorMessage = "The user name is already taken, try '{$this->username->Text}01'"; } } - + /** * Skip the role assignment step if not admin. */ @@ -66,7 +64,7 @@ class UserCreate extends TPage } } } - + /** * Create a new user if all data entered are valid. * The default user roles are obtained from "config.xml". The new user @@ -84,11 +82,11 @@ class UserCreate extends TPage $newUser->Name = $this->username->Text; $newUser->IsGuest = false; $newUser->Roles = $this->role->SelectedValue; - + //save the user $userDao = $this->Application->Modules['daos']->getDao('UserDao'); $userDao->addNewUser($newUser, $this->password->Text); - + //update the user credentials if not admin if(!$this->User->isInRole('admin')) { @@ -97,7 +95,7 @@ class UserCreate extends TPage } } } - + /** * Continue with requested page. */ diff --git a/demos/time-tracker/protected/pages/TimeTracker/UserList.php b/demos/time-tracker/protected/pages/TimeTracker/UserList.php index 9dc3ab5f..71b41add 100755 --- a/demos/time-tracker/protected/pages/TimeTracker/UserList.php +++ b/demos/time-tracker/protected/pages/TimeTracker/UserList.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: UserList.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ @@ -14,7 +13,6 @@ * List all users in a repeater. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: UserList.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ @@ -27,7 +25,7 @@ class UserList extends TPage { $userDao = $this->Application->Modules['daos']->getDao('UserDao'); $this->list->DataSource = $userDao->getAllUsers(); - $this->list->dataBind(); + $this->list->dataBind(); } } |