diff options
799 files changed, 6126 insertions, 5958 deletions
@@ -34,4 +34,4 @@ bin/dbunit.php #OSX .DS_Store -/nbproject/private/
\ No newline at end of file +/nbproject
\ No newline at end of file @@ -1,7 +1,7 @@ The PRADO framework and the included demos are free software. They are released under the terms of the following BSD License. -Copyright 2004-2013, The PRADO Group (http://www.pradosoft.com) +Copyright 2004-2014, The PRADO Group (http://www.pradosoft.com) All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/bin/prado-cli.php b/bin/prado-cli.php index b4b43062..1906946b 100755 --- a/bin/prado-cli.php +++ b/bin/prado-cli.php @@ -5,9 +5,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ */ if(!isset($_SERVER['argv']) || php_sapi_name()!=='cli') @@ -58,7 +57,6 @@ PradoCommandLineInterpreter::getInstance()->run($_SERVER['argv']); * Command line interface, configures the action classes and dispatches the command actions. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ * @since 3.0.5 */ class PradoCommandLineInterpreter @@ -136,7 +134,6 @@ class PradoCommandLineInterpreter * Base class for command line actions. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ * @since 3.0.5 */ abstract class PradoCommandLineAction @@ -227,7 +224,6 @@ EOD; * Create a Prado project skeleton, including directories and files. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ * @since 3.0.5 */ class PradoCommandLineCreateProject extends PradoCommandLineAction @@ -305,8 +301,7 @@ require_once($frameworkPath); $application=new TApplication; $application->run(); - -?>'; +'; } protected function renderConfigFile($appName) @@ -379,7 +374,6 @@ EOD; * Creates test fixtures for a Prado application. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ * @since 3.0.5 */ class PradoCommandLineCreateTests extends PradoCommandLineAction @@ -431,8 +425,7 @@ $test_cases = dirname(__FILE__)."/unit"; $tester = new PradoUnitTester($test_cases, $app_directory); $tester->run(new HtmlReporter()); - -?>'; +'; } protected function renderFunctionalTestFixture() @@ -446,8 +439,7 @@ $test_cases = dirname(__FILE__)."/functional"; $tester=new PradoFunctionalTester($test_cases); $tester->run(new SimpleReporter()); - -?>'; +'; } } @@ -456,7 +448,6 @@ $tester->run(new SimpleReporter()); * Creates and run a Prado application in a PHP Shell. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ * @since 3.0.5 */ class PradoCommandLinePhpShell extends PradoCommandLineAction @@ -478,7 +469,6 @@ class PradoCommandLinePhpShell extends PradoCommandLineAction * Runs unit test cases. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ * @since 3.0.5 */ class PradoCommandLineUnitTest extends PradoCommandLineAction @@ -594,7 +584,6 @@ class PradoCommandLineUnitTest extends PradoCommandLineAction * Create active record skeleton * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ * @since 3.1 */ class PradoCommandLineActiveRecordGen extends PradoCommandLineAction @@ -737,7 +726,7 @@ $props return parent::finder(\$className); } } -?> + EOD; } } @@ -747,7 +736,6 @@ EOD; * * @author Matthias Endres <me[at]me23[dot]de> * @author Daniel Sampedro Bello <darthdaniel85[at]gmail[dot]com> - * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $ * @since 3.2 */ class PradoCommandLineActiveRecordGenAll extends PradoCommandLineAction { @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - PRADO 3.2 build file - Copyright (C) 2013 PradoSoft + PRADO 3.2 build file - Copyright (C) 2014 PradoSoft Requirements ============ diff --git a/buildscripts/apigen/pradosoft/@layout.latte b/buildscripts/apigen/pradosoft/@layout.latte index 2790d92c..266f0e17 100644 --- a/buildscripts/apigen/pradosoft/@layout.latte +++ b/buildscripts/apigen/pradosoft/@layout.latte @@ -182,7 +182,7 @@ the file LICENSE.md that was distributed with this source code. <a href="/support/">Contact Us</a> <br/> {$config->title} API documentation generated by <a href="http://apigen.org">{$generator} {$version}</a> - <br/>Copyright © 2006-2013 by the PRADO Group.<br/> + <br/>Copyright © 2006-2014 by the PRADO Group.<br/> <a title="Powered by PRADO" href="http://www.pradosoft.com/"><img src="http://www.pradosoft.com/images/powered2.gif" style="border-width:0px;" alt="Powered by PRADO" /></a> </div> diff --git a/buildscripts/classtree/DWExtension.php b/buildscripts/classtree/DWExtension.php index 8849efea..a7a1ca30 100644 --- a/buildscripts/classtree/DWExtension.php +++ b/buildscripts/classtree/DWExtension.php @@ -252,4 +252,3 @@ class PradoTagChooser return $this->_document->saveXML(); } } -?>
\ No newline at end of file diff --git a/buildscripts/index/build.php b/buildscripts/index/build.php index bbe151e6..a2e57286 100644 --- a/buildscripts/index/build.php +++ b/buildscripts/index/build.php @@ -61,5 +61,3 @@ else { echo "Usage: 'php build.php quickstart' or 'php build.php api'\n"; } - -?> diff --git a/buildscripts/index/quickstart_index.php b/buildscripts/index/quickstart_index.php index 61e21514..5df0f549 100644 --- a/buildscripts/index/quickstart_index.php +++ b/buildscripts/index/quickstart_index.php @@ -104,4 +104,3 @@ class quickstart_index echo "\nSaving search index ({$count}) to {$this->_dir}\n\n"; } } -?>
\ No newline at end of file diff --git a/buildscripts/index/search.php b/buildscripts/index/search.php index 23948ca5..ff83e629 100644 --- a/buildscripts/index/search.php +++ b/buildscripts/index/search.php @@ -11,7 +11,7 @@ require_once('Zend/Search/Lucene.php'); if($keyword!=='') { - $search=new Zend_Search_Lucene(realpath(dirname(__FILE__))); + $search=new Zend_Search_Lucene(realpath(dirname(__FILE__))); $results=$search->find(strtolower($keyword)); $content=''; foreach($results as $entry) @@ -32,5 +32,3 @@ $page=preg_replace('/<!-- content begin -->.*<!-- content end -->/ms',$content,$ if($keyword!=='') $page=preg_replace('/<input type="text" name="keyword"/','<input type="text" name="keyword" value="'.htmlentities($keyword).'"',$page); echo $page; - -?>
\ No newline at end of file diff --git a/buildscripts/phing/tasks/PradoPearTask.php b/buildscripts/phing/tasks/PradoPearTask.php index 5d615084..541c972e 100644 --- a/buildscripts/phing/tasks/PradoPearTask.php +++ b/buildscripts/phing/tasks/PradoPearTask.php @@ -129,5 +129,3 @@ class PradoPearTask extends Task echo $e->getMessage(); } } - -?>
\ No newline at end of file diff --git a/buildscripts/phpbuilder/build.php b/buildscripts/phpbuilder/build.php index 17e02806..47b7bec4 100644 --- a/buildscripts/phpbuilder/build.php +++ b/buildscripts/phpbuilder/build.php @@ -144,5 +144,3 @@ function unfold_file($fileName) } return $content; } - -?>
\ No newline at end of file diff --git a/buildscripts/setup.php b/buildscripts/setup.php deleted file mode 100644 index 59d636b8..00000000 --- a/buildscripts/setup.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * Setup script for build system. You could run this script to install or upgrade Phing - * with dependencies. Please make sure to change the PEAR_CMD constant to how you want - * to execute the PEAR installer. - * - * @author Knut Urdalen - */ - -// Where to find the PEAR installer -define('PEAR_CMD', 'sudo pear'); - -// Storing your preferred_state -$preferred_state = exec(PEAR_CMD.' config-get preferred_state'); - -// Setting preferred state temporary to development to automatically get all dependencies -system(PEAR_CMD.' config-set preferred_state devel'); - -// Ensure that the PEAR channel protocol is updated -system(PEAR_CMD.' channel-update pear.php.net'); - -// Ensure that the Phing PEAR channel is added -system(PEAR_CMD.' channel-discover pear.phing.info'); - -// and channel protocol is updated -system(PEAR_CMD.' channel-update pear.phing.info'); - -// Checking if Phing is already installed -$result = exec(PEAR_CMD.' info phing/phing'); -if(strstr($result, 'No information found for')) { // Install - system(PEAR_CMD.' install --alldeps phing/phing'); -} else { // Try to upgrade - system(PEAR_CMD.' upgrade --alldeps phing/phing'); -} - -// Setting your preferred state back to what it was -system(PEAR_CMD.' config-set preferred_state '.$preferred_state); - -?>
\ No newline at end of file diff --git a/buildscripts/texbuilder/Page2Tex.php b/buildscripts/texbuilder/Page2Tex.php index b0d37149..ce2ece7f 100644 --- a/buildscripts/texbuilder/Page2Tex.php +++ b/buildscripts/texbuilder/Page2Tex.php @@ -343,5 +343,3 @@ class Page2Tex return "<p id=\"".($page + (++self::$p_count))."\" class=\"block-content\">"; } } - -?> diff --git a/buildscripts/texbuilder/quickstart/build.php b/buildscripts/texbuilder/quickstart/build.php index a42d6be3..6a824125 100644 --- a/buildscripts/texbuilder/quickstart/build.php +++ b/buildscripts/texbuilder/quickstart/build.php @@ -76,6 +76,3 @@ if($argv[1] == 'pdf') echo " Unable to find pdfLatex executable $pdflatexExec"; } } - - -?> diff --git a/buildscripts/texbuilder/quickstart/pages.php b/buildscripts/texbuilder/quickstart/pages.php index cd11c4b1..1fb94431 100644 --- a/buildscripts/texbuilder/quickstart/pages.php +++ b/buildscripts/texbuilder/quickstart/pages.php @@ -177,5 +177,3 @@ $pages['Client-side Scripting'] = array( return $pages; //-------------- END CONFIG ---------------- - -?>
\ No newline at end of file diff --git a/buildscripts/texbuilder/quickstart/quickstart.tex b/buildscripts/texbuilder/quickstart/quickstart.tex index 41258800..29c76afc 100644 --- a/buildscripts/texbuilder/quickstart/quickstart.tex +++ b/buildscripts/texbuilder/quickstart/quickstart.tex @@ -53,7 +53,7 @@ %----------------- TITLE -------------- \title{\Huge \bfseries PRADO v3.2.3 Quickstart Tutorial - \thanks{Copyright 2004-2013. All Rights Reserved.} + \thanks{Copyright 2004-2014. All Rights Reserved.} } \author{Qiang Xue and Wei Zhuo} \date{\today} @@ -78,7 +78,7 @@ Prado quick start doc \chapter*{License} \addcontentsline{toc}{chapter}{License} PRADO is free software released under the terms of the following BSD license.\\ -Copyright 2004-2013, The PRADO Group (http://www.pradosoft.com) +Copyright 2004-2014, The PRADO Group (http://www.pradosoft.com) All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/buildscripts/texbuilder/sqlmap/build.php b/buildscripts/texbuilder/sqlmap/build.php index 4ea4d75e..066af486 100644 --- a/buildscripts/texbuilder/sqlmap/build.php +++ b/buildscripts/texbuilder/sqlmap/build.php @@ -76,6 +76,3 @@ if($argv[1] == 'pdf') echo " Unable to find pdfLatex executable $pdflatexExec"; } } - - -?> diff --git a/buildscripts/texbuilder/sqlmap/pages.php b/buildscripts/texbuilder/sqlmap/pages.php index 57fff767..b0b7bca0 100644 --- a/buildscripts/texbuilder/sqlmap/pages.php +++ b/buildscripts/texbuilder/sqlmap/pages.php @@ -58,5 +58,3 @@ $pages['Advanced Topics'] = array( ); return $pages; - -?>
\ No newline at end of file diff --git a/buildscripts/texbuilder/time-tracker/pages.php b/buildscripts/texbuilder/time-tracker/pages.php index 732f675d..a9c32347 100644 --- a/buildscripts/texbuilder/time-tracker/pages.php +++ b/buildscripts/texbuilder/time-tracker/pages.php @@ -14,5 +14,3 @@ $pages['Testing Business Code'] = array( 'Docs/UserClassAndExceptions.page' ); return $pages; - -?>
\ No newline at end of file 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(); } } diff --git a/framework/3rdParty/SafeHtml/HTMLSax3.php b/framework/3rdParty/SafeHtml/HTMLSax3.php index ff0bad63..262cf2ac 100644 --- a/framework/3rdParty/SafeHtml/HTMLSax3.php +++ b/framework/3rdParty/SafeHtml/HTMLSax3.php @@ -24,7 +24,6 @@ /** * Main parser components * @package System.Security.SafeHtml -* @version $Id: HTMLSax3.php 3188 2012-07-12 12:13:23Z ctrlaltca $ */ /** * Required classes @@ -367,7 +366,7 @@ class TSax3_StateParser_Lt430 extends TSax3_StateParser { * @return void */ function ignoreWhitespace() { - while ($this->position < $this->length && + while ($this->position < $this->length && strpos(" \n\r\t", $this->rawtext{$this->position}) !== FALSE) { $this->position++; } @@ -536,7 +535,7 @@ class TSax3 { * <li>XML_OPTION_ENTITIES_UNPARSED: XML entities are returned as * seperate data handler calls in unparsed form</li> * <li>XML_OPTION_ENTITIES_PARSED: (PHP 4.3.0+ only) XML entities are - * returned as seperate data handler calls and are parsed with + * returned as seperate data handler calls and are parsed with * PHP's html_entity_decode() function</li> * <li>XML_OPTION_STRIP_ESCAPES: strips out the -- -- comment markers * or CDATA markup inside an XML escape, if found.</li> diff --git a/framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php b/framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php index 8a33c983..d300ae65 100644 --- a/framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php +++ b/framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php @@ -24,7 +24,6 @@ /** * Decorators for dealing with parser options * @package System.Security.SafeHtml -* @version $Id: Decorators.php 3188 2012-07-12 12:13:23Z ctrlaltca $ * @see TSax3::set_option */ /** diff --git a/framework/3rdParty/SafeHtml/HTMLSax3/States.php b/framework/3rdParty/SafeHtml/HTMLSax3/States.php index 8afc5fb5..5001bb76 100644 --- a/framework/3rdParty/SafeHtml/HTMLSax3/States.php +++ b/framework/3rdParty/SafeHtml/HTMLSax3/States.php @@ -24,7 +24,6 @@ /** * Parsing states. * @package System.Security.SafeHtml -* @version $Id: States.php 3188 2012-07-12 12:13:23Z ctrlaltca $ */ /** * Define parser states @@ -133,7 +132,7 @@ class TSax3_OpeningTagState { */ function parseAttributes(&$context) { $Attributes = array(); - + $context->ignoreWhitespace(); $attributename = $context->scanUntilCharacters("=/> \n\r\t"); while ($attributename != '') { @@ -159,7 +158,7 @@ class TSax3_OpeningTagState { $context->unscanCharacter(); } $Attributes[$attributename] = $attributevalue; - + $context->ignoreWhitespace(); $attributename = $context->scanUntilCharacters("=/> \n\r\t"); } @@ -183,14 +182,14 @@ class TSax3_OpeningTagState { $context->unscanCharacter(); } $context->handler_object_element-> - {$context->handler_method_opening}($context->htmlsax, $tag, + {$context->handler_method_opening}($context->htmlsax, $tag, $Attributes, TRUE); $context->handler_object_element-> - {$context->handler_method_closing}($context->htmlsax, $tag, + {$context->handler_method_closing}($context->htmlsax, $tag, TRUE); } else { $context->handler_object_element-> - {$context->handler_method_opening}($context->htmlsax, $tag, + {$context->handler_method_opening}($context->htmlsax, $tag, $Attributes, FALSE); } } diff --git a/framework/3rdParty/WsdlGen/Wsdl.php b/framework/3rdParty/WsdlGen/Wsdl.php index 8cfee9cc..7344812b 100644 --- a/framework/3rdParty/WsdlGen/Wsdl.php +++ b/framework/3rdParty/WsdlGen/Wsdl.php @@ -12,7 +12,6 @@ * * @author Marcus Nyeholt <tanus@users.sourceforge.net> * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: Wsdl.php 3314 2013-08-20 10:00:47Z ctrlaltca $ * @package System.Web.Services.SOAP */ diff --git a/framework/3rdParty/WsdlGen/WsdlGenerator.php b/framework/3rdParty/WsdlGen/WsdlGenerator.php index 0bc2e6d4..e4624ef4 100644 --- a/framework/3rdParty/WsdlGen/WsdlGenerator.php +++ b/framework/3rdParty/WsdlGen/WsdlGenerator.php @@ -11,7 +11,6 @@ * This file is part of the PRADO framework from {@link http://www.xisc.com} * * @author Marcus Nyeholt <tanus@users.sourceforge.net> - * @version $Id: WsdlGenerator.php 3314 2013-08-20 10:00:47Z ctrlaltca $ * @package System.Web.Services.SOAP */ diff --git a/framework/3rdParty/WsdlGen/WsdlMessage.php b/framework/3rdParty/WsdlGen/WsdlMessage.php index 5e0391ef..3597c977 100644 --- a/framework/3rdParty/WsdlGen/WsdlMessage.php +++ b/framework/3rdParty/WsdlGen/WsdlMessage.php @@ -12,7 +12,6 @@ * * @author Marcus Nyeholt <tanus@users.sourceforge.net> * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: WsdlMessage.php 3188 2012-07-12 12:13:23Z ctrlaltca $ * @package System.Web.Services.SOAP */ diff --git a/framework/3rdParty/WsdlGen/WsdlOperation.php b/framework/3rdParty/WsdlGen/WsdlOperation.php index 5c9b4be5..91adbda4 100644 --- a/framework/3rdParty/WsdlGen/WsdlOperation.php +++ b/framework/3rdParty/WsdlGen/WsdlOperation.php @@ -12,7 +12,6 @@ * * @author Marcus Nyeholt <tanus@users.sourceforge.net> * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: WsdlOperation.php 3188 2012-07-12 12:13:23Z ctrlaltca $ * @package System.Web.Services.SOAP */ diff --git a/framework/3rdParty/readme.html b/framework/3rdParty/readme.html index 2855ba74..5889a943 100644 --- a/framework/3rdParty/readme.html +++ b/framework/3rdParty/readme.html @@ -19,6 +19,30 @@ projects. </tr>
<tr>
+ <td><a href="jQuery">jQuery</a></td>
+ <td><a href="http://jquery.com/">jQuery - Write less, do more</a></td>
+ <td><a href="http://jquery.org/license/">MIT License</a></td>
+ <td></td>
+ <td>Core of Prado javascript library.</td>
+</tr>
+
+<tr>
+ <td><a href="jQueryUI">jQuery UI</a></td>
+ <td><a href="http://jqueryui.com/">jQuery user interface</a></td>
+ <td><a href="http://jquery.org/license/">MIT License</a></td>
+ <td>System.Web.UI.JuiControls</td>
+ <td>jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.</td>
+</tr>
+
+<tr>
+ <td><a href="Low Pro JQ">Low Pro JQ</a></td>
+ <td><a href="http://github.com/danwrong/low-pro-for-jquery">jQuery - Write less, do more</a></td>
+ <td><a href="http://github.com/danwrong/low-pro-for-jquery/blob/master/MIT-LICENCE">MIT License</a></td>
+ <td></td>
+ <td> A jQuery port of the Low Pro behavior framework that was originally written for Prototype. Prado actually uses it as a base to emulate OOP subclassing, inheritance and contructor events.</td>
+</tr>
+
+<tr>
<td><a href="ReCaptcha">ReCaptcha</a></td>
<td><a href="http://www.google.com/recaptcha">ReCaptcha - Stop spam, read books</a></td>
<td><a href="ReCaptcha/LICENSE">BSD-like</a></td>
@@ -41,10 +65,10 @@ projects. </tr>
<tr>
<td><a href="TinyMCE">TinyMCE</a></td>
- <td><a href="http://tinymce.moxiecode.com/">TinyMCE Javascript Content Editor</a> (v3.5.6)</td>
+ <td><a href="http://tinymce.moxiecode.com/">TinyMCE Javascript WYSIWYG Editor</a></td>
<td><a href="TinyMCE/license.txt">GNU LESSER GENERAL PUBLIC LICENSE</a></td>
- <td>System.Web.UI.WebControls.THtmlArea</td>
- <td>TinyMCE is a powerful WYSIWYG editor control for web browsers such as MSIE or Mozilla that enables the user to edit HTML contents in a more user friendly way.</td>
+ <td>System.Web.UI.WebControls.THtmlArea, System.Web.UI.WebControls.THtmlArea4</td>
+ <td>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL. TinyMCE has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</td>
</tr>
<tr>
<td>N.A.</td>
@@ -92,8 +116,8 @@ projects. <td><a href="../Web/Javascripts/prototype/">../Web/Javascripts/prototype</a></td>
<td><a href="http://dev.rubyonrails.org/browser/spinoffs/prototype">Prototype javascript library</a></td>
<td><a href="../Web/Javascripts/prototype/LICENSE">The Prototype License (MIT based)</a></td>
- <td>N.A.</td>
- <td>Core of Prado javascript library.</td>
+ <td>System.Web.UI.TAutoComplete, TDraggable, TDropContainer</td>
+ <td>Prototype used to be the core of Prado javascript library. Now it's still supported for backwards compatibility</td>
</tr>
<tr>
<td><a href="../Web/Javascripts/prado/logger/logger.js">../Web/Javascripts/prado/logger/logger.js</a></td>
@@ -113,14 +137,6 @@ projects. </tr>
<tr>
- <td><a href="adodb">adodb</a></td>
- <td><a href="http://adodb.sourceforge.net/">ADOdb Database Abstraction Library for PHP</a></td>
- <td><a href="adodb/license.txt">Dual licensed using BSD and LGPL.</a></td>
- <td>Provides one database access abstraction layer.</td>
- <td>Slightly modified to work nicely with E_STRICT in php 5.</td>
-</tr>
-
-<tr>
<td><a href="Markdown">Markdown</a></td>
<td><a href="http://www.michelf.com/projects/php-markdown/">PHP Markdown</a></td>
<td><a href="Markdown/License.text">BSD</a></td>
diff --git a/framework/Caching/TAPCCache.php b/framework/Caching/TAPCCache.php index 8826fac6..ec0aa35c 100644 --- a/framework/Caching/TAPCCache.php +++ b/framework/Caching/TAPCCache.php @@ -4,9 +4,8 @@ * * @author Alban Hanry <compte_messagerie@hotmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TAPCCache.php 3281 2013-03-13 21:01:40Z ctrlaltca $ * @package System.Caching */ @@ -41,7 +40,6 @@ * * @author Alban Hanry <compte_messagerie@hotmail.com> * @author Knut Urdalen <knut.urdalen@gmail.com> - * @version $Id: TAPCCache.php 3281 2013-03-13 21:01:40Z ctrlaltca $ * @package System.Caching * @since 3.0b */ @@ -57,10 +55,10 @@ class TAPCCache extends TCache { if(!extension_loaded('apc')) throw new TConfigurationException('apccache_extension_required'); - + if(ini_get('apc.enabled') == false) - throw new TConfigurationException('apccache_extension_not_enabled'); - + throw new TConfigurationException('apccache_extension_not_enabled'); + if(substr(php_sapi_name(), 0, 3) === 'cli' and ini_get('apc.enable_cli') == false) throw new TConfigurationException('apccache_extension_not_enabled_cli'); diff --git a/framework/Caching/TCache.php b/framework/Caching/TCache.php index 0a0ca2db..99b3f24c 100644 --- a/framework/Caching/TCache.php +++ b/framework/Caching/TCache.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching */ @@ -42,7 +41,6 @@ Prado::using('System.Collections.TList'); * the cache acts as an array. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.0 */ @@ -313,7 +311,6 @@ abstract class TCache extends TModule implements ICache, ArrayAccess * - {@link TChainedCacheDependency}: checks whether any of a list of dependencies is changed or not * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.1.0 */ @@ -331,7 +328,6 @@ abstract class TCacheDependency extends TComponent implements ICacheDependency * last modification time remains unchanged. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.1.0 */ @@ -400,7 +396,6 @@ class TFileCacheDependency extends TCacheDependency * to a certain depth of the subdirectories. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.1.0 */ @@ -556,7 +551,6 @@ class TDirectoryCacheDependency extends TCacheDependency * set {@link setStateName StateName} to the name of the global state. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.1.0 */ @@ -617,7 +611,6 @@ class TGlobalStateCacheDependency extends TCacheDependency * (see {@link TList} for more details}). * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.1.0 */ @@ -667,7 +660,6 @@ class TChainedCacheDependency extends TCacheDependency * will be checked. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.1.0 */ @@ -694,7 +686,6 @@ class TApplicationStateCacheDependency extends TCacheDependency * for more details. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.1.0 */ diff --git a/framework/Caching/TDbCache.php b/framework/Caching/TDbCache.php index 03c6f54f..c26066a2 100644 --- a/framework/Caching/TDbCache.php +++ b/framework/Caching/TDbCache.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching */ @@ -82,7 +81,6 @@ Prado::using('System.Data.TDbConnection'); * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.1.0 */ diff --git a/framework/Caching/TEACache.php b/framework/Caching/TEACache.php index 6a20f63b..f57011a6 100644 --- a/framework/Caching/TEACache.php +++ b/framework/Caching/TEACache.php @@ -1 +1 @@ -<?php
/**
* TEACache class file
*
* @author Dario rigolin <drigolin@e-portaltech.it>
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id: TEACache.php 3281 2013-03-13 19:31:03Z xue $
* @package System.Caching
*/
/**
* TEACache class
*
* TEACache implements a cache application module based on {@link http://eaccelerator.net/ eAccelerator}.
*
* By definition, cache does not ensure the existence of a value
* even if it never expires. Cache is not meant to be an persistent storage.
*
* To use this module, the eAccelerator PHP extension must be loaded and enabled
*
* Please note that as of v0.9.6, eAccelerator no longer supports data caching.
* This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version.
*
* Some usage examples of TEACache are as follows,
* <code>
* $cache=new TEACache; // TEACache may also be loaded as a Prado application module
* $cache->init(null);
* $cache->add('object',$object);
* $object2=$cache->get('object');
* </code>
*
* If loaded, TEACache will register itself with {@link TApplication} as the
* cache module. It can be accessed via {@link TApplication::getCache()}.
*
* TEACache may be configured in application configuration file as follows
* <code>
* <module id="cache" class="System.Caching.TEACache" />
* </code>
*
* @author Dario Rigolin <drigolin@e-portaltech.it>
* @version $Id: TEACache.php 3281 2013-03-13 19:31:03Z xue $
* @package System.Caching
* @since 3.2.2
*/
class TEACache extends TCache
{
/**
* Initializes this module.
* This method is required by the IModule interface.
* @param TXmlElement configuration for this module, can be null
* @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini
*/
public function init($config)
{
if(!function_exists('eaccelerator_get'))
throw new TConfigurationException('eacceleratorcache_extension_required');
parent::init($config);
}
/**
* Retrieves a value from cache with a specified key.
* This is the implementation of the method declared in the parent class.
* @param string a unique key identifying the cached value
* @return string the value stored in cache, false if the value is not in the cache or expired.
*/
protected function getValue($key)
{
$value = eaccelerator_get($key);
return ($value === null) ? false : $value;
}
/**
* Stores a value identified by a key in cache.
* This is the implementation of the method declared in the parent class.
*
* @param string the key identifying the value to be cached
* @param string the value to be cached
* @param integer the number of seconds in which the cached value will expire. 0 means never expire.
* @return boolean true if the value is successfully stored into cache, false otherwise
*/
protected function setValue($key,$value,$expire)
{
return eaccelerator_put($key,$value,$expire);
}
/**
* Stores a value identified by a key into cache if the cache does not contain this key.
* This is the implementation of the method declared in the parent class.
*
* @param string the key identifying the value to be cached
* @param string the value to be cached
* @param integer the number of seconds in which the cached value will expire. 0 means never expire.
* @return boolean true if the value is successfully stored into cache, false otherwise
*/
protected function addValue($key,$value,$expire)
{
return (null === eaccelerator_get($key)) ? $this->setValue($key,$value,$expire) : false;
}
/**
* Deletes a value with the specified key from cache
* This is the implementation of the method declared in the parent class.
* @param string the key of the value to be deleted
* @return boolean if no error happens during deletion
*/
protected function deleteValue($key)
{
return eaccelerator_rm($key);
}
/**
* Deletes all values from cache.
* Be careful of performing this operation if the cache is shared by multiple applications.
*/
public function flush()
{
// first, remove expired content from cache
eaccelerator_gc();
// now, remove leftover cache-keys
$keys = eaccelerator_list_keys();
foreach($keys as $key)
$this->deleteValue(substr($key['name'], 1));
return true;
}
}
\ No newline at end of file +<?php
/**
* TEACache class file
*
* @author Dario rigolin <drigolin@e-portaltech.it>
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Caching
*/
/**
* TEACache class
*
* TEACache implements a cache application module based on {@link http://eaccelerator.net/ eAccelerator}.
*
* By definition, cache does not ensure the existence of a value
* even if it never expires. Cache is not meant to be an persistent storage.
*
* To use this module, the eAccelerator PHP extension must be loaded and enabled
*
* Please note that as of v0.9.6, eAccelerator no longer supports data caching.
* This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version.
*
* Some usage examples of TEACache are as follows,
* <code>
* $cache=new TEACache; // TEACache may also be loaded as a Prado application module
* $cache->init(null);
* $cache->add('object',$object);
* $object2=$cache->get('object');
* </code>
*
* If loaded, TEACache will register itself with {@link TApplication} as the
* cache module. It can be accessed via {@link TApplication::getCache()}.
*
* TEACache may be configured in application configuration file as follows
* <code>
* <module id="cache" class="System.Caching.TEACache" />
* </code>
*
* @author Dario Rigolin <drigolin@e-portaltech.it>
* @package System.Caching
* @since 3.2.2
*/
class TEACache extends TCache
{
/**
* Initializes this module.
* This method is required by the IModule interface.
* @param TXmlElement configuration for this module, can be null
* @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini
*/
public function init($config)
{
if(!function_exists('eaccelerator_get'))
throw new TConfigurationException('eacceleratorcache_extension_required');
parent::init($config);
}
/**
* Retrieves a value from cache with a specified key.
* This is the implementation of the method declared in the parent class.
* @param string a unique key identifying the cached value
* @return string the value stored in cache, false if the value is not in the cache or expired.
*/
protected function getValue($key)
{
$value = eaccelerator_get($key);
return ($value === null) ? false : $value;
}
/**
* Stores a value identified by a key in cache.
* This is the implementation of the method declared in the parent class.
*
* @param string the key identifying the value to be cached
* @param string the value to be cached
* @param integer the number of seconds in which the cached value will expire. 0 means never expire.
* @return boolean true if the value is successfully stored into cache, false otherwise
*/
protected function setValue($key,$value,$expire)
{
return eaccelerator_put($key,$value,$expire);
}
/**
* Stores a value identified by a key into cache if the cache does not contain this key.
* This is the implementation of the method declared in the parent class.
*
* @param string the key identifying the value to be cached
* @param string the value to be cached
* @param integer the number of seconds in which the cached value will expire. 0 means never expire.
* @return boolean true if the value is successfully stored into cache, false otherwise
*/
protected function addValue($key,$value,$expire)
{
return (null === eaccelerator_get($key)) ? $this->setValue($key,$value,$expire) : false;
}
/**
* Deletes a value with the specified key from cache
* This is the implementation of the method declared in the parent class.
* @param string the key of the value to be deleted
* @return boolean if no error happens during deletion
*/
protected function deleteValue($key)
{
return eaccelerator_rm($key);
}
/**
* Deletes all values from cache.
* Be careful of performing this operation if the cache is shared by multiple applications.
*/
public function flush()
{
// first, remove expired content from cache
eaccelerator_gc();
// now, remove leftover cache-keys
$keys = eaccelerator_list_keys();
foreach($keys as $key)
$this->deleteValue(substr($key['name'], 1));
return true;
}
}
\ No newline at end of file diff --git a/framework/Caching/TMemCache.php b/framework/Caching/TMemCache.php index 8d2e6a4b..c2d4901b 100644 --- a/framework/Caching/TMemCache.php +++ b/framework/Caching/TMemCache.php @@ -5,9 +5,8 @@ * @author Qiang Xue <qiang.xue@gmail.com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMemCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching */ @@ -77,7 +76,6 @@ * NB : MemCache server(s) must be restarted to apply settings. Require (PECL memcache >= 2.0.0). * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TMemCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.0 */ @@ -109,11 +107,11 @@ class TMemCache extends TCache private $_persistence = true; /** * @var integer number of buckets to create for this server which in turn control its - * probability of it being selected. The probability is relative to the total weight + * probability of it being selected. The probability is relative to the total weight * of all servers. */ private $_weight = 1; - + private $_timeout = 360; private $_retryInterval = 15; @@ -126,9 +124,9 @@ class TMemCache extends TCache * @var float Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings. */ private $_minSavings=0.0; - + private $_status = true; - + private $_failureCallback = null; /** @@ -176,13 +174,13 @@ class TMemCache extends TCache Prado::trace('Adding server '.$this->_host, 'System.Caching.TMemCache'); if($this->_cache->addServer($this->_host,$this->_port)===false) throw new TConfigurationException('memcache_connection_failed',$this->_host,$this->_port); - } + } if($this->_threshold!==0) - $this->_cache->setCompressThreshold($this->_threshold,$this->_minSavings); + $this->_cache->setCompressThreshold($this->_threshold,$this->_minSavings); $this->_initialized=true; parent::init($config); } - + /** * Loads configuration from an XML element * @param TXmlElement configuration node @@ -209,7 +207,7 @@ class TMemCache extends TCache ); foreach($checks as $property=>$exception) { - $value=$properties->remove($property); + $value=$properties->remove($property); if($value!==null && is_numeric($value)) $server[$property]=$value; else if($value!==null) @@ -268,7 +266,7 @@ class TMemCache extends TCache { return $this->_threshold; } - + /** * @param integer minimum value length before attempting to compress * @throws TInvalidOperationException if the module is already initialized @@ -280,7 +278,7 @@ class TMemCache extends TCache else $this->_threshold=TPropertyValue::ensureInteger($value); } - + /** * @return float minimum amount of savings to actually store the value compressed */ @@ -288,7 +286,7 @@ class TMemCache extends TCache { return $this->_minSavings; } - + /** * @param float minimum amount of savings to actually store the value compressed * @throws TInvalidOperationException if the module is already initialized @@ -300,7 +298,7 @@ class TMemCache extends TCache else $this->_minSavings=TPropertyValue::ensureFloat($value); } - + /** * Retrieves a value from cache with a specified key. * This is the implementation of the method declared in the parent class. diff --git a/framework/Caching/TSqliteCache.php b/framework/Caching/TSqliteCache.php index ae040028..3c11d45f 100644 --- a/framework/Caching/TSqliteCache.php +++ b/framework/Caching/TSqliteCache.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqliteCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching */ @@ -67,7 +66,6 @@ * SQLite DB file (in the namespace format). * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TSqliteCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Caching * @since 3.0 */ diff --git a/framework/Caching/TXCache.php b/framework/Caching/TXCache.php index e86c8fa9..b29fd38c 100644 --- a/framework/Caching/TXCache.php +++ b/framework/Caching/TXCache.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TXCache.php 1994 2007-06-11 16:02:28Z knut $ * @package System.Caching */ @@ -37,7 +36,6 @@ * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TXCache.php 1994 2007-06-11 16:02:28Z knut $ * @package System.Caching * @since 3.1.1 */ diff --git a/framework/Collections/TAttributeCollection.php b/framework/Collections/TAttributeCollection.php index d72640f2..775ad054 100644 --- a/framework/Collections/TAttributeCollection.php +++ b/framework/Collections/TAttributeCollection.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TAttributeCollection.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections */ @@ -38,7 +37,6 @@ Prado::using('System.Collections.TMap'); * in the collection storage. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TAttributeCollection.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ diff --git a/framework/Collections/TDummyDataSource.php b/framework/Collections/TDummyDataSource.php index bf74dbec..7345982a 100644 --- a/framework/Collections/TDummyDataSource.php +++ b/framework/Collections/TDummyDataSource.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections */ @@ -22,7 +21,6 @@ * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ @@ -76,7 +74,6 @@ class TDummyDataSource extends TComponent implements IteratorAggregate, Countabl * for traversing its dummy items. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ diff --git a/framework/Collections/TList.php b/framework/Collections/TList.php index b82f676e..765fa2ce 100644 --- a/framework/Collections/TList.php +++ b/framework/Collections/TList.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections */ @@ -32,7 +31,6 @@ * operation, override {@link insertAt()}, and {@link removeAt()}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ @@ -252,7 +250,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl } /** - * Finds the base item. If found, the item is inserted before it. + * Finds the base item. If found, the item is inserted before it. * @param mixed the base item which will be pushed back by the second parameter * @param mixed the item * @return int the index where the item is inserted @@ -266,9 +264,9 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl { if(($index = $this->indexOf($baseitem)) == -1) throw new TInvalidDataValueException('list_item_inexistent'); - + $this->insertAt($index, $item); - + return $index; } else @@ -276,7 +274,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl } /** - * Finds the base item. If found, the item is inserted after it. + * Finds the base item. If found, the item is inserted after it. * @param mixed the base item which comes before the second parameter when added to the list * @param mixed the item * @return int the index where the item is inserted @@ -290,9 +288,9 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl { if(($index = $this->indexOf($baseitem)) == -1) throw new TInvalidDataValueException('list_item_inexistent'); - + $this->insertAt($index + 1, $item); - + return $index + 1; } else @@ -402,10 +400,9 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl * * TListIterator is used by TList. It allows TList to return a new iterator * for traversing the items in the list. - * - * @deprecated Issue 264 : ArrayIterator should be used instead + * + * @deprecated Issue 264 : ArrayIterator should be used instead * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ diff --git a/framework/Collections/TListItemCollection.php b/framework/Collections/TListItemCollection.php index 23d5ade8..90a1fbf1 100644 --- a/framework/Collections/TListItemCollection.php +++ b/framework/Collections/TListItemCollection.php @@ -6,9 +6,8 @@ * @author Robin J. Rogge <rojaro@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TListControl.php 2624 2009-03-19 21:20:47Z godzilla80@gmx.net $ * @package System.Collections */ @@ -24,7 +23,6 @@ Prado::using('System.Web.UI.WebControls.TListItem'); * TListItemCollection maintains a list of {@link TListItem} for {@link TListControl}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TListControl.php 2624 2009-03-19 21:20:47Z godzilla80@gmx.net $ * @package System.Collections * @since 3.0 */ diff --git a/framework/Collections/TMap.php b/framework/Collections/TMap.php index d5f2ffce..a0ae8d5b 100644 --- a/framework/Collections/TMap.php +++ b/framework/Collections/TMap.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections */ @@ -28,7 +27,6 @@ * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ @@ -272,9 +270,8 @@ class TMap extends TComponent implements IteratorAggregate,ArrayAccess,Countable * TMapIterator is used by TMap. It allows TMap to return a new iterator * for traversing the items in the map. * - * @deprecated Issue 264 : ArrayIterator should be used instead + * @deprecated Issue 264 : ArrayIterator should be used instead * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ diff --git a/framework/Collections/TPagedDataSource.php b/framework/Collections/TPagedDataSource.php index 60d2736b..745fc052 100644 --- a/framework/Collections/TPagedDataSource.php +++ b/framework/Collections/TPagedDataSource.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections */ @@ -24,7 +23,6 @@ * within the specified page will be returned and traversed. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ @@ -277,7 +275,6 @@ class TPagedDataSource extends TComponent implements IteratorAggregate,Countable * to return a new iterator for traversing the items in a {@link TList} object. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ @@ -363,7 +360,6 @@ class TPagedListIterator implements Iterator * to return a new iterator for traversing the items in a {@link TMap} object. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ diff --git a/framework/Collections/TPagedList.php b/framework/Collections/TPagedList.php index ff03606f..57e567e0 100644 --- a/framework/Collections/TPagedList.php +++ b/framework/Collections/TPagedList.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections */ @@ -51,7 +50,6 @@ * * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ @@ -372,7 +370,6 @@ class TPagedList extends TList * To obtain the page index before it was changed, use {@link getOldPageIndex OldPageIndex}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ @@ -410,7 +407,6 @@ class TPagedListPageChangedEventParameter extends TEventParameter * Newly fetched data should be saved in {@link setData Data} property. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ diff --git a/framework/Collections/TPriorityList.php b/framework/Collections/TPriorityList.php index 1ccbd9ce..6a66b5be 100644 --- a/framework/Collections/TPriorityList.php +++ b/framework/Collections/TPriorityList.php @@ -4,21 +4,20 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPriorityList.php 2541 2008-10-21 15:05:13Z javalizard $ * @package System.Collections */ /** * TPriorityList class * - * TPriorityList implements a priority ordered list collection class. It allows you to specify - * any numeric for priorities down to a specific precision. The lower the numeric, the high the priority of the item in the - * list. Thus -10 has a higher priority than -5, 0, 10 (the default), 18, 10005, etc. Per {@link round}, precision may be negative and - * thus rounding can go by 10, 100, 1000, etc, instead of just .1, .01, .001, etc. The default precision allows for 8 decimal - * places. There is also a default priority of 10, if no different default priority is specified or no item specific priority is indicated. - * If you replace TList with this class it will work exactly the same with items inserted set to the default priority, until you start + * TPriorityList implements a priority ordered list collection class. It allows you to specify + * any numeric for priorities down to a specific precision. The lower the numeric, the high the priority of the item in the + * list. Thus -10 has a higher priority than -5, 0, 10 (the default), 18, 10005, etc. Per {@link round}, precision may be negative and + * thus rounding can go by 10, 100, 1000, etc, instead of just .1, .01, .001, etc. The default precision allows for 8 decimal + * places. There is also a default priority of 10, if no different default priority is specified or no item specific priority is indicated. + * If you replace TList with this class it will work exactly the same with items inserted set to the default priority, until you start * using different priorities than the default priority. * * As you access the PHP array features of this class, it flattens and caches the results. If at all possible, this @@ -39,15 +38,14 @@ * $n=count($list); // returns the number of items in the list * </code> * - * To extend TPriorityList for doing your own operations with each addition or removal, + * To extend TPriorityList for doing your own operations with each addition or removal, * override {@link insertAtIndexInPriority()} and {@link removeAtIndexInPriority()} and then call the parent. * * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: TPriorityList.php 2541 2008-10-21 15:05:13Z javalizard $ * @package System.Collections * @since 3.2a */ -class TPriorityList extends TList +class TPriorityList extends TList { /** * @var array internal data storage @@ -73,7 +71,7 @@ class TPriorityList extends TList * @var integer the precision of the numeric priorities within this priority list. */ private $_p=8; - + /** * Constructor. * Initializes the list with an array or an iterable object. @@ -92,7 +90,7 @@ class TPriorityList extends TList $this->setPrecision($precision); $this->setDefaultPriority($defaultPriority); } - + /** * Returns the number of items in the list. * This method is required by Countable interface. @@ -102,7 +100,7 @@ class TPriorityList extends TList { return $this->getCount(); } - + /** * Returns the total number of items in the list * @return integer the number of items in the list @@ -111,7 +109,7 @@ class TPriorityList extends TList { return $this->_c; } - + /** * Gets the number of items at a priority within the list * @param numeric optional priority at which to count items. if no parameter, it will be set to the default {@link getDefaultPriority} @@ -122,12 +120,12 @@ class TPriorityList extends TList if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); - + if(!isset($this->_d[$priority]) || !is_array($this->_d[$priority])) return false; return count($this->_d[$priority]); } - + /** * @return numeric gets the default priority of inserted items without a specified priority */ @@ -135,7 +133,7 @@ class TPriorityList extends TList { return $this->_dp; } - + /** * This must be called internally or when instantiated. * @param numeric sets the default priority of inserted items without a specified priority @@ -144,7 +142,7 @@ class TPriorityList extends TList { $this->_dp=(string)round(TPropertyValue::ensureFloat($value),$this->_p); } - + /** * @return integer The precision of numeric priorities, defaults to 8 */ @@ -152,7 +150,7 @@ class TPriorityList extends TList { return $this->_p; } - + /** * This must be called internally or when instantiated. * @param integer The precision of numeric priorities. @@ -161,7 +159,7 @@ class TPriorityList extends TList { $this->_p=TPropertyValue::ensureInteger($value); } - + /** * Returns an iterator for traversing the items in the list. * This method is required by the interface IteratorAggregate. @@ -171,7 +169,7 @@ class TPriorityList extends TList { return new ArrayIterator($this->flattenPriorities()); } - + /** * This returns a list of the priorities within this list, ordered lowest to highest. * @return array the array of priority numerics in decreasing priority order @@ -181,8 +179,8 @@ class TPriorityList extends TList $this->sortPriorities(); return array_keys($this->_d); } - - + + /** * This orders the priority list internally. */ @@ -194,20 +192,20 @@ class TPriorityList extends TList } /** - * This flattens the priority list into a flat array [0,...,n-1] + * This flattens the priority list into a flat array [0,...,n-1] * @return array array of items in the list in priority and index order */ protected function flattenPriorities() { if(is_array($this->_fd)) return $this->_fd; - + $this->sortPriorities(); $this->_fd=array(); foreach($this->_d as $priority => $itemsatpriority) $this->_fd=array_merge($this->_fd,$itemsatpriority); return $this->_fd; } - + /** * Returns the item at the index of a flattened priority list. @@ -235,7 +233,7 @@ class TPriorityList extends TList if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); - + return isset($this->_d[$priority])?$this->_d[$priority]:null; } @@ -250,14 +248,14 @@ class TPriorityList extends TList if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority), $this->_p); - + return !isset($this->_d[$priority])?false:( isset($this->_d[$priority][$index])?$this->_d[$priority][$index]:false ); } /** - * Appends an item into the list at the end of the specified priority. The position of the added item may + * Appends an item into the list at the end of the specified priority. The position of the added item may * not be at the end of the list. * @param mixed item to add into the list at priority * @param numeric priority blank or null for the default priority @@ -268,7 +266,7 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + return $this->insertAtIndexInPriority($item,false,$priority,true); } @@ -284,7 +282,7 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + if(($priority=$this->priorityAt($index,true))!==false) $this->insertAtIndexInPriority($item,$priority[1],$priority[0]); else @@ -292,7 +290,7 @@ class TPriorityList extends TList } /** - * Inserts an item at the specified index within a priority. Override and call this method to + * Inserts an item at the specified index within a priority. Override and call this method to * insert your own functionality. * @param mixed item to add within the list. * @param integer index within the priority to add the item, defaults to false which appends the item at the priority @@ -305,11 +303,11 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority), $this->_p); - + if($preserveCache) { $this->sortPriorities(); $cc=0; @@ -318,7 +316,7 @@ class TPriorityList extends TList break; else $cc+=count($items); - + if($index===false&&isset($this->_d[$priority])) { $c=count($this->_d[$priority]); $c+=$cc; @@ -331,7 +329,7 @@ class TPriorityList extends TList $this->_o = false; $this->_d[$priority]=array($item); } - + if($this->_fd&&is_array($this->_fd)) // if there is a flattened array cache array_splice($this->_fd,$c,0,array($item)); } else { @@ -352,13 +350,13 @@ class TPriorityList extends TList else $this->_fd=null; } - + $this->_c++; - + return $c; - + } - + /** * Removes an item from the priority list. @@ -373,14 +371,14 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + if(($p=$this->priorityOf($item,true))!==false) { if($priority!==false) { if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); - + if($p[0]!=$priority) throw new TInvalidDataValueException('list_item_inexistent'); } @@ -402,14 +400,14 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + if(($priority=$this->priorityAt($index, true))!==false) return $this->removeAtIndexInPriority($priority[1],$priority[0]); throw new TInvalidDataValueException('list_index_invalid',$index); } /** - * Removes the item at a specific index within a priority. Override + * Removes the item at a specific index within a priority. Override * and call this method to insert your own functionality. * @param integer index of item to remove within the priority. * @param numeric priority of the item to remove, defaults to null, or left blank, it is then set to the default priority @@ -420,21 +418,21 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); - + if(!isset($this->_d[$priority])||$index<0||$index>=count($this->_d[$priority])) throw new TInvalidDataValueException('list_item_inexistent'); - + // $value is an array of elements removed, only one $value=array_splice($this->_d[$priority],$index,1); $value=$value[0]; - + if(!count($this->_d[$priority])) unset($this->_d[$priority]); - + $this->_c--; $this->_fd=null; return $value; @@ -447,7 +445,7 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + $d=array_reverse($this->_d,true); foreach($this->_d as $priority=>$items) { for($index=count($items)-1;$index>=0;$index--) @@ -489,17 +487,17 @@ class TPriorityList extends TList public function priorityOf($item,$withindex = false) { $this->sortPriorities(); - + $absindex = 0; foreach($this->_d as $priority=>$items) { if(($index=array_search($item,$items,true))!==false) { $absindex+=$index; - return $withindex?array($priority,$index,$absindex, + return $withindex?array($priority,$index,$absindex, 'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority; } else $absindex+=count($items); } - + return false; } @@ -516,21 +514,21 @@ class TPriorityList extends TList { if($index<0||$index>=$this->getCount()) throw new TInvalidDataValueException('list_index_invalid',$index); - + $absindex=$index; $this->sortPriorities(); foreach($this->_d as $priority=>$items) { if($index>=($c=count($items))) $index-=$c; else - return $withindex?array($priority,$index,$absindex, + return $withindex?array($priority,$index,$absindex, 'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority; } return false; } /** - * This inserts an item before another item within the list. It uses the same priority as the + * This inserts an item before another item within the list. It uses the same priority as the * found index item and places the new item before it. * @param mixed indexitem the item to index * @param mixed the item to add before indexitem @@ -541,17 +539,17 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + if(($priority=$this->priorityOf($indexitem,true))===false) throw new TInvalidDataValueException('list_item_inexistent'); - + $this->insertAtIndexInPriority($item,$priority[1],$priority[0]); - + return $priority[2]; } /** - * This inserts an item after another item within the list. It uses the same priority as the + * This inserts an item after another item within the list. It uses the same priority as the * found index item and places the new item after it. * @param mixed indexitem the item to index * @param mixed the item to add after indexitem @@ -562,12 +560,12 @@ class TPriorityList extends TList { if($this->getReadOnly()) throw new TInvalidOperationException('list_readonly',get_class($this)); - + if(($priority=$this->priorityOf($indexitem,true))===false) throw new TInvalidDataValueException('list_item_inexistent'); - + $this->insertAtIndexInPriority($item,$priority[1]+1,$priority[0]); - + return $priority[2]+1; } @@ -592,7 +590,7 @@ class TPriorityList extends TList * Combines the map elements which have a priority below the parameter value * @param numeric the cut-off priority. All items of priority less than this are returned. * @param boolean whether or not the input cut-off priority is inclusive. Default: false, not inclusive. - * @return array the array of priorities keys with values of arrays of items that are below a specified priority. + * @return array the array of priorities keys with values of arrays of items that are below a specified priority. * The priorities are sorted so important priorities, lower numerics, are first. */ public function toArrayBelowPriority($priority,$inclusive=false) @@ -612,7 +610,7 @@ class TPriorityList extends TList * Combines the map elements which have a priority above the parameter value * @param numeric the cut-off priority. All items of priority greater than this are returned. * @param boolean whether or not the input cut-off priority is inclusive. Default: true, inclusive. - * @return array the array of priorities keys with values of arrays of items that are above a specified priority. + * @return array the array of priorities keys with values of arrays of items that are above a specified priority. * The priorities are sorted so important priorities, lower numerics, are first. */ public function toArrayAbovePriority($priority,$inclusive=true) @@ -627,7 +625,7 @@ class TPriorityList extends TList } return $items; } - + /** * Copies iterable data into the priority list. @@ -658,7 +656,7 @@ class TPriorityList extends TList /** * Merges iterable data into the priority list. * New data will be appended to the end of the existing data. If another TPriorityList is merged, - * the incoming parameter items will be appended at the priorities they are present. These items will be added + * the incoming parameter items will be appended at the priorities they are present. These items will be added * to the end of the existing items with equal priorities, if there are any. * @param mixed the data to be merged with, must be an array or object implementing Traversable * @throws TInvalidDataTypeException If data is neither an array nor an iterator. @@ -677,7 +675,7 @@ class TPriorityList extends TList { foreach($data as $priority=>$item) $this->add($item); - + } else if($data!==null) throw new TInvalidDataTypeException('map_data_not_iterable'); @@ -707,12 +705,12 @@ class TPriorityList extends TList /** * Sets the element at the specified offset. This method is required by the interface ArrayAccess. - * Setting elements in a priority list is not straight forword when appending and setting at the + * Setting elements in a priority list is not straight forword when appending and setting at the * end boundary. When appending without an offset (a null offset), the item will be added at * the default priority. The item may not be the last item in the list. When appending with an * offset equal to the count of the list, the item will get be appended with the last items priority. * - * All together, when setting the location of an item, the item stays in that location, but appending + * All together, when setting the location of an item, the item stays in that location, but appending * an item into a priority list doesn't mean the item is at the end of the list. * @param integer the offset to set element * @param mixed the element value diff --git a/framework/Collections/TPriorityMap.php b/framework/Collections/TPriorityMap.php index 46f05e9e..352e56ff 100644 --- a/framework/Collections/TPriorityMap.php +++ b/framework/Collections/TPriorityMap.php @@ -4,27 +4,26 @@ * * @author Brad Anderson <javalizard@mac.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPriorityMap.php 2817 2010-04-18 04:25:03Z javalizard $ * @package System.Collections */ /** * TPriorityMap class * - * TPriorityMap implements a collection that takes key-value pairs with - * a priority to allow key-value pairs to be ordered. This ordering is + * TPriorityMap implements a collection that takes key-value pairs with + * a priority to allow key-value pairs to be ordered. This ordering is * important when flattening the map. When flattening the map, if some - * key-value pairs are required to be before or after others, use this + * key-value pairs are required to be before or after others, use this * class to keep order to your map. * * You can access, add or remove an item with a key by using - * {@link itemAt}, {@link add}, and {@link remove}. These functions - * can optionally take a priority parameter to allow access to specific - * priorities. TPriorityMap is functionally backward compatible + * {@link itemAt}, {@link add}, and {@link remove}. These functions + * can optionally take a priority parameter to allow access to specific + * priorities. TPriorityMap is functionally backward compatible * with {@link TMap}. - * + * * To get the number of the items in the map, use {@link getCount}. * TPriorityMap can also be used like a regular array as follows, * <code> @@ -39,19 +38,18 @@ * * An item that doesn't specify a priority will receive the default * priority. The default priority is set during the instantiation - * of a new TPriorityMap. If no custom default priority is specified, + * of a new TPriorityMap. If no custom default priority is specified, * the standard default priority of 10 is used. * * Priorities with significant digits below precision will be rounded. * - * A priority may also be a numeric with decimals. This is set - * during the instantiation of a new TPriorityMap. + * A priority may also be a numeric with decimals. This is set + * during the instantiation of a new TPriorityMap. * The default is 8 decimal places for a priority. If a negative number * is used, rounding occurs into the integer space rather than in * the decimal space. See {@link round}. * * @author Brad Anderson <javalizard@mac.com> - * @version $Id: TPriorityMap.php 2817 2010-04-18 04:25:03Z javalizard $ * @package System.Collections * @since 3.2a */ @@ -121,7 +119,7 @@ class TPriorityMap extends TMap { $this->_r=TPropertyValue::ensureBoolean($value); } - + /** * @return numeric gets the default priority of inserted items without a specified priority */ @@ -129,7 +127,7 @@ class TPriorityMap extends TMap { return $this->_dp; } - + /** * This must be called internally or when instantiated. * @param numeric sets the default priority of inserted items without a specified priority @@ -138,7 +136,7 @@ class TPriorityMap extends TMap { $this->_dp = (string)round(TPropertyValue::ensureFloat($value), $this->_p); } - + /** * @return integer The precision of numeric priorities, defaults to 8 */ @@ -146,7 +144,7 @@ class TPriorityMap extends TMap { return $this->_p; } - + /** * This must be called internally or when instantiated. * @param integer The precision of numeric priorities. @@ -165,8 +163,8 @@ class TPriorityMap extends TMap { return new ArrayIterator($this->flattenPriorities()); } - - + + /** * Orders the priority list internally. */ @@ -184,7 +182,7 @@ class TPriorityMap extends TMap protected function flattenPriorities() { if(is_array($this->_fd)) return $this->_fd; - + $this->sortPriorities(); $this->_fd = array(); foreach($this->_d as $priority => $itemsatpriority) @@ -209,10 +207,10 @@ class TPriorityMap extends TMap { return $this->_c; } - + /** * Gets the number of items at a priority within the map. - * @param numeric optional priority at which to count items. if no parameter, + * @param numeric optional priority at which to count items. if no parameter, * it will be set to the default {@link getDefaultPriority} * @return integer the number of items in the map at the specified priority */ @@ -221,12 +219,12 @@ class TPriorityMap extends TMap if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); - + if(!isset($this->_d[$priority])||!is_array($this->_d[$priority])) return false; return count($this->_d[$priority]); } - + /** * This returns a list of the priorities within this map, ordered lowest to highest. * @return array the array of priority numerics in decreasing priority order @@ -250,7 +248,7 @@ class TPriorityMap extends TMap * Returns the item with the specified key. If a priority is specified, only items * within that specific priority will be selected * @param mixed the key - * @param mixed the priority. null is the default priority, false is any priority, + * @param mixed the priority. null is the default priority, false is any priority, * and numeric is a specific priority. default: false, any priority. * @return mixed the element at the offset, null if no element is found at the offset */ @@ -279,7 +277,7 @@ class TPriorityMap extends TMap if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); - + $oldpriority=$this->priorityAt($key); if($oldpriority!==false&&$oldpriority!=$priority) { $value=$this->remove($key,$oldpriority); @@ -298,7 +296,7 @@ class TPriorityMap extends TMap if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); - + return isset($this->_d[$priority])?$this->_d[$priority]:null; } @@ -348,7 +346,7 @@ class TPriorityMap extends TMap if($priority===null) $priority=$this->getDefaultPriority(); $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); - + if(!$this->_r) { foreach($this->_d as $innerpriority=>$items) @@ -376,11 +374,11 @@ class TPriorityMap extends TMap /** * Removes an item from the map by its key. If no priority, or false, is specified * then priority is irrelevant. If null is used as a parameter for priority, then - * the priority will be the default priority. If a priority is specified, or + * the priority will be the default priority. If a priority is specified, or * the default priority is specified, only key-value pairs in that priority * will be affected. * @param mixed the key of the item to be removed - * @param numeric|false|null priority. False is any priority, null is the + * @param numeric|false|null priority. False is any priority, null is the * default priority, and numeric is a specific priority * @return mixed the removed value, null if no such key exists. * @throws TInvalidOperationException if the map is read-only @@ -391,7 +389,7 @@ class TPriorityMap extends TMap { if($priority===null) $priority=$this->getDefaultPriority(); - + if($priority===false) { $this->sortPriorities(); @@ -455,8 +453,8 @@ class TPriorityMap extends TMap } /** - * When the map is flattened into an array, the priorities are taken into - * account and elements of the map are ordered in the array according to + * When the map is flattened into an array, the priorities are taken into + * account and elements of the map are ordered in the array according to * their priority. * @return array the list of items in array */ @@ -469,7 +467,7 @@ class TPriorityMap extends TMap * Combines the map elements which have a priority below the parameter value * @param numeric the cut-off priority. All items of priority less than this are returned. * @param boolean whether or not the input cut-off priority is inclusive. Default: false, not inclusive. - * @return array the array of priorities keys with values of arrays of items that are below a specified priority. + * @return array the array of priorities keys with values of arrays of items that are below a specified priority. * The priorities are sorted so important priorities, lower numerics, are first. */ public function toArrayBelowPriority($priority,$inclusive=false) @@ -489,7 +487,7 @@ class TPriorityMap extends TMap * Combines the map elements which have a priority above the parameter value * @param numeric the cut-off priority. All items of priority greater than this are returned. * @param boolean whether or not the input cut-off priority is inclusive. Default: true, inclusive. - * @return array the array of priorities keys with values of arrays of items that are above a specified priority. + * @return array the array of priorities keys with values of arrays of items that are above a specified priority. * The priorities are sorted so important priorities, lower numerics, are first. */ public function toArrayAbovePriority($priority,$inclusive=true) @@ -508,7 +506,7 @@ class TPriorityMap extends TMap /** * Copies iterable data into the map. * Note, existing data in the map will be cleared first. - * @param mixed the data to be copied from, must be an array, object implementing + * @param mixed the data to be copied from, must be an array, object implementing * Traversable, or a TPriorityMap * @throws TInvalidDataTypeException If data is neither an array nor an iterator. */ @@ -538,7 +536,7 @@ class TPriorityMap extends TMap /** * Merges iterable data into the map. * Existing data in the map will be kept and overwritten if the keys are the same. - * @param mixed the data to be merged with, must be an array, object implementing + * @param mixed the data to be merged with, must be an array, object implementing * Traversable, or a TPriorityMap * @throws TInvalidDataTypeException If data is neither an array nor an iterator. */ diff --git a/framework/Collections/TQueue.php b/framework/Collections/TQueue.php index 077b9b2f..ffa81b95 100644 --- a/framework/Collections/TQueue.php +++ b/framework/Collections/TQueue.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Collections @@ -161,7 +161,7 @@ class TQueue extends TComponent implements IteratorAggregate,Countable { return $this->_c; } - + /** * Returns the number of items in the queue. * This method is required by Countable interface. diff --git a/framework/Collections/TStack.php b/framework/Collections/TStack.php index 06c97046..91996aaa 100644 --- a/framework/Collections/TStack.php +++ b/framework/Collections/TStack.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections */ @@ -27,7 +26,6 @@ * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ @@ -180,9 +178,8 @@ class TStack extends TComponent implements IteratorAggregate,Countable * TStackIterator is used by TStack. It allows TStack to return a new iterator * for traversing the items in the list. * - * @deprecated Issue 264 : ArrayIterator should be used instead + * @deprecated Issue 264 : ArrayIterator should be used instead * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Collections * @since 3.0 */ diff --git a/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php b/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php index 7dd69641..11fb796b 100644 --- a/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php +++ b/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord */ @@ -14,7 +13,6 @@ * Base exception class for Active Records. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @since 3.1 */ @@ -38,7 +36,6 @@ class TActiveRecordException extends TDbException * TActiveRecordConfigurationException class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @since 3.1 */ diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php index 32e27742..2197b48c 100644 --- a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php +++ b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.ActiveRecord.Relations diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php index e41dc806..92fe495a 100644 --- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php +++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.ActiveRecord.Relations diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php index d845d372..1b58f112 100644 --- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php +++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.ActiveRecord.Relations diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php index 4f20f12f..46c4d9fb 100644 --- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php +++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.ActiveRecord.Relations diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php index 2fe6dcb1..7fe2d468 100644 --- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php +++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.ActiveRecord.Relations diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php index 6c1dcd4f..961dcd91 100644 --- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php +++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.ActiveRecord.Relations diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php index 71f015b8..0a2c0cd3 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php @@ -4,7 +4,7 @@ * * @author Cesar Ramos <cramos[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Data.ActiveRecord.Scaffold.InputBuilder */ diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php index b9d133a2..1cb73438 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php @@ -3,7 +3,7 @@ * TMssqlScaffoldInput class file. * * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Data.ActiveRecord.Scaffold.InputBuilder */ diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php index 74eddbd8..e2e75318 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php @@ -3,7 +3,7 @@ * TMysqlScaffoldInput class file. * * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Data.ActiveRecord.Scaffold.InputBuilder */ diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php index 088bbd42..6d10874a 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php @@ -3,7 +3,7 @@ * TPgsqlScaffoldInput class file. * * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Data.ActiveRecord.Scaffold.InputBuilder */ diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php index 611cfdfb..14244b4c 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php @@ -3,7 +3,7 @@ * TScaffoldInputBase class file. * * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Data.ActiveRecord.Scaffold.InputBuilder */ diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php index 68404adb..3394680e 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php @@ -3,7 +3,7 @@ * TScaffoldInputCommon class file. * * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Data.ActiveRecord.Scaffold.InputBuilder */ diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php index 302f320b..441d2770 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php @@ -3,7 +3,7 @@ * TSqliteScaffoldInput class file. * * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Data.ActiveRecord.Scaffold.InputBuilder */ diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php index 41dbb240..122dfbd2 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TScaffoldBase.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold */ @@ -26,7 +25,6 @@ Prado::using('System.Data.ActiveRecord.TActiveRecord'); * file explicitly. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TScaffoldBase.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold * @since 3.1 */ diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php index ff1c65c7..74e79eaa 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold */ @@ -43,7 +42,6 @@ Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldBase'); * xxx is the property name). * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold * @since 3.1 */ @@ -294,7 +292,6 @@ class TScaffoldEditView extends TScaffoldBase * that is called before the save() method is called on the TActiveRecord. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold * @since 3.1 */ diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php index 2cd2def5..afdb126c 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TScaffoldListView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold */ @@ -44,7 +43,6 @@ Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldBase'); * Parameters property of TActiveRecordCriteria. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TScaffoldListView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold * @since 3.1 */ diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php index 5505977f..ea2d2c94 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.ActiveRecord.Scaffold diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php index 63dea8dd..acc78fd2 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TScaffoldView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold */ @@ -35,7 +34,6 @@ Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldSearch'); * the Active Record class to be displayed/edited/added. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TScaffoldView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord.Scaffold * @since 3.0 */ diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php index 24fa41ce..735579cd 100644 --- a/framework/Data/ActiveRecord/TActiveRecord.php +++ b/framework/Data/ActiveRecord/TActiveRecord.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord */ @@ -142,7 +141,6 @@ Prado::using('System.Data.ActiveRecord.Relations.TActiveRecordRelationContext'); * </code> * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @since 3.1 */ @@ -1025,6 +1023,29 @@ abstract class TActiveRecord extends TComponent { return isset(self::$_relations[get_class($this)][strtolower($property)]); } + + /** + * Return record data as array + * @return array of column name and column values + * @since 3.2.4 + */ + public function toArray(){ + $result=array(); + foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName){ + $result[$columnName]=$this->getColumnValue($columnName); + } + + return $result; + } + + /** + * Return record data as JSON + * @return JSON + * @since 3.2.4 + */ + public function toJSON(){ + return json_encode($this->toArray()); + } } /** @@ -1037,7 +1058,6 @@ abstract class TActiveRecord extends TComponent * be set to false to prevent the requested change event to be performed. * * @author Wei Zhuo<weizhuo@gmail.com> - * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @since 3.1.2 */ @@ -1072,7 +1092,6 @@ class TActiveRecordChangeEventParameter extends TEventParameter * - Exception: throws a TActiveRecordException * * @author Yves Berkholz <godzilla80@gmx.net> - * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @see TActiveRecordManager::setInvalidFinderResult * @see TActiveRecordConfig::setInvalidFinderResult diff --git a/framework/Data/ActiveRecord/TActiveRecordConfig.php b/framework/Data/ActiveRecord/TActiveRecordConfig.php index 7421d08b..6e726df0 100644 --- a/framework/Data/ActiveRecord/TActiveRecordConfig.php +++ b/framework/Data/ActiveRecord/TActiveRecordConfig.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveRecordConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord */ @@ -66,7 +65,6 @@ Prado::using('System.Data.ActiveRecord.TActiveRecordManager'); * </code> * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TActiveRecordConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @since 3.1 */ diff --git a/framework/Data/ActiveRecord/TActiveRecordCriteria.php b/framework/Data/ActiveRecord/TActiveRecordCriteria.php index afa76c51..aec3ce53 100644 --- a/framework/Data/ActiveRecord/TActiveRecordCriteria.php +++ b/framework/Data/ActiveRecord/TActiveRecordCriteria.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveRecordCriteria.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord */ @@ -28,7 +27,6 @@ Prado::using('System.Data.DataGateway.TSqlCriteria'); * </code> * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TActiveRecordCriteria.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @since 3.1 */ diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php index c61cdd18..4d4fdac1 100644 --- a/framework/Data/ActiveRecord/TActiveRecordGateway.php +++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveRecordGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord */ @@ -15,7 +14,6 @@ * record as arrays (for most finder methods). * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TActiveRecordGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @since 3.1 */ diff --git a/framework/Data/ActiveRecord/TActiveRecordManager.php b/framework/Data/ActiveRecord/TActiveRecordManager.php index 26c04e87..4aa2cde9 100644 --- a/framework/Data/ActiveRecord/TActiveRecordManager.php +++ b/framework/Data/ActiveRecord/TActiveRecordManager.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveRecordManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord */ @@ -31,7 +30,6 @@ Prado::using('System.Data.ActiveRecord.TActiveRecordGateway'); * the active record gateway to cache the table meta data information. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TActiveRecordManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.ActiveRecord * @since 3.1 */ diff --git a/framework/Data/Common/Mssql/TMssqlCommandBuilder.php b/framework/Data/Common/Mssql/TMssqlCommandBuilder.php index efee34f9..ac718bcb 100644 --- a/framework/Data/Common/Mssql/TMssqlCommandBuilder.php +++ b/framework/Data/Common/Mssql/TMssqlCommandBuilder.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common */ @@ -17,7 +16,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder'); * for MSSQL servers. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common * @since 3.1 */ diff --git a/framework/Data/Common/Mssql/TMssqlMetaData.php b/framework/Data/Common/Mssql/TMssqlMetaData.php index 8ee455d5..990639af 100644 --- a/framework/Data/Common/Mssql/TMssqlMetaData.php +++ b/framework/Data/Common/Mssql/TMssqlMetaData.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPgsqlMetaData.php 1866 2007-04-14 05:02:29Z wei $ * @package System.Data.Common.Mssql */ @@ -20,12 +19,11 @@ Prado::using('System.Data.Common.Mssql.TMssqlTableInfo'); * TMssqlMetaData loads MSSQL database table and column information. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TPgsqlMetaData.php 1866 2007-04-14 05:02:29Z wei $ * @package System.Data.Common.Mssql * @since 3.1 */ class TMssqlMetaData extends TDbMetaData -{ +{ /** * @return string TDbTableInfo class name. */ @@ -260,7 +258,7 @@ EOD; } return false; } - + /** * Returns all table names in the database. * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema. diff --git a/framework/Data/Common/Mssql/TMssqlTableColumn.php b/framework/Data/Common/Mssql/TMssqlTableColumn.php index 7976c28a..e3bd431e 100644 --- a/framework/Data/Common/Mssql/TMssqlTableColumn.php +++ b/framework/Data/Common/Mssql/TMssqlTableColumn.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMssqlTableColumn.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common.Mssql */ @@ -19,7 +18,6 @@ Prado::using('System.Data.Common.TDbTableColumn'); * Describes the column metadata of the schema for a Mssql database table. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TMssqlTableColumn.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common.Mssql * @since 3.1 */ diff --git a/framework/Data/Common/Mssql/TMssqlTableInfo.php b/framework/Data/Common/Mssql/TMssqlTableInfo.php index 0db446b1..d003b336 100644 --- a/framework/Data/Common/Mssql/TMssqlTableInfo.php +++ b/framework/Data/Common/Mssql/TMssqlTableInfo.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMssqlTableInfo.php 1861 2007-04-12 08:05:03Z wei $ * @package System.Data.Common.Mssql */ @@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Mssql.TMssqlTableColumn'); * TMssqlTableInfo class provides additional table information for Mssql database. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TMssqlTableInfo.php 1861 2007-04-12 08:05:03Z wei $ * @package System.Data.Common.Mssql * @since 3.1 */ diff --git a/framework/Data/Common/Mysql/TMysqlCommandBuilder.php b/framework/Data/Common/Mysql/TMysqlCommandBuilder.php index 8492c537..38e98b4f 100644 --- a/framework/Data/Common/Mysql/TMysqlCommandBuilder.php +++ b/framework/Data/Common/Mysql/TMysqlCommandBuilder.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common */ @@ -16,7 +15,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder'); * TMysqlCommandBuilder implements default TDbCommandBuilder * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common * @since 3.1 */ diff --git a/framework/Data/Common/Mysql/TMysqlMetaData.php b/framework/Data/Common/Mysql/TMysqlMetaData.php index f08a6fc0..cc9bc01d 100644 --- a/framework/Data/Common/Mysql/TMysqlMetaData.php +++ b/framework/Data/Common/Mysql/TMysqlMetaData.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMysqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Mysql */ @@ -23,7 +22,6 @@ Prado::using('System.Data.Common.Mysql.TMysqlTableInfo'); * See http://netevil.org/node.php?nid=795&SC=1 * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TMysqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Mysql * @since 3.1 */ @@ -382,7 +380,7 @@ EOD; } return false; } - + /** * Returns all table names in the database. * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema. diff --git a/framework/Data/Common/Mysql/TMysqlTableColumn.php b/framework/Data/Common/Mysql/TMysqlTableColumn.php index 6f482537..dd62f0f6 100644 --- a/framework/Data/Common/Mysql/TMysqlTableColumn.php +++ b/framework/Data/Common/Mysql/TMysqlTableColumn.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMysqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Mysql */ @@ -19,7 +18,6 @@ Prado::using('System.Data.Common.TDbTableColumn'); * Describes the column metadata of the schema for a Mysql database table. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TMysqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Mysql * @since 3.1 */ diff --git a/framework/Data/Common/Mysql/TMysqlTableInfo.php b/framework/Data/Common/Mysql/TMysqlTableInfo.php index b190e961..17b32aa9 100644 --- a/framework/Data/Common/Mysql/TMysqlTableInfo.php +++ b/framework/Data/Common/Mysql/TMysqlTableInfo.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMysqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Mysql */ @@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Mysql.TMysqlTableColumn'); * TMysqlTableInfo class provides additional table information for MySQL database. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TMysqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Mysql * @since 3.1 */ diff --git a/framework/Data/Common/Oracle/TOracleCommandBuilder.php b/framework/Data/Common/Oracle/TOracleCommandBuilder.php index 26490d54..56173c3a 100644 --- a/framework/Data/Common/Oracle/TOracleCommandBuilder.php +++ b/framework/Data/Common/Oracle/TOracleCommandBuilder.php @@ -5,9 +5,8 @@ * * @author Marcos Nobre <marconobre[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TOracleCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common */ @@ -18,7 +17,6 @@ Prado :: using('System.Data.Common.TDbCommandBuilder'); * for Oracle database. * * @author Marcos Nobre <marconobre[at]gmail[dot]com> - * @version $Id: TOracleCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common * @since 3.1 */ @@ -134,14 +132,14 @@ class TOracleCommandBuilder extends TDbCommandBuilder { " SELECT rownum as {$pradoNUMLIN} {$aliasedFields} FROM ". " ($sql) {$fieldsALIAS} WHERE rownum <= {$limit} ". ") WHERE {$pradoNUMLIN} >= {$offset} "; - + ************************* */ $offset=(int)$offset; $toReg = $offset + $limit ; $fullTableName = $this->getTableInfo()->getTableFullName(); - if (empty ($sORDERBY)) + if (empty ($sORDERBY)) $sORDERBY="ROWNUM"; - + $newSql = " SELECT $fields FROM " . "( " . " SELECT ROW_NUMBER() OVER ( ORDER BY {$sORDERBY} ) -1 as {$pradoNUMLIN} {$aliasedFields} " . diff --git a/framework/Data/Common/Oracle/TOracleMetaData.php b/framework/Data/Common/Oracle/TOracleMetaData.php index 8648fcc9..fc1800c5 100644 --- a/framework/Data/Common/Oracle/TOracleMetaData.php +++ b/framework/Data/Common/Oracle/TOracleMetaData.php @@ -4,9 +4,8 @@ * * @author Marcos Nobre <marconobre[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TOracleMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Oracle */ @@ -21,7 +20,6 @@ Prado::using('System.Data.Common.Oracle.TOracleTableColumn'); * TOracleMetaData loads Oracle database table and column information. * * @author Marcos Nobre <marconobre[at]gmail[dot]com> - * @version $Id: TOracleMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Oracle * @since 3.1 */ @@ -29,7 +27,7 @@ class TOracleMetaData extends TDbMetaData { private $_defaultSchema = 'system'; - + /** * @return string TDbTableInfo class name. */ @@ -336,7 +334,7 @@ EOD; } return false; } - + /** * Returns all table names in the database. * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema. diff --git a/framework/Data/Common/Oracle/TOracleTableColumn.php b/framework/Data/Common/Oracle/TOracleTableColumn.php index bbd7212c..bc89d8c5 100644 --- a/framework/Data/Common/Oracle/TOracleTableColumn.php +++ b/framework/Data/Common/Oracle/TOracleTableColumn.php @@ -4,9 +4,8 @@ * * @author Marcos Nobre <marconobre[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TOracleTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Oracle */ @@ -19,14 +18,13 @@ Prado::using('System.Data.Common.TDbTableColumn'); * Describes the column metadata of the schema for a PostgreSQL database table. * * @author Marcos Nobre <marconobre[at]gmail[dot]com> - * @version $Id: TOracleTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Oracle * @since 3.1 */ class TOracleTableColumn extends TDbTableColumn { private static $types=array( - 'numeric' => array( 'numeric' ) + 'numeric' => array( 'numeric' ) // 'integer' => array('bit', 'bit varying', 'real', 'serial', 'int', 'integer'), // 'boolean' => array('boolean'), // 'float' => array('bigint', 'bigserial', 'double precision', 'money', 'numeric') diff --git a/framework/Data/Common/Oracle/TOracleTableInfo.php b/framework/Data/Common/Oracle/TOracleTableInfo.php index 6aa31fd8..4a2e31fd 100644 --- a/framework/Data/Common/Oracle/TOracleTableInfo.php +++ b/framework/Data/Common/Oracle/TOracleTableInfo.php @@ -5,9 +5,8 @@ * * @author Marcos Nobre <marconobre[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TOracleTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common */ @@ -15,7 +14,6 @@ * TDbTableInfo class describes the meta data of a database table. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TOracleTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common * @since 3.1 */ diff --git a/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php b/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php index eb975a1a..851dabb5 100644 --- a/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php +++ b/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common */ @@ -17,7 +16,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder'); * for Pgsql database. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common * @since 3.1 */ diff --git a/framework/Data/Common/Pgsql/TPgsqlMetaData.php b/framework/Data/Common/Pgsql/TPgsqlMetaData.php index a8e7bfed..e5d30ed7 100644 --- a/framework/Data/Common/Pgsql/TPgsqlMetaData.php +++ b/framework/Data/Common/Pgsql/TPgsqlMetaData.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPgsqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Pgsql */ @@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Pgsql.TPgsqlTableInfo'); * TPgsqlMetaData loads PostgreSQL database table and column information. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TPgsqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Pgsql * @since 3.1 */ @@ -418,7 +416,7 @@ EOD; } return false; } - + /** * Returns all table names in the database. * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema. diff --git a/framework/Data/Common/Pgsql/TPgsqlTableColumn.php b/framework/Data/Common/Pgsql/TPgsqlTableColumn.php index da17a7d3..fd0fd23c 100644 --- a/framework/Data/Common/Pgsql/TPgsqlTableColumn.php +++ b/framework/Data/Common/Pgsql/TPgsqlTableColumn.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPgsqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Pgsql */ @@ -19,7 +18,6 @@ Prado::using('System.Data.Common.TDbTableColumn'); * Describes the column metadata of the schema for a PostgreSQL database table. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TPgsqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Pgsql * @since 3.1 */ diff --git a/framework/Data/Common/Pgsql/TPgsqlTableInfo.php b/framework/Data/Common/Pgsql/TPgsqlTableInfo.php index ef2b4575..43298ffa 100644 --- a/framework/Data/Common/Pgsql/TPgsqlTableInfo.php +++ b/framework/Data/Common/Pgsql/TPgsqlTableInfo.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPgsqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Pgsql */ @@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Pgsql.TPgsqlTableColumn'); * TPgsqlTableInfo class provides additional table information for PostgreSQL database. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TPgsqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common.Pgsql * @since 3.1 */ diff --git a/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php b/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php index 396ec7c5..b442f7b4 100644 --- a/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php +++ b/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common */ @@ -17,7 +16,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder'); * for Sqlite database. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ * @package System.Data.Common * @since 3.1 */ diff --git a/framework/Data/Common/Sqlite/TSqliteMetaData.php b/framework/Data/Common/Sqlite/TSqliteMetaData.php index c66825c7..b6dd24b7 100644 --- a/framework/Data/Common/Sqlite/TSqliteMetaData.php +++ b/framework/Data/Common/Sqlite/TSqliteMetaData.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqliteMetaData.php 1861 2007-04-12 08:05:03Z wei $ * @package System.Data.Common.Sqlite */ @@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Sqlite.TSqliteTableInfo'); * TSqliteMetaData loads SQLite database table and column information. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqliteMetaData.php 1861 2007-04-12 08:05:03Z wei $ * @package System.Data.Commom.Sqlite * @since 3.1 */ @@ -190,7 +188,7 @@ class TSqliteMetaData extends TDbMetaData } return false; } - + /** * Returns all table names in the database. * @param string $schema the schema of the tables. This is not used for sqlite database. diff --git a/framework/Data/Common/Sqlite/TSqliteTableColumn.php b/framework/Data/Common/Sqlite/TSqliteTableColumn.php index d8fd1966..f54b6f59 100644 --- a/framework/Data/Common/Sqlite/TSqliteTableColumn.php +++ b/framework/Data/Common/Sqlite/TSqliteTableColumn.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqliteTableColumn.php 1861 2007-04-12 08:05:03Z wei $ * @package System.Data.Common.Sqlite */ @@ -19,7 +18,6 @@ Prado::using('System.Data.Common.TDbTableColumn'); * Describes the column metadata of the schema for a PostgreSQL database table. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqliteTableColumn.php 1861 2007-04-12 08:05:03Z wei $ * @package System.Data.Common.Sqlite * @since 3.1 */ diff --git a/framework/Data/Common/Sqlite/TSqliteTableInfo.php b/framework/Data/Common/Sqlite/TSqliteTableInfo.php index 52fb3530..e15f050a 100644 --- a/framework/Data/Common/Sqlite/TSqliteTableInfo.php +++ b/framework/Data/Common/Sqlite/TSqliteTableInfo.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqliteTableInfo.php 1861 2007-04-12 08:05:03Z wei $ * @package System.Data.Common.Sqlite */ @@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Sqlite.TSqliteTableColumn'); * TSqliteTableInfo class provides additional table information for PostgreSQL database. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqliteTableInfo.php 1861 2007-04-12 08:05:03Z wei $ * @package System.Data.Common.Sqlite * @since 3.1 */ diff --git a/framework/Data/Common/TDbCommandBuilder.php b/framework/Data/Common/TDbCommandBuilder.php index fdaa3bfe..7a7b75d4 100644 --- a/framework/Data/Common/TDbCommandBuilder.php +++ b/framework/Data/Common/TDbCommandBuilder.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common */ @@ -15,7 +14,6 @@ * giving by {@link setTableInfo TableInfo} the property. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common * @since 3.1 */ diff --git a/framework/Data/Common/TDbMetaData.php b/framework/Data/Common/TDbMetaData.php index 0a3a6e90..1d07c750 100644 --- a/framework/Data/Common/TDbMetaData.php +++ b/framework/Data/Common/TDbMetaData.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbMetaData.php 3284 2013-04-11 07:14:59Z ctrlaltca $ * @package System.Data.Common */ @@ -17,7 +16,6 @@ * Use the {@link getTableInfo} method to retrieve a table information. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbMetaData.php 3284 2013-04-11 07:14:59Z ctrlaltca $ * @package System.Data.Common * @since 3.1 */ @@ -180,7 +178,7 @@ abstract class TDbMetaData extends TComponent return $lft . str_replace(self::$delimiterIdentifier, '', $name) . $rgt; } - + /** * Returns all table names in the database. * This method should be overridden by child classes in order to support this feature diff --git a/framework/Data/Common/TDbTableColumn.php b/framework/Data/Common/TDbTableColumn.php index 27cfb7c5..fe96e12a 100644 --- a/framework/Data/Common/TDbTableColumn.php +++ b/framework/Data/Common/TDbTableColumn.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common */ @@ -14,7 +13,6 @@ * TDbTableColumn class describes the column meta data of the schema for a database table. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common * @since 3.1 */ diff --git a/framework/Data/Common/TDbTableInfo.php b/framework/Data/Common/TDbTableInfo.php index fbfcf46d..5060845b 100644 --- a/framework/Data/Common/TDbTableInfo.php +++ b/framework/Data/Common/TDbTableInfo.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common */ @@ -14,7 +13,6 @@ * TDbTableInfo class describes the meta data of a database table. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.Common * @since 3.1 */ diff --git a/framework/Data/DataGateway/TDataGatewayCommand.php b/framework/Data/DataGateway/TDataGatewayCommand.php index f51097c7..fb0f5df0 100644 --- a/framework/Data/DataGateway/TDataGatewayCommand.php +++ b/framework/Data/DataGateway/TDataGatewayCommand.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.DataGateway diff --git a/framework/Data/DataGateway/TSqlCriteria.php b/framework/Data/DataGateway/TSqlCriteria.php index fb8a3a98..bc1bbbbb 100644 --- a/framework/Data/DataGateway/TSqlCriteria.php +++ b/framework/Data/DataGateway/TSqlCriteria.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbSqlCriteria.php 1835 2007-04-03 01:38:15Z wei $ * @package System.Data.DataGateway */ @@ -25,7 +24,6 @@ * </code> * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDbSqlCriteria.php 1835 2007-04-03 01:38:15Z wei $ * @package System.Data.DataGateway * @since 3.1 */ diff --git a/framework/Data/DataGateway/TTableGateway.php b/framework/Data/DataGateway/TTableGateway.php index 1d6385cf..b527fbb4 100644 --- a/framework/Data/DataGateway/TTableGateway.php +++ b/framework/Data/DataGateway/TTableGateway.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.DataGateway diff --git a/framework/Data/SqlMap/Configuration/TDiscriminator.php b/framework/Data/SqlMap/Configuration/TDiscriminator.php index 278ef2d3..1f7347ae 100644 --- a/framework/Data/SqlMap/Configuration/TDiscriminator.php +++ b/framework/Data/SqlMap/Configuration/TDiscriminator.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -21,7 +20,6 @@ * the object data. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -187,7 +185,6 @@ class TDiscriminator extends TComponent * is used inplace of the current result map. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ diff --git a/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php b/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php index a2abab3a..e8977b0d 100644 --- a/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php +++ b/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php @@ -4,21 +4,19 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TInlineParameterMapParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ /** * TInlineParameterMapParser class. * - * The inline parameter map syntax lets you embed the property name, - * the property type, the column type, and a null value replacement into a + * The inline parameter map syntax lets you embed the property name, + * the property type, the column type, and a null value replacement into a * parametrized SQL statement. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TInlineParameterMapParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ diff --git a/framework/Data/SqlMap/Configuration/TParameterMap.php b/framework/Data/SqlMap/Configuration/TParameterMap.php index e24648d2..2eaad9a3 100644 --- a/framework/Data/SqlMap/Configuration/TParameterMap.php +++ b/framework/Data/SqlMap/Configuration/TParameterMap.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TParameterMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -26,7 +25,6 @@ * The <parameterMap> element accepts two attributes: id (required) and extends (optional). * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TParameterMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -150,8 +148,8 @@ class TParameterMap extends TComponent return $value; } - - + + /** * Create type handler from {@link Type setType()} or {@link TypeHandler setTypeHandler}. * @param TParameterProperty parameter property @@ -166,7 +164,7 @@ class TParameterMap extends TComponent $handler = Prado::createComponent($type); return $handler; } - + /** * @param mixed object to obtain the property from. diff --git a/framework/Data/SqlMap/Configuration/TParameterProperty.php b/framework/Data/SqlMap/Configuration/TParameterProperty.php index 255ec690..84007a28 100644 --- a/framework/Data/SqlMap/Configuration/TParameterProperty.php +++ b/framework/Data/SqlMap/Configuration/TParameterProperty.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TParameterProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -25,7 +24,6 @@ * will be written to the database instead of the value. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TParameterProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -137,7 +135,7 @@ class TParameterProperty extends TComponent public function __sleep() { - $exprops = array(); $cn = 'TParameterProperty'; + $exprops = array(); $cn = 'TParameterProperty'; if ($this->_typeHandler===null) $exprops[] = "\0$cn\0_typeHandler"; if ($this->_type===null) $exprops[] = "\0$cn\0_type"; if ($this->_column===null) $exprops[] = "\0$cn\0_column"; diff --git a/framework/Data/SqlMap/Configuration/TResultMap.php b/framework/Data/SqlMap/Configuration/TResultMap.php index 65f149df..e35faf28 100644 --- a/framework/Data/SqlMap/Configuration/TResultMap.php +++ b/framework/Data/SqlMap/Configuration/TResultMap.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TResultMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -32,7 +31,6 @@ * from the "parent" <resultMap> are set before any values specified by this <resultMap>. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TResultMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ diff --git a/framework/Data/SqlMap/Configuration/TResultProperty.php b/framework/Data/SqlMap/Configuration/TResultProperty.php index 54ba832d..796060ae 100644 --- a/framework/Data/SqlMap/Configuration/TResultProperty.php +++ b/framework/Data/SqlMap/Configuration/TResultProperty.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TResultProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -29,7 +28,6 @@ * with the {@link Select setSelect()} . * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TResultProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -327,7 +325,7 @@ class TResultProperty extends TComponent public function __sleep() { - $exprops = array(); $cn = 'TResultProperty'; + $exprops = array(); $cn = 'TResultProperty'; if ($this->_nullValue===null) $exprops[] = "\0$cn\0_nullValue"; if ($this->_propertyName===null) $exprops[] = "\0$cn\0_propertyNama"; if ($this->_columnName===null) $exprops[] = "\0$cn\0_columnName"; diff --git a/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php b/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php index ac7eb059..29260036 100644 --- a/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php +++ b/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSimpleDynamicParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -15,7 +14,6 @@ * it with a TSimpleDynamicParser::DYNAMIC_TOKEN. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSimpleDynamicParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ diff --git a/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php b/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php index b560fe41..271db675 100644 --- a/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php +++ b/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -28,7 +27,6 @@ * the current request. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -193,7 +191,6 @@ class TSqlMapCacheModel extends TComponent * Implemented cache are 'Basic', 'FIFO' and 'LRU'. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -210,7 +207,6 @@ class TSqlMapCacheTypes extends TEnumerable * Provides a hash of the object to be cached. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ diff --git a/framework/Data/SqlMap/Configuration/TSqlMapStatement.php b/framework/Data/SqlMap/Configuration/TSqlMapStatement.php index efa16484..0efcc5b6 100644 --- a/framework/Data/SqlMap/Configuration/TSqlMapStatement.php +++ b/framework/Data/SqlMap/Configuration/TSqlMapStatement.php @@ -5,9 +5,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -24,7 +23,6 @@ * statement can return a database-generated key.) * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -295,7 +293,7 @@ class TSqlMapStatement extends TComponent public function __sleep() { - $cn = __CLASS__; + $cn = __CLASS__; $exprops = array("\0$cn\0_resultMap"); if (!$this->_parameterMapName) $exprops[] = "\0$cn\0_parameterMapName"; if (!$this->_parameterMap) $exprops[] = "\0$cn\0_parameterMap"; @@ -319,7 +317,6 @@ class TSqlMapStatement extends TComponent * TSqlMapSelect class file. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ @@ -338,7 +335,6 @@ class TSqlMapSelect extends TSqlMapStatement * to generate a key to be used for the insert command. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -367,7 +363,6 @@ class TSqlMapInsert extends TSqlMapStatement * TSqlMapUpdate class corresponds to <update> element. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -379,7 +374,6 @@ class TSqlMapUpdate extends TSqlMapStatement * TSqlMapDelete class corresponds to the <delete> element. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -391,7 +385,6 @@ class TSqlMapDelete extends TSqlMapUpdate * TSqlMapSelect corresponds to the <selectKey> element. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ diff --git a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php index abe9b588..db178f70 100644 --- a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php +++ b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ @@ -16,7 +15,6 @@ Prado::using('System.Data.SqlMap.Configuration.TSqlMapStatement'); * TSqlMapXmlConfig class file. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration */ abstract class TSqlMapXmlConfigBuilder @@ -128,7 +126,6 @@ abstract class TSqlMapXmlConfigBuilder * Configures the TSqlMapManager using xml configuration file. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ @@ -301,7 +298,6 @@ class TSqlMapXmlConfiguration extends TSqlMapXmlConfigBuilder * description * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Configuration * @since 3.1 */ diff --git a/framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php b/framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php index ae6aa200..d2e3d014 100644 --- a/framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php +++ b/framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php @@ -4,19 +4,17 @@ * * @author Berczi Gabor <gabor.berczi@devworx.hu> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TFastSqlMapApplicationCache.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $ * @package System.Data.SqlMap */ /** * TFastSqlMapApplicationCache class file - * + * * Fast SqlMap result cache class with minimal-concurrency get/set and atomic flush operations - * + * * @author Berczi Gabor <gabor.berczi@devworx.hu> - * @version $Id: TFastSqlMapApplicationCache.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $ * @package System.Data.SqlMap * @since 3.2 */ @@ -30,12 +28,12 @@ class TFastSqlMapApplicationCache implements ICache { $this->_cacheModel = $cacheModel; } - + protected function getBaseKeyKeyName() { return 'SqlMapCacheBaseKey::'.$this->_cacheModel->getId(); } - + protected function getBaseKey() { $cache = $this->getCache(); @@ -48,7 +46,7 @@ class TFastSqlMapApplicationCache implements ICache } return $basekey; } - + protected function getCacheKey($key) { return $this->getBaseKey().'###'.$key; @@ -63,7 +61,7 @@ class TFastSqlMapApplicationCache implements ICache { $this->getCache()->delete($this->getBaseKeyKeyName()); } - + public function get($key) { $result = $this->getCache()->get($this->getCacheKey($key)); diff --git a/framework/Data/SqlMap/DataMapper/TLazyLoadList.php b/framework/Data/SqlMap/DataMapper/TLazyLoadList.php index c512ef92..d50c1b84 100644 --- a/framework/Data/SqlMap/DataMapper/TLazyLoadList.php +++ b/framework/Data/SqlMap/DataMapper/TLazyLoadList.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap */ @@ -14,7 +13,6 @@ * TLazyLoadList executes mapped statements when the proxy collection is first accessed. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -107,7 +105,6 @@ class TLazyLoadList * particular object and relays the call to handler object. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/SqlMap/DataMapper/TPropertyAccess.php b/framework/Data/SqlMap/DataMapper/TPropertyAccess.php index 20a853c4..c19b77ab 100644 --- a/framework/Data/SqlMap/DataMapper/TPropertyAccess.php +++ b/framework/Data/SqlMap/DataMapper/TPropertyAccess.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPropertyAccess.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap */ @@ -37,7 +36,6 @@ * </code> * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TPropertyAccess.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapCache.php b/framework/Data/SqlMap/DataMapper/TSqlMapCache.php index 15e148fe..aa853b6c 100644 --- a/framework/Data/SqlMap/DataMapper/TSqlMapCache.php +++ b/framework/Data/SqlMap/DataMapper/TSqlMapCache.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap */ @@ -16,7 +15,6 @@ * a least-recently-used cache implementation. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -89,7 +87,6 @@ abstract class TSqlMapCache implements ICache * object that was first added when the cache is full. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -126,7 +123,6 @@ class TSqlMapFifoCache extends TSqlMapCache * object that was accessed last when the cache is full. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -168,7 +164,6 @@ class TSqlMapLruCache extends TSqlMapCache * caching SqlMap results. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapException.php b/framework/Data/SqlMap/DataMapper/TSqlMapException.php index d308768f..bce03a5c 100644 --- a/framework/Data/SqlMap/DataMapper/TSqlMapException.php +++ b/framework/Data/SqlMap/DataMapper/TSqlMapException.php @@ -4,7 +4,6 @@ * TSqlMapException is the base exception class for all SqlMap exceptions. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -63,7 +62,6 @@ class TSqlMapException extends TException * TSqlMapConfigurationException, raised during configuration file parsing. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -76,7 +74,6 @@ class TSqlMapConfigurationException extends TSqlMapException * TSqlMapUndefinedException, raised when mapped statemented are undefined. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -89,7 +86,6 @@ class TSqlMapUndefinedException extends TSqlMapException * TSqlMapDuplicateException, raised when a duplicate mapped statement is found. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -101,7 +97,6 @@ class TSqlMapDuplicateException extends TSqlMapException * TInvalidPropertyException, raised when setting or getting an invalid property. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php b/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php index f3d67d47..d789471d 100644 --- a/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php +++ b/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap */ @@ -23,7 +22,6 @@ Prado::using('System.Collections.TPagedList'); * The paged list does not need to know about the total number of records. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSqlMapPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php b/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php index 9d743b82..18b8ef99 100644 --- a/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php +++ b/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap */ @@ -15,7 +14,6 @@ * to PHP types and vice versa. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ @@ -121,7 +119,6 @@ class TSqlMapTypeHandlerRegistry * booleans using "Y" and "N" instead of the more typical 0/1. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/IMappedStatement.php b/framework/Data/SqlMap/Statements/IMappedStatement.php index 175b6f39..859d2ee3 100644 --- a/framework/Data/SqlMap/Statements/IMappedStatement.php +++ b/framework/Data/SqlMap/Statements/IMappedStatement.php @@ -3,7 +3,6 @@ * IMappedStatement interface file. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: IMappedStatement.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -11,7 +10,6 @@ * Interface for all mapping statements. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: IMappedStatement.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TCachingStatement.php b/framework/Data/SqlMap/Statements/TCachingStatement.php index b01280de..ad22b84f 100644 --- a/framework/Data/SqlMap/Statements/TCachingStatement.php +++ b/framework/Data/SqlMap/Statements/TCachingStatement.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCachingStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TCacheingStatement class. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TCachingStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php b/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php index 4b023dc7..119beb39 100644 --- a/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php +++ b/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDeleteMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TDeleteMappedStatement class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDeleteMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TInsertMappedStatement.php b/framework/Data/SqlMap/Statements/TInsertMappedStatement.php index 02bd4a68..de785b94 100644 --- a/framework/Data/SqlMap/Statements/TInsertMappedStatement.php +++ b/framework/Data/SqlMap/Statements/TInsertMappedStatement.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TInsertMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TInsertMappedStatement class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TInsertMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TMappedStatement.php b/framework/Data/SqlMap/Statements/TMappedStatement.php index 40caf4f7..4d3b6355 100644 --- a/framework/Data/SqlMap/Statements/TMappedStatement.php +++ b/framework/Data/SqlMap/Statements/TMappedStatement.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -17,7 +16,6 @@ * This class is usualy instantiated during SQLMap configuration by TSqlDomBuilder. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.0 */ @@ -924,10 +922,10 @@ class TMappedStatement extends TComponent implements IMappedStatement parent::__wakeup(); if (is_null($this->_selectQueue)) $this->_selectQueue = array(); } - + public function __sleep() { - $exprops = array(); $cn = __CLASS__; + $exprops = array(); $cn = __CLASS__; if (!count($this->_selectQueue)) $exprops[] = "\0$cn\0_selectQueue"; if (is_null($this->_groupBy)) $exprops[] = "\0$cn\0_groupBy"; if (!$this->_IsRowDataFound) $exprops[] = "\0$cn\0_IsRowDataFound"; @@ -939,7 +937,6 @@ class TMappedStatement extends TComponent implements IMappedStatement * TPostSelectBinding class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ @@ -975,7 +972,6 @@ class TPostSelectBinding * build using the {@link collect} method. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ @@ -1151,7 +1147,7 @@ class TSqlMapObjectCollectionTree extends TComponent public function __sleep() { - $exprops = array(); $cn = __CLASS__; + $exprops = array(); $cn = __CLASS__; if (!count($this->_tree)) $exprops[] = "\0$cn\0_tree"; if (!count($this->_entries)) $exprops[] = "\0$cn\0_entries"; if (!count($this->_list)) $exprops[] = "\0$cn\0_list"; @@ -1163,7 +1159,6 @@ class TSqlMapObjectCollectionTree extends TComponent * TResultSetListItemParameter class * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ @@ -1200,7 +1195,6 @@ class TResultSetListItemParameter extends TComponent * TResultSetMapItemParameter class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TPreparedCommand.php b/framework/Data/SqlMap/Statements/TPreparedCommand.php index 1e6906a1..8b4bdbcc 100644 --- a/framework/Data/SqlMap/Statements/TPreparedCommand.php +++ b/framework/Data/SqlMap/Statements/TPreparedCommand.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPreparedCommand.php 3261 2013-01-22 22:36:51Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -17,7 +16,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder'); * TPreparedCommand class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TPreparedCommand.php 3261 2013-01-22 22:36:51Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TPreparedStatement.php b/framework/Data/SqlMap/Statements/TPreparedStatement.php index 4127eae0..79f39aea 100644 --- a/framework/Data/SqlMap/Statements/TPreparedStatement.php +++ b/framework/Data/SqlMap/Statements/TPreparedStatement.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPreparedStatement.php 3261 2013-01-22 22:36:51Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TpreparedStatement class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TPreparedStatement.php 3261 2013-01-22 22:36:51Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ @@ -28,26 +26,26 @@ class TPreparedStatement extends TComponent public function setPreparedSql($value){ $this->_sqlString = $value; } public function getParameterNames($needed = true) - { + { if (!$this->_parameterNames and $needed) $this->_parameterNames = new TList; - return $this->_parameterNames; + return $this->_parameterNames; } public function setParameterNames($value){ $this->_parameterNames = $value; } public function getParameterValues($needed = true) - { + { if (!$this->_parameterValues and $needed) $this->_parameterValues=new TMap; - return $this->_parameterValues; + return $this->_parameterValues; } public function setParameterValues($value){ $this->_parameterValues = $value; } - + public function __sleep() { - $exprops = array(); $cn = __CLASS__; + $exprops = array(); $cn = __CLASS__; if (!$this->_parameterNames or !$this->_parameterNames->getCount()) $exprops[] = "\0$cn\0_parameterNames"; if (!$this->_parameterValues or !$this->_parameterValues->getCount()) $exprops[] = "\0$cn\0_parameterValues"; return array_diff(parent::__sleep(),$exprops); diff --git a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php index 5fdd16b5..6eef27c3 100644 --- a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php +++ b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPreparedStatementFactory.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TPreparedStatementFactory class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TPreparedStatementFactory.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TSelectMappedStatement.php b/framework/Data/SqlMap/Statements/TSelectMappedStatement.php index b0926c41..8e6ea75e 100644 --- a/framework/Data/SqlMap/Statements/TSelectMappedStatement.php +++ b/framework/Data/SqlMap/Statements/TSelectMappedStatement.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSelectMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TSelectMappedStatment class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSelectMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php b/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php index 3fce2e3a..b2e0356d 100644 --- a/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php +++ b/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSimpleDynamicSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TSimpleDynamicSql class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSimpleDynamicSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TStaticSql.php b/framework/Data/SqlMap/Statements/TStaticSql.php index 1da6330e..f0110332 100644 --- a/framework/Data/SqlMap/Statements/TStaticSql.php +++ b/framework/Data/SqlMap/Statements/TStaticSql.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TStaticSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TStaticSql class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TStaticSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php b/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php index d3c3acc4..9ba2458d 100644 --- a/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php +++ b/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TUpdateMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements */ @@ -14,7 +13,6 @@ * TUpdateMappedStatement class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TUpdateMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap.Statements * @since 3.1 */ diff --git a/framework/Data/SqlMap/TSqlMapConfig.php b/framework/Data/SqlMap/TSqlMapConfig.php index c6bd4754..d99b99d5 100644 --- a/framework/Data/SqlMap/TSqlMapConfig.php +++ b/framework/Data/SqlMap/TSqlMapConfig.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap */ @@ -18,7 +17,6 @@ Prado::using('System.Data.TDataSourceConfig'); * Database connection and TSqlMapManager configuration. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TSqlMapConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/SqlMap/TSqlMapGateway.php b/framework/Data/SqlMap/TSqlMapGateway.php index a0cebd9c..8ce09ee4 100644 --- a/framework/Data/SqlMap/TSqlMapGateway.php +++ b/framework/Data/SqlMap/TSqlMapGateway.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap */ @@ -23,7 +22,6 @@ Prado::using('System.Data.SqlMap.TSqlMapManager'); * This class should be instantiated from a TSqlMapManager instance. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSqlMapGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/SqlMap/TSqlMapManager.php b/framework/Data/SqlMap/TSqlMapManager.php index 29234920..0fa6fd57 100644 --- a/framework/Data/SqlMap/TSqlMapManager.php +++ b/framework/Data/SqlMap/TSqlMapManager.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSqlMapManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap */ @@ -37,7 +36,6 @@ Prado::using('System.Caching.TCache'); * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSqlMapManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data.SqlMap * @since 3.1 */ diff --git a/framework/Data/TDataSourceConfig.php b/framework/Data/TDataSourceConfig.php index aff5f1af..ecece8c4 100644 --- a/framework/Data/TDataSourceConfig.php +++ b/framework/Data/TDataSourceConfig.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataSourceConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data */ @@ -42,7 +41,6 @@ Prado::using('System.Data.TDbConnection'); * that extends the TDbConnection class. * * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @version $Id: TDataSourceConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data * @since 3.1 */ diff --git a/framework/Data/TDbCommand.php b/framework/Data/TDbCommand.php index e80d7704..43472ea4 100644 --- a/framework/Data/TDbCommand.php +++ b/framework/Data/TDbCommand.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbCommand.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data */ @@ -32,7 +31,6 @@ * You may also call {@link prepare} to explicitly prepare an SQL statement. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbCommand.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data * @since 3.0 */ @@ -58,7 +56,7 @@ class TDbCommand extends TComponent */ public function __sleep() { - return array_diff(parent::__sleep(),array("\0TDbCommand\0_statement")); + return array_diff(parent::__sleep(),array("\0TDbCommand\0_statement")); } /** @@ -134,7 +132,7 @@ class TDbCommand extends TComponent * the form :name. For a prepared statement using question mark * placeholders, this will be the 1-indexed position of the parameter. * Unlike {@link bindValue}, the variable is bound as a reference and will - * only be evaluated at the time that {@link execute} or {@link query} is called. + * only be evaluated at the time that {@link execute} or {@link query} is called. * @param mixed Name of the PHP variable to bind to the SQL statement parameter * @param int SQL data type of the parameter * @param int length of the data type diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php index fe04188c..b475c059 100644 --- a/framework/Data/TDbConnection.php +++ b/framework/Data/TDbConnection.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data */ @@ -77,7 +76,6 @@ Prado::using('System.Data.TDbCommand'); * of certain DBMS attributes, such as {@link getNullConversion NullConversion}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data * @since 3.0 */ @@ -136,7 +134,7 @@ class TDbConnection extends TComponent public function __sleep() { // $this->close(); - DO NOT CLOSE the current connection as serializing doesn't neccessarily mean we don't this connection anymore in the current session - return array_diff(parent::__sleep(),array("\0TDbConnection\0_pdo","\0TDbConnection\0_active")); + return array_diff(parent::__sleep(),array("\0TDbConnection\0_pdo","\0TDbConnection\0_active")); } /** @@ -638,7 +636,6 @@ class TDbConnection extends TComponent * TDbColumnCaseMode * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data * @since 3.0 */ @@ -662,7 +659,6 @@ class TDbColumnCaseMode extends TEnumerable * TDbNullConversionMode * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data * @since 3.0 */ diff --git a/framework/Data/TDbDataReader.php b/framework/Data/TDbDataReader.php index 718d355a..b28cd490 100644 --- a/framework/Data/TDbDataReader.php +++ b/framework/Data/TDbDataReader.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbDataReader.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data */ @@ -30,7 +29,6 @@ * for more details. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbDataReader.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data * @since 3.0 */ diff --git a/framework/Data/TDbTransaction.php b/framework/Data/TDbTransaction.php index f1be4e0b..8a2a0821 100644 --- a/framework/Data/TDbTransaction.php +++ b/framework/Data/TDbTransaction.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbTransaction.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data */ @@ -35,7 +34,6 @@ Prado::using('System.Data.TDbDataReader'); * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbTransaction.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Data * @since 3.0 */ diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index 3c9d8514..ad5fe662 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TErrorHandler.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions */ @@ -45,7 +44,6 @@ * <module id="error" class="TErrorHandler" ErrorTemplatePath="System.Exceptions" /> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TErrorHandler.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ diff --git a/framework/Exceptions/TException.php b/framework/Exceptions/TException.php index c4fe62b4..24dbdb0f 100644 --- a/framework/Exceptions/TException.php +++ b/framework/Exceptions/TException.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions */ @@ -28,7 +27,6 @@ * "message.txt" will be used instead. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -67,7 +65,7 @@ class TException extends Exception $msgFile=$this->getErrorMessageFile(); // Cache messages - if (!isset(self::$_messageCache[$msgFile])) + if (!isset(self::$_messageCache[$msgFile])) { if(($entries=@file($msgFile))!==false) { @@ -132,7 +130,6 @@ class TException extends Exception * TSystemException is the base class for all framework-level exceptions. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -146,7 +143,6 @@ class TSystemException extends TException * TApplicationException is the base class for all user application-level exceptions. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -160,7 +156,6 @@ class TApplicationException extends TException * TInvalidOperationException represents an exception caused by invalid operations. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -174,7 +169,6 @@ class TInvalidOperationException extends TSystemException * TInvalidDataTypeException represents an exception caused by invalid data type. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -188,7 +182,6 @@ class TInvalidDataTypeException extends TSystemException * TInvalidDataValueException represents an exception caused by invalid data value. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -203,7 +196,6 @@ class TInvalidDataValueException extends TSystemException * such as error in an application configuration file or control template file. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -217,7 +209,6 @@ class TConfigurationException extends TSystemException * TTemplateException represents an exception caused by invalid template syntax. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.1 */ @@ -282,7 +273,6 @@ class TTemplateException extends TConfigurationException * TIOException represents an exception related with improper IO operations. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -296,7 +286,6 @@ class TIOException extends TSystemException * TDbException represents an exception related with DB operations. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -310,7 +299,6 @@ class TDbException extends TSystemException * TDbConnectionException represents an exception caused by DB connection failure. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -324,7 +312,6 @@ class TDbConnectionException extends TDbException * TNotSupportedException represents an exception caused by using an unsupported PRADO feature. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -339,7 +326,6 @@ class TNotSupportedException extends TSystemException * This exception is mainly thrown within a PHP error handler. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ @@ -382,7 +368,6 @@ class TPhpErrorException extends TSystemException * It is used by {@link TErrorHandler} to provide different error output to users. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Exceptions * @since 3.0 */ diff --git a/framework/Exceptions/messages/messages.txt b/framework/Exceptions/messages/messages.txt index 2c4de1da..8ea41292 100644 --- a/framework/Exceptions/messages/messages.txt +++ b/framework/Exceptions/messages/messages.txt @@ -504,3 +504,5 @@ tactivetablerow_control_notincollection = {0} '{1}' no member of the TTableRowCo juioptions_control_invalid = Control '{0}' must implement IJuiOptions. juioptions_option_invalid = '{1}' is not a valid option for control '{0}'. + +ratinglist_invalid_caption_id = '{0}' is not a valid caption control for TRatingList '{0}'.
\ No newline at end of file diff --git a/framework/I18N/TChoiceFormat.php b/framework/I18N/TChoiceFormat.php index ad9a4500..4525aaad 100644 --- a/framework/I18N/TChoiceFormat.php +++ b/framework/I18N/TChoiceFormat.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TChoiceFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.I18N */ @@ -65,7 +64,7 @@ Prado::using('System.I18N.TTranslate'); * # <tt>&</tt> -- conditional AND. * # <tt>&&</tt> -- condition AND with short circuit. * # <tt>|</tt> -- conditional OR. - * # <tt>||</tt> -- conditional OR with short circuit. + * # <tt>||</tt> -- conditional OR with short circuit. * # <tt>!</tt> -- negation. * * Additional round brackets can also be used to perform grouping. diff --git a/framework/I18N/TDateFormat.php b/framework/I18N/TDateFormat.php index 544e4973..e7846be7 100644 --- a/framework/I18N/TDateFormat.php +++ b/framework/I18N/TDateFormat.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDateFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.I18N */ @@ -165,7 +164,7 @@ class TDateFormat extends TI18NControl implements IDataRenderer { $this->setViewState('Value',$value,''); } - + /** * Get the default text value for this control. * @return string default text value @@ -174,7 +173,7 @@ class TDateFormat extends TI18NControl implements IDataRenderer { return $this->getViewState('DefaultText',''); } - + /** * Set the default text value for this control. * @param string default text value @@ -222,7 +221,7 @@ class TDateFormat extends TI18NControl implements IDataRenderer $defaultText = $this->getDefaultText(); if(empty($value) && !empty($defaultText)) return $this->getDefaultText(); - + $app = $this->getApplication()->getGlobalization(); //initialized the default class wide formatter diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php index 6638af22..3fbaa2b4 100644 --- a/framework/I18N/TGlobalization.php +++ b/framework/I18N/TGlobalization.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TGlobalization.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.I18N */ diff --git a/framework/I18N/TGlobalizationAutoDetect.php b/framework/I18N/TGlobalizationAutoDetect.php index ad786401..a79a128d 100644 --- a/framework/I18N/TGlobalizationAutoDetect.php +++ b/framework/I18N/TGlobalizationAutoDetect.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $ * @package System.I18N @@ -32,7 +32,7 @@ class TGlobalizationAutoDetect extends TGlobalization parent::init($xml); //set the culture according to browser language settings - $http = new HTTPNegotiator(); + $http = new HTTPNegotiator(); $languages = $http->getLanguages(); if(count($languages) > 0) { diff --git a/framework/I18N/TI18NControl.php b/framework/I18N/TI18NControl.php index 97a7268a..96fc8b62 100644 --- a/framework/I18N/TI18NControl.php +++ b/framework/I18N/TI18NControl.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TI18NControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.I18N */ diff --git a/framework/I18N/TNumberFormat.php b/framework/I18N/TNumberFormat.php index 27c124f7..89eab245 100644 --- a/framework/I18N/TNumberFormat.php +++ b/framework/I18N/TNumberFormat.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TNumberFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.I18N */ @@ -116,7 +115,7 @@ class TNumberFormat extends TI18NControl implements IDataRenderer { return $this->getViewState('DefaultText',''); } - + /** * Set the default text value for this control. * @param string default text value diff --git a/framework/I18N/TTranslate.php b/framework/I18N/TTranslate.php index 3382f925..1365b937 100644 --- a/framework/I18N/TTranslate.php +++ b/framework/I18N/TTranslate.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTranslate.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.I18N */ @@ -243,7 +242,7 @@ class TTranslate extends TI18NControl $catalogue = $config['catalogue']; if (empty($catalogue)) $catalogue='messages'; Translation::init($catalogue); - + $key = $this->getKey(); if(!empty($key)) $text = $key; diff --git a/framework/I18N/TTranslateParameter.php b/framework/I18N/TTranslateParameter.php index b461a36a..d5c41230 100644 --- a/framework/I18N/TTranslateParameter.php +++ b/framework/I18N/TTranslateParameter.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTranslateParameter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.I18N */ diff --git a/framework/I18N/Translation.php b/framework/I18N/Translation.php index 5219e132..9592ef53 100644 --- a/framework/I18N/Translation.php +++ b/framework/I18N/Translation.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: Translation.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.I18N */ @@ -40,7 +39,7 @@ class Translation extends TComponent public static function init($catalogue='messages') { static $saveEventHandlerAttached=false; - + //initialized the default class wide formatter if(!isset(self::$formatters[$catalogue])) { diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php index c22ed5c4..fc20b833 100644 --- a/framework/I18N/core/CultureInfo.php +++ b/framework/I18N/core/CultureInfo.php @@ -13,7 +13,6 @@ * {@link http://prado.sourceforge.net/} * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: CultureInfo.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.I18N.core */ @@ -44,7 +43,6 @@ * For example, Australian English is "en_AU". * * @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: CultureInfo.php 3187 2012-07-12 11:21:01Z ctrlaltca $ * @package System.I18N.core */ class CultureInfo diff --git a/framework/I18N/core/MessageCache.php b/framework/I18N/core/MessageCache.php index 3bd21704..ad310258 100644 --- a/framework/I18N/core/MessageCache.php +++ b/framework/I18N/core/MessageCache.php @@ -2,7 +2,6 @@ /** * Translation table cache. * @author $Author: weizhuo $ - * @version $Id: MessageCache.php 3188 2012-07-12 12:13:23Z ctrlaltca $ * @package System.I18N.core */ @@ -16,9 +15,8 @@ require_once(dirname(__FILE__).'/TCache_Lite.php'); * It can cache each cataloug+variant or just the whole section. * @package System.I18N.core * @author $Author: weizhuo $ - * @version $Id: MessageCache.php 3188 2012-07-12 12:13:23Z ctrlaltca $ */ -class MessageCache +class MessageCache { /** @@ -31,16 +29,16 @@ class MessageCache * Caceh life time, default is 1 year. */ protected $lifetime = 3153600; - + /** * Create a new Translation cache. * @param string $cacheDir Directory to store the cache files. */ public function __construct($cacheDir) - { + { $cacheDir = $cacheDir.'/'; - + if(!is_dir($cacheDir)) throw new Exception( 'The cache directory '.$cacheDir.' does not exists.'. @@ -49,7 +47,7 @@ class MessageCache throw new Exception( 'The cache directory '.$cacheDir.' must be writable '. 'by the server.'); - + $options = array( 'cacheDir' => $cacheDir, 'lifeTime' => $this->getLifeTime(), @@ -102,31 +100,31 @@ class MessageCache * @param string $catalogue The translation section. * @param string $culture The translation locale, e.g. "en_AU". * @param string $filename If the source is a file, this file's modified - * time is newer than the cache's modified time, no cache hit. + * time is newer than the cache's modified time, no cache hit. * @return mixed Boolean FALSE if no cache hit. Otherwise, translation * table data for the specified section and locale. */ - public function get($catalogue, $culture, $lastmodified=0) + public function get($catalogue, $culture, $lastmodified=0) { $ID = $this->getID($catalogue, $culture); - $group = $this->getGroup($catalogue, $culture); + $group = $this->getGroup($catalogue, $culture); $this->cache->_setFileName($ID, $group); $cache = $this->cache->getCacheFile(); - - if(is_file($cache) == false) + + if(is_file($cache) == false) return false; $lastmodified = (int)$lastmodified; - + if($lastmodified <= 0 || $lastmodified > filemtime($cache)) - return false; - + return false; + //echo '@@ Cache hit: "'.$ID.'" : "'.$group.'"'; //echo "<br>\n"; - + return $this->cache->get($ID, $group); } @@ -136,28 +134,28 @@ class MessageCache * @param string $catalogue The translation section. * @param string $culture The translation locale, e.g. "en_AU". */ - public function save($data, $catalogue, $culture) - { + public function save($data, $catalogue, $culture) + { $ID = $this->getID($catalogue, $culture); - $group = $this->getGroup($catalogue, $culture); - + $group = $this->getGroup($catalogue, $culture); + //echo '## Cache save: "'.$ID.'" : "'.$group.'"'; //echo "<br>\n"; - + return $this->cache->save($data, $ID, $group); } - + /** * Clean up the cache for the specified section and locale. * @param string $catalogue The translation section. * @param string $culture The translation locale, e.g. "en_AU". */ - public function clean($catalogue, $culture) + public function clean($catalogue, $culture) { - $group = $this->getGroup($catalogue, $culture); + $group = $this->getGroup($catalogue, $culture); $this->cache->clean($group); } - + /** * Flush the cache. Deletes all the cache files. */ diff --git a/framework/I18N/core/TCache_Lite.php b/framework/I18N/core/TCache_Lite.php index a0629bd1..69e1c308 100644 --- a/framework/I18N/core/TCache_Lite.php +++ b/framework/I18N/core/TCache_Lite.php @@ -38,7 +38,6 @@ * Mike BENOIT <ipso@snappymail.ca> * * @package System.I18N.core -* @version $Id: TCache_Lite.php 3188 2012-07-12 12:13:23Z ctrlaltca $ * @author Fabien MARTY <fab@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL diff --git a/framework/IO/TTarFileExtractor.php b/framework/IO/TTarFileExtractor.php index ca67320d..cb613fff 100644 --- a/framework/IO/TTarFileExtractor.php +++ b/framework/IO/TTarFileExtractor.php @@ -4,7 +4,6 @@ * * @author Vincent Blavet <vincent@phpconcept.net> * @copyright Copyright © 1997-2003 The PHP Group - * @version $Id: TTarFileExtractor.php 3188 2012-07-12 12:13:23Z ctrlaltca $ * @package System.IO */ @@ -31,7 +30,6 @@ * TTarFileExtractor class * * @author Vincent Blavet <vincent@phpconcept.net> - * @version $Id: TTarFileExtractor.php 3188 2012-07-12 12:13:23Z ctrlaltca $ * @package System.IO * @since 3.0 */ diff --git a/framework/IO/TTextWriter.php b/framework/IO/TTextWriter.php index f5930a73..f888083d 100644 --- a/framework/IO/TTextWriter.php +++ b/framework/IO/TTextWriter.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTextWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.IO */ @@ -18,7 +17,6 @@ * and can be obtained by calling {@link flush()}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTextWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.IO * @since 3.0 */ diff --git a/framework/PradoBase.php b/framework/PradoBase.php index 0722d0fd..3eb4d0d6 100644 --- a/framework/PradoBase.php +++ b/framework/PradoBase.php @@ -7,9 +7,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: PradoBase.php 3325 2013-09-13 08:19:04Z ctrlaltca $ * @package System */ @@ -34,7 +33,6 @@ if(!defined('PRADO_CHMOD')) * rewritten for customization. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: PradoBase.php 3325 2013-09-13 08:19:04Z ctrlaltca $ * @package System * @since 3.0 */ diff --git a/framework/Security/IUserManager.php b/framework/Security/IUserManager.php index 390189cb..0ca65929 100644 --- a/framework/Security/IUserManager.php +++ b/framework/Security/IUserManager.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: IUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security */ @@ -18,7 +17,6 @@ * and {@link TUser}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: IUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0 */ diff --git a/framework/Security/TAuthManager.php b/framework/Security/TAuthManager.php index e30b0bcb..2bf6a5b1 100644 --- a/framework/Security/TAuthManager.php +++ b/framework/Security/TAuthManager.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TAuthManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security */ @@ -26,7 +25,7 @@ Prado::using('System.Security.IUserManager'); * To login or logout a user, call {@link login} or {@link logout}, respectively. * * The {@link setAuthExpire AuthExpire} property can be used to define the time - * in seconds after which the authentication should expire. + * in seconds after which the authentication should expire. * {@link setAllowAutoLogin AllowAutoLogin} specifies if the login information * should be stored in a cookie to perform automatic login. Enabling this * feature will cause that {@link setAuthExpire AuthExpire} has no effect @@ -37,7 +36,6 @@ Prado::using('System.Security.IUserManager'); * <module id="users" class="System.Security.TUserManager" /> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TAuthManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0 */ @@ -290,7 +288,7 @@ class TAuthManager extends TModule $user=$this->_userManager->getUser(null)->loadFromString($sessionInfo); // check for authentication expiration - $isAuthExpired = $this->_authExpire>0 && !$user->getIsGuest() && + $isAuthExpired = $this->_authExpire>0 && !$user->getIsGuest() && ($expiretime=$session->itemAt('AuthExpireTime')) && $expiretime<time(); // try authenticating through cookie if possible @@ -321,7 +319,7 @@ class TAuthManager extends TModule if($this->hasEventHandler('OnAuthenticate')) $this->raiseEvent('OnAuthenticate',$this,$application); } - + /** * Performs user logout on authentication expiration. * An 'OnAuthExpire' event will be raised if there is any handler attached to it. @@ -333,7 +331,7 @@ class TAuthManager extends TModule if($this->hasEventHandler('OnAuthExpire')) $this->raiseEvent('OnAuthExpire',$this,$param); } - + /** * Performs the real authorization work. * Authorization rules obtained from the application will be used to check diff --git a/framework/Security/TAuthorizationRule.php b/framework/Security/TAuthorizationRule.php index cae28bfb..aa9bed90 100644 --- a/framework/Security/TAuthorizationRule.php +++ b/framework/Security/TAuthorizationRule.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security */ /** @@ -25,7 +24,6 @@ * IP rules are separated by comma ',' and can contain wild card in the rules (e.g. '192.132.23.33, 192.122.*.*') * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0 */ @@ -249,7 +247,6 @@ class TAuthorizationRule extends TComponent * To check if a user is allowed, call {@link isUserAllowed}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0 */ diff --git a/framework/Security/TDbUserManager.php b/framework/Security/TDbUserManager.php index aabd6e5c..0832dfe5 100644 --- a/framework/Security/TDbUserManager.php +++ b/framework/Security/TDbUserManager.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security */ @@ -44,7 +43,6 @@ Prado::using('System.Security.TUser'); * which specifies how to establish database connection to retrieve user information. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.1.0 */ @@ -216,7 +214,6 @@ class TDbUserManager extends TModule implements IUserManager * - {@link createUser()}: creates a new user instance given the username * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.1.0 */ diff --git a/framework/Security/TSecurityManager.php b/framework/Security/TSecurityManager.php index b5267db1..bdb85564 100644 --- a/framework/Security/TSecurityManager.php +++ b/framework/Security/TSecurityManager.php @@ -5,9 +5,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security */ @@ -36,7 +35,6 @@ * Note, to use encryption, the PHP Mcrypt extension must be loaded. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0 */ @@ -354,7 +352,6 @@ class TSecurityManager extends TModule * - SHA1: an SHA1 hash is generated from the data and used for validation. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0.4 */ diff --git a/framework/Security/TUser.php b/framework/Security/TUser.php index 3a7a3fa0..8a229b1a 100644 --- a/framework/Security/TUser.php +++ b/framework/Security/TUser.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TUser.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security */ @@ -27,7 +26,6 @@ Prado::using('System.Security.IUserManager'); * TUser is meant to be used together with {@link IUserManager}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TUser.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0 */ diff --git a/framework/Security/TUserManager.php b/framework/Security/TUserManager.php index 5cb716dd..4ad67a15 100644 --- a/framework/Security/TUserManager.php +++ b/framework/Security/TUserManager.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security */ @@ -64,7 +63,6 @@ Prado::using('System.Security.TUser'); * * @author Qiang Xue <qiang.xue@gmail.com> * @author Carl Mathisen <carl@kamikazemedia.no> - * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0 */ @@ -108,7 +106,7 @@ class TUserManager extends TModule implements IUserManager */ public function init($config) { - $this->loadUserData($config); + $this->loadUserData($config); if($this->_userFile!==null) { if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP) @@ -125,7 +123,7 @@ class TUserManager extends TModule implements IUserManager } $this->_initialized=true; } - + /* * Loads user/role information * @param mixed the variable containing the user information @@ -389,7 +387,6 @@ class TUserManager extends TModule implements IUserManager * - SHA1: the password is recorded as the SHA1 hash value of the original password * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Security * @since 3.0.4 */ diff --git a/framework/TApplication.php b/framework/TApplication.php index d7aac218..e015ead8 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $ * @package System */ @@ -105,7 +104,6 @@ Prado::using('System.I18N.TGlobalization'); * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $ * @package System * @since 3.0 */ @@ -131,7 +129,7 @@ class TApplication extends TComponent /** * File extension for external config files */ - const CONFIG_FILE_EXT_XML='.xml'; + const CONFIG_FILE_EXT_XML='.xml'; /** * Configuration file type, application.xml and config.xml */ @@ -296,7 +294,7 @@ class TApplication extends TComponent * @var TApplicationMode application mode */ private $_mode=TApplicationMode::Debug; - + /** * @var string Customizable page service ID */ @@ -334,7 +332,7 @@ class TApplication extends TComponent $this->_uniqueID=md5($this->_runtimePath); $this->_parameters=new TMap; $this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null)); - + Prado::setPathOfAlias('Application',$this->_basePath); } @@ -521,7 +519,7 @@ class TApplication extends TComponent { $this->_id=$value; } - + /** * @return string page service ID */ @@ -609,7 +607,7 @@ class TApplication extends TComponent { $this->_configType = $value; } - + /** * @return string the application configuration type. default is 'xml' */ @@ -628,7 +626,7 @@ class TApplication extends TComponent } return $this->_configFileExt; } - + /** * @return string the default configuration file name */ @@ -999,7 +997,7 @@ class TApplication extends TComponent foreach($config->getProperties() as $name=>$value) $this->setSubProperty($name,$value); } - + if(empty($this->_services)) $this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null)); @@ -1081,7 +1079,7 @@ class TApplication extends TComponent if(($serviceID=$this->getRequest()->resolveRequest(array_keys($this->_services)))===null) $serviceID=$this->getPageServiceID(); - + $this->startService($serviceID); } @@ -1280,7 +1278,6 @@ class TApplication extends TComponent * - Normal: the application is running in normal production mode. * - Performance: the application is running in performance mode. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $ * @package System * @since 3.0.4 */ @@ -1300,7 +1297,6 @@ class TApplicationMode extends TEnumerable * * @author Qiang Xue <qiang.xue@gmail.com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> - * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $ * @package System * @since 3.0 */ @@ -1382,7 +1378,7 @@ class TApplicationConfiguration extends TComponent $this->_properties[$name]=$value; } $this->_empty = false; - } + } if(isset($config['paths']) && is_array($config['paths'])) $this->loadPathsPhp($config['paths'],$configPath); @@ -1395,7 +1391,7 @@ class TApplicationConfiguration extends TComponent if(isset($config['parameters']) && is_array($config['parameters'])) $this->loadParametersPhp($config['parameters'], $configPath); - + if(isset($config['includes']) && is_array($config['includes'])) $this->loadExternalXml($config['includes'],$configPath); } @@ -1541,7 +1537,7 @@ class TApplicationConfiguration extends TComponent $properties['id'] = $id; $this->_modules[$id]=array($type,$properties,$module); $this->_empty=false; - } + } } /** @@ -1589,7 +1585,7 @@ class TApplicationConfiguration extends TComponent $properties['id'] = $id; $this->_services[$id] = array($type,$properties,$service); $this->_empty = false; - } + } } /** @@ -1809,7 +1805,6 @@ class TApplicationConfiguration extends TComponent * Cache will be exploited if it is enabled. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $ * @package System * @since 3.0 */ diff --git a/framework/TApplicationComponent.php b/framework/TApplicationComponent.php index a307d54b..a906a232 100644 --- a/framework/TApplicationComponent.php +++ b/framework/TApplicationComponent.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TApplicationComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System */ @@ -28,7 +27,6 @@ * publishing private files: {@link publishAsset} and {@link publishFilePath}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TApplicationComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ diff --git a/framework/TComponent.php b/framework/TComponent.php index e9fa5a65..484a3186 100644 --- a/framework/TComponent.php +++ b/framework/TComponent.php @@ -3,14 +3,13 @@ * TComponent, TPropertyValue classes * * @author Qiang Xue <qiang.xue@gmail.com> - * + * * Global Events, intra-object events, Class behaviors, expanded behaviors * @author Brad Anderson <javalizard@mac.com> - * + * * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System */ @@ -56,7 +55,7 @@ * </code> * Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name: * <code> - * // set some simple text as property value + * // set some simple text as property value * $component->Text = 'text'; * // set some javascript code as property value * $component->JsText = 'raw javascript'; @@ -65,7 +64,7 @@ * 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 {@link TJavaScriptLiteral} class. + * This special handling makes use of the {@link TJavaScriptLiteral} class. * * Events * @@ -100,40 +99,40 @@ * - array($object,'buttonClicked') : $object->buttonClicked($sender,$param); * - array($object,'MainContent.SubmitButton.buttonClicked') : * $object->MainContent->SubmitButton->buttonClicked($sender,$param); - * - * 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 + * + * 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. * * 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 + * 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 + * 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. * * 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 + * 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 {@link listen} and + * object's global event listeners, call the object's {@link listen} and * {@link unlisten} methods, respectively. An object may auto-install its global event * during {@link __construct} by overriding {@link getAutoGlobalListen} and returning true. - * + * * As of PHP version 5.3, nulled objects without code references will still continue to persist * in the global event queue because {@link __destruct} is not automatically called. In the common * __destruct method, if an object is listening to global events, then {@link unlisten} is called. * {@link unlisten} is required to be manually called before an object is - * left without references if it is currently listening to any global events. This includes + * left without references if it is currently listening to any global events. This includes * class wide behaviors. * - * An object that contains a method that starts with 'fx' will have those functions + * An object that contains a method that starts with 'fx' will have those functions * automatically receive those events of the same name after {@link listen} is called on the object. * - * An object may listen to a global event without defining an 'fx' method of the same name by + * 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 * <code> * $component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback); @@ -142,27 +141,27 @@ * * Events between Objects and their behaviors, Dynamic Events * - * An intra-object/behavior event is defined by methods that start with 'dy'. Just as with + * 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 + * starts with 'dy' will be handled, regardless of whether it is implemented. These * events are for communicating with attached behaviors. - * + * * 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 + * 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. - * + * * 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 {@link raiseEvent}. - * For dynamic events where there are behaviors that respond to the dynamic events, a + * For dynamic events where there are behaviors that respond to the dynamic events, a * {@link TCallChain} is developed. A call chain allows the behavior dynamic event * implementations to call further implementing behaviors within a chain. - * - * If an object implements {@link IDynamicMethods}, all global and object dynamic - * events will be sent to {@link __dycall}. In the case of global events, all + * + * If an object implements {@link IDynamicMethods}, all global and object dynamic + * events will be sent to {@link __dycall}. 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. * @@ -171,29 +170,29 @@ * * There are two types of behaviors. There are individual object behaviors and * there are class wide behaviors. Class behaviors depend upon object behaviors. - * + * * When a new class implements {@link IBehavior} or {@link IClassBehavior} or - * extends {@link TBehavior} or {@link TClassBehavior}, it may be added to an + * extends {@link TBehavior} or {@link TClassBehavior}, it may be added to an * object by calling the object's {@link attachBehavior}. The behaviors associated - * name can then be used to {@link enableBehavior} or {@link disableBehavior} + * name can then be used to {@link enableBehavior} or {@link disableBehavior} * the specific behavior. * - * All behaviors may be turned on and off via {@link enableBehaviors} and + * All behaviors may be turned on and off via {@link enableBehaviors} and * {@link disableBehaviors}, respectively. To check if behaviors are on or off * a call to {@link getBehaviorsEnabled} will provide the variable. - * - * Attaching and detaching whole sets of behaviors is done using + * + * Attaching and detaching whole sets of behaviors is done using * {@link attachBehaviors} and {@link detachBehaviors}. {@link clearBehaviors} * removes all of an object's behaviors. * * {@link asa} returns a behavior of a specific name. {@link isa} is the * behavior inclusive function that acts as the PHP operator {@link instanceof}. * 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 {@link IInstanceCheck} to provide the identity of the + * the host object to act similarly to a completely different class. A behavior + * would then implement {@link IInstanceCheck} to provide the identity of the * different class. * - * Class behaviors are similar to object behaviors except that the class behavior + * 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. @@ -202,12 +201,12 @@ * using {@link detachClassBehavior}. 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 - * {@link __construct}. Detaching a class behavior will remove the behavior + * {@link __construct}. Detaching a class behavior will remove the behavior * from the default set of behaviors created for an object when the object * is instanced. * - * Class behaviors are also added to all existing instances via the global 'fx' - * event mechanism. When a new class behavior is added, the event + * Class behaviors are also added to all existing instances via the global 'fx' + * event mechanism. When a new class behavior is added, the event * {@link fxAttachClassBehavior} is raised and all existing instances that are * listening to this global event (primarily after {@link listen} is called) * will have this new behavior attached. A similar process is used when @@ -218,8 +217,8 @@ * * 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 + * 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. @@ -228,7 +227,7 @@ * 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event * </code> * - * Dynamic events can be chained together within behaviors to allow for data + * 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. * <code> @@ -239,8 +238,8 @@ * } * } * </code> - * This implementation of a behavior and dynamic event will flow through to the - * next behavior implementing the dynamic event. The first parameter is always + * 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. * * In the case of a class behavior, the object is also prepended to the dynamic @@ -258,26 +257,25 @@ * * Global Event and Dynamic event catching * - * Given that all global 'fx' events and dynamic 'dy' events are valid and + * 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 {@link __call}). 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 + * 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 {@link IDynamicMethods} and method {@link __dycall}. * - * In the case of dynamic events, {@link __dycall} is supplied with the method + * In the case of dynamic events, {@link __dycall} is supplied with the method * name and its parameters. When a global event is raised, via {@link raiseEvent}, * the method is the event name and the parameters are supplied. * * 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 + * 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. - * + * * @author Qiang Xue <qiang.xue@gmail.com> * @author Brad Anderson <javalizard@mac.com> - * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -287,18 +285,18 @@ class TComponent * @var array event handler lists */ private $_e=array(); - + /** - * @var boolean if listening is enabled. Automatically turned on or off in + * @var boolean if listening is enabled. Automatically turned on or off in * constructor according to {@link getAutoGlobalListen}. Default false, off */ private $_listeningenabled=false; - + /** * @var array static registered global event handler lists */ private static $_ue=array(); - + /** * @var boolean if object behaviors are on or off. default true, on */ @@ -308,13 +306,13 @@ class TComponent * @var TPriorityMap list of object behaviors */ private $_m=null; - + /** * @var array static global class behaviors, these behaviors are added upon instantiation of a class */ private static $_um=array(); - - + + /** * @const string the name of the global {@link raiseEvent} listener */ @@ -323,7 +321,7 @@ class TComponent /** * The common __construct - * If desired by the new object, this will auto install and listen to global event functions + * If desired by the new object, this will auto install and listen to global event functions * as defined by the object via 'fx' methods. This also attaches any predefined behaviors. * This function installs all class behaviors in a class hierarchy from the deepest subclass * through each parent to the top most class, TComponent. @@ -331,22 +329,22 @@ class TComponent public function __construct() { if($this->getAutoGlobalListen()) $this->listen(); - + $classes=array_reverse($this->getClassHierarchy(true)); foreach($classes as $class) { if(isset(self::$_um[$class])) $this->attachBehaviors(self::$_um[$class]); } } - - + + /** * Tells TComponent whether or not to automatically listen to global events. * Defaults to false because PHP variable cleanup is affected if this is true. * When unsetting a variable that is listening to global events, {@link unlisten} * must explicitly be called when cleaning variables allocation or else the global * event registry will contain references to the old object. This is true for PHP 5.4 - * + * * Override this method by a subclass to change the setting. When set to true, this * will enable {@link __construct} to call {@link listen}. * @@ -368,19 +366,19 @@ class TComponent if($this->_listeningenabled) $this->unlisten(); } - - + + /** - * This utility function is a private array filter method. The array values + * This utility function is a private array filter method. The array values * that start with 'fx' are filtered in. */ private function filter_prado_fx($name) { return strncasecmp($name,'fx',2)===0; } - - + + /** - * This returns an array of the class name and the names of all its parents. The base object first, + * This returns an array of the class name and the names of all its parents. The base object first, * {@link TComponent}, and the deepest subclass is last. * @param boolean optional should the names be all lowercase true/false * @return array array of strings being the class hierarchy of $this. @@ -394,10 +392,10 @@ class TComponent return array_map('strtolower',$classes); return $classes; } - - + + /** - * This adds an object's fx event handlers into the global broadcaster to listen into any + * This adds an object's fx event handlers into the global broadcaster to listen into any * broadcast global events called through {@link raiseEvent} * * Behaviors may implement the function: @@ -413,24 +411,24 @@ class TComponent public function listen() { if($this->_listeningenabled) return; - + $fx=array_filter(get_class_methods($this),array($this,'filter_prado_fx')); - + foreach($fx as $func) $this->attachEventHandler($func,array($this,$func)); - + if(is_a($this,'IDynamicMethods')) { $this->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER,array($this,'__dycall')); array_push($fx,TComponent::GLOBAL_RAISE_EVENT_LISTENER); } - + $this->_listeningenabled=true; - + $this->dyListen($fx); - + return count($fx); } - + /** * this removes an object's fx events from the global broadcaster * @@ -447,24 +445,24 @@ class TComponent public function unlisten() { if(!$this->_listeningenabled) return; - + $fx=array_filter(get_class_methods($this),array($this,'filter_prado_fx')); - + foreach($fx as $func) $this->detachEventHandler($func,array($this,$func)); - + if(is_a($this,'IDynamicMethods')) { $this->detachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER,array($this,'__dycall')); array_push($fx,TComponent::GLOBAL_RAISE_EVENT_LISTENER); } - + $this->_listeningenabled=false; - + $this->dyUnlisten($fx); - + return count($fx); } - + /** * Gets the state of listening to global events * @return boolean is Listening to global broadcast enabled @@ -473,12 +471,12 @@ class TComponent { return $this->_listeningenabled; } - + /** * Calls a method. * Do not call this method directly. This is a PHP magic method that we override - * to allow behaviors, dynamic events (intra-object/behavior events), + * to allow behaviors, dynamic events (intra-object/behavior events), * undefined dynamic and global events, and * to allow using the following syntax to call a property setter or getter. * <code> @@ -495,7 +493,7 @@ class TComponent * @param mixed method parameters * @throws TInvalidOperationException If the property is not defined or read-only or * method is undefined - * @return mixed result of the method call, or false if 'fx' or 'dy' function but + * @return mixed result of the method call, or false if 'fx' or 'dy' function but * is not found in the class, otherwise it runs */ public function __call($method, $args) @@ -516,7 +514,7 @@ class TComponent if (($getset=='set')&&method_exists($this,'getjs'.$propname)) throw new TInvalidOperationException('component_property_readonly',get_class($this),$method); } - + if($this->_m!==null&&$this->_behaviorsenabled) { if(strncasecmp($method,'dy',2)===0) @@ -531,7 +529,7 @@ class TComponent array_unshift($behavior_args,$this); $callchain->addCall(array($behavior,$method),$behavior_args); } - + } if($callchain->getCount()>0) return call_user_func_array(array($callchain,'call'),$args); @@ -549,14 +547,14 @@ class TComponent } } } - + if(strncasecmp($method,'dy',2)===0||strncasecmp($method,'fx',2)===0) { if($this instanceof IDynamicMethods) return $this->__dycall($method,$args); return isset($args[0])?$args[0]:null; } - + throw new TApplicationException('component_method_undefined',get_class($this),$method); } @@ -675,9 +673,9 @@ class TComponent } } if($sets)return $value; - + } - + if(method_exists($this,'get'.$name)||method_exists($this,'getjs'.$name)) { throw new TInvalidOperationException('component_property_readonly',get_class($this),$name); @@ -690,12 +688,12 @@ class TComponent /** * Checks if a property value is null, there are no events in the object - * event list or global event list registered under the name, and, if - * behaviors are enabled, + * event list or global event list registered under the name, and, if + * behaviors are enabled, * Do not call this method. This is a PHP magic method that we override * to allow using isset() to detect if a component property is set or not. - * This also works for global events. When behaviors are enabled, it - * will check for a behavior of the specified name, and also check + * This also works for global events. When behaviors are enabled, it + * will check for a behavior of the specified name, and also check * the behavior for events and properties. * @param string the property name or the event name * @since 3.2.3 @@ -725,7 +723,7 @@ class TComponent if((!($behavior instanceof IBehavior)||$behavior->getEnabled())) return isset($behavior->$name); } - + } else return false; @@ -733,7 +731,7 @@ class TComponent /** * Sets a component property to be null. Clears the object or global - * events. When enabled, loops through all behaviors and unsets the + * events. When enabled, loops through all behaviors and unsets the * property or event. * Do not call this method. This is a PHP magic method that we override * to allow using unset() to set a component property to be null. @@ -874,9 +872,9 @@ class TComponent /** * Determines whether an event is defined. - * An event is defined if the class has a method whose name is the event name + * An event is defined if the class has a method whose name is the event name * prefixed with 'on', 'fx', or 'dy'. - * Every object responds to every 'fx' and 'dy' event as they are in a universally + * Every object responds to every 'fx' and 'dy' event as they are in a universally * accepted event space. 'on' event must be declared by the object. * When enabled, this will loop through all active behaviors for 'on' events * defined by the behavior. @@ -888,7 +886,7 @@ class TComponent { if((strncasecmp($name,'on',2)===0&&method_exists($this,$name))||strncasecmp($name,'fx',2)===0||strncasecmp($name,'dy',2)===0) return true; - + else if($this->_m!==null&&$this->_behaviorsenabled) { foreach($this->_m->toArray() as $behavior) @@ -901,9 +899,9 @@ class TComponent } /** - * Checks if an event has any handlers. This function also checks through all + * Checks if an event has any handlers. This function also checks through all * the behaviors for 'on' events when behaviors are enabled. - * 'dy' dynamic events are not handled by this function. + * 'dy' dynamic events are not handled by this function. * @param string the event name * @return boolean whether an event has been attached one or several handlers */ @@ -928,7 +926,7 @@ class TComponent } /** - * Returns the list of attached event handlers for an 'on' or 'fx' event. This function also + * Returns the list of attached event handlers for an 'on' or 'fx' event. This function also * checks through all the behaviors for 'on' event lists when behaviors are enabled. * @return TPriorityList list of attached event handlers for an event * @throws TInvalidOperationException if the event is not defined @@ -976,7 +974,7 @@ class TComponent * function handlerName($sender, $param, $name) {} * </code> * where $sender represents the object that raises the event, - * and $param is the event parameter. $name refers to the event name + * and $param is the event parameter. $name refers to the event name * being handled. * * This is a convenient method to add an event handler. @@ -1001,7 +999,7 @@ class TComponent * * @param string the event name * @param callback the event handler - * @param numeric|null the priority of the handler, defaults to null which translates into the + * @param numeric|null the priority of the handler, defaults to null which translates into the * default priority of 10.0 within {@link TPriorityList} * @throws TInvalidOperationException if the event does not exist */ @@ -1012,11 +1010,11 @@ class TComponent /** * Detaches an existing event handler. - * This method is the opposite of {@link attachEventHandler}. It will detach + * This method is the opposite of {@link attachEventHandler}. It will detach * any 'on' events definedb by an objects active behaviors as well. * @param string event name * @param callback the event handler to be removed - * @param numeric|false|null the priority of the handler, defaults to false which translates + * @param numeric|false|null the priority of the handler, defaults to false which translates * to an item of any priority within {@link TPriorityList}; null means the default priority * @return boolean if the removal is successful */ @@ -1041,10 +1039,10 @@ class TComponent * This method represents the happening of an event and will * invoke all attached event handlers for the event in {@link TPriorityList} order. * This method does not handle intra-object/behavior dynamic 'dy' events. - * - * There are ways to handle event responses. By defailt {@link EVENT_RESULT_FILTER}, - * all event responses are stored in an array, filtered for null responses, and returned. - * If {@link EVENT_RESULT_ALL} is specified, all returned results will be stored along + * + * There are ways to handle event responses. By defailt {@link EVENT_RESULT_FILTER}, + * all event responses are stored in an array, filtered for null responses, and returned. + * If {@link EVENT_RESULT_ALL} is specified, all returned results will be stored along * with the sender and param in an array * <code> * $result[] = array('sender'=>$sender,'param'=>$param,'response'=>$response); @@ -1054,14 +1052,14 @@ class TComponent * fed forward as the parameters for the next event. This allows for events to filter data * directly by affecting the event parameters * - * If a callable function is set in the response type or the post function filter is specified then the + * If a callable function is set in the response type or the post function filter is specified then the * result of each called event handler is post processed by the callable function. Used in * combination with {@link EVENT_RESULT_FEED_FORWARD}, any event (and its result) can be chained. * - * When raising a global 'fx' event, registered handlers in the global event list for + * When raising a global 'fx' event, registered handlers in the global event list for * {@link GLOBAL_RAISE_EVENT_LISTENER} are always added into the set of event handlers. In this way, - * these global events are always raised for every global 'fx' event. The registered handlers for global - * raiseEvent events have priorities. Any registered global raiseEvent event handlers with a priority less than zero + * these global events are always raised for every global 'fx' event. The registered handlers for global + * raiseEvent events have priorities. Any registered global raiseEvent event handlers with a priority less than zero * are added before the main event handlers being raised and any registered global raiseEvent event handlers * with a priority equal or greater than zero are added after the main event handlers being raised. In this way * all {@link GLOBAL_RAISE_EVENT_LISTENER} handlers are always called for every raised 'fx' event. @@ -1087,22 +1085,22 @@ class TComponent * dyPreRaiseEvent has the effect of being able to change the event being raised. This intra * object/behavior event returns the name of the desired event to be raised. It will pass through * if no dynamic event is specified, or if the original event name is returned. - * dyIntraRaiseEventTestHandler returns true or false as to whether a specific handler should be + * dyIntraRaiseEventTestHandler returns true or false as to whether a specific handler should be * called for a specific raised event (and associated event arguments) * dyIntraRaiseEventPostHandler does not return anything. This allows behaviors to access the results * of an event handler in the per handler loop. * dyPostRaiseEvent returns the responses. This allows for any post processing of the event * results from the sum of all event handlers * - * When handling a catch-all {@link __dycall}, the method name is the name of the event + * When handling a catch-all {@link __dycall}, the method name is the name of the event * and the parameters are the sender, the param, and then the name of the event. - * + * * @param string the event name * @param mixed the event sender object * @param TEventParameter the event parameter * @param numeric how the results of the event are tabulated. default: {@link EVENT_RESULT_FILTER} The default filters out * null responses. optional - * @param function any per handler filtering of the response result needed is passed through + * @param function any per handler filtering of the response result needed is passed through * this if not null. default: null. optional * @return mixed the results of the event * @throws TInvalidOperationException if the event is undefined @@ -1116,15 +1114,15 @@ class TComponent $postfunction=$responsetype; $responsetype=null; } - + if($responsetype===null) $responsetype=TEventResults::EVENT_RESULT_FILTER; - + $name=strtolower($name); $responses=array(); - + $name=$this->dyPreRaiseEvent($name,$sender,$param,$responsetype,$postfunction); - + if($this->hasEventHandler($name)||$this->hasEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER)) { $handlers=$this->getEventHandlers($name); @@ -1139,7 +1137,7 @@ class TComponent { if($this->dyIntraRaiseEventTestHandler($handler,$sender,$param,$name)===false) continue; - + if(is_string($handler)) { if(($pos=strrpos($handler,'.'))!==false) @@ -1184,30 +1182,30 @@ class TComponent } else throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name,gettype($handler)); - + $this->dyIntraRaiseEventPostHandler($name,$sender,$param,$handler,$response); - + if($postfunction) $response=call_user_func_array($postfunction,array($sender,$param,$this,$response)); - + if($responsetype&TEventResults::EVENT_RESULT_ALL) $responses[]=array('sender'=>$sender,'param'=>$param,'response'=>$response); else $responses[]=$response; - + if($response!==null&&($responsetype&TEventResults::EVENT_RESULT_FEED_FORWARD)) $param=$response; - + } } else if(strncasecmp($name,'on',2)===0&&!$this->hasEvent($name)) throw new TInvalidOperationException('component_event_undefined',get_class($this),$name); - + if($responsetype&TEventResults::EVENT_RESULT_FILTER) $responses=array_filter($responses); - + $responses=$this->dyPostRaiseEvent($responses,$name,$sender,$param,$responsetype,$postfunction); - + return $responses; } @@ -1220,7 +1218,7 @@ class TComponent * return $chain->dyEvaluateExpressionFilter(str_replace('foo', 'bar', $expression)); //example * } * </code> - * to be executed when evaluateExpression is called. All attached behaviors are notified through + * to be executed when evaluateExpression is called. All attached behaviors are notified through * dyEvaluateExpressionFilter. The chaining is important in this function due to the filtering * pass-through effect. * @@ -1252,7 +1250,7 @@ class TComponent * return $chain->dyEvaluateStatementsFilter(str_replace('foo', 'bar', $statements)); //example * } * </code> - * to be executed when evaluateStatements is called. All attached behaviors are notified through + * to be executed when evaluateStatements is called. All attached behaviors are notified through * dyEvaluateStatementsFilter. The chaining is important in this function due to the filtering * pass-through effect. * @@ -1291,7 +1289,7 @@ class TComponent * return $chain->dyCreatedOnTemplate($parent); //example * } * </code> - * to be executed when createdOnTemplate is called. All attached behaviors are notified through + * to be executed when createdOnTemplate is called. All attached behaviors are notified through * dyCreatedOnTemplate. * * @param TComponent potential parent of this control @@ -1314,7 +1312,7 @@ class TComponent * public function dyAddParsedObject($object[, $chain]) { * } * </code> - * to be executed when addParsedObject is called. All attached behaviors are notified through + * to be executed when addParsedObject is called. All attached behaviors are notified through * dyAddParsedObject. * * @param string|TComponent text string or component parsed and instantiated in template @@ -1324,10 +1322,10 @@ class TComponent { $this->dyAddParsedObject($object); } - - + + /** - * This is the method registered for all instanced objects should a class behavior be added after + * This is the method registered for all instanced objects should a class behavior be added after * the class is instanced. Only when the class to which the behavior is being added is in this * object's class hierarchy, via {@link getClassHierarchy}, is the behavior added to this instance. * @param $sender the application @@ -1338,10 +1336,10 @@ class TComponent if(in_array($param->getClass(),$this->getClassHierarchy(true))) return $this->attachBehavior($param->getName(),$param->getBehavior(),$param->getPriority()); } - - + + /** - * This is the method registered for all instanced objects should a class behavior be removed after + * This is the method registered for all instanced objects should a class behavior be removed after * the class is instanced. Only when the class to which the behavior is being added is in this * object's class hierarchy, via {@link getClassHierarchy}, is the behavior removed from this instance. * @param $sender the application @@ -1352,17 +1350,17 @@ class TComponent if(in_array($param->getClass(),$this->getClassHierarchy(true))) return $this->detachBehavior($param->getName(),$param->getPriority()); } - - + + /** - * This will add a class behavior to all classes instanced (that are listening) and future newly instanced objects. - * This registers the behavior for future instances and pushes the changes to all the instances that are listening as well. + * This will add a class behavior to all classes instanced (that are listening) and future newly instanced objects. + * This registers the behavior for future instances and pushes the changes to all the instances that are listening as well. * The universal class behaviors are stored in an inverted stack with the latest class behavior being at the first position in the array. * This is done so class behaviors are added last first. * @param string name the key of the class behavior * @param object|string class behavior or name of the object behavior per instance * @param string|class string of class or class on which to attach this behavior. Defaults to null which will error - * but more important, if this is on PHP 5.3 it will use Late Static Binding to derive the class + * but more important, if this is on PHP 5.3 it will use Late Static Binding to derive the class * it should extend. * <code> * TPanel::attachClassBehavior('javascripts', (new TJsPanelBehavior())->init($this)); @@ -1377,7 +1375,7 @@ class TComponent $class=get_called_class(); if(!$class) throw new TInvalidOperationException('component_no_class_provided_nor_late_binding'); - + if(!is_string($name)) $name=get_class($name); $class=strtolower($class); @@ -1392,16 +1390,16 @@ class TComponent $behaviorObject=is_string($behavior)?new $behavior:$behavior; return $behaviorObject->raiseEvent('fxAttachClassBehavior',null,$param); } - - + + /** * This will remove a behavior from a class. It unregisters it from future instances and * pulls the changes from all the instances that are listening as well. * PHP 5.3 uses Late Static Binding to derive the static class upon which this method is called. * @param $name the key of the class behavior - * @param $class string class on which to attach this behavior. Defaults to null. - * @param $priority numeric|null|false priority. false is any priority, null is default - * {@link TPriorityList} priority, and numeric is a specific priority. + * @param $class string class on which to attach this behavior. Defaults to null. + * @param $priority numeric|null|false priority. false is any priority, null is default + * {@link TPriorityList} priority, and numeric is a specific priority. * @throws Exception if the the class cannot be derived from Late Static Binding and is not * not supplied as a parameter. * @since 3.2.3 @@ -1411,7 +1409,7 @@ class TComponent $class=get_called_class(); if(!$class) throw new TInvalidOperationException('component_no_class_provided_nor_late_binding'); - + $class=strtolower($class); if(!is_string($name)) $name=get_class($name); @@ -1443,8 +1441,8 @@ class TComponent * then the behavior can determine what it is an instanceof. If this behavior function returns true, * then this method returns true. If the behavior instance checking function returns false, * then no further checking is performed as it is assumed to be correct. - * - * If the behavior instance check function returns nothing or null or the behavior + * + * If the behavior instance check function returns nothing or null or the behavior * doesn't implement the {@link IInstanceCheck} interface, then the default instanceof occurs. * The default isa behavior is to check if the behavior is an instanceof the class. * @@ -1463,7 +1461,7 @@ class TComponent foreach($this->_m->toArray() as $behavior){ if(($behavior instanceof IBehavior)&&!$behavior->getEnabled()) continue; - + $check = null; if(($behavior->isa('IInstanceCheck'))&&$check=$behavior->isinstanceof($class,$this)) return true; @@ -1535,7 +1533,7 @@ class TComponent * public function dyAttachBehavior($name,$behavior[, $chain]) { * } * </code> - * to be executed when attachBehavior is called. All attached behaviors are notified through + * to be executed when attachBehavior is called. All attached behaviors are notified through * dyAttachBehavior. * * @param string the behavior's name. It should uniquely identify this behavior. @@ -1569,7 +1567,7 @@ class TComponent * public function dyDetachBehavior($name,$behavior[, $chain]) { * } * </code> - * to be executed when detachBehavior is called. All attached behaviors are notified through + * to be executed when detachBehavior is called. All attached behaviors are notified through * dyDetachBehavior. * * @param string the behavior's name. It uniquely identifies the behavior. @@ -1597,7 +1595,7 @@ class TComponent * public function dyEnableBehaviors($name,$behavior[, $chain]) { * } * </code> - * to be executed when enableBehaviors is called. All attached behaviors are notified through + * to be executed when enableBehaviors is called. All attached behaviors are notified through * dyEnableBehaviors. * @since 3.2.3 */ @@ -1618,7 +1616,7 @@ class TComponent * public function dyDisableBehaviors($name,$behavior[, $chain]) { * } * </code> - * to be executed when disableBehaviors is called. All attached behaviors are notified through + * to be executed when disableBehaviors is called. All attached behaviors are notified through * dyDisableBehaviors. * @since 3.2.3 */ @@ -1630,7 +1628,7 @@ class TComponent $this->_behaviorsenabled=false; } } - + /** * Returns if all the behaviors are turned on or off for the object. @@ -1652,7 +1650,7 @@ class TComponent * public function dyEnableBehavior($name,$behavior[, $chain]) { * } * </code> - * to be executed when enableBehavior is called. All attached behaviors are notified through + * to be executed when enableBehavior is called. All attached behaviors are notified through * dyEnableBehavior. * * @param string the behavior's name. It uniquely identifies the behavior. @@ -1680,7 +1678,7 @@ class TComponent * public function dyDisableBehavior($name,$behavior[, $chain]) { * } * </code> - * to be executed when disableBehavior is called. All attached behaviors are notified through + * to be executed when disableBehavior is called. All attached behaviors are notified through * dyDisableBehavior. * * @param string the behavior's name. It uniquely identifies the behavior. @@ -1718,11 +1716,11 @@ class TComponent { $a = (array)$this; $a = array_keys($a); - $exprops = array(); + $exprops = array(); if($this->_listeningenabled===false) - $exprops[] = "\0TComponent\0_listeningenabled"; + $exprops[] = "\0TComponent\0_listeningenabled"; if($this->_behaviorsenabled===true) - $exprops[] = "\0TComponent\0_behaviorsenabled"; + $exprops[] = "\0TComponent\0_behaviorsenabled"; if ($this->_e===array()) $exprops[] = "\0TComponent\0_e"; if ($this->_m===null) @@ -1763,7 +1761,7 @@ class TClassBehaviorEventParameter extends TEventParameter private $_name; private $_behavior; private $_priority; - + /** * Holds the parameters for the Class Behavior Events * @param string $class this is the class to get the behavior @@ -1777,7 +1775,7 @@ class TClassBehaviorEventParameter extends TEventParameter $this->_behavior=$behavior; $this->_priority=$priority; } - + /** * This is the class to get the behavior * @return string the class to get the behavior @@ -1786,7 +1784,7 @@ class TClassBehaviorEventParameter extends TEventParameter { return $this->_class; } - + /** * name of the behavior * @return string the name to get the behavior @@ -1795,19 +1793,19 @@ class TClassBehaviorEventParameter extends TEventParameter { return $this->_name; } - + /** * This is the behavior which the class is to get - * @return object the behavior to implement + * @return object the behavior to implement */ public function getBehavior() { return $this->_behavior; } - + /** * This is the priority which the behavior is to get - * @return numeric the priority of the behavior + * @return numeric the priority of the behavior */ public function getPriority() { @@ -1834,7 +1832,6 @@ class TClassBehaviorEventParameter extends TEventParameter * TTextAlign::Right. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -1897,7 +1894,6 @@ class TEnumerable implements Iterator * - enum: enumerable type, represented by an array of strings. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -2050,7 +2046,6 @@ class TPropertyValue * TEventParameter is the base class for all event parameter classes. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -2078,7 +2073,6 @@ class TEventResults extends TEnumerable { * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -2247,9 +2241,9 @@ class TComponentReflection extends TComponent } /** - * IBaseBehavior interface is the base behavior class from which all other + * IBaseBehavior interface is the base behavior class from which all other * behaviors types are derived - * + * * @author Brad Anderson <javalizard@mac.com> * @version $Id$ * @package System @@ -2272,7 +2266,7 @@ interface IBaseBehavior { * IBehavior interfaces is implemented by instance behavior classes. * * A behavior is a way to enhance a component with additional methods and - * events that are defined in the behavior class and not available in the + * events that are defined in the behavior class and not available in the * class. Objects may signal behaviors through dynamic events. * * @author Brad Anderson <javalizard@mac.com> @@ -2294,11 +2288,11 @@ interface IBehavior extends IBaseBehavior /** - * IClassBehavior interface is implements behaviors across all instances of + * IClassBehavior interface is implements behaviors across all instances of * a particular class * - * Any calls to functions not present in the original object but to behaviors - * derived from this class, will have inserted as the first argument parameter + * Any calls to functions not present in the original object but to behaviors + * derived from this class, will have inserted as the first argument parameter * the object containing the behavior. * * For example: @@ -2329,9 +2323,9 @@ interface IClassBehavior extends IBaseBehavior { /** - * IInstanceCheck This interface allows objects to determine their own - * 'instanceof' results when {@link TComponent::isa} is called. This is - * important with behaviors because behaviors may want to look like + * IInstanceCheck This interface allows objects to determine their own + * 'instanceof' results when {@link TComponent::isa} is called. This is + * important with behaviors because behaviors may want to look like * particular objects other than themselves. * * @author Brad Anderson <javalizard@mac.com> @@ -2341,20 +2335,20 @@ interface IClassBehavior extends IBaseBehavior { */ interface IInstanceCheck { /** - * The method checks $this or, if needed, the parameter $instance is of type - * class. In the case of a Class Behavior, the instance to which the behavior + * The method checks $this or, if needed, the parameter $instance is of type + * class. In the case of a Class Behavior, the instance to which the behavior * is attached may be important to determine if $this is an instance * of a particular class. * @param class|string the component that this behavior is checking if it is an instanceof. * @param object the object which the behavior is attached to. default: null - * @return boolean|null if the this or the instance is of type class. When null, no information could be derived and + * @return boolean|null if the this or the instance is of type class. When null, no information could be derived and * the default mechanisms take over. */ public function isinstanceof($class,$instance=null); } /** - * TJavaScriptLiteral class that encloses string literals that are not + * TJavaScriptLiteral class that encloses string literals that are not * supposed to be escaped by {@link TJavaScript::encode() } * * Since Prado 3.2 all the data that gets sent clientside inside a javascript statement @@ -2371,7 +2365,6 @@ interface IInstanceCheck { * $raw=_js($js); * </code> * - * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.2.0 */ @@ -2397,9 +2390,8 @@ class TJavaScriptLiteral /** * TJavaScriptString class is an internal class that marks strings that will be - * forcibly encoded when rendered inside a javascript block + * forcibly encoded when rendered inside a javascript block * - * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.2.0 */ diff --git a/framework/TModule.php b/framework/TModule.php index fee51016..7c149962 100644 --- a/framework/TModule.php +++ b/framework/TModule.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System */ @@ -17,7 +16,6 @@ * used as the basic class for application modules. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ diff --git a/framework/TService.php b/framework/TService.php index 1ec20017..9c51eb5a 100644 --- a/framework/TService.php +++ b/framework/TService.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System */ @@ -17,7 +16,6 @@ * used as the basic class for application services. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ diff --git a/framework/TShellApplication.php b/framework/TShellApplication.php index 3552d8a7..e989ed9f 100644 --- a/framework/TShellApplication.php +++ b/framework/TShellApplication.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TShellApplication.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System */ @@ -29,7 +28,6 @@ * accessibility to resources as the PRADO Web applications. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TShellApplication.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.1.0 */ diff --git a/framework/Util/TBehavior.php b/framework/Util/TBehavior.php index 951a758f..56a81a87 100644 --- a/framework/Util/TBehavior.php +++ b/framework/Util/TBehavior.php @@ -11,7 +11,6 @@ /** * TBehavior is a convenient base class for behavior classes. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBehaviour.php 3211 2012-10-31 02:35:01Z javalizard@gmail.com $ * @package System.Util * @since 3.2.3 */ diff --git a/framework/Util/TCallChain.php b/framework/Util/TCallChain.php index 9d6144b3..a6d99a61 100644 --- a/framework/Util/TCallChain.php +++ b/framework/Util/TCallChain.php @@ -4,16 +4,15 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2008-2013 Pradosoft + * @copyright Copyright © 2008-2014 Pradosoft * @license http://www.pradosoft.com/license/ */ /** * TCallChain is a recursive event calling mechanism. This class implements * the {@link IDynamicMethods} class so that any 'dy' event calls can be caught - * and patched through to the intended recipient + * and patched through to the intended recipient * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: TCallChain.php 564 2009-01-21 22:07:10Z javalizard $ * @package System.Util * @since 3.2.3 */ @@ -23,12 +22,12 @@ class TCallChain extends TList implements IDynamicMethods * @var {@link TListIterator} for moving through the chained method calls */ private $_iterator=null; - + /** * @var string the method name of the call chain */ private $_method=null; - + /** * This initializes the list and the name of the method to be called * @param string the name of the function call @@ -37,11 +36,11 @@ class TCallChain extends TList implements IDynamicMethods $this->_method=$method; parent::__construct(); } - - + + /** * This initializes the list and the name of the method to be called - * @param string|array this is a callable function as a string or array with + * @param string|array this is a callable function as a string or array with * the object and method name as string * @param array The array of arguments to the function call chain */ @@ -49,12 +48,12 @@ class TCallChain extends TList implements IDynamicMethods { $this->add(array($method,$args)); } - + /** * This method calls the next Callable in the list. All of the method arguments - * coming into this method are substituted into the original method argument of + * coming into this method are substituted into the original method argument of * call in the chain. - * + * * If the original method call has these parameters * <code> * $originalobject->dyExampleMethod('param1', 'param2', 'param3') @@ -71,7 +70,7 @@ class TCallChain extends TList implements IDynamicMethods * list in 'dy' event calls is always the object containing the behavior. This modifies * the parameter replacement mechanism slightly to leave the object containing the behavior * alone and only replacing the other parameters in the argument list. As per {@link __call}, - * any calls to a 'dy' event do not need the object containing the behavior as the addition of + * any calls to a 'dy' event do not need the object containing the behavior as the addition of * the object to the argument list as the first element is automatic for IClassBehaviors. * * The last parameter of the method parameter list for any callable in the call chain @@ -87,14 +86,14 @@ class TCallChain extends TList implements IDynamicMethods * * When there are no handlers or no handlers left, it returns the first parameter of the * argument list. - * + * */ public function call() { $args=func_get_args(); if($this->getCount()===0) return isset($args[0])?$args[0]:null; - + if(!$this->_iterator) { $chain_array=array_reverse($this->toArray()); @@ -115,12 +114,12 @@ class TCallChain extends TList implements IDynamicMethods $result = $args[0]; return $result; } - - + + /** * This catches all the unpatched dynamic events. When the method call matches the - * call chain method, it passes the arguments to the original __call (of the dynamic - * event being unspecified in TCallChain) and funnels into the method {@link call}, + * call chain method, it passes the arguments to the original __call (of the dynamic + * event being unspecified in TCallChain) and funnels into the method {@link call}, * so the next dynamic event handler can be called. * If the original method call has these parameters * <code> diff --git a/framework/Util/TClassBehavior.php b/framework/Util/TClassBehavior.php index 9d29dbf4..03ea0c57 100644 --- a/framework/Util/TClassBehavior.php +++ b/framework/Util/TClassBehavior.php @@ -11,7 +11,6 @@ /** * TClassBehavior is a convenient base class for whole class behaviors. * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: TClassBehavior.php 564 2009-01-21 22:07:10Z javalizard $ * @package System.Util * @since 3.2.3 */ @@ -25,7 +24,7 @@ class TClassBehavior extends TComponent implements IClassBehavior public function attach($component) { } - + /** * Detaches the behavior object from the component. * @param TComponent the component that this behavior is to be detached from. diff --git a/framework/Util/TDataFieldAccessor.php b/framework/Util/TDataFieldAccessor.php index ae9df57b..1bead02e 100644 --- a/framework/Util/TDataFieldAccessor.php +++ b/framework/Util/TDataFieldAccessor.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataFieldAccessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -26,7 +25,6 @@ * then field 'MyValue.MySubValue' will return that method call result. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataFieldAccessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -36,7 +34,7 @@ class TDataFieldAccessor * Evaluates the data value at the specified field. * - If the data is an array, then the field is treated as an array index * and the corresponding element value is returned; the field name can also include - * dots to access subarrays. For example a field named 'MyField.MySubField' will + * dots to access subarrays. For example a field named 'MyField.MySubField' will * first try to access $data['MyField.MySubField'], then try $data['MyField']['MySubField']. * - If the data is a TMap or TList object, then the field is treated as a key * into the map or list, and the corresponding value is returned. diff --git a/framework/Util/TDateTimeStamp.php b/framework/Util/TDateTimeStamp.php index 7a995b00..fcbd573f 100644 --- a/framework/Util/TDateTimeStamp.php +++ b/framework/Util/TDateTimeStamp.php @@ -4,9 +4,8 @@ * @author Fabio Bas ctrlaltca[AT]gmail[DOT]com * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDateTimeStamp.php 3246 2013-01-07 21:07:38Z ctrlaltca $ * @package System.Util */ @@ -20,7 +19,6 @@ * julian dates anymore. * * @author Fabio Bas ctrlaltca[AT]gmail[DOT]com - * @version $Id: TDateTimeStamp.php 3246 2013-01-07 21:07:38Z ctrlaltca $ * @package System.Util * @since 3.0.4 * @deprecated since 3.2.1 @@ -194,8 +192,8 @@ class TDateTimeStamp $dt = new DateTime(); if($is_gmt) $dt->setTimeZone(new DateTimeZone('UTC')); - $dt->setDate($year!==false ? $year : date('Y'), - $mon!==false ? $mon : date('m'), + $dt->setDate($year!==false ? $year : date('Y'), + $mon!==false ? $mon : date('m'), $day!==false ? $day : date('d')); $dt->setTime($hr, $min, $sec); return (int) $dt->format('U'); diff --git a/framework/Util/TLogRouter.php b/framework/Util/TLogRouter.php index 32273c0c..575c21ab 100644 --- a/framework/Util/TLogRouter.php +++ b/framework/Util/TLogRouter.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -29,14 +28,13 @@ Prado::using('System.Data.TDbConnection'); * </code> * PHP configuration style: * <code> - * + * * </code> * You can specify multiple routes with different filtering conditions and different * targets, even if the routes are of the same type. * * @author Qiang Xue <qiang.xue@gmail.com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -128,8 +126,8 @@ class TLogRouter extends TModule /** * Adds a TLogRoute instance to the log router. - * - * @param TLogRoute $route + * + * @param TLogRoute $route * @throws TInvalidDataTypeException if the route object is invalid */ public function addRoute($route) @@ -190,7 +188,6 @@ class TLogRouter extends TModule * satisfying both filter conditions will they be returned. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -363,7 +360,6 @@ abstract class TLogRoute extends TApplicationComponent * specifies how many files to be kept. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -503,7 +499,6 @@ class TFileLogRoute extends TLogRoute * {@link setSentFrom SentFrom} address. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -629,7 +624,6 @@ class TEmailLogRoute extends TLogRoute * TBrowserLogRoute prints selected log messages in the response. * * @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -639,7 +633,7 @@ class TBrowserLogRoute extends TLogRoute * @var string css class for indentifying the table structure in the dom tree */ private $_cssClass=null; - + public function processLogs($logs) { if(empty($logs) || $this->getApplication()->getMode()==='Performance') return; @@ -664,7 +658,7 @@ class TBrowserLogRoute extends TLogRoute } $response->write($this->renderFooter()); } - + /** * @param string the css class of the control */ @@ -816,7 +810,6 @@ EOD; * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.1.2 */ @@ -1022,7 +1015,6 @@ class TDbLogRoute extends TLogRoute * {@link http://www.getfirebug.com/ FireBug Website} * * @author Enrico Stahn <mail@enricostahn.com>, Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.1.2 */ @@ -1099,7 +1091,6 @@ EOD; * {@link http://www.firephp.org/ FirePHP Website} * * @author Yves Berkholz <godzilla80[at]gmx[dot]net> - * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.1.5 */ diff --git a/framework/Util/TLogger.php b/framework/Util/TLogger.php index 74fa22bf..6fd12ccf 100644 --- a/framework/Util/TLogger.php +++ b/framework/Util/TLogger.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -18,7 +17,6 @@ * log categories, and by control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -82,14 +80,14 @@ class TLogger extends TComponent * Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp. * A level filter is specified by an integer, whose bits indicate the levels interested. * For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels. - * A category filter is specified by an array of categories to filter. + * A category filter is specified by an array of categories to filter. * A message whose category name starts with any filtering category * will be returned. For example, a category filter array('System.Web','System.IO') * will return messages under categories such as 'System.Web', 'System.IO', * 'System.Web.UI', 'System.Web.UI.WebControls', etc. * A control client id filter is specified by an array of control client id * A message whose control client id starts with any filtering naming panels - * will be returned. For example, a category filter array('ctl0_body_header', + * will be returned. For example, a category filter array('ctl0_body_header', * 'ctl0_body_content_sidebar') * will return messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar', * 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc. @@ -135,14 +133,14 @@ class TLogger extends TComponent * Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp. * A level filter is specified by an integer, whose bits indicate the levels interested. * For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels. - * A category filter is specified by an array of categories to filter. + * A category filter is specified by an array of categories to filter. * A message whose category name starts with any filtering category * will be deleted. For example, a category filter array('System.Web','System.IO') * will delete messages under categories such as 'System.Web', 'System.IO', * 'System.Web.UI', 'System.Web.UI.WebControls', etc. * A control client id filter is specified by an array of control client id * A message whose control client id starts with any filtering naming panels - * will be deleted. For example, a category filter array('ctl0_body_header', + * will be deleted. For example, a category filter array('ctl0_body_header', * 'ctl0_body_content_sidebar') * will delete messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar', * 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc. diff --git a/framework/Util/TParameterModule.php b/framework/Util/TParameterModule.php index 5b345b4e..84616c63 100644 --- a/framework/Util/TParameterModule.php +++ b/framework/Util/TParameterModule.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TParameterModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -41,7 +40,6 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> - * @version $Id: TParameterModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ diff --git a/framework/Util/TRpcClient.php b/framework/Util/TRpcClient.php index fbfb528a..91b27b52 100644 --- a/framework/Util/TRpcClient.php +++ b/framework/Util/TRpcClient.php @@ -5,7 +5,6 @@ * @link http://www.pradosoft.com/ * @copyright 2010 Bigpoint GmbH * @license http://www.pradosoft.com/license/ - * @version $Id: TRpcClient.php 137 2010-03-27 22:13:36Z rrogge $ * @since 3.2 * @package System.Util */ @@ -158,7 +157,7 @@ class TRpcClient extends TApplicationComponent * @package System.Util * @since 3.2 */ - + class TRpcClientTypesEnumerable extends TEnumerable { const JSON = 'TJsonRpcClient'; @@ -176,7 +175,7 @@ class TRpcClientTypesEnumerable extends TEnumerable * @package System.Util * @since 3.2 */ - + class TRpcClientRequestException extends TApplicationException { } @@ -184,7 +183,7 @@ class TRpcClientRequestException extends TApplicationException /** * TRpcClientResponseException class * - * This Exception is fired when the + * This Exception is fired when the * * @author Robin J. Rogge <rrogge@bigpoint.net> * @version $Id$ @@ -323,7 +322,7 @@ class TXmlRpcClient extends TRpcClient // skip response handling if the request was just a notification request if($this->isNotification) return true; - + // decode response if(($_response = xmlrpc_decode($_response)) === null) throw new TRpcClientResponseException('Empty response received'); diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php index 295a2d60..18e71529 100644 --- a/framework/Util/TSimpleDateFormatter.php +++ b/framework/Util/TSimpleDateFormatter.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSimpleDateFormatter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -40,7 +39,6 @@ * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSimpleDateFormatter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -177,7 +175,7 @@ class TSimpleDateFormatter if(is_numeric($value)) return $s->getDate($value); else - return $s->parseDate($value); + return $s->parseDate($value); } /** @@ -302,7 +300,7 @@ class TSimpleDateFormatter if(!$defaultToCurrentTime && ($month === null || $day === null || $year === null)) return null; else - { + { if(empty($year)) { $year = date('Y'); } diff --git a/framework/Util/TVarDumper.php b/framework/Util/TVarDumper.php index f49a1274..c89b205a 100644 --- a/framework/Util/TVarDumper.php +++ b/framework/Util/TVarDumper.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TVarDumper.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -24,7 +23,6 @@ * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TVarDumper.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ diff --git a/framework/Web/Javascripts/TJavaScript.php b/framework/Web/Javascripts/TJavaScript.php index 8cfbc9ba..f55b5c5b 100644 --- a/framework/Web/Javascripts/TJavaScript.php +++ b/framework/Web/Javascripts/TJavaScript.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJavaScript.php 3291 2013-05-09 17:44:58Z ctrlaltca $ * @package System.Web.Javascripts */ @@ -17,7 +16,6 @@ * functions. * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> - * @version $Id: TJavaScript.php 3291 2013-05-09 17:44:58Z ctrlaltca $ * @package System.Web.Javascripts * @since 3.0 */ @@ -251,7 +249,7 @@ class TJavaScript self::checkJsonError(); return $s; } - + private static function checkJsonError() { switch ($err = json_last_error()) @@ -284,7 +282,7 @@ class TJavaScript /** * Minimize the size of a javascript script. * This method is based on Douglas Crockford's JSMin. - * @param string code that you want to minimzie + * @param string code that you want to minimzie * @return minimized version of the code */ public static function JSMin($code) diff --git a/framework/Web/Javascripts/packages.php b/framework/Web/Javascripts/packages.php index 8223ecba..19cda98b 100644 --- a/framework/Web/Javascripts/packages.php +++ b/framework/Web/Javascripts/packages.php @@ -9,11 +9,7 @@ if (!defined('SCRIPTACULOUS_DIR')) define ('SCRIPTACULOUS_DIR', 'scriptaculous-1 //package names and its contents (files relative to the current directory) $packages = array( - 'prototype' => array( - PROTOTYPE_DIR.'/prototype.js', - SCRIPTACULOUS_DIR.'/builder.js', - SCRIPTACULOUS_DIR.'/effects.js' - ), + // base prado scripts 'prado' => array( 'prado/prado.js', 'prado/controls/controls.js' @@ -40,15 +36,6 @@ $packages = array( 'prado/activecontrols/activecontrols3.js', ), - 'dragdrop'=>array( - SCRIPTACULOUS_DIR.'/dragdrop.js', - 'prado/activecontrols/dragdrop.js' - ), - - 'dragdropextra'=>array( - 'prado/activecontrols/dragdropextra.js', - ), - 'slider'=>array( 'prado/controls/slider.js' ), @@ -60,19 +47,15 @@ $packages = array( 'tabpanel'=>array( 'prado/controls/tabpanel.js' ), - + 'activedatepicker' => array( 'prado/activecontrols/activedatepicker.js' ), - + 'activefileupload' => array( 'prado/activefileupload/activefileupload.js' ), - 'accordion'=>array( - 'prado/controls/accordion.js' - ), - 'htmlarea'=>array( 'prado/controls/htmlarea.js' ), @@ -81,14 +64,18 @@ $packages = array( 'prado/controls/htmlarea4.js' ), - 'ratings' => array( - 'prado/ratings/ratings.js', + 'accordion'=>array( + 'prado/controls/accordion.js' ), 'inlineeditor' => array( 'prado/activecontrols/inlineeditor.js' ), + 'ratings' => array( + 'prado/ratings/ratings.js', + ), + // jquery 'jquery' => array( JQUERY_DIR.'/jquery.js', @@ -98,12 +85,31 @@ $packages = array( JQUERY_DIR.'/jquery-ui-i18n.min.js', ), + // prototype + scriptaculous + 'prototype' => array( + PROTOTYPE_DIR.'/prototype.js', + SCRIPTACULOUS_DIR.'/builder.js', + SCRIPTACULOUS_DIR.'/effects.js' + ), + + 'dragdrop'=>array( + SCRIPTACULOUS_DIR.'/dragdrop.js', + 'prado/activecontrols/dragdrop.js' + ), + + 'dragdropextra'=>array( + 'prado/activecontrols/dragdropextra.js', + ), + + 'autocomplete' => array( + SCRIPTACULOUS_DIR.'/controls.js', + 'prado/activecontrols/autocomplete.js' + ), ); //package names and their dependencies $dependencies = array( - 'prototype' => array('prototype'), 'jquery' => array('jquery'), 'prado' => array('jquery', 'prado'), 'validator' => array('jquery', 'prado', 'validator'), @@ -119,15 +125,14 @@ $dependencies = array( 'htmlarea4' => array('jquery', 'prado', 'htmlarea4'), 'keyboard' => array('jquery', 'prado', 'keyboard'), 'slider' => array('jquery', 'prado', 'slider'), - 'dragdrop' => array(), -/* - 'dragdrop' => array('prototype', 'prado', 'effects', 'ajax', 'dragdrop'), - 'dragdropextra' => array('prototype', 'prado', 'effects', 'ajax', 'dragdrop','dragdropextra'), - 'accordion' => array('prototype', 'prado', 'effects', 'accordion'), - 'ratings' => array('prototype', 'prado', 'effects', 'ajax', 'ratings'), - 'inlineeditor' => array('prototype', 'prado', 'effects', 'ajax', 'inlineeditor'), - */ + 'inlineeditor' => array('jquery', 'prado', 'ajax', 'inlineeditor'), + 'accordion' => array('jquery', 'prado', 'accordion'), + 'ratings' => array('jquery', 'prado', 'ajax', 'ratings'), 'jqueryui' => array('jquery', 'jqueryui'), + 'prototype' => array('prototype'), + 'dragdrop' => array('prototype', 'jquery', 'prado', 'ajax', 'dragdrop'), + 'dragdropextra' => array('prototype', 'jquery', 'prado', 'ajax', 'dragdrop','dragdropextra'), + 'autocomplete' => array('prototype', 'jquery', 'prado', 'ajax', 'autocomplete'), ); return array($packages, $dependencies); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js index 71c9d73c..907d930e 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js @@ -50,18 +50,17 @@ Prado.WebUI.TActiveCheckBox = jQuery.klass(Prado.WebUI.CallbackControl, Prado.WebUI.TActiveRadioButton = jQuery.klass(Prado.WebUI.TActiveCheckBox); -Prado.WebUI.TActiveCheckBoxList = jQuery.extend( +Prado.WebUI.TActiveCheckBoxList = jQuery.klass(Prado.WebUI.Control, { - constructor : function(options) + onInit : function(options) { - Prado.Registry[options.ListID] = this; for(var i = 0; i<options.ItemCount; i++) { - var checkBoxOptions = jQuery.extend( + var checkBoxOptions = jQuery.extend({}, options, { - ID : options.ListID+"_c"+i, + ID : options.ID+"_c"+i, EventTarget : options.ListName+"$c"+i - }, options); + }); new Prado.WebUI.TActiveCheckBox(checkBoxOptions); } } @@ -108,9 +107,9 @@ Prado.WebUI.TJuiAutoComplete = jQuery.klass(Prado.WebUI.TActiveTextBox, }) jQuery('#'+options.ID).autocomplete(this.options) .data( "ui-autocomplete")._renderItem = function( ul, item ) { - return $( "<li>" ) + return jQuery( "<li>" ) .attr( "data-value", item.value ) - .append( $( "<a>" ).html( item.label ) ) + .append( jQuery( "<a>" ).html( item.label ) ) .appendTo( ul ); }; @@ -283,7 +282,7 @@ Prado.WebUI.TEventTriggeredCallback = jQuery.klass(Prado.WebUI.Control, onInit : function(options) { this.options = options || {} ; - var element = $('#'+options['ControlID']).get(0); + var element = jQuery('#'+options['ControlID']).get(0); if(element) this.observe(element, this.getEventName(element), this.doCallback.bind(this)); }, @@ -328,7 +327,7 @@ Prado.WebUI.TValueTriggeredCallback = jQuery.klass(Prado.WebUI.Control, { this.options = options || {} ; this.options.PropertyName = this.options.PropertyName || 'value'; - var element = $('#'+options['ControlID']).get(0); + var element = jQuery('#'+options['ControlID']).get(0); this.value = element ? element[this.options.PropertyName] : undefined; Prado.WebUI.TValueTriggeredCallback.register(this); this.startObserving(); @@ -347,7 +346,7 @@ Prado.WebUI.TValueTriggeredCallback = jQuery.klass(Prado.WebUI.Control, checkChanges : function() { - var element = $('#'+this.options.ControlID).get(0); + var element = jQuery('#'+this.options.ControlID).get(0); if(element) { var value = element[this.options.PropertyName]; @@ -401,7 +400,7 @@ Prado.WebUI.TActiveTableCell = jQuery.klass(Prado.WebUI.CallbackControl); Prado.WebUI.TActiveTableRow = jQuery.klass(Prado.WebUI.CallbackControl); Prado.WebUI.TActiveRatingList = jQuery.klass(Prado.WebUI.TRatingList, -{ +{ dispatchRequest : function(ev) { var requestOptions = jQuery.extend( @@ -413,5 +412,5 @@ Prado.WebUI.TActiveRatingList = jQuery.klass(Prado.WebUI.TRatingList, if(request.dispatch()==false) ev.preventDefault(); } - + }); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js index c0268077..dd0fc6f2 100755 --- a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js @@ -6,7 +6,7 @@ Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker, onInit : function(options) { this.options = options || []; - this.control = $('#'+options.ID).get(0); + this.control = jQuery('#'+options.ID).get(0); this.dateSlot = new Array(42); this.weekSlot = new Array(6); this.minimalDaysInFirstWeek = 4; @@ -17,7 +17,7 @@ Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker, //which element to trigger to show the calendar if(this.options.Trigger) { - this.trigger = $('#'+this.options.Trigger).get(0) ; + this.trigger = jQuery('#'+this.options.Trigger).get(0) ; var triggerEvent = this.options.TriggerEvent || "click"; } else @@ -25,7 +25,7 @@ Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker, this.trigger = this.control; var triggerEvent = this.options.TriggerEvent || "focus"; } - + // Popup position if(this.options.PositionMode == 'Top') { @@ -36,12 +36,12 @@ Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker, if (this.options.ShowCalendar) this.observe(this.trigger, triggerEvent, jQuery.proxy(this.show,this)); - - // Listen to change event + + // Listen to change event if(this.options.InputMode == "TextBox") { this.observe(this.control, "change", jQuery.proxy(this.onDateChanged,this)); - } + } else { var day = Prado.WebUI.TDatePicker.getDayListControl(this.control); @@ -50,11 +50,11 @@ Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker, if (day) this.observe (day, "change", jQuery.proxy(this.onDateChanged,this)); if (month) this.observe (month, "change", jQuery.proxy(this.onDateChanged,this)); if (year) this.observe (year, "change", jQuery.proxy(this.onDateChanged,this)); - + } - }, - + }, + // Respond to change event on the textbox or dropdown list // This method raises OnDateChanged event on client side if it has been defined, // and raise the callback request @@ -64,7 +64,7 @@ Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker, if (this.options.InputMode == "TextBox") { date=this.control.value; - } + } else { var day = Prado.WebUI.TDatePicker.getDayListControl(this.control); @@ -76,7 +76,7 @@ Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker, date=new Date(year, month, day, 0,0,0).SimpleFormat(this.Format, this); } if (typeof(this.options.OnDateChanged) == "function") this.options.OnDateChanged(this, date); - + if(this.options['AutoPostBack']==true) { // Make callback request @@ -84,4 +84,4 @@ Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker, request.dispatch(); } } -}); +}); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js index 0d306a89..e6616176 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js @@ -1,4 +1,4 @@ -Prado.CallbackRequestManager = +Prado.CallbackRequestManager = { /** * Callback request target POST field name. @@ -66,6 +66,55 @@ Prado.CallbackRequestManager = } msg += e.version+" "+e.time+"\n"; return msg; + }, + + /*! jQuery Ajax Queue - v0.1.2pre - 2013-03-19 + * https://github.com/gnarf37/jquery-ajaxQueue + * Copyright (c) 2013 Corey Frang; Licensed MIT + * Slightly adapted for use within prado by Fabio Bas <ctrlaltca@gmail.com> + */ + + // jQuery on an empty object, we are going to use this as our Queue + ajaxQueue : jQuery({}), + + ajax : function( ajaxOpts ) { + var jqXHR, + dfd = jQuery.Deferred(), + promise = dfd.promise(); + + // run the actual query + function doRequest( next ) { + jqXHR = jQuery.ajax( ajaxOpts ); + jqXHR.done( dfd.resolve ) + .fail( dfd.reject ) + .then( next, next ); + } + + // queue our ajax request + Prado.CallbackRequestManager.ajaxQueue.queue( doRequest ); + + // add the abort method + promise.abort = function( statusText ) { + + // proxy abort to the jqXHR if it is active + if ( jqXHR ) { + return jqXHR.abort( statusText ); + } + + // if there wasn't already a jqXHR we need to remove from queue + var queue = Prado.CallbackRequestManager.ajaxQueue.queue(), + index = jQuery.inArray( doRequest, queue ); + + if ( index > -1 ) { + queue.splice( index, 1 ); + } + + // and then reject the deferred + dfd.rejectWith( ajaxOpts.context || ajaxOpts, [ promise, statusText, "" ] ); + return promise; + }; + + return promise; } }; @@ -202,7 +251,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, if(this.options.onPreDispatch) this.options.onPreDispatch(this,null); - + // jQuery don't have all these states.. simulate them to avoid breaking old scripts if (this.options.onLoading) this.options.onLoading(this,null); @@ -215,7 +264,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, this.options.data = this.getParameters(); this.options.url = this.getCallbackUrl(); - this.request = jQuery.ajax(this.options); + this.request = Prado.CallbackRequestManager.ajax(this.options); }, abort : function() @@ -239,7 +288,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, if(this.options.EventTarget) data[Prado.CallbackRequestManager.FIELD_CALLBACK_TARGET] = this.options.EventTarget; - if(this.options.PostInputs != false) + if(this.options.PostInputs != false) return jQuery(form).serialize() + '&' + jQuery.param(data); else return jQuery.param(data); @@ -352,7 +401,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, */ updatePageState : function(request, datain) { - var pagestate = $("#"+Prado.CallbackRequestManager.FIELD_CALLBACK_PAGESTATE); + var pagestate = jQuery("#"+Prado.CallbackRequestManager.FIELD_CALLBACK_PAGESTATE); var enabled = request.options.EnablePageStateUpdate; var aborted = false; //typeof(self.currentRequest) == 'undefined' || self.currentRequest == null; if(enabled && !aborted && pagestate) @@ -408,7 +457,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, }, /* - * Checks which assets are used by the response and ensures they're loaded + * Checks which assets are used by the response and ensures they're loaded */ loadAssets : function(request, datain, callback) { @@ -439,7 +488,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, }, /* - * Checks which scripts are used by the response and ensures they're loaded + * Checks which scripts are used by the response and ensures they're loaded */ loadScripts : function(request, datain, callback) { @@ -473,10 +522,10 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, { var url = this.ScriptsToLoad.shift(); var obj = this; if ( - Prado.ScriptManager.ensureAssetIsLoaded(url, - function() { - obj.loadNextScript(); - } + Prado.ScriptManager.ensureAssetIsLoaded(url, + function() { + obj.loadNextScript(); + } ) ) this.loadNextScript(); @@ -560,10 +609,10 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, { var url = this.StyleSheetsToLoad.shift(); var obj = this; if ( - Prado.StyleSheetManager.ensureAssetIsLoaded(url, - function() { - obj.loadNextStyleSheet(); - } + Prado.StyleSheetManager.ensureAssetIsLoaded(url, + function() { + obj.loadNextStyleSheet(); + } ) ) this.loadNextStyleSheet(); @@ -591,8 +640,10 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, if(typeof(Logger) != "undefined") Logger.warn("Invalid action:"+data); } else { - for(var key in json) - this.__run(this, json[key]); + var that = this; + jQuery.each(json, function(idx, item){ + that.__run(that, item); + }); } } }, @@ -659,7 +710,7 @@ jQuery(function() // /** // * Prado Callback client-side request handler. // */ -// Prado.CallbackRequestManager = +// Prado.CallbackRequestManager = // { // requestQueue : [], @@ -795,11 +846,11 @@ jQuery(function() // this.Enabled = true; // this.id = id; // this.randomId = this.randomString(); - + // if(typeof(id)=="string"){ // Prado.CallbackRequestManager.requests[id+"__"+this.randomId] = this; // } - + // Prado.CallbackRequestManager.requests[id+"__"+this.randomId].ActiveControl = this.options; // }, @@ -864,7 +915,7 @@ if (typeof(Prado.AssetManagerClass)=="undefined") { discoverLoadedAssets: function() { // wait until document has finished loading to avoid javascript errors - if (!document.body) return; + if (!document.body) return; var assets = this.findAssetUrlsInMarkup(); for(var i=0;i<assets.length;i++) @@ -873,11 +924,11 @@ if (typeof(Prado.AssetManagerClass)=="undefined") { /** * Extend url to a fully qualified url. - * @param string url + * @param string url */ makeFullUrl: function(url) { - // this is not intended to be a fully blown url "canonicalizator", + // this is not intended to be a fully blown url "canonicalizator", // just to handle the most common and basic asset paths used by Prado if (!this.baseUri) this.baseUri = window.location; @@ -906,7 +957,7 @@ if (typeof(Prado.AssetManagerClass)=="undefined") { /** * Mark asset as being already loaded - * @param string url of the asset + * @param string url of the asset */ markAssetAsLoaded: function(url) { url = this.makeFullUrl(url); @@ -987,7 +1038,7 @@ Prado.ScriptManagerClass = jQuery.klass(Prado.AssetManagerClass, { var urls = new Array(); var scripts = document.getElementsByTagName('script'); for(var i=0;i<scripts.length;i++) - { + { var e = scripts[i]; var src = e.src; if (src!="") urls.push(src); @@ -1011,7 +1062,7 @@ Prado.StyleSheetManagerClass = jQuery.klass(Prado.AssetManagerClass, { var urls = new Array(); var scripts = document.getElementsByTagName('link'); for(var i=0;i<scripts.length;i++) - { + { var e = scripts[i]; var href = e.href; if ((e.rel=="stylesheet") && (href.length>0)) urls.push(href); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js b/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js new file mode 100644 index 00000000..180ceecf --- /dev/null +++ b/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js @@ -0,0 +1,84 @@ +jQuery.noConflict(); + +/** + * TAutoComplete control. + */ +Prado.WebUI.TAutoComplete = Class.create(Autocompleter.Base, Prado.WebUI.TActiveTextBox.prototype); +Prado.WebUI.TAutoComplete = Class.create(Prado.WebUI.TAutoComplete, +{ + initialize : function(options) + { + this.options = options; + this.observers = new Array(); + this.hasResults = false; + this.baseInitialize(options.ID, options.ResultPanel, options); + Object.extend(this.options, + { + onSuccess : this.onComplete.bind(this) + }); + + if(options.AutoPostBack) + this.onInit(options); + + Prado.Registry[options.ID] = this; + }, + + doCallback : function(event, options) + { + if(!this.active) + { + var request = new Prado.CallbackRequest(this.options.EventTarget, options); + request.dispatch(); + Event.stop(event); + } + }, + + //Overrides parent implementation, fires onchange event. + onClick: function(event) + { + var element = Event.findElement(event, 'LI'); + this.index = element.autocompleteIndex; + this.selectEntry(); + this.hide(); + Event.fire(this.element, "change"); + }, + + getUpdatedChoices : function() + { + var options = new Array(this.getToken(),"__TAutoComplete_onSuggest__"); + Prado.Callback(this.options.EventTarget, options, null, this.options); + }, + + /** + * Overrides parent implements, don't update if no results. + */ + selectEntry: function() + { + if(this.hasResults) + { + this.active = false; + this.updateElement(this.getCurrentEntry()); + var options = [this.index, "__TAutoComplete_onSuggestionSelected__"]; + Prado.Callback(this.options.EventTarget, options, null, this.options); + } + }, + + onComplete : function(request, boundary) + { + var result = request.extractContent(boundary); + if(typeof(result) == "string") + { + if(result.length > 0) + { + this.hasResults = true; + this.updateChoices(result); + } + else + { + this.active = false; + this.hasResults = false; + this.hide(); + } + } + } +});
\ No newline at end of file diff --git a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js index 7fa9e791..9e583c1f 100755 --- a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js @@ -1,20 +1,22 @@ +jQuery.noConflict(); + /** * DropContainer control */ - -Prado.WebUI.DropContainer = jQuery.klass(Prado.WebUI.CallbackControl, + +Prado.WebUI.DropContainer = Class.create(Prado.WebUI.CallbackControl, { onInit: function(options) { this.options = options; - Object.extend (this.options, + Object.extend (this.options, { onDrop: this.onDrop.bind(this) }); - + Droppables.add (options.ID, this.options); }, - + onDrop: function(dragElement, dropElement, event) { var elementId=dragElement.id.replace(/clone_/,""); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js index d2a17c8d..66862584 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js @@ -8,13 +8,13 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, this.editField = null; this.readOnly = options.ReadOnly; - this.options = Object.extend( + this.options = jQuery.extend( { LoadTextFromSource : false, TextMode : 'SingleLine' }, options || {}); - this.element = $(this.options.ID); + this.element = jQuery('#'+this.options.ID).get(0); Prado.WebUI.TInPlaceTextBox.register(this); this.createEditorInput(); this.initializeListeners(); @@ -25,10 +25,10 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, */ initializeListeners : function() { - this.onclickListener = this.enterEditMode.bindAsEventListener(this); + this.onclickListener = this.enterEditMode.bind(this); this.observe(this.element, 'click', this.onclickListener); if (this.options.ExternalControl) - this.observe($(this.options.ExternalControl), 'click', this.onclickListener); + this.observe(jQuery('#'+this.options.ExternalControl).get(0), 'click', this.onclickListener); }, /** @@ -45,9 +45,9 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, this.editField.disabled = false; if(this.options.LoadTextOnEdit) this.loadExternalText(); - Prado.Element.focus(this.editField); + jQuery(this.editField).focus(); if (evt) - Event.stop(evt); + evt.preventDefault(); return false; }, @@ -62,14 +62,14 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, showTextBox : function() { - Element.hide(this.element); - Element.show(this.editField); + jQuery(this.element).hide(); + jQuery(this.editField).show(); }, showLabel : function() { - Element.show(this.element); - Element.hide(this.editField); + jQuery(this.element).show(); + jQuery(this.editField).hide(); }, /** @@ -91,8 +91,8 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); request.setCausesValidation(false); request.setCallbackParameter(options); - request.ActiveControl.onSuccess = this.onloadExternalTextSuccess.bind(this); - request.ActiveControl.onFailure = this.onloadExternalTextFailure.bind(this); + request.options.onSuccess = this.onloadExternalTextSuccess.bind(this); + request.options.onFailure = this.onloadExternalTextFailure.bind(this); request.dispatch(); }, @@ -103,41 +103,44 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, { var cssClass= this.element.className || ''; var inputName = this.options.EventTarget; - var options = {'className' : cssClass, name : inputName, id : this.options.TextBoxID}; + if(this.options.TextMode == 'SingleLine') { + this.editField = document.createElement("input"); if(this.options.MaxLength > 0) - options['maxlength'] = this.options.MaxLength; + this.editField.maxlength = this.options.MaxLength; if(this.options.Columns > 0) - options['size'] = this.options.Columns; - this.editField = INPUT(options); + this.editField.size = this.options.Columns; } else { + this.editField = document.createElement("textarea"); if(this.options.Rows > 0) - options['rows'] = this.options.Rows; + this.editField.rows = this.options.Rows; if(this.options.Columns > 0) - options['cols'] = this.options.Columns; + this.editField.cols = this.options.Columns; if(this.options.Wrap) - options['wrap'] = 'off'; - this.editField = TEXTAREA(options); + this.editField.wrap = 'off'; } + this.editField.className = cssClass; + this.editField.name = inputName; + this.editField.id = this.options.TextBoxID; this.editField.style.display="none"; - this.element.parentNode.insertBefore(this.editField,this.element) - + this.element.parentNode.insertBefore(this.editField, this.element) + //handle return key within single line textbox if(this.options.TextMode == 'SingleLine') { this.observe(this.editField, "keydown", function(e) { - if(Event.keyCode(e) == Event.KEY_RETURN) + if(e.keyCode == 13) //KEY_RETURN { - var target = Event.element(e); + var target = e.target; if(target) { - Event.fireEvent(target, "blur"); - Event.stop(e); + jQuery(target).trigger("blur"); + e.preventDefault(); } } }); @@ -183,15 +186,16 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, onKeyPressed : function(e) { - if (Event.keyCode(e) == Event.KEY_ESC) + if (e.keyCode == 27) //KEY_ESC { this.editField.value = this.getText(); this.isEditing = false; if(this.options.AutoHide) this.showLabel(); } - else if (Event.keyCode(e) == Event.KEY_RETURN && this.options.TextMode != 'MultiLine') - Event.stop(e); + else if (e.keyCode == 13 // KEY_RETURN + && this.options.TextMode != 'MultiLine') + e.preventDefault() }, /** @@ -202,8 +206,8 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, { var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); request.setCallbackParameter(text); - request.ActiveControl.onSuccess = this.onTextChangedSuccess.bind(this); - request.ActiveControl.onFailure = this.onTextChangedFailure.bind(this); + request.options.onSuccess = this.onTextChangedSuccess.bind(this); + request.options.onFailure = this.onTextChangedFailure.bind(this); if(request.dispatch()) { this.isSaving = true; @@ -224,7 +228,7 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, this.isEditing = true; this.editField.disabled = false; this.editField.value = this.getText(); - Prado.Element.focus(this.editField); + jQuery(this.editField).focus(); if(typeof(this.options.onSuccess)=="function") this.options.onSuccess(sender,parameter); }, @@ -266,7 +270,7 @@ Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control, }); -Object.extend(Prado.WebUI.TInPlaceTextBox, +jQuery.extend(Prado.WebUI.TInPlaceTextBox, { //class methods diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js index 29c9e3d4..15998278 100755 --- a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js +++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js @@ -4,21 +4,21 @@ Prado.WebUI.TActiveFileUpload = jQuery.klass(Prado.WebUI.Control, { this.options = options || {}; Prado.WebUI.TActiveFileUpload.register(this); - - this.input = $('#'+options.inputID).get(0); - this.flag = $('#'+options.flagID).get(0); - this.form = $('#'+options.formID).get(0); - - this.indicator = $('#'+options.indicatorID).get(0); - this.complete = $('#'+options.completeID).get(0); - this.error = $('#'+options.errorID).get(0); - + + this.input = jQuery('#'+options.inputID).get(0); + this.flag = jQuery('#'+options.flagID).get(0); + this.form = jQuery('#'+options.formID).get(0); + + this.indicator = jQuery('#'+options.indicatorID).get(0); + this.complete = jQuery('#'+options.completeID).get(0); + this.error = jQuery('#'+options.errorID).get(0); + // set up events if (options.autoPostBack){ this.observe(this.input,"change",this.fileChanged.bind(this)); } }, - + fileChanged : function(){ // show the upload indicator, and hide the complete and error indicators (if they areSn't already). this.flag.value = '1'; @@ -43,7 +43,7 @@ Prado.WebUI.TActiveFileUpload = jQuery.klass(Prado.WebUI.Control, this.form.method = this.oldFormMethod; this.form.enctype = this.oldFormEnctype; }, - + finishUpload : function(options){ if (this.options.targetID == options.targetID) @@ -82,7 +82,7 @@ Prado.WebUI.TActiveFileUpload = jQuery.klass(Prado.WebUI.Control, }); -jQuery.extend(Prado.WebUI.TActiveFileUpload, +jQuery.extend(Prado.WebUI.TActiveFileUpload, { //class methods @@ -92,12 +92,12 @@ jQuery.extend(Prado.WebUI.TActiveFileUpload, { Prado.WebUI.TActiveFileUpload.controls[control.options.ID] = control; }, - + onFileUpload : function(options) { Prado.WebUI.TActiveFileUpload.controls[options.clientID].finishUpload(options); }, - + fileChanged : function(controlID){ Prado.WebUI.TActiveFileUpload.controls[controlID].fileChanged(); } diff --git a/framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js b/framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js index 54680922..9915eb81 100644 --- a/framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js +++ b/framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js @@ -93,7 +93,7 @@ Rico.Color.prototype = { toColorPart: function(number) { number = (number > 255 ? 255 : (number < 0 ? 0 : number)); var hex = number.toString(16); - return hex.length < 2 ? "0" + hex : hex; + return hex.length < 2 ? "0" + hex : hex; } }; @@ -265,13 +265,13 @@ Prado.WebUI.TColorPicker = jQuery.klass(Prado.WebUI.Control, { options = jQuery.extend(basics, options); this.options = options; - this.input = $('#'+options['ID']).get(0); - this.button = $('#'+options['ID']+'_button').get(0); + this.input = jQuery('#'+options['ID']).get(0); + this.button = jQuery('#'+options['ID']+'_button').get(0); this._buttonOnClick = jQuery.proxy(this.buttonOnClick, this); if(options['ShowColorPicker']) this.observe(this.button, "click", this._buttonOnClick); this.observe(this.input, "change", jQuery.proxy(this.updatePicker, this)); - + Prado.Registry[options.ID] = this; }, diff --git a/framework/Web/Javascripts/source/prado/controls/accordion.js b/framework/Web/Javascripts/source/prado/controls/accordion.js index 28075cd6..084aef7f 100644 --- a/framework/Web/Javascripts/source/prado/controls/accordion.js +++ b/framework/Web/Javascripts/source/prado/controls/accordion.js @@ -1,8 +1,9 @@ -/* Simple Accordion Script +/* Simple Accordion Script * Requires Prototype and Script.aculo.us Libraries * By: Brian Crescimanno <brian.crescimanno@gmail.com> * http://briancrescimanno.com * Adapted to Prado & minor improvements: Gabor Berczi <gabor.berczi@devworx.hu> + * jQuery port by Bas Fabio <ctrlaltca@gmail.com> * This work is licensed under the Creative Commons Attribution-Share Alike 3.0 * http://creativecommons.org/licenses/by-sa/3.0/us/ */ @@ -11,9 +12,9 @@ Prado.WebUI.TAccordion = jQuery.klass(Prado.WebUI.Control, { onInit : function(options) { - this.accordion = $(options.ID); + this.accordion = jQuery('#'+options.ID).get(0); this.options = options; - this.hiddenField = $(options.ID+'_1'); + this.hiddenField = jQuery('#'+options.ID+'_1').get(0); if (this.options.maxHeight) { @@ -29,15 +30,15 @@ Prado.WebUI.TAccordion = jQuery.klass(Prado.WebUI.Control, var i = 0; for(var view in this.options.Views) { - var header = $(view+'_0'); + var header = jQuery('#'+view+'_0').get(0); if(header) { this.observe(header, "click", jQuery.proxy(this.elementClicked,this,view)); if(this.hiddenField.value == i) { this.currentView = view; - if($(this.currentView).getHeight() != this.maxHeight) - $(this.currentView).setStyle({height: this.maxHeight+"px"}); + if(jQuery('#'+this.currentView).height() != this.maxHeight) + jQuery('#'+this.currentView).css({height: this.maxHeight+"px"}); } } i++; @@ -48,38 +49,20 @@ Prado.WebUI.TAccordion = jQuery.klass(Prado.WebUI.Control, { for(var viewID in this.options.Views) { - var view = $(viewID); - if(view.getHeight() > this.maxHeight) - this.maxHeight = view.getHeight(); + var view = jQuery('#'+viewID); + if(view.height() > this.maxHeight) + this.maxHeight = view.height(); } }, - elementClicked : function(event,viewID) - { - // dummy effect to force processing of click into the event queue - // is not actually supposed to change the appearance of the accordion - var obj = this; - new Effect.Opacity( - this.element, - { - from: 1.0, to: 1.0, duration: 0.0, - queue: { - position: 'end', - scope: 'accordion' - }, - afterFinish: function() { obj.processElementClick(event, viewID); } - } - ); - }, - - processElementClick : function(event,viewID) + elementClicked : function(viewID, event) { var i = 0; for(var index in this.options.Views) { - if ($(index)) + if (jQuery('#'+index).get(0)) { - var header = $(index+'_0'); + var header = jQuery('#'+index+'_0').get(0); if(index == viewID) { this.oldView = this.currentView; @@ -96,75 +79,31 @@ Prado.WebUI.TAccordion = jQuery.klass(Prado.WebUI.Control, { this.animate(); } else { - $(this.currentView).setStyle({ height: this.maxHeight+"px" }); - $(this.currentView).show(); - $(this.oldView).hide(); - - var oldHeader = $(this.oldView+'_0'); - var currentHeader = $(this.currentView+'_0'); - oldHeader.className=this.options.HeaderCssClass; - currentHeader.className=this.options.ActiveHeaderCssClass; + jQuery('#'+this.currentView).css({ height: this.maxHeight+"px" }); + jQuery('#'+this.currentView).show(); + jQuery('#'+this.oldView).hide(); + + jQuery('#'+this.oldView+'_0').removeClass().addClass(this.options.HeaderCssClass); + jQuery('#'+this.currentView+'_0').removeClass().addClass(this.options.ActiveHeaderCssClass); } } }, animate: function() { - var effects = new Array(); - var options = { - sync: true, - queue: { - position: 'end', - scope: 'accordion' - }, - scaleFrom: 0, - scaleContent: false, - transition: Effect.Transitions.sinoidal, - scaleMode: { - originalHeight: this.maxHeight, - originalWidth: this.accordion.getWidth() - }, - scaleX: false, - scaleY: true - }; - - effects.push(new Effect.Scale(this.currentView, 100, options)); - - options = { - sync: true, - queue: { - position: 'end', - scope: 'accordion' - }, - scaleContent: false, - transition: Effect.Transitions.sinoidal, - scaleX: false, - scaleY: true - }; - - effects.push(new Effect.Scale(this.oldView, 0, options)); - - var oldHeader = $(this.oldView+'_0'); - var currentHeader = $(this.currentView+'_0'); - - new Effect.Parallel(effects, { - duration: this.options.Duration, - fps: 35, - queue: { - position: 'end', - scope: 'accordion' - }, - beforeStart: function() { - $(this.currentView).setStyle({ height: "0px" }); - $(this.currentView).show(); - - oldHeader.className=this.options.HeaderCssClass; - currentHeader.className=this.options.ActiveHeaderCssClass; - }.bind(this), - afterFinish: function() { - $(this.oldView).hide(); - $(this.currentView).setStyle({ height: this.maxHeight+"px" }); - }.bind(this) - }); + jQuery('#'+this.oldView+'_0').removeClass().addClass(this.options.HeaderCssClass); + jQuery('#'+this.currentView+'_0').removeClass().addClass(this.options.ActiveHeaderCssClass); + + jQuery('#'+this.oldView).animate( + {height: 0}, + this.options.Duration, + function() { + jQuery(this).hide() + } + ); + jQuery('#'+this.currentView).css({height: 0}).show().animate( + {height: this.maxHeight+'px'}, + this.options.Duration + ); } }); diff --git a/framework/Web/Javascripts/source/prado/controls/controls.js b/framework/Web/Javascripts/source/prado/controls/controls.js index 0f0b01f4..00a39e66 100644 --- a/framework/Web/Javascripts/source/prado/controls/controls.js +++ b/framework/Web/Javascripts/source/prado/controls/controls.js @@ -60,11 +60,11 @@ Prado.WebUI.Control = jQuery.klass({ // from the old wrapper to this new one (which then could live on, while the old // one could get destroyed), or to copy the new, changed options to the old wrapper, // (which could then left intact to keep working, while this new wrapper could be - // disposed of by exiting its initialization without installing any handlers or + // disposed of by exiting its initialization without installing any handlers or // leaving any references to it) // - // for now this method is simply deinitializing and deregistering the old wrapper, + // for now this method is simply deinitializing and deregistering the old wrapper, // and then registering the new wrapper for the control id if (oldwrapper.deinitialize) @@ -74,7 +74,7 @@ Prado.WebUI.Control = jQuery.klass({ }, /** - * Registers an event observer which will be automatically disposed of when the wrapper + * Registers an event observer which will be automatically disposed of when the wrapper * is deregistered * @param element DOM element reference or id to attach the event handler to * @param string event name to observe @@ -99,7 +99,7 @@ Prado.WebUI.Control = jQuery.klass({ var e = { _element: element, _eventName: eventName, _handler: handler }; var idx = -1; for(var i=0;i<this.observers.length;i++) - { + { var o = this.observers[i]; if ((o._element===element) && (o._eventName===eventName) && (o._handler===handler)) { @@ -109,7 +109,7 @@ Prado.WebUI.Control = jQuery.klass({ } return idx; }, - + /** * Degisters an event observer from the list of automatically disposed handlers @@ -133,11 +133,11 @@ Prado.WebUI.Control = jQuery.klass({ * wrapper hasn't been destroyed in the meantime * @param code function or code snippet to execute * @param int number of milliseconds to wait before executing - * @return int unique ID that can be used to cancel the scheduled execution + * @return int unique ID that can be used to cancel the scheduled execution */ setTimeout: function(func, delay) { - if (!jQuery.isFunction(func)) + if (!jQuery.isFunction(func)) { var expr = func; func = function() { return eval(expr); } @@ -209,11 +209,11 @@ Prado.WebUI.Control = jQuery.klass({ this.onDone(); // automatically stop all intervals - while (this.intervals.length>0) + while (this.intervals.length>0) window.clearInterval(this.intervals.pop()); // automatically deregister all installed observers - while (this.observers.length>0) + while (this.observers.length>0) { var e = this.observers.pop(); jQuery(e._element).unbind(e._eventName, e._handler); @@ -235,7 +235,7 @@ Prado.WebUI.PostBackControl = jQuery.klass(Prado.WebUI.Control, { { this._elementOnClick = null; - if (!this.element) + if (!this.element) debugger; // element not found else { @@ -284,17 +284,17 @@ Prado.WebUI.TImageMap = jQuery.klass(Prado.WebUI.PostBackControl); * TImageButton client-side behaviour. With validation, Firefox needs * to capture the x,y point of the clicked image in hidden form fields. */ -Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl, +Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl, { /** * Override parent onPostBack function, tried to add hidden forms * inputs to capture x,y clicked point. */ - onPostBack : function(event, options) + onPostBack : function(options, event) { - this.addXYInput(event,options); - new Prado.PostBack(event, options); - this.removeXYInput(event,options); + this.addXYInput(options, event); + new Prado.PostBack(options, event); + this.removeXYInput(options, event); }, /** @@ -302,7 +302,7 @@ Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl, * @param event DOM click event. * @param array image button options. */ - addXYInput : function(event,options) + addXYInput : function(options, event) { var imagePos = jQuery(this.element).offset(); var clickedPos = [event.clientX, event.clientY]; @@ -335,7 +335,7 @@ Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl, * @param event DOM click event. * @param array image button options. */ - removeXYInput : function(event,options) + removeXYInput : function(options, event) { var id = this.element.id; jQuery('#'+id+'_x').remove(); @@ -351,7 +351,7 @@ Prado.WebUI.TRadioButton = jQuery.klass(Prado.WebUI.PostBackControl, { initialize : function($super, options) { - this.element = $("#" + options['ID']).get(0); + this.element = jQuery("#" + options['ID']).get(0); if(this.element) { if(!this.element.checked) @@ -386,14 +386,14 @@ Prado.WebUI.TTextBox = jQuery.klass(Prado.WebUI.PostBackControl, { if(this.options['AutoPostBack']==true) { - $(target).trigger( "change" ); + jQuery(target).trigger( "change" ); e.stopPropagation(); } else { if(this.options['CausesValidation'] && typeof(Prado.Validation) != "undefined") { - if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], $(this.options['ID']))) + if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], jQuery(this.options['ID']))) return e.stopPropagation(); } } @@ -432,10 +432,10 @@ Prado.WebUI.DefaultButton = jQuery.klass(Prado.WebUI.Control, var isTextArea = ev.target.tagName.toLowerCase() == "textarea"; var isHyperLink = ev.target.tagName.toLowerCase() == "a" && ev.target.hasAttribute("href"); var isValidButton = ev.target.tagName.toLowerCase() == "input" && ev.target.type.toLowerCase() == "submit"; - + if(enterPressed && !isTextArea && !isValidButton && !isHyperLink) { - var defaultButton = $('#'+this.options['Target']); + var defaultButton = jQuery('#'+this.options['Target']); if(defaultButton) { this.triggered = true; @@ -496,16 +496,15 @@ jQuery.klass(Prado.WebUI.TTextHighlighter, Prado.WebUI.TCheckBoxList = jQuery.klass(Prado.WebUI.Control, { - constructor : function(options) + onInit : function(options) { - Prado.Registry.set(options.ListID, this); for(var i = 0; i<options.ItemCount; i++) { - var checkBoxOptions = jQuery.extend( + var checkBoxOptions = jQuery.extend({}, options, { - ID : options.ListID+"_c"+i, + ID : options.ID+"_c"+i, EventTarget : options.ListName+"$c"+i - }, options); + }); new Prado.WebUI.TCheckBox(checkBoxOptions); } } @@ -513,16 +512,15 @@ Prado.WebUI.TCheckBoxList = jQuery.klass(Prado.WebUI.Control, Prado.WebUI.TRadioButtonList = jQuery.klass(Prado.WebUI.Control, { - constructor : function(options) + onInit : function(options) { - Prado.Registry.set(options.ListID, this); for(var i = 0; i<options.ItemCount; i++) { - var radioButtonOptions = jQuery.extend( + var radioButtonOptions = jQuery.extend({}, options, { - ID : options.ListID+"_c"+i, + ID : options.ID+"_c"+i, EventTarget : options.ListName+"$c"+i - }, options); + }); new Prado.WebUI.TRadioButton(radioButtonOptions); } } diff --git a/framework/Web/Javascripts/source/prado/controls/htmlarea.js b/framework/Web/Javascripts/source/prado/controls/htmlarea.js index 819e853c..7bf820ab 100644 --- a/framework/Web/Javascripts/source/prado/controls/htmlarea.js +++ b/framework/Web/Javascripts/source/prado/controls/htmlarea.js @@ -1,6 +1,6 @@ /* - * + * * HtmlArea (tinyMCE) wrapper * * @author Gabor Berczi <gabor.berczi@devworx.hu> @@ -24,7 +24,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, this.registerInstance(); }, - + registerInstance: function() @@ -38,7 +38,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, { // we're in a callback // try it again in some time, as tinyMCE is most likely still loading - this.setTimeout(this.registerInstance.bind(this), 50); + this.setTimeout(this.registerInstance.bind(this), 50); return; } throw "TinyMCE libraries must be loaded first"; @@ -62,7 +62,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, } } }, - + compressedScriptsLoaded: function() { Prado.WebUI.THtmlArea.tinyMCELoadState = 255; @@ -119,14 +119,14 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, if (prev) try { - tinyMCE.execCommand('mceFocus', false, this.ID); + tinyMCE.execCommand('mceFocus', false, this.ID); // when removed, tinyMCE restores its content to the textarea. If the textarea content has been // updated in this same callback, it will be overwritten with the old content. Workaround this. - var curtext = $('#'+this.ID).get(0).value; + var curtext = jQuery('#'+this.ID).get(0).value; tinyMCE.execCommand('mceRemoveControl', false, this.ID); - $('#'+this.ID).get(0).value = curtext; + jQuery('#'+this.ID).get(0).value = curtext; } - catch (e) + catch (e) { // suppress error here in case editor can't be properly removed // (happens when <textarea> has been removed from DOM tree without deinitialzing the tinyMCE editor first) @@ -139,7 +139,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, } }); -jQuery.extend(Prado.WebUI.THtmlArea, +jQuery.extend(Prado.WebUI.THtmlArea, { pendingRegistrations : [], tinyMCELoadState : 0 diff --git a/framework/Web/Javascripts/source/prado/controls/htmlarea4.js b/framework/Web/Javascripts/source/prado/controls/htmlarea4.js index 418a6e19..64a78176 100644 --- a/framework/Web/Javascripts/source/prado/controls/htmlarea4.js +++ b/framework/Web/Javascripts/source/prado/controls/htmlarea4.js @@ -1,6 +1,6 @@ /* - * + * * HtmlArea (tinyMCE 4) wrapper * * @author Gabor Berczi <gabor.berczi@devworx.hu> @@ -39,14 +39,14 @@ Prado.WebUI.THtmlArea4 = jQuery.klass(Prado.WebUI.Control, if (prev) try { - tinyMCE.execCommand('mceFocus', false, this.ID); + tinyMCE.execCommand('mceFocus', false, this.ID); // when removed, tinyMCE restores its content to the textarea. If the textarea content has been // updated in this same callback, it will be overwritten with the old content. Workaround this. - // var curtext = $(this.ID).html(); + // var curtext = jQuery(this.ID).html(); tinyMCE.execCommand('mceRemoveControl', false, this.ID); - // $(this.ID).html(curtext); + // jQuery(this.ID).html(curtext); } - catch (e) + catch (e) { // suppress error here in case editor can't be properly removed // (happens when <textarea> has been removed from DOM tree without deinitialzing the tinyMCE editor first) diff --git a/framework/Web/Javascripts/source/prado/controls/slider.js b/framework/Web/Javascripts/source/prado/controls/slider.js index 28d7d4ac..e18fde84 100644 --- a/framework/Web/Javascripts/source/prado/controls/slider.js +++ b/framework/Web/Javascripts/source/prado/controls/slider.js @@ -9,33 +9,33 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, { var slider = this; this.options=options || {}; - this.track = $('#'+options.ID+'_track').get(0); - this.handle =$('#'+options.ID+'_handle').get(0); - this.progress = $('#'+options.ID+'_progress').get(0); + this.track = jQuery('#'+options.ID+'_track').get(0); + this.handle =jQuery('#'+options.ID+'_handle').get(0); + this.progress = jQuery('#'+options.ID+'_progress').get(0); this.axis = this.options.axis || 'horizontal'; this.range = this.options.range || [0, 1]; this.value = 0; this.maximum = this.options.maximum || this.range[1]; this.minimum = this.options.minimum || this.range[0]; - this.hiddenField=$('#'+this.options.ID+'_1').get(0); - + this.hiddenField=jQuery('#'+this.options.ID+'_1').get(0); + // Will be used to align the handle onto the track, if necessary this.alignX = parseInt(this.options.alignX || - this.track.offsetLeft); this.alignY = parseInt(this.options.alignY || - this.track.offsetTop); - + this.trackLength = this.maximumOffset() - this.minimumOffset(); - this.handleLength = this.isVertical() ? - (this.handle.offsetHeight != 0 ? - this.handle.offsetHeight : this.handles.style.height.replace(/px$/,"")) : - (this.handle.offsetWidth != 0 ? this.handle.offsetWidth : + this.handleLength = this.isVertical() ? + (this.handle.offsetHeight != 0 ? + this.handle.offsetHeight : this.handles.style.height.replace(/px$/,"")) : + (this.handle.offsetWidth != 0 ? this.handle.offsetWidth : this.handle.style.width.replace(/px$/,"")); - + this.active = false; this.dragging = false; this.disabled = false; if(this.options.disabled) this.setDisabled(); - + // Allowed values array this.allowedValues = this.options.values ? this.options.values.sort() : false; if(this.allowedValues) { @@ -50,15 +50,15 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, // Initialize handle this.setValue(parseFloat(slider.options.sliderValue)); this.observe (this.handle, "mousedown", this.eventMouseDown); - + this.observe (this.track, "mousedown", this.eventMouseDown); if (this.progress) this.observe (this.progress, "mousedown", this.eventMouseDown); - + this.observe (document, "mouseup", this.eventMouseUp); this.observe (document, "mousemove", this.eventMouseMove); - + this.initialized=true; - + if(this.options['AutoPostBack']==true) this.observe(this.hiddenField, "change", jQuery.proxy(this.doPostback,this,options)); }, @@ -67,20 +67,20 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, { new Prado.PostBack(options, event); }, - + setDisabled: function(){ this.disabled = true; }, setEnabled: function(){ this.disabled = false; - }, + }, getNearestValue: function(value){ if(this.allowedValues){ var max = Math.max.apply( Math, this.allowedValues ); var min = Math.min.apply( Math, this.allowedValues ); if(value >= max) return(max); if(value <= min) return(min); - + var offset = Math.abs(this.allowedValues[0] - value); var newValue = this.allowedValues[0]; jQuery.each(this.allowedValues, function(idx, v) { @@ -88,7 +88,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, if(currentOffset <= offset){ newValue = v; offset = currentOffset; - } + } }); return newValue; } @@ -96,7 +96,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, if(value < this.range[0]) return this.range[0]; return value; }, - + setValue: function(sliderValue){ if(!this.active) { this.updateStyles(); @@ -106,47 +106,47 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, this.handle.style[this.isVertical() ? 'top' : 'left'] = pixelValue; if (this.progress) this.progress.style[this.isVertical() ? 'height' : 'width'] = pixelValue; - + //this.drawSpans(); if(!this.dragging || !this.event) this.updateFinished(); }, - + setValueBy: function(delta) { this.setValue(this.value + delta); }, - + translateToPx: function(value) { return Math.round( ((this.trackLength-this.handleLength)/(this.range[1]-this.range[0])) * (value - this.range[0])) + "px"; }, - + translateToValue: function(offset) { return ((offset/(this.trackLength-this.handleLength) * (this.range[1]-this.range[0])) + this.range[0]); }, - + minimumOffset: function(){ return(this.isVertical() ? this.alignY : this.alignX); }, - + maximumOffset: function(){ - return(this.isVertical() ? + return(this.isVertical() ? (this.track.offsetHeight != 0 ? this.track.offsetHeight : - this.track.style.height.replace(/px$/,"")) - this.alignY : - (this.track.offsetWidth != 0 ? this.track.offsetWidth : + this.track.style.height.replace(/px$/,"")) - this.alignY : + (this.track.offsetWidth != 0 ? this.track.offsetWidth : this.track.style.width.replace(/px$/,"")) - this.alignX); }, - + isVertical: function(){ return (this.axis == 'vertical'); }, - + updateStyles: function() { - if (this.active) + if (this.active) jQuery(this.handle).addClass('selected'); else jQuery(this.handle).removeClass('selected'); }, - + startDrag: function(event) { if (event.which === 1) { // left click @@ -158,7 +158,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, if(track==this.track) { var offsets = jQuery(this.track).offset(); this.event = event; - this.setValue(this.translateToValue( + this.setValue(this.translateToValue( (this.isVertical() ? pointer[1]-offsets['top'] : pointer[0]-offsets['left'])-(this.handleLength/2) )); var offsets = jQuery(this.handle).offset(); @@ -174,7 +174,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, event.stopPropagation(); } }, - + update: function(event) { if(this.active) { if(!this.dragging) this.dragging = true; @@ -182,7 +182,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, event.stopPropagation(); } }, - + draw: function(event) { var pointer = [event.pageX, event.pageY]; var offsets = jQuery(this.track).offset(); @@ -193,7 +193,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, if(this.initialized && this.options.onSlide) this.options.onSlide(this.value, this); }, - + endDrag: function(event) { if(this.active && this.dragging) { this.finishDrag(event, true); @@ -201,18 +201,18 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl, } this.active = false; this.dragging = false; - }, - + }, + finishDrag: function(event, success) { this.active = false; this.dragging = false; this.updateFinished(); }, - + updateFinished: function() { this.hiddenField.value=this.value; this.updateStyles(); - if(this.initialized && this.options.onChange) + if(this.initialized && this.options.onChange) this.options.onChange(this.value, this); this.event = null; if (this.options['AutoPostBack']==true) diff --git a/framework/Web/Javascripts/source/prado/controls/tabpanel.js b/framework/Web/Javascripts/source/prado/controls/tabpanel.js index 78f6478c..866e45fb 100644 --- a/framework/Web/Javascripts/source/prado/controls/tabpanel.js +++ b/framework/Web/Javascripts/source/prado/controls/tabpanel.js @@ -4,7 +4,7 @@ Prado.WebUI.TTabPanel = jQuery.klass(Prado.WebUI.Control, { this.views = options.Views; this.viewsvis = options.ViewsVis; - this.hiddenField = $("#"+options.ID+'_1').get(0); + this.hiddenField = jQuery("#"+options.ID+'_1').get(0); this.activeCssClass = options.ActiveCssClass; this.normalCssClass = options.NormalCssClass; var length = options.Views.length; @@ -18,10 +18,10 @@ Prado.WebUI.TTabPanel = jQuery.klass(Prado.WebUI.Control, if (options.AutoSwitch) this.observe(element, "mouseenter", jQuery.proxy(this.elementClicked,this,item)); } - + if(element) { - var view = $("#"+options.Views[i]).get(0); + var view = jQuery("#"+options.Views[i]).get(0); if (view) if(this.hiddenField.value == i) { diff --git a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js index bca801b9..012f2ef8 100644 --- a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js +++ b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js @@ -22,18 +22,18 @@ Prado.WebUI.TDatePicker = jQuery.klass(Prado.WebUI.Control, onInit : function(options) { this.options = options || []; - this.control = $('#'+options.ID).get(0); + this.control = jQuery('#'+options.ID).get(0); this.dateSlot = new Array(42); this.weekSlot = new Array(6); this.minimalDaysInFirstWeek = 4; this.positionMode = 'Bottom'; - + Prado.Registry[options.ID] = this; //which element to trigger to show the calendar if(this.options.Trigger) { - this.trigger = $('#'+this.options.Trigger).get(0); + this.trigger = jQuery('#'+this.options.Trigger).get(0); var triggerEvent = this.options.TriggerEvent || "click"; } else @@ -41,7 +41,7 @@ Prado.WebUI.TDatePicker = jQuery.klass(Prado.WebUI.Control, this.trigger = this.control; var triggerEvent = this.options.TriggerEvent || "focus"; } - + // Popup position if(this.options.PositionMode == 'Top') { @@ -51,16 +51,16 @@ Prado.WebUI.TDatePicker = jQuery.klass(Prado.WebUI.Control, jQuery.extend(this,options); // generate default date _after_ extending options this.selectedDate = this.newDate(); - + this.observe(this.trigger, triggerEvent, jQuery.proxy(this.show,this)); - + // Listen to change event if needed if (typeof(this.options.OnDateChanged) == "function") { if(this.options.InputMode == "TextBox") { this.observe(this.control, "change", jQuery.proxy(this.onDateChanged,this)); - } + } else { var day = Prado.WebUI.TDatePicker.getDayListControl(this.control); @@ -69,10 +69,10 @@ Prado.WebUI.TDatePicker = jQuery.klass(Prado.WebUI.Control, this.observe (day, "change", jQuery.proxy(this.onDateChanged,this)); this.observe (month, "change", jQuery.proxy(this.onDateChanged,this)); this.observe (year, "change", jQuery.proxy(this.onDateChanged,this)); - + } - - + + } }, @@ -407,7 +407,7 @@ Prado.WebUI.TDatePicker = jQuery.klass(Prado.WebUI.Control, if (this.options.InputMode == "TextBox") { date=this.control.value; - } + } else { var day = Prado.WebUI.TDatePicker.getDayListControl(this.control).selectedIndex+1; @@ -438,9 +438,9 @@ Prado.WebUI.TDatePicker = jQuery.klass(Prado.WebUI.Control, else jQuery(element).trigger("change"); }, - + onChange : function(ref, date, capevents) - { + { if(this.options.InputMode == "TextBox") { this.control.value = this.formatDate(); @@ -587,7 +587,7 @@ Prado.WebUI.TDatePicker = jQuery.klass(Prado.WebUI.Control, } this.observe(document,"keydown", this.documentKeyDownEvent); this.showing = true; - + if(this.positionMode=='Top') { this._calDiv.style.top = ((pos[1]-1) - this.getDatePickerOffsetHeight() - this._calDiv.offsetHeight) + 'px'; @@ -744,16 +744,16 @@ jQuery.extend(Prado.WebUI.TDatePicker, getYearListControl : function(control) { - return $('#'+control.id+"_year").get(0); + return jQuery('#'+control.id+"_year").get(0); }, getMonthListControl : function(control) { - return $('#'+control.id+"_month").get(0); + return jQuery('#'+control.id+"_month").get(0); }, getDayListControl : function(control) { - return $('#'+control.id+"_day").get(0); + return jQuery('#'+control.id+"_day").get(0); } });
\ No newline at end of file diff --git a/framework/Web/Javascripts/source/prado/prado.js b/framework/Web/Javascripts/source/prado/prado.js index 2e3ffbaa..1d69a034 100644 --- a/framework/Web/Javascripts/source/prado/prado.js +++ b/framework/Web/Javascripts/source/prado/prado.js @@ -1,11 +1,11 @@ /* * Low Pro JQ * ---------- - * + * * Author: Dan Webb (dan@danwebb.net) * GIT: github.com:danwrong/low-pro-for-jquery.git * Download: http://github.com/danwrong/low-pro-for-jquery/tree/master/src/lowpro.jquery.js?raw=true - * + * * A jQuery port of the Low Pro behavior framework that was originally written for Prototype. * * Prado actually uses it as a base to emulate OOP subclassing, inheritance and contructor events. @@ -185,9 +185,9 @@ Remote.Link = $.klass(Remote.Base, { onclick: function(e) { - var options = $.extend({ - url: $(this).attr('href'), - type: 'GET' + var options = $.extend({ + url: $(this).attr('href'), + type: 'GET' }, this.options); return e.data.behavior._makeRequest(e.data.behavior.options); } @@ -203,9 +203,9 @@ onsubmit: function(e) { var elm = $(this), data = elm.serializeArray(); - if (e.data.behavior._submitButton) data.push({ - name: e.data.behavior._submitButton.name, - value: e.data.behavior._submitButton.value + if (e.data.behavior._submitButton) data.push({ + name: e.data.behavior._submitButton.name, + value: e.data.behavior._submitButton.value }); var options = $.extend({ @@ -241,7 +241,7 @@ var Prado = * @var Version */ Version: '3.2.3', - + /** * Registry for Prado components * @var Registry @@ -249,7 +249,7 @@ var Prado = Registry: {}, }; -Prado.RequestManager = +Prado.RequestManager = { FIELD_POSTBACK_TARGET : 'PRADO_POSTBACK_TARGET', @@ -262,8 +262,8 @@ Prado.RequestManager = * @param event - Event that triggered this postback * @... {string} FormID - Form that should be posted back * @... {optional boolean} CausesValidation - Validate before PostBack if true - * @... {optional string} ValidationGroup - Group to Validate - * @... {optional string} ID - Validation ID + * @... {optional string} ValidationGroup - Group to Validate + * @... {optional string} ID - Validation ID * @... {optional string} PostBackUrl - Postback URL * @... {optional boolean} TrackFocus - Keep track of focused element if true * @... {string} EventTarget - Id of element that triggered PostBack @@ -289,7 +289,7 @@ Prado.PostBack = jQuery.klass( var form = this.getForm(); if(this.options['CausesValidation'] && typeof(Prado.Validation) != "undefined") { - if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], $("#" + this.options['ID']))) + if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], jQuery("#" + this.options['ID']))) return event.preventDefault(); } @@ -298,7 +298,7 @@ Prado.PostBack = jQuery.klass( if(this.options['TrackFocus']) { - var lastFocus = $('PRADO_LASTFOCUS'); + var lastFocus = jQuery('#PRADO_LASTFOCUS'); if(lastFocus) { var active = document.activeElement; //where did this come from @@ -356,7 +356,7 @@ Prado.Element = * @param {string} element - Element id * @param {string} method - Name of any {@link Prado.Element.Selection} method * @param {array|boolean|string} value - Values that should be selected - * @param {int} total - Number of elements + * @param {int} total - Number of elements */ select : function(element, method, value, total) { @@ -407,16 +407,16 @@ Prado.Element = offset : 50 }; jQuery.extend(op, options || {}); - $('html, body').animate({ - scrollTop: $("#"+element).offset().top - op.offset + jQuery('html, body').animate({ + scrollTop: jQuery("#"+element).offset().top - op.offset }, op.duration); }, /** - * Sets the options for a select element. + * Sets the options for a select element. * @function ? * @param {string} element - Element id - * @param {array[]} options - Array of options, each an array of structure + * @param {array[]} options - Array of options, each an array of structure * [ "optionText" , "optionValue" , "optionGroup" ] */ setOptions : function(element, options) @@ -436,9 +436,9 @@ Prado.Element = }, /** - * Create opt-group options from an array of options. + * Create opt-group options from an array of options. * @function {array} ? - * @param {array[]} options - Array of options, each an array of structure + * @param {array[]} options - Array of options, each an array of structure * [ "optionText" , "optionValue" , "optionGroup" ] * @returns Array of option DOM elements */ @@ -599,7 +599,7 @@ Prado.Element.Selection = /** * Set selected attribute for elements options by value. * If value is boolean, all elements options selected attribute will be set - * to value. Otherwhise all options that have the given value will be selected. + * to value. Otherwhise all options that have the given value will be selected. * @function ? * @param {element[]} elements - Array of selectable DOM elements * @param {boolean|string} value - Value of options that should be selected or boolean value of selection status @@ -735,7 +735,7 @@ Prado.Element.Selection = var el; for(var i = 0; i < total; i++) { - el = $("#"+element+"_c"+i).get(0); + el = jQuery("#"+element+"_c"+i).get(0); if(el) elements.push(el); } @@ -744,12 +744,12 @@ Prado.Element.Selection = /** * Set checked attribute of elements by value. - * If value is boolean, checked attribute will be set to value. - * Otherwhise all elements that have the given value will be checked. + * If value is boolean, checked attribute will be set to value. + * Otherwhise all elements that have the given value will be checked. * @function ? * @param {element[]} elements - Array of checkable DOM elements * @param {boolean|String} value - Value that should be checked or boolean value of checked status - * + * */ checkValue : function(elements, value) { @@ -767,7 +767,7 @@ Prado.Element.Selection = * @function ? * @param {element[]} elements - Array of checkable DOM elements * @param {string[]} values - Values that should be checked - * + * */ checkValues : function(elements, values) { @@ -928,7 +928,7 @@ jQuery.extend(String.prototype, { /** * Convert period separated function names into a function reference. * <br />Example: - * <pre> + * <pre> * "Prado.AJAX.Callback.Action.setValue".toFunction() * </pre> * @function {function} ? diff --git a/framework/Web/Javascripts/source/prado/ratings/ratings.js b/framework/Web/Javascripts/source/prado/ratings/ratings.js index 1369c740..eb541b99 100644 --- a/framework/Web/Javascripts/source/prado/ratings/ratings.js +++ b/framework/Web/Javascripts/source/prado/ratings/ratings.js @@ -1,78 +1,67 @@ -Prado.WebUI.TRatingList = Base.extend( +Prado.WebUI.TRatingList = jQuery.klass(Prado.WebUI.Control, { selectedIndex : -1, rating: -1, readOnly : false, - constructor : function(options) + onInit : function(options) { - var cap = $(options.CaptionID); - this.options = Object.extend( + var cap = $('#'+options.CaptionID).get(0); + this.options = jQuery.extend( { caption : cap ? cap.innerHTML : '' }, options || {}); - Prado.WebUI.TRatingList.register(this); - this._init(); - Prado.Registry.set(options.ListID, this); - this.selectedIndex = options.SelectedIndex; - this.rating = options.Rating; - this.readOnly = options.ReadOnly - if(options.Rating <= 0 && options.SelectedIndex >= 0) - this.rating = options.SelectedIndex+1; - this.setReadOnly(this.readOnly); - }, + this.radios = []; - _init: function(options) - { - Element.addClassName($(this.options.ListID),this.options.Style); - this.radios = new Array(); - this._mouseOvers = new Array(); - this._mouseOuts = new Array(); - this._clicks = new Array(); - var index=0; - for(var i = 0; i<this.options.ItemCount; i++) + $('#'+options.ID).addClass(options.Style); + for(var i = 0; i<options.ItemCount; i++) { - var radio = $(this.options.ListID+'_c'+i); + var radio = $('#'+options.ID+"_c"+i).get(0); var td = radio.parentNode.parentNode; + if(radio && td.tagName.toLowerCase()=='td') { this.radios.push(radio); - this._mouseOvers.push(this.hover.bindEvent(this,index)); - this._mouseOuts.push(this.recover.bindEvent(this,index)); - this._clicks.push(this.click.bindEvent(this,index)); - index++; - Element.addClassName(td,"rating"); + $(td).addClass("rating"); } } + + this.selectedIndex = options.SelectedIndex; + this.rating = options.Rating; + this.readOnly = options.ReadOnly + if(options.Rating <= 0 && options.SelectedIndex >= 0) + this.rating = options.SelectedIndex+1; + this.setReadOnly(this.readOnly); }, - hover : function(ev,index) + hover : function(index, ev) { if(this.readOnly==true) return; + for(var i = 0; i<this.radios.length; i++) { var node = this.radios[i].parentNode.parentNode; - var action = i <= index ? 'addClassName' : 'removeClassName' - Element[action](node,"rating_hover"); - Element.removeClassName(node,"rating_selected"); - Element.removeClassName(node,"rating_half"); + if(i <= index) + $(node).addClass('rating_hover'); + else + $(node).removeClass('rating_hover'); + $(node).removeClass("rating_selected"); + $(node).removeClass("rating_half"); } this.showCaption(this.getIndexCaption(index)); }, - recover : function(ev,index) + recover : function(index, ev) { if(this.readOnly==true) return; this.showRating(this.rating); this.showCaption(this.options.caption); }, - click : function(ev, index) + click : function(index, ev) { if(this.readOnly==true) return; - for(var i = 0; i<this.radios.length; i++) - this.radios[i].checked = (i == index); this.selectedIndex = index; this.setRating(index+1); @@ -83,13 +72,13 @@ Prado.WebUI.TRatingList = Base.extend( dispatchRequest : function(ev) { - var requestOptions = Object.extend( + var requestOptions =jQuery.extend({}, this.options, { - ID : this.options.ListID+"_c"+this.selectedIndex, + ID : this.options.ID+"_c"+this.selectedIndex, EventTarget : this.options.ListName+"$c"+this.selectedIndex - },this.options); - Prado.PostBack(ev, requestOptions); - }, + }); + new Prado.PostBack(requestOptions, ev); + }, setRating : function(value) { @@ -119,16 +108,19 @@ Prado.WebUI.TRatingList = Base.extend( for(var i = 0; i<this.radios.length; i++) { var node = this.radios[i].parentNode.parentNode; - var action = i > index ? 'removeClassName' : 'addClassName'; - Element[action](node, "rating_selected"); + if(i <= index) + $(node).addClass('rating_selected'); + else + $(node).removeClass('rating_selected'); + if(i==index+1 && hasHalf) - Element.addClassName(node, "rating_half"); + $(node).addClass("rating_half"); else - Element.removeClassName(node, "rating_half"); - Element.removeClassName(node,"rating_hover"); + $(node).removeClass("rating_half"); + $(node).removeClass("rating_hover"); } }, - + getIndexCaption : function(index) { return index > -1 ? this.radios[index].value : this.options.caption; @@ -136,9 +128,8 @@ Prado.WebUI.TRatingList = Base.extend( showCaption : function(value) { - var caption = $(this.options.CaptionID); - if(caption) caption.innerHTML = value; - $(this.options.ListID).title = value; + $('#'+this.options.CaptionID).html(value); + $('#'+this.options.ID).attr( "title", value); }, setCaption : function(value) @@ -152,55 +143,37 @@ Prado.WebUI.TRatingList = Base.extend( this.readOnly = value; for(var i = 0; i<this.radios.length; i++) { - - var action = value ? 'addClassName' : 'removeClassName'; - Element[action](this.radios[i].parentNode.parentNode, "rating_disabled"); - - var action = value ? 'stopObserving' : 'observe'; - var td = this.radios[i].parentNode.parentNode; - Event[action](td, "mouseover", this._mouseOvers[i]); - Event[action](td, "mouseout", this._mouseOuts[i]); - Event[action](td, "click", this._clicks[i]); + var node = this.radios[i].parentNode.parentNode; + if(value) + { + $(node).addClass('rating_disabled'); + $(node).off('mouseover', jQuery.proxy(this.hover, this, i)); + $(node).off('mouseout', jQuery.proxy(this.recover, this, i)); + $(node).off('click', jQuery.proxy(this.click, this, i)); + } else { + $(node).removeClass('rating_disabled'); + $(node).on('mouseover', jQuery.proxy(this.hover, this, i)); + $(node).on('mouseout', jQuery.proxy(this.recover, this, i)); + $(node).on('click', jQuery.proxy(this.click, this, i)); + } } this.showRating(this.rating); } -}, -{ -ratings : {}, -register : function(rating) -{ - Prado.WebUI.TRatingList.ratings[rating.options.ListID] = rating; -}, - -setReadOnly : function(id,value) -{ - Prado.WebUI.TRatingList.ratings[id].setReadOnly(value); -}, - -setRating : function(id,value) -{ - Prado.WebUI.TRatingList.ratings[id].setRating(value); -}, - -setCaption : function(id,value) -{ - Prado.WebUI.TRatingList.ratings[id].setCaption(value); -} }); -Prado.WebUI.TActiveRatingList = Prado.WebUI.TRatingList.extend( -{ +Prado.WebUI.TActiveRatingList = jQuery.klass(Prado.WebUI.TRatingList, +{ dispatchRequest : function(ev) { - var requestOptions = Object.extend( + var requestOptions =jQuery.extend({}, this.options, { - ID : this.options.ListID+"_c"+this.selectedIndex, + ID : this.options.ID+"_c"+this.selectedIndex, EventTarget : this.options.ListName+"$c"+this.selectedIndex - },this.options); + }); var request = new Prado.CallbackRequest(requestOptions.EventTarget, requestOptions); if(request.dispatch()==false) - Event.stop(ev); + ev.preventDefault(); } - + }); diff --git a/framework/Web/Services/TFeedService.php b/framework/Web/Services/TFeedService.php index a1518d4e..75775f49 100644 --- a/framework/Web/Services/TFeedService.php +++ b/framework/Web/Services/TFeedService.php @@ -5,7 +5,7 @@ * @author Qiang Xue <qiang.xue@gmail.com> * @author Knut Urdalen <knut.urdalen@gmail.com> * @link http://www.pradosoft.com - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.Services @@ -132,7 +132,7 @@ class TFeedService extends TService else throw new TConfigurationException('feedservice_class_required',$id); } - + // init feed properties foreach($properties as $name=>$value) $feed->setSubproperty($name,$value); diff --git a/framework/Web/Services/TJsonService.php b/framework/Web/Services/TJsonService.php index 15701a9a..e3b9b1cb 100644 --- a/framework/Web/Services/TJsonService.php +++ b/framework/Web/Services/TJsonService.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.Services */ @@ -47,7 +46,6 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> - * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.Services * @since 3.1 */ @@ -132,7 +130,7 @@ class TJsonService extends TService throw new TConfigurationException('jsonservice_response_type_invalid',$id); } else - throw new TConfigurationException('jsonservice_class_required',$id); + throw new TConfigurationException('jsonservice_class_required',$id); } } else @@ -172,7 +170,6 @@ class TJsonService extends TService * will be empty if the returned content is null. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.Services * @since 3.1 */ diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 8e052693..f0dd8c1a 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.Services */ @@ -70,7 +69,6 @@ Prado::using('System.Web.UI.TThemeManager'); * * @author Qiang Xue <qiang.xue@gmail.com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> - * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.Services * @since 3.0 */ @@ -547,7 +545,6 @@ class TPageService extends TService * Configurations along this path are merged together to be provided for the page. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.Services * @since 3.0 */ @@ -657,14 +654,14 @@ class TPageConfiguration extends TComponent Prado::trace("Loading page configuration file $fname",'System.Web.Services.TPageService'); if(empty($fname) || !is_file($fname)) return; - + if(Prado::getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP) { $fcontent = include $fname; $this->loadFromPhp($fcontent,dirname($fname),$configPagePath); } else - { + { $dom=new TXmlDocument; if($dom->loadFromFile($fname)) $this->loadFromXml($dom,dirname($fname),$configPagePath); @@ -692,7 +689,7 @@ class TPageConfiguration extends TComponent $this->loadApplicationConfigurationFromXml($dom,$configPath); $this->loadPageConfigurationFromXml($dom,$configPath,$configPagePath); } - + public function loadApplicationConfigurationFromPhp($config,$configPath) { $appConfig=new TApplicationConfiguration; @@ -775,7 +772,7 @@ class TPageConfiguration extends TComponent if(isset($page['properties'])) { $properties=$page['properties']; - unset($page['properties']); + unset($page['properties']); } $matching=false; $id=($configPagePath==='')?$id:$configPagePath.'.'.$id; @@ -787,7 +784,7 @@ class TPageConfiguration extends TComponent $this->_properties=array_merge($this->_properties,$properties); } } - + // external configurations if(isset($config['includes']) && is_array($config['includes'])) { diff --git a/framework/Web/Services/TSoapService.php b/framework/Web/Services/TSoapService.php index 2d59f462..c928dc06 100644 --- a/framework/Web/Services/TSoapService.php +++ b/framework/Web/Services/TSoapService.php @@ -5,9 +5,8 @@ * @author Knut Urdalen <knut.urdalen@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSoapService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.Services */ @@ -156,7 +155,7 @@ class TSoapService extends TService * @throws TConfigurationException if soap server id is not specified or duplicated */ private function loadConfig($config) - { + { if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP) { if(is_array($config)) @@ -296,7 +295,6 @@ class TSoapService extends TService * It also manages the URI for the SOAP service and WSDL. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TSoapService.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.Services * @since 3.1 */ diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php index f29b0707..272d4400 100644 --- a/framework/Web/TAssetManager.php +++ b/framework/Web/TAssetManager.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TAssetManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web */ @@ -38,7 +37,6 @@ * pointing to a valid directory writable by the Web server process. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TAssetManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web * @since 3.0 */ diff --git a/framework/Web/TCacheHttpSession.php b/framework/Web/TCacheHttpSession.php index d658c0f3..02e84e22 100644 --- a/framework/Web/TCacheHttpSession.php +++ b/framework/Web/TCacheHttpSession.php @@ -5,9 +5,8 @@ * @author Carl G. Mathisen <carlgmathisen@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCacheHttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web * @since 3.1.1 */ @@ -36,7 +35,6 @@ * * @author Carl G. Mathisen <carlgmathisen@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCacheHttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web * @since 3.1.1 */ diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index f621d1eb..5d77ba60 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $ * @package System.Web */ @@ -64,7 +63,6 @@ Prado::using('System.Web.TUrlManager'); * request module. It can be accessed via {@link TApplication::getRequest()}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $ * @package System.Web * @since 3.0 */ @@ -267,7 +265,7 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar if($this->getEnableCache()) { $cache = $this->getApplication()->getCache(); - if($cache !== null) + if($cache !== null) { $dependencies = null; if($this->getApplication()->getMode() !== TApplicationMode::Performance) @@ -969,7 +967,6 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $ * @package System.Web * @since 3.0 */ @@ -1057,7 +1054,6 @@ class THttpCookieCollection extends TList * domain, path, expire, and secure. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $ * @package System.Web * @since 3.0 */ @@ -1232,7 +1228,6 @@ class THttpCookie extends TComponent * - fragment: anchor * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $ * @package System.Web * @since 3.0 */ @@ -1399,7 +1394,6 @@ class TUri extends TComponent * - HiddenPath: the URL format is like /path/to/name1,value1/name2,value2... * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $ * @package System.Web * @since 3.0.4 */ diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index ebcb9cc7..75563ef9 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THttpResponse.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web */ @@ -60,7 +59,6 @@ Prado::using('System.Web.THttpResponseAdapter'); * will force the browser to ask for a username and a password. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpResponse.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web * @since 3.0 */ diff --git a/framework/Web/THttpResponseAdapter.php b/framework/Web/THttpResponseAdapter.php index 635752ed..3411e71c 100644 --- a/framework/Web/THttpResponseAdapter.php +++ b/framework/Web/THttpResponseAdapter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php index f32b7063..79c6e6df 100644 --- a/framework/Web/THttpSession.php +++ b/framework/Web/THttpSession.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web */ @@ -57,7 +56,6 @@ * and {@link getTimeout TimeOut} are configurable properties of THttpSession. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web * @since 3.0 */ @@ -159,7 +157,7 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar $this->_started=false; } } - + /** * Update the current session id with a newly generated one * @@ -628,7 +626,6 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar * for traversing the session variables. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web * @since 3.0 */ @@ -717,7 +714,6 @@ class TSessionIterator implements Iterator * - Only: using cookie only. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web * @since 3.0.4 */ diff --git a/framework/Web/THttpUtility.php b/framework/Web/THttpUtility.php index 128dee55..f41060f7 100644 --- a/framework/Web/THttpUtility.php +++ b/framework/Web/THttpUtility.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THttpUtility.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web */ @@ -14,7 +13,6 @@ * THttpUtility class * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THttpUtility.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web * @since 3.0 */ diff --git a/framework/Web/TUrlManager.php b/framework/Web/TUrlManager.php index 75abdcf1..2d3fa572 100644 --- a/framework/Web/TUrlManager.php +++ b/framework/Web/TUrlManager.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id $ * @package System.Web @@ -50,7 +50,7 @@ class TUrlManager extends TModule * In order to use the 'HiddenPath' format you need proper url rewrite configuration; * here's an example for Apache's .htaccess: * <cdde> - * Options +FollowSymLinks + * Options +FollowSymLinks * RewriteEngine On * RewriteCond %{REQUEST_FILENAME} !-d * RewriteCond %{REQUEST_FILENAME} !-f diff --git a/framework/Web/TUrlMapping.php b/framework/Web/TUrlMapping.php index 929a873e..4c93f004 100644 --- a/framework/Web/TUrlMapping.php +++ b/framework/Web/TUrlMapping.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $ * @package System.Web */ @@ -63,7 +62,6 @@ Prado::using('System.Collections.TAttributeCollection'); * in the GET variables. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $ * @package System.Web * @since 3.0.5 */ @@ -477,7 +475,7 @@ class TUrlMapping extends TUrlManager * Since 3.2.2 you can also add a list of "constants" parameters that can be used just * like the original "parameters" parameters, except that the supplied value will be treated * as a simple string constant instead of a regular expression. For example - * + * * <url ServiceParameter="MyPage" pattern="/mypage/mypath/list/detail/{pageidx}" parameters.pageidx="\d+" constants.listtype="detailed"/> * <url ServiceParameter="MyPage" pattern="/mypage/mypath/list/summary/{pageidx}" parameters.pageidx="\d+" constants.listtype="summarized"/> * @@ -486,7 +484,6 @@ class TUrlMapping extends TUrlManager * The constants is practically a table-based validation and translation of specified, fixed-set parameter values. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $ * @package System.Web * @since 3.0.5 */ @@ -1003,7 +1000,6 @@ class TUrlMappingPattern extends TComponent * URL prefix behavior that can be used by {@link TUrlMappingPattern::constructUrl()}. * * @author Yves Berkholz <godzilla80[at]gmx[dot]net> - * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $ * @package System.Web * @since 3.2 */ diff --git a/framework/Web/UI/ActiveControls/TActiveButton.php b/framework/Web/UI/ActiveControls/TActiveButton.php index 16ba5339..697e96f1 100644 --- a/framework/Web/UI/ActiveControls/TActiveButton.php +++ b/framework/Web/UI/ActiveControls/TActiveButton.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -29,7 +28,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * will update the button's caption upon callback response completion. * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> - * @version $Id: TActiveButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -63,7 +61,7 @@ class TActiveButton extends TButton implements ICallbackEventHandler, IActiveCon } /** - * Raises the callback event. This method is required by + * Raises the callback event. This method is required by * {@link ICallbackEventHandler} interface. If {@link getCausesValidation CausesValidation} * is true, it will invoke the page's {@link TPage::validate validate} * method first. It will raise {@link onClick OnClick} event first diff --git a/framework/Web/UI/ActiveControls/TActiveCheckBox.php b/framework/Web/UI/ActiveControls/TActiveCheckBox.php index 6221150d..b5d7393c 100644 --- a/framework/Web/UI/ActiveControls/TActiveCheckBox.php +++ b/framework/Web/UI/ActiveControls/TActiveCheckBox.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -26,7 +25,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * changed during a callback. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -121,9 +119,9 @@ class TActiveCheckBox extends TCheckBox implements ICallbackEventHandler, IActiv /** * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. - * + * * Since 3.1.4, the javascript code is not rendered if {@link setAutoPostBack AutoPostBack} is false - * + * * @param THtmlWriter the writer for the rendering purpose * @param string checkbox id * @param string onclick js diff --git a/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php b/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php index a42044fb..ea174c94 100644 --- a/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php +++ b/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -30,7 +29,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveListControlAdapter'); * List items can not be changed dynamically during a callback request. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -78,7 +76,7 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall */ protected function createRepeatedControl() { - $control = new TActiveCheckBox; + $control = new TActiveCheckBoxListItem; $control->getAdapter()->setBaseActiveControl($this->getActiveControl()); return $control; } @@ -117,5 +115,29 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall $this->getClientClassName(), $this->getPostBackOptions()); } + /** + * Gets the name of the javascript class responsible for performing postback for this control. + * This method overrides the parent implementation. + * @return string the javascript class name + */ + protected function getClientClassName() + { + return 'Prado.WebUI.TActiveCheckBoxList'; + } +} + +class TActiveCheckBoxListItem extends TActiveCheckBox +{ + /** + * Override client implementation to avoid emitting the javascript + * + * @param THtmlWriter the writer for the rendering purpose + * @param string checkbox id + * @param string onclick js + */ + protected function renderInputTag($writer,$clientID,$onclick) + { + TCheckBox::renderInputTag($writer,$clientID,$onclick); + } } diff --git a/framework/Web/UI/ActiveControls/TActiveClientScript.php b/framework/Web/UI/ActiveControls/TActiveClientScript.php index 8fce726a..4443ea30 100755 --- a/framework/Web/UI/ActiveControls/TActiveClientScript.php +++ b/framework/Web/UI/ActiveControls/TActiveClientScript.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveClientScript.php 3144 2012-05-19 10:07:03Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -15,13 +14,13 @@ * * This is the active counterpart of the {@link TClientScript} class. * - * TActiveClientScript has the ability to render itself on ajax + * TActiveClientScript has the ability to render itself on ajax * callbacks. This means that every variable or function declared in javascript * code will be available to the page. * * Beware that when rendered on normal (postback) or ajax callbacks, some - * javascript code won't behave in the same way. - * When rendered as part of a normal/postback response, scripts will execute instantly + * javascript code won't behave in the same way. + * When rendered as part of a normal/postback response, scripts will execute instantly * where they are in the page and in a synchronous fashion. * Instead, when they are rendered as part of a callback response, * they will be executed when all DOM modifications are complete and any dynamic @@ -30,7 +29,6 @@ * This can potentially hurt compatibility and graceful fallback. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveClientScript.php 3144 2012-05-19 10:07:03Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.2 */ diff --git a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php index 6c209ac5..bf1bc9f5 100644 --- a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php +++ b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -29,7 +28,6 @@ Prado::using('System.Web.UI.ActiveControls.TBaseActiveControl'); * corresponding client-side properties. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -177,7 +175,6 @@ class TActiveControlAdapter extends TControlAdapter * Tracking changes to the page state during callback. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -367,7 +364,6 @@ class TCallbackPageStateTracker * Calculates the viewstate changes during the request. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -411,7 +407,6 @@ abstract class TViewStateDiff * Calculate the changes to a scalar value. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -436,7 +431,6 @@ class TScalarDiff extends TViewStateDiff * Calculates the changes to the Style properties. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -528,7 +522,6 @@ class TStyleDiff extends TViewStateDiff * Calculate the changes to attributes collection. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php index cc2a54a1..f05704fc 100644 --- a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php +++ b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -28,7 +27,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackClientSide'); * will be true when validation is made during a callback request. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -186,7 +184,6 @@ class TActiveCustomValidator extends TCustomValidator * Custom Validator callback client side options class. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveDataGrid.php b/framework/Web/UI/ActiveControls/TActiveDataGrid.php index 00c9cb49..d5084e2d 100644 --- a/framework/Web/UI/ActiveControls/TActiveDataGrid.php +++ b/framework/Web/UI/ActiveControls/TActiveDataGrid.php @@ -107,7 +107,7 @@ class TActiveDataGrid extends TDataGrid implements IActiveControl, ISurroundable * If it is enabled (clickable), its command name and parameter will also be set. * It overrides the datagrid's original method to create active controls instead, thus * the pager will do callbacks instead of the regular postbacks. - * @param mixed the container pager instance of TActiveDatagridPager + * @param mixed the container pager instance of TActiveDatagridPager * @param string button type, either LinkButton or PushButton * @param boolean whether the button should be enabled * @param string caption of the button @@ -786,7 +786,6 @@ class TActiveLiteralColumn extends TLiteralColumn { * TActiveDataGridPager represents a pager in an activedatagrid. * * @author Fabio Bas <ctrlaltca@gmail.com> - * @version $Id: TDataGrid.php 3057 2011-11-09 12:35:57Z ctrlaltca@gmail.com $ * @package System.Web.UI.ActiveControls * @since 3.2.1 */ @@ -813,7 +812,6 @@ class TActiveDataGridPager extends TDataGridPager * The {@link getPager Pager} property indicates the datagrid pager related with the event. * * @author Fabio Bas <ctrlaltca@gmail.com> - * @version $Id: TActiveDataGrid.php 3057 2011-11-09 12:35:57Z ctrlaltca@gmail.com $ * @package System.Web.UI.ActiveControls * @since 3.2.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveDataList.php b/framework/Web/UI/ActiveControls/TActiveDataList.php index dbf70067..6b749b40 100644 --- a/framework/Web/UI/ActiveControls/TActiveDataList.php +++ b/framework/Web/UI/ActiveControls/TActiveDataList.php @@ -1,12 +1,11 @@ <?php /** * TActiveDataList class file - * + * * @author Marcos Aurelio Nobre <marconobre@gmail.com> * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license * @package System.Web.UI.ActiveControls - * @version $Id: TActiveDataList.php 2706 2009-09-24 14:42:30Z rojaro $ */ /** @@ -14,7 +13,7 @@ * * TActiveDataList represents a data bound and updatable grid control which is the * active counterpart to the original {@link TDataList} control. - * + * * This component can be used in the same way as the regular datalist, the only * difference is that the active datalist uses callbacks instead of postbacks * for interaction. @@ -25,10 +24,10 @@ * @package System.Web.UI.ActiveControls */ class TActiveDataList extends TDataList implements IActiveControl { - + /** * Creates a new callback control, sets the adapter to - * TActiveControlAdapter. + * TActiveControlAdapter. */ public function __construct() { @@ -43,7 +42,7 @@ class TActiveDataList extends TDataList implements IActiveControl { { return $this->getAdapter()->getBaseActiveControl(); } - + /** * Sets the data source object associated with the repeater control. * In addition, the render method of all connected pagers is called so they @@ -59,7 +58,7 @@ class TActiveDataList extends TDataList implements IActiveControl { $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); } } - + /** * Returns the id of the surrounding container (span). * @return string container id @@ -68,7 +67,7 @@ class TActiveDataList extends TDataList implements IActiveControl { { return $this->ClientID.'_Container'; } - + /** * Renders the repeater. * If the repeater did not pass the prerender phase yet, it will register itself for rendering later. @@ -85,10 +84,10 @@ class TActiveDataList extends TDataList implements IActiveControl { $this->getPage()->getAdapter()->registerControlToRender($this,$writer); } } - + /** * Loops through all {@link TActivePager} on the page and registers the ones which are set to paginate - * the repeater for rendering. This is to ensure that the connected pagers are also rendered if the + * the repeater for rendering. This is to ensure that the connected pagers are also rendered if the * data source changed. */ private function renderPager() @@ -102,7 +101,7 @@ class TActiveDataList extends TDataList implements IActiveControl { } } } - + /** * Renders the repeater by writing a span tag with the container id obtained from {@link getContainerID()} * which will be called by the replacement method of the client script to update it's content. diff --git a/framework/Web/UI/ActiveControls/TActiveDatePicker.php b/framework/Web/UI/ActiveControls/TActiveDatePicker.php index 279739a8..ad363d9c 100755 --- a/framework/Web/UI/ActiveControls/TActiveDatePicker.php +++ b/framework/Web/UI/ActiveControls/TActiveDatePicker.php @@ -1,13 +1,12 @@ <?php /** * TActiveDatePicker class file - * + * * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @author Christophe Boulain <Christophe.Boulain@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -18,20 +17,19 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); /** * TActiveDatePicker class - * + * * The active control counter part to date picker control. * When the date selection is changed, the {@link onCallback OnCallback} event is * raised. - * + * * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @author Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1.3 */ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, IActiveControl { - + /** * @return boolean a value indicating whether an automatic postback to the server * will occur whenever the user modifies the text in the TActiveDatePicker control and @@ -67,7 +65,7 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I $options['AutoPostBack'] = $this->getAutoPostBack(); return $options; } - + /** * Creates a new callback control, sets the adapter to * TActiveControlAdapter. If you override this class, be sure to set the @@ -78,7 +76,7 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I parent::__construct(); $this->setAdapter(new TActiveControlAdapter($this)); } - + /** * @return TBaseActiveCallbackControl standard callback control options. */ @@ -103,21 +101,21 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $date['mday'], 'select'); $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon']-1, 'select'); $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $date['year'], 'select'); - + } } } - + /** * Raises the callback event. This method is required by {@link - * ICallbackEventHandler} interface. + * ICallbackEventHandler} interface. * This method is mainly used by framework and control developers. * @param TCallbackEventParameter the event parameter */ public function raiseCallbackEvent($param){ $this->onCallback($param); - } - + } + /** * This method is invoked when a callback is requested. The method raises * 'OnCallback' event to fire up the event handlers. If you override this @@ -128,7 +126,7 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I public function onCallback($param){ $this->raiseEvent('OnCallback', $this, $param); } - + /** * Registers the javascript code to initialize the date picker. */ @@ -174,9 +172,8 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I * is changed. * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent * as parameter to this event - * + * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> - * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.2.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveDropDownList.php b/framework/Web/UI/ActiveControls/TActiveDropDownList.php index f0f8bba2..0de95078 100644 --- a/framework/Web/UI/ActiveControls/TActiveDropDownList.php +++ b/framework/Web/UI/ActiveControls/TActiveDropDownList.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -31,7 +30,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveListControlAdapter'); * List items can be changed dynamically during a callback request. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveFileUpload.php b/framework/Web/UI/ActiveControls/TActiveFileUpload.php index 10aa2ed3..61bf7816 100755 --- a/framework/Web/UI/ActiveControls/TActiveFileUpload.php +++ b/framework/Web/UI/ActiveControls/TActiveFileUpload.php @@ -1,11 +1,10 @@ <?php /** * TActiveFileUpload.php - * + * * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @author Christophe Boulain <Christophe.Boulain@gmail.com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (issue 349 remote vulnerability fix) - * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -17,7 +16,7 @@ Prado::using('System.Web.UI.WebControls.TFileUpload'); /** * TActiveFileUpload - * + * * TActiveFileUpload displays a file upload field on a page. Upon postback, * the text entered into the field will be treated as the name of the file * that will be uploaded to the server. The property {@link getHasFile HasFile} @@ -31,22 +30,21 @@ Prado::using('System.Web.UI.WebControls.TFileUpload'); * * TActiveFileUpload raises {@link onFileUpload OnFileUpload} event if a file is uploaded * (whether it succeeds or not). - * + * * TActiveFileUpload actually does a postback in a hidden IFrame, and then does a callback. * This callback then raises the {@link onFileUpload OnFileUpload} event. After the postback * a status icon is displayed; either a green checkmark if the upload is successful, * or a red x if there was an error. - * + * * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @author Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ -class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer +class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer { - + const SCRIPT_PATH = 'prado/activefileupload'; - + /** * @var THiddenField a flag to tell which component is doing the callback. */ @@ -68,7 +66,7 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback */ private $_target; - + /** * Creates a new callback control, sets the adapter to * TActiveControlAdapter. If you override this class, be sure to set the @@ -78,8 +76,8 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback parent::__construct(); $this->setAdapter(new TActiveControlAdapter($this)); } - - + + /** * @param string asset file in the self::SCRIPT_PATH directory. * @return string asset file url. @@ -89,8 +87,8 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); return $base.'/'.self::SCRIPT_PATH.'/'.$file; } - - + + /** * This method is invoked when a file is uploaded. * If you override this method, be sure to call the parent implementation to ensure @@ -103,10 +101,10 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback // save the file so that it will persist past the end of this return. $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),'')); parent::saveAs($localName); - + $filename=addslashes($this->getFileName()); - - + + $params = new TActiveFileUploadCallbackParams; $params->localName = $localName; $params->fileName = $filename; @@ -128,11 +126,11 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback parent.Prado.WebUI.TActiveFileUpload.onFileUpload(Options); </script> EOS; - + exit(); } } - + /** * @return string the path where the uploaded file will be stored temporarily, in namespace format * default "Application.runtime.*" @@ -140,7 +138,7 @@ EOS; public function getTempPath(){ return $this->getViewState('TempPath', 'Application.runtime.*'); } - + /** * @param string the path where the uploaded file will be stored temporarily in namespace format * default "Application.runtime.*" @@ -148,7 +146,7 @@ EOS; public function setTempPath($value){ $this->setViewState('TempPath',$value,'Application.runtime.*'); } - + /** * @return boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. * Note: When set to false, you will need to trigger the callback yourself. @@ -156,7 +154,7 @@ EOS; public function getAutoPostBack(){ return $this->getViewState('AutoPostBack', true); } - + /** * @param boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. * Note: When set to false, you will need to trigger the callback yourself. @@ -164,49 +162,49 @@ EOS; public function setAutoPostBack($value){ $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true); } - + /** * @return string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false} - */ + */ public function getCallbackJavascript(){ return "Prado.WebUI.TActiveFileUpload.fileChanged(\"{$this->getClientID()}\")"; } - + /** * @throws TInvalidDataValueException if the {@link getTempPath TempPath} is not writable. */ public function onInit($sender){ parent::onInit($sender); - + if (!Prado::getApplication()->getCache()) if (!Prado::getApplication()->getSecurityManager()) throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); - + if (!is_writable(Prado::getPathOfNamespace($this->getTempPath()))){ throw new TInvalidDataValueException("activefileupload_temppath_invalid", $this->getTempPath()); } } - + /** * Raises <b>OnFileUpload</b> event. - * - * This method is required by {@link ICallbackEventHandler} interface. + * + * This method is required by {@link ICallbackEventHandler} interface. * This method is mainly used by framework and control developers. * @param TCallbackEventParameter the event parameter */ public function raiseCallbackEvent($param){ $cp = $param->getCallbackParameter(); if ($key = $cp->targetID == $this->_target->getUniqueID()){ - + $params = $this->popParamsByToken($cp->callbackToken); - + $_FILES[$key]['name'] = $params->fileName; $_FILES[$key]['size'] = intval($params->fileSize); $_FILES[$key]['type'] = $params->fileType; $_FILES[$key]['error'] = intval($params->errorCode); $_FILES[$key]['tmp_name'] = $params->localName; $this->loadPostData($key, null); - + $this->raiseEvent('OnFileUpload', $this, $param); } } @@ -220,7 +218,7 @@ EOS; { $this->onFileUpload($this->getPage()->getRequest()->itemAt('TActiveFileUpload_TargetId')); } - + protected function pushParamsAndGetToken(TActiveFileUploadCallbackParams $params) { if ($cache = Prado::getApplication()->getCache()) @@ -237,10 +235,10 @@ EOS; } else throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); - + return $token; } - + protected function popParamsByToken($token) { if ($cache = Prado::getApplication()->getCache()) @@ -260,7 +258,7 @@ EOS; throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); assert($params instanceof TActiveFileUploadCallbackParams); - + return $params; } @@ -277,14 +275,14 @@ EOS; $this->_errorCode = UPLOAD_ERR_FORM_SIZE; $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),'')); $fileName = addslashes($this->getFileName()); - + $params = new TActiveFileUploadCallbackParams; $params->localName = $localName; $params->fileName = $fileName; $params->fileSize = $this->getFileSize(); $params->fileType = $this->getFileType(); $params->errorCode = $this->getErrorCode(); - + echo <<<EOS <script language="Javascript"> Options = new Object(); @@ -300,30 +298,30 @@ EOS; EOS; } } - + public function createChildControls(){ $this->_flag = Prado::createComponent('THiddenField'); $this->_flag->setID('Flag'); $this->getControls()->add($this->_flag); - + $this->_busy = Prado::createComponent('TImage'); $this->_busy->setID('Busy'); $this->_busy->setImageUrl($this->getAssetUrl('ActiveFileUploadIndicator.gif')); $this->_busy->setStyle("display:none"); $this->getControls()->add($this->_busy); - + $this->_success = Prado::createComponent('TImage'); $this->_success->setID('Success'); $this->_success->setImageUrl($this->getAssetUrl('ActiveFileUploadComplete.png')); $this->_success->setStyle("display:none"); $this->getControls()->add($this->_success); - + $this->_error = Prado::createComponent('TImage'); $this->_error->setID('Error'); $this->_error->setImageUrl($this->getAssetUrl('ActiveFileUploadError.png')); $this->_error->setStyle("display:none"); $this->getControls()->add($this->_error); - + $this->_target = Prado::createComponent('TInlineFrame'); $this->_target->setID('Target'); $this->_target->setFrameUrl($this->getAssetUrl('ActiveFileUploadBlank.html')); @@ -331,14 +329,14 @@ EOS; $this->_target->setShowBorder(false); $this->getControls()->add($this->_target); } - - + + /** - * Removes localfile on ending of the callback. + * Removes localfile on ending of the callback. */ public function onUnload($param){ - if ($this->getPage()->getIsCallback() && - $this->getHasFile() && + if ($this->getPage()->getIsCallback() && + $this->getHasFile() && file_exists($this->getLocalName())){ unlink($this->getLocalName()); } @@ -367,7 +365,7 @@ EOS; public function addAttributesToRender($writer){ parent::addAttributesToRender($writer); $writer->addAttribute('id',$this->getClientID()); - + $this->getPage()->getClientScript()->registerPradoScript('activefileupload'); $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(),$this->getClientOptions()); } @@ -392,7 +390,7 @@ EOS; protected function getClientOptions(){ $options['ID'] = $this->getClientID(); $options['EventTarget'] = $this->getUniqueID(); - + $options['inputID'] = $this->getClientID(); $options['flagID'] = $this->_flag->getClientID(); $options['targetID'] = $this->_target->getUniqueID(); @@ -422,25 +420,25 @@ EOS; } /** - * @return TImage the image displayed when an upload + * @return TImage the image displayed when an upload * completes successfully. */ public function getSuccessImage(){ $this->ensureChildControls(); return $this->_success; } - + /** - * @return TImage the image displayed when an upload + * @return TImage the image displayed when an upload * does not complete successfully. */ public function getErrorImage(){ $this->ensureChildControls(); return $this->_error; } - + /** - * @return TImage the image displayed when an upload + * @return TImage the image displayed when an upload * is in progress. */ public function getBusyImage(){ @@ -451,10 +449,9 @@ EOS; /** * TActiveFileUploadCallbackParams is an internal class used by {@link TActiveFileUpload}. - * + * * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @author Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ class TActiveFileUploadCallbackParams diff --git a/framework/Web/UI/ActiveControls/TActiveHiddenField.php b/framework/Web/UI/ActiveControls/TActiveHiddenField.php index 0d4b3737..28be574a 100644 --- a/framework/Web/UI/ActiveControls/TActiveHiddenField.php +++ b/framework/Web/UI/ActiveControls/TActiveHiddenField.php @@ -4,7 +4,7 @@ * * @author Carl G. Mathisen <carlgmathisen@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.ActiveControls diff --git a/framework/Web/UI/ActiveControls/TActiveHyperLink.php b/framework/Web/UI/ActiveControls/TActiveHyperLink.php index 6ba8a801..13161eec 100644 --- a/framework/Web/UI/ActiveControls/TActiveHyperLink.php +++ b/framework/Web/UI/ActiveControls/TActiveHyperLink.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveHyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -21,7 +20,6 @@ * {@link setNavigateUrl NavigateUrl} and {@link setTarget Target}. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveHyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveImage.php b/framework/Web/UI/ActiveControls/TActiveImage.php index 752c7a04..27ec337e 100644 --- a/framework/Web/UI/ActiveControls/TActiveImage.php +++ b/framework/Web/UI/ActiveControls/TActiveImage.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -19,7 +18,6 @@ * a callback request. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveImageButton.php b/framework/Web/UI/ActiveControls/TActiveImageButton.php index 8fe5e33d..17068412 100644 --- a/framework/Web/UI/ActiveControls/TActiveImageButton.php +++ b/framework/Web/UI/ActiveControls/TActiveImageButton.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -21,7 +20,6 @@ * and it is raise <b>after</b> the {@link onClick OnClick} event. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveLabel.php b/framework/Web/UI/ActiveControls/TActiveLabel.php index 4fd19a56..0a20e2b0 100644 --- a/framework/Web/UI/ActiveControls/TActiveLabel.php +++ b/framework/Web/UI/ActiveControls/TActiveLabel.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -26,7 +25,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * the client-side "for" attribute on the label. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveLinkButton.php b/framework/Web/UI/ActiveControls/TActiveLinkButton.php index d8a8ffcb..304d1cef 100644 --- a/framework/Web/UI/ActiveControls/TActiveLinkButton.php +++ b/framework/Web/UI/ActiveControls/TActiveLinkButton.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -29,7 +28,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * will update the link text upon callback response completion. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -145,7 +143,7 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback $this->getClientClassName(), $this->getPostBackOptions()); } else { - $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false); + $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false); } } } diff --git a/framework/Web/UI/ActiveControls/TActiveListBox.php b/framework/Web/UI/ActiveControls/TActiveListBox.php index 913cdeda..efc9dfcc 100644 --- a/framework/Web/UI/ActiveControls/TActiveListBox.php +++ b/framework/Web/UI/ActiveControls/TActiveListBox.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -21,7 +20,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveListControlAdapter'); * List items can be added dynamically during a callback request. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php index e48b9364..ca88477d 100644 --- a/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php +++ b/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -23,7 +22,6 @@ Prado::using('System.Web.UI.WebControls.TListControl'); * during callback response. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -170,7 +168,6 @@ class TActiveListControlAdapter extends TActiveControlAdapter implements IListCo * repopulate the client-side options. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php index c594ed42..bce3beb0 100644 --- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php +++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php @@ -5,9 +5,8 @@ * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering) * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -25,7 +24,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter'); * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering) - * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -296,7 +294,7 @@ class TActivePageAdapter extends TControlAdapter } /** - * Gets callback parameter. JSON encoding is assumed. + * Gets callback parameter. * @return string postback event parameter */ public function getCallbackEventParameter() @@ -304,8 +302,7 @@ class TActivePageAdapter extends TControlAdapter if($this->_callbackEventParameter===null) { $param = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); - if(strlen($param) > 0) - $this->_callbackEventParameter=TJavaScript::jsonDecode((string)$param); + $this->_callbackEventParameter=$param; } return $this->_callbackEventParameter; } @@ -340,7 +337,6 @@ class TActivePageAdapter extends TControlAdapter * the error stack trace. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -406,7 +402,6 @@ class TCallbackErrorHandler extends TErrorHandler * TInvalidCallbackException class. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TActivePager.php b/framework/Web/UI/ActiveControls/TActivePager.php index 7dcd3212..b49faa37 100644 --- a/framework/Web/UI/ActiveControls/TActivePager.php +++ b/framework/Web/UI/ActiveControls/TActivePager.php @@ -4,9 +4,8 @@ * * @author "gevik" (forum contributor) and Christophe Boulain (Christophe.Boulain@gmail.com) * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActivePager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -17,15 +16,14 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); /** * TActivePager is the active control counter part of TPager. - * + * * When a page change is requested, TActivePager raises a callback instead of the * traditional postback. * * The {@link onCallback OnCallback} event is raised during a callback request * and it is raise <b>after</b> the {@link onPageIndexChanged OnPageIndexChanged} event. - * + * * @author "gevik" (forum contributor) and Christophe Boulain (Christophe.Boulain@gmail.com) - * @version $Id: TActivePager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1.2 */ @@ -41,7 +39,7 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl parent::__construct(); $this->setAdapter(new TActiveControlAdapter($this)); } - + /** * @return TBaseActiveControl standard active control options. */ @@ -60,11 +58,11 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl /** * Raises the callback event. This method is required by {@link - * ICallbackEventHandler} interface. + * ICallbackEventHandler} interface. * This method is mainly used by framework and control developers. * @param TCallbackEventParameter the event parameter */ - + public function raiseCallbackEvent($param) { $this->onCallback($param); @@ -82,7 +80,7 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl { $this->raiseEvent('OnCallback', $this, $param); } - + /** * Builds a dropdown list pager * Override parent implementation to build Active dropdown lists. @@ -90,25 +88,25 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl protected function buildListPager() { $list=new TActiveDropDownList; - + $list->getAdapter()->getBaseActiveControl()->setClientSide( $this->getClientSide() ); - + $this->getControls()->add($list); $list->setDataSource(range(1,$this->getPageCount())); $list->dataBind(); $list->setSelectedIndex($this->getCurrentPageIndex()); $list->setAutoPostBack(true); $list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged')); - $list->attachEventHandler('OnCallback', array($this, 'handleCallback')); - } - + $list->attachEventHandler('OnCallback', array($this, 'handleCallback')); + } + /** * Creates a pager button. * Override parent implementation to create, depending on the button type, a TActiveLinkButton, * a TActiveButton or a TActiveImageButton may be created. - * + * * @param string button type, either LinkButton or PushButton * @param boolean whether the button should be enabled * @param string caption of the button @@ -144,28 +142,28 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl if(!$enabled) $button->setEnabled(false); } - + if($buttonType===TPagerButtonType::ImageButton) { $button->ImageUrl = $text; } - + $button->setText($text); $button->setCommandName($commandName); $button->setCommandParameter($commandParameter); $button->setCausesValidation(false); - - $button->attachEventHandler('OnCallback', array($this, 'handleCallback')); + + $button->attachEventHandler('OnCallback', array($this, 'handleCallback')); $button->getAdapter()->getBaseActiveControl()->setClientSide( $this->getClientSide() ); - + return $button; } - + /** * Event handler to the OnCallback active buttons or active dropdownlist. - * This handler will raise the {@link onCallback OnCallback} event + * This handler will raise the {@link onCallback OnCallback} event * * @param mixed $sender * @param TCallbackEventParameter $param @@ -181,14 +179,14 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl { $control->render($param->getNewWriter()); // FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting - // of getting the same boundaries in ajax response. Wait 1 microsecond to avoid this. + // of getting the same boundaries in ajax response. Wait 1 microsecond to avoid this. usleep(1); } } // Raise callback event $this->onCallback($param); - } - + } + public function render ($writer) { if($this->getHasPreRendered()) diff --git a/framework/Web/UI/ActiveControls/TActivePanel.php b/framework/Web/UI/ActiveControls/TActivePanel.php index 39636cad..4b00b013 100644 --- a/framework/Web/UI/ActiveControls/TActivePanel.php +++ b/framework/Web/UI/ActiveControls/TActivePanel.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActivePanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -32,7 +31,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActivePanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -87,7 +85,7 @@ class TActivePanel extends TPanel implements IActiveControl if ($this->getHasControls()) { // If we update a TActivePanel on callback, - // We shouldn't update all childs, because the whole content will be replaced by + // We shouldn't update all childs, because the whole content will be replaced by // the parent foreach ($this->findControlsByType('IActiveControl', false) as $control) { diff --git a/framework/Web/UI/ActiveControls/TActiveRadioButton.php b/framework/Web/UI/ActiveControls/TActiveRadioButton.php index d192536a..46dbbaf7 100644 --- a/framework/Web/UI/ActiveControls/TActiveRadioButton.php +++ b/framework/Web/UI/ActiveControls/TActiveRadioButton.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -25,7 +24,6 @@ * and can not be changed using javascript. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -121,7 +119,7 @@ class TActiveRadioButton extends TRadioButton implements IActiveControl, ICallba * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. * Since 3.1.4, the javascript code is not rendered if {@link setAutoPostBack AutoPostBack} is false - * + * */ protected function renderInputTag($writer,$clientID,$onclick) { diff --git a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php index 3244ce11..84a71951 100644 --- a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php +++ b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -31,7 +30,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveRadioButton'); * List items can not be changed dynamically during a callback request. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -79,7 +77,7 @@ class TActiveRadioButtonList extends TRadioButtonList implements IActiveControl, */ protected function createRepeatedControl() { - $control = new TActiveRadioButton; + $control = new TActiveRadioButtonItem; $control->getAdapter()->setBaseActiveControl($this->getActiveControl()); return $control; } @@ -117,5 +115,31 @@ class TActiveRadioButtonList extends TRadioButtonList implements IActiveControl, $this->getActiveControl()->registerCallbackClientScript( $this->getClientClassName(), $this->getPostBackOptions()); } + + /** + * Gets the name of the javascript class responsible for performing postback for this control. + * This method overrides the parent implementation. + * @return string the javascript class name + */ + protected function getClientClassName() + { + return 'Prado.WebUI.TActiveRadioButtonList'; + } + } + +class TActiveRadioButtonItem extends TActiveRadioButton +{ + /** + * Override client implementation to avoid emitting the javascript + * + * @param THtmlWriter the writer for the rendering purpose + * @param string checkbox id + * @param string onclick js + */ + protected function renderInputTag($writer,$clientID,$onclick) + { + TRadioButton::renderInputTag($writer,$clientID,$onclick); + } +}
\ No newline at end of file diff --git a/framework/Web/UI/ActiveControls/TActiveRatingList.php b/framework/Web/UI/ActiveControls/TActiveRatingList.php index 022efe65..2b1c764c 100644 --- a/framework/Web/UI/ActiveControls/TActiveRatingList.php +++ b/framework/Web/UI/ActiveControls/TActiveRatingList.php @@ -5,7 +5,7 @@ * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.ActiveControls @@ -116,7 +116,7 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback public function setCaption($value) { parent::setCaption($value); - // if it's an active control, this should not be needed. + // if it's an active control, this should not be needed. $this->callClientFunction('setCaption',$value); } diff --git a/framework/Web/UI/ActiveControls/TActiveRepeater.php b/framework/Web/UI/ActiveControls/TActiveRepeater.php index 08e6f93a..08aeefab 100644 --- a/framework/Web/UI/ActiveControls/TActiveRepeater.php +++ b/framework/Web/UI/ActiveControls/TActiveRepeater.php @@ -5,7 +5,6 @@ * @author LANDWEHR Computer und Software GmbH <programmierung@landwehr-software.de> * @package System.Web.UI.ActiveControls * @since 3.1.9 - * @version $Id: TActiveRepeater.php 2707 2009-09-29 10:33:30Z Christophe.Boulain $ */ /** diff --git a/framework/Web/UI/ActiveControls/TActiveTextBox.php b/framework/Web/UI/ActiveControls/TActiveTextBox.php index 5f96ff29..1b8791fd 100644 --- a/framework/Web/UI/ActiveControls/TActiveTextBox.php +++ b/framework/Web/UI/ActiveControls/TActiveTextBox.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -25,7 +24,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * event. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TActiveTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TAutoComplete.php b/framework/Web/UI/ActiveControls/TAutoComplete.php new file mode 100644 index 00000000..4ed0d34c --- /dev/null +++ b/framework/Web/UI/ActiveControls/TAutoComplete.php @@ -0,0 +1,438 @@ +<?php +/** + * TAutoComplete class file. + * + * @author Wei Zhuo <weizhuo[at]gamil[dot]com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System.Web.UI.ActiveControls + */ + +/** + * Load active text box. + */ +Prado::using('System.Web.UI.ActiveControls.TActiveTextBox'); +Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter'); + +/** + * TAutoComplete class. + * + * TAutoComplete is a textbox that provides a list of suggestion on + * the current partial word typed in the textbox. The suggestions are + * requested using callbacks, and raises the {@link onSuggestion OnSuggestion} + * event. The events of the TActiveText (from which TAutoComplete is extended from) + * and {@link onSuggestion OnSuggestion} are mutually exculsive. That is, + * if {@link onTextChange OnTextChange} and/or {@link onCallback OnCallback} + * events are raise, then {@link onSuggestion OnSuggestion} will not be raise, and + * vice versa. + * + * The list of suggestions should be set in the {@link onSuggestion OnSuggestion} + * event handler. The partial word to match the suggestion is in the + * {@link TCallbackEventParameter::getCallbackParameter TCallbackEventParameter::CallbackParameter} + * property. The datasource of the TAutoComplete must be set using {@link setDataSource} + * method. This sets the datasource for the suggestions repeater, available through + * the {@link getSuggestions Suggestions} property. Header, footer templates and + * other properties of the repeater can be access via the {@link getSuggestions Suggestions} + * property and its sub-properties. + * + * The {@link setTextCssClass TextCssClass} property if set is used to find + * the element within the Suggestions.ItemTemplate and Suggestions.AlternatingItemTemplate + * that contains the actual text for the suggestion selected. That is, + * only text inside elements with CSS class name equal to {@link setTextCssClass TextCssClass} + * will be used as suggestions. + * + * To return the list of suggestions back to the browser, supply a non-empty data source + * and call databind. For example, + * <code> + * function autocomplete_suggestion($sender, $param) + * { + * $token = $param->getToken(); //the partial word to match + * $sender->setDataSource($this->getSuggestionsFor($token)); //set suggestions + * $sender->dataBind(); + * } + * </code> + * + * The suggestion will be rendered when the {@link dataBind()} method is called + * <strong>during a callback request</strong>. + * + * When an suggestion is selected, that is, when the use has clicked, pressed + * the "Enter" key, or pressed the "Tab" key, the {@link onSuggestionSelected OnSuggestionSelected} + * event is raised. The + * {@link TCallbackEventParameter::getCallbackParameter TCallbackEventParameter::CallbackParameter} + * property contains the index of the selected suggestion. + * + * TAutoComplete allows multiple suggestions within one textbox with each + * word or phrase separated by any characters specified in the + * {@link setSeparator Separator} property. The {@link setFrequency Frequency} + * and {@link setMinChars MinChars} properties sets the delay and minimum number + * of characters typed, respectively, before requesting for sugggestions. + * + * Use {@link onTextChange OnTextChange} and/or {@link onCallback OnCallback} events + * to handle post backs due to {@link setAutoPostBack AutoPostBack}. + * + * In the {@link getSuggestions Suggestions} TRepater item template, all HTML text elements + * are considered as text for the suggestion. Text within HTML elements with CSS class name + * "informal" are ignored as text for suggestions. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @package System.Web.UI.ActiveControls + * @since 3.1 + */ +class TAutoComplete extends TActiveTextBox implements INamingContainer +{ + /** + * @var ITemplate template for repeater items + */ + private $_repeater=null; + /** + * @var TPanel result panel holding the suggestion items. + */ + private $_resultPanel=null; + + /** + * @return string word or token separators (delimiters). + */ + public function getSeparator() + { + return $this->getViewState('tokens', ''); + } + + /** + * @return string word or token separators (delimiters). + */ + public function setSeparator($value) + { + $this->setViewState('tokens', TPropertyValue::ensureString($value), ''); + } + + /** + * @return float maximum delay (in seconds) before requesting a suggestion. + */ + public function getFrequency() + { + return $this->getViewState('frequency', ''); + } + + /** + * @param float maximum delay (in seconds) before requesting a suggestion. + * Default is 0.4. + */ + public function setFrequency($value) + { + $this->setViewState('frequency', TPropertyValue::ensureFloat($value),''); + } + + /** + * @return integer minimum number of characters before requesting a suggestion. + */ + public function getMinChars() + { + return $this->getViewState('minChars',''); + } + + /** + * @param integer minimum number of characters before requesting a suggestion. + */ + public function setMinChars($value) + { + $this->setViewState('minChars', TPropertyValue::ensureInteger($value), ''); + } + + /** + * @param string Css class name of the element to use for suggestion. + */ + public function setTextCssClass($value) + { + $this->setViewState('TextCssClass', $value); + } + + /** + * @return string Css class name of the element to use for suggestion. + */ + public function getTextCssClass() + { + return $this->getViewState('TextCssClass'); + } + + /** + * Raises the callback event. This method is overrides the parent implementation. + * If {@link setAutoPostBack AutoPostBack} is enabled it will raise + * {@link onTextChanged OnTextChanged} event event and then the + * {@link onCallback OnCallback} event. The {@link onSuggest OnSuggest} event is + * raise if the request is to find sugggestions, the {@link onTextChanged OnTextChanged} + * and {@link onCallback OnCallback} events are <b>NOT</b> raised. + * This method is mainly used by framework and control developers. + * @param TCallbackEventParameter the event parameter + */ + public function raiseCallbackEvent($param) + { + $token = $param->getCallbackParameter(); + if(is_array($token) && count($token) == 2) + { + if($token[1] === '__TAutoComplete_onSuggest__') + { + $parameter = new TAutoCompleteEventParameter($this->getResponse(), $token[0]); + $this->onSuggest($parameter); + } + else if($token[1] === '__TAutoComplete_onSuggestionSelected__') + { + $parameter = new TAutoCompleteEventParameter($this->getResponse(), null, $token[0]); + $this->onSuggestionSelected($parameter); + } + } + else if($this->getAutoPostBack()) + parent::raiseCallbackEvent($param); + } + + /** + * This method is invoked when an autocomplete suggestion is requested. + * The method raises 'OnSuggest' event. If you override this + * method, be sure to call the parent implementation so that the event + * handler can be invoked. + * @param TCallbackEventParameter event parameter to be passed to the event handlers + */ + public function onSuggest($param) + { + $this->raiseEvent('OnSuggest', $this, $param); + } + + /** + * This method is invoked when an autocomplete suggestion is selected. + * The method raises 'OnSuggestionSelected' event. If you override this + * method, be sure to call the parent implementation so that the event + * handler can be invoked. + * @param TCallbackEventParameter event parameter to be passed to the event handlers + */ + public function onSuggestionSelected($param) + { + $this->raiseEvent('OnSuggestionSelected', $this, $param); + } + + /** + * @param array data source for suggestions. + */ + public function setDataSource($data) + { + $this->getSuggestions()->setDataSource($data); + } + + /** + * Overrides parent implementation. Callback {@link renderSuggestions()} when + * page's IsCallback property is true. + */ + public function dataBind() + { + parent::dataBind(); + if($this->getPage()->getIsCallback()) + $this->renderSuggestions($this->getResponse()->createHtmlWriter()); + } + + /** + * @return TPanel suggestion results panel. + */ + public function getResultPanel() + { + if($this->_resultPanel===null) + $this->_resultPanel = $this->createResultPanel(); + return $this->_resultPanel; + } + + /** + * @return TPanel new instance of result panel. Default uses TPanel. + */ + protected function createResultPanel() + { + $panel = Prado::createComponent('System.Web.UI.WebControls.TPanel'); + $this->getControls()->add($panel); + $panel->setID('result'); + return $panel; + } + + /** + * @return TRepeater suggestion list repeater + */ + public function getSuggestions() + { + if($this->_repeater===null) + $this->_repeater = $this->createRepeater(); + return $this->_repeater; + } + + /** + * @return TRepeater new instance of TRepater to render the list of suggestions. + */ + protected function createRepeater() + { + $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater'); + $repeater->setHeaderTemplate(new TAutoCompleteTemplate('<ul>')); + $repeater->setFooterTemplate(new TAutoCompleteTemplate('</ul>')); + $repeater->setItemTemplate(new TTemplate('<li><%# $this->DataItem %></li>',null)); + $repeater->setEmptyTemplate(new TAutoCompleteTemplate('<ul></ul>')); + $this->getControls()->add($repeater); + return $repeater; + } + + /** + * Renders the end tag and registers the needed javascript library. + */ + public function renderEndTag($writer) + { + $cs=$this->getPage()->getClientScript(); + $cs->registerPradoScript('autocomplete'); + parent::renderEndTag($writer); + $this->renderResultPanel($writer); + } + + /** + * Renders the result panel. + * @param THtmlWriter the renderer. + */ + protected function renderResultPanel($writer) + { + $this->getResultPanel()->render($writer); + } + + /** + * Renders the suggestions during a callback respones. + * @param THtmlWriter the renderer. + */ + public function renderCallback($writer) + { + $this->renderSuggestions($writer); + } + + /** + * Renders the suggestions repeater. + * @param THtmlWriter the renderer. + */ + public function renderSuggestions($writer) + { + if($this->getActiveControl()->canUpdateClientSide()) + { + $this->getSuggestions()->render($writer); + $boundary = $writer->getWriter()->getBoundary(); + $this->getResponse()->getAdapter()->setResponseData($boundary); + } + } + + /** + * @return array list of callback options. + */ + protected function getPostBackOptions() + { + //disallow page state update ? + //$this->getActiveControl()->getClientSide()->setEnablePageStateUpdate(false); + $options = array(); + if(strlen($string = $this->getSeparator())) + { + $string = strtr($string,array('\t'=>"\t",'\n'=>"\n",'\r'=>"\r")); + $token = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY); + $options['tokens'] = $token; + } + if($this->getAutoPostBack()) + { + $options = array_merge($options,parent::getPostBackOptions()); + $options['AutoPostBack'] = true; + } + if(strlen($select = $this->getTextCssClass())) + $options['select'] = $select; + $options['ResultPanel'] = $this->getResultPanel()->getClientID(); + $options['ID'] = $this->getClientID(); + $options['EventTarget'] = $this->getUniqueID(); + if(($minchars=$this->getMinChars())!=='') + $options['minChars'] = $minchars; + if(($frequency=$this->getFrequency())!=='') + $options['frequency'] = $frequency; + $options['CausesValidation'] = $this->getCausesValidation(); + $options['ValidationGroup'] = $this->getValidationGroup(); + return $options; + } + + /** + * Override parent implementation, no javascript is rendered here instead + * the javascript required for active control is registered in {@link addAttributesToRender}. + */ + protected function renderClientControlScript($writer) + { + } + + /** + * @return string corresponding javascript class name for this TActiveButton. + */ + protected function getClientClassName() + { + return 'Prado.WebUI.TAutoComplete'; + } +} + +/** + * TAutCompleteEventParameter contains the {@link getToken Token} requested by + * the user for a partial match of the suggestions. + * + * The {@link getSelectedIndex SelectedIndex} is a zero-based index of the + * suggestion selected by the user, -1 if not suggestion is selected. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @package System.Web.UI.ActiveControls + * @since 3.1 + */ +class TAutoCompleteEventParameter extends TCallbackEventParameter +{ + private $_selectedIndex=-1; + + /** + * Creates a new TCallbackEventParameter. + */ + public function __construct($response, $parameter, $index=-1) + { + parent::__construct($response, $parameter); + $this->_selectedIndex=$index; + } + + /** + * @return int selected suggestion zero-based index, -1 if not selected. + */ + public function getSelectedIndex() + { + return $this->_selectedIndex; + } + + /** + * @return string token for matching a list of suggestions. + */ + public function getToken() + { + return $this->getCallbackParameter(); + } +} + +/** + * TAutoCompleteTemplate class. + * + * TAutoCompleteTemplate is the default template for TAutoCompleteTemplate + * item template. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @package System.Web.UI.ActiveControls + * @since 3.1 + */ +class TAutoCompleteTemplate extends TComponent implements ITemplate +{ + private $_template; + + public function __construct($template) + { + $this->_template = $template; + } + /** + * Instantiates the template. + * It creates a {@link TDataList} control. + * @param TControl parent to hold the content within the template + */ + public function instantiateIn($parent) + { + $parent->getControls()->add($this->_template); + } +} + diff --git a/framework/Web/UI/ActiveControls/TBaseActiveControl.php b/framework/Web/UI/ActiveControls/TBaseActiveControl.php index f4daec02..c9b6f36e 100644 --- a/framework/Web/UI/ActiveControls/TBaseActiveControl.php +++ b/framework/Web/UI/ActiveControls/TBaseActiveControl.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -23,7 +22,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackClientSide'); * response returns. * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> - * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -155,7 +153,6 @@ class TBaseActiveControl extends TComponent * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TCallback.php b/framework/Web/UI/ActiveControls/TCallback.php index 2c20567c..557001b2 100644 --- a/framework/Web/UI/ActiveControls/TCallback.php +++ b/framework/Web/UI/ActiveControls/TCallback.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -37,7 +36,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php index 96c8d38e..82f597bb 100644 --- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php +++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCallbackClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -54,7 +53,6 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> - * @version $Id: TCallbackClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -94,7 +92,7 @@ class TCallbackClientScript extends TApplicationComponent if(count($params) > 0) { - if ($params[0] instanceof ISurroundable) + if ($params[0] instanceof ISurroundable) $params[0] = $params[0]->getSurroundingTagID(); elseif($params[0] instanceof TControl) $params[0] = $params[0]->getClientID(); @@ -110,7 +108,7 @@ class TCallbackClientScript extends TApplicationComponent */ public function jQuery($element, $method, $params=array()) { - if ($element instanceof ISurroundable) + if ($element instanceof ISurroundable) $element = $element->getSurroundingTagID(); elseif($element instanceof TControl) $element = $element->getClientID(); @@ -179,7 +177,7 @@ class TCallbackClientScript extends TApplicationComponent /** * Client script to click on an element. <b>This client-side function is unpredictable.</b> - * + * * @param TControl control element or element id */ public function click($control) @@ -233,14 +231,14 @@ class TCallbackClientScript extends TApplicationComponent { $promptText = $control->getPromptText(); $promptValue = $control->getPromptValue(); - + if($promptValue==='') $promptValue = $promptText; - + if($promptValue!=='') $options[] = array($promptText, $promptValue); } - + foreach($items as $item) { if($item->getHasAttributes()) @@ -338,7 +336,7 @@ class TCallbackClientScript extends TApplicationComponent /** * Scroll the top of the browser viewing area to the location of the * element. - * + * * @param TControl control element or element id * @param array additional options: 'duration' in ms, 'offset' from the top in pixels */ @@ -480,7 +478,7 @@ class TCallbackClientScript extends TApplicationComponent { $boundary = $this->getResponseContentBoundary($content); } - + $this->callClientFunction('Prado.Element.appendScriptBlock', array($boundary)); } diff --git a/framework/Web/UI/ActiveControls/TCallbackClientSide.php b/framework/Web/UI/ActiveControls/TCallbackClientSide.php index ec993c14..449bea80 100644 --- a/framework/Web/UI/ActiveControls/TCallbackClientSide.php +++ b/framework/Web/UI/ActiveControls/TCallbackClientSide.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCallbackClientSide.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -28,8 +27,8 @@ * * * Note that theses 2 events are not fired correctly by Opera. To make * them work in this browser, Prado will fire them just after onPreDispatch. - * - * In a general way, onUninitialized, onLoading, onLoaded and onInteractive events + * + * In a general way, onUninitialized, onLoading, onLoaded and onInteractive events * are not implemented consistently in all browsers.When cross browser compatibility is * needed, it is best to avoid use them * @@ -46,7 +45,6 @@ * viewstate update. This will automatically set HasPriority to true when enabled. * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> - * @version $Id: TCallbackClientSide.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TCallbackEventParameter.php b/framework/Web/UI/ActiveControls/TCallbackEventParameter.php index 728ebbba..2d4451a8 100644 --- a/framework/Web/UI/ActiveControls/TCallbackEventParameter.php +++ b/framework/Web/UI/ActiveControls/TCallbackEventParameter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.ActiveControls @@ -28,7 +28,6 @@ * callback handler function) can be set using {@link setResponseData ResponseData} property. * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> - * @version $Id: TActivePageAdapter.php 1648 2007-01-24 05:52:22Z wei $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TCallbackOptions.php b/framework/Web/UI/ActiveControls/TCallbackOptions.php index 19d53aeb..0d929ed1 100644 --- a/framework/Web/UI/ActiveControls/TCallbackOptions.php +++ b/framework/Web/UI/ActiveControls/TCallbackOptions.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCallbackOptions.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -17,7 +16,6 @@ * to be attached to other active controls. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TCallbackOptions.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php b/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php index 47b5fae4..cad3c9ee 100755 --- a/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php +++ b/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -22,7 +21,6 @@ * property. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -110,7 +108,6 @@ class TCallbackResponseAdapter extends THttpResponseAdapter * is generated using microtime. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TDraggable.php b/framework/Web/UI/ActiveControls/TDraggable.php index df92bec5..fe2ac4cc 100755 --- a/framework/Web/UI/ActiveControls/TDraggable.php +++ b/framework/Web/UI/ActiveControls/TDraggable.php @@ -1,17 +1,16 @@ <?php /** * TDraggable class file - * + * * @author Christophe BOULAIN (Christophe.Boulain@gmail.com) * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license * @package System.Web.UI.ActiveControls - * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $ */ /** * TDraggable is a control which can be dragged - * + * * This control will make "draggable" control. * Properties : * @@ -21,14 +20,13 @@ * <b>{@link setRevert Revert}</b>: Set to True if you want your dragged element to revert to its initial position if not dropped on a valid area. * <b>{@link setConstraint Constraint}</b>: Set this to Horizontal or Vertical if you want to constraint your move in one direction. * <b>{@link setHandle Handle}</b>: - * + * * @author Christophe BOULAIN (Christophe.Boulain@gmail.com) * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license * @package System.Web.UI.ActiveControls - * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $ */ -class TDraggable extends TPanel +class TDraggable extends TPanel { /** * Set the handle id or css class @@ -38,7 +36,7 @@ class TDraggable extends TPanel { $this->setViewState('DragHandle', TPropertyValue::ensureString($value), null); } - + /** * Get the handle id or css class * @return string @@ -47,7 +45,7 @@ class TDraggable extends TPanel { return $this->getViewState('DragHandle', null); } - + /** * Determine if draggable element should revert to it orginal position * upon release in an non-droppable container. @@ -61,7 +59,7 @@ class TDraggable extends TPanel { return $this->getViewState('Revert', TDraggableRevertOptions::Revert); } - + /** * Sets whether the draggable element should revert to it orginal position * upon release in an non-droppable container. @@ -79,7 +77,7 @@ class TDraggable extends TPanel $value=TDraggableRevertOptions::None; $this->setViewState('Revert', TPropertyValue::ensureEnum($value, 'TDraggableRevertOptions'), true); } - + /** * Determine if the element should be cloned when dragged * If true, Clones the element and drags the clone, leaving the original in place until the clone is dropped. @@ -96,7 +94,7 @@ class TDraggable extends TPanel { return $this->getViewState('Ghosting', TDraggableGhostingOptions::None); } - + /** * Sets wether the element should be cloned when dragged * If true, Clones the element and drags the clone, leaving the original in place until the clone is dropped. @@ -117,7 +115,7 @@ class TDraggable extends TPanel $value=TDraggableGhostingOptions::None; $this->setViewState('Ghosting', TPropertyValue::ensureEnum($value, 'TDraggableGhostingOptions'), TDraggableGhostingOptions::None); } - + /** * Determine if the element should be constrainted in one direction or not * @return CDraggableConstraint @@ -126,7 +124,7 @@ class TDraggable extends TPanel { return $this->getViewState('Constraint', TDraggableConstraint::None); } - + /** * Set wether the element should be constrainted in one direction * @param CDraggableConstraint @@ -135,7 +133,7 @@ class TDraggable extends TPanel { $this->setViewState('Constraint', TPropertyValue::ensureEnum($value, 'TDraggableConstraint'), TDraggableConstraint::None); } - + /** * Registers clientscripts * @@ -166,7 +164,7 @@ class TDraggable extends TPanel $code="new {$class}('{$this->getClientId()}', {$options}) "; $cs->registerEndScript(sprintf('%08X', crc32($code)), $code); } - + /** * Gets the name of the javascript class responsible for performing postback for this control. * This method overrides the parent implementation. @@ -176,7 +174,7 @@ class TDraggable extends TPanel { return 'Draggable'; } - + /** * Gets the post back options for this textbox. * @return array @@ -193,7 +191,7 @@ class TDraggable extends TPanel else $options['revert']=strtolower($revert); if (($constraint=$this->getConstraint())!==TDraggableConstraint::None) $options['constraint']=strtolower($constraint); - switch ($this->getGhosting()) + switch ($this->getGhosting()) { case TDraggableGhostingOptions::SuperGhosting: $options['superghosting']=true; @@ -205,7 +203,7 @@ class TDraggable extends TPanel return $options; } - + } /** @@ -213,7 +211,6 @@ class TDraggable extends TPanel * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license * @package System.Web.UI.ActiveControls - * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $ */ class TDraggableConstraint extends TEnumerable { @@ -227,7 +224,6 @@ class TDraggableConstraint extends TEnumerable * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license * @package System.Web.UI.ActiveControls - * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $ */ class TDraggableGhostingOptions extends TEnumerable { @@ -241,7 +237,6 @@ class TDraggableGhostingOptions extends TEnumerable * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license * @package System.Web.UI.ActiveControls - * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $ */ class TDraggableRevertOptions extends TEnumerable { diff --git a/framework/Web/UI/ActiveControls/TDropContainer.php b/framework/Web/UI/ActiveControls/TDropContainer.php index 43e8017c..e0fea5df 100755 --- a/framework/Web/UI/ActiveControls/TDropContainer.php +++ b/framework/Web/UI/ActiveControls/TDropContainer.php @@ -1,13 +1,11 @@ <?php /** * TDropContainer class file - * + * * @author Christophe BOULAIN (Christophe.Boulain@gmail.com) * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license - * @version $Id: TDropContainer.php 3159 2012-2013 PradoSoft * @license http://www.pradosoft.com/license - * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -24,29 +22,28 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel'); /** * TDropContainer is a panel where TDraggable controls can be dropped. * When a TDraggable component is dropped into a TDropContainer, the {@link OnDrop OnDrop} event is raised. - * The {@link TDropContainerEventParameter} param will contain the dropped control. - * + * The {@link TDropContainerEventParameter} param will contain the dropped control. + * * Properties : - * + * * <b>{@link setAcceptCssClass AcceptCssClass}</b> : a coma delimited classname of elements that the drop container can accept. * <b>{@link setHoverCssClass HoverCssClass}</b>: CSS classname of the container when a draggable element hovers over the container. - * + * * Events: - * + * * <b>{@link OnDrop OnDrop}</b> : raised when a TDraggable control is dropped. The dropped control id is encapsulated in the event parameter, * as well as mouse coordinates and key modifiers status * - * + * * @author Christophe BOULAIN (Christophe.Boulain@gmail.com) * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license - * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ -class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler -{ +class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler +{ private $_container=null; - + /** * Creates a new callback control, sets the adapter to * TActiveControlAdapter. If you override this class, be sure to set the @@ -91,7 +88,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan { $this->setViewState('Accepts', TPropertyValue::ensureArray($value), ''); } - + /** * Sets the Css class name used when a draggble element is hovering * over this container. @@ -111,8 +108,8 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan { return $this->getViewState('HoverClass', ''); } - - + + /** * Raises callback event. This method is required bu {@link ICallbackEventHandler} * interface. @@ -125,19 +122,19 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan $this->onDrop($param->getCallbackParameter()); $this->onCallback($param); } - + /** - * Raises the onDrop event. + * Raises the onDrop event. * The drop parameters are encapsulated into a {@link TDropContainerEventParameter} - * + * * @param object $dropControlId */ public function onDrop ($dropParams) { $this->raiseEvent('OnDrop', $this, new TDropContainerEventParameter ($dropParams)); - + } - + /** * This method is invoked when a callback is requested. The method raises * 'OnCallback' event to fire up the event handlers. If you override this @@ -149,7 +146,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan { $this->raiseEvent('OnCallback', $this, $param); } - + /** * Gets the post back options for this textbox. * @return array @@ -163,7 +160,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan $options['hoverclass'] = $this->getHoverCssClass(); return $options; } - + /** * Gets the name of the javascript class responsible for performing postback for this control. * This method overrides the parent implementation. @@ -172,7 +169,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan protected function getClientClassName() { return 'Prado.WebUI.DropContainer'; - } + } /** * Registers clientscripts @@ -198,7 +195,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan $this->getActiveControl()->registerCallbackClientScript( $this->getClientClassName(), $this->getPostBackOptions()); } - + /** * Creates child control * Override parent implementation to create a container which will contain all @@ -214,7 +211,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan parent::getControls()->add($this->_container); } } - + /** * Override parent implementation to return the container control collection. * @@ -225,7 +222,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan $this->ensureChildControls(); return $this->_container->getControls(); } - + /** * Renders and replaces the panel's content on the client-side. * When render() is called before the OnPreRender event, such as when render() @@ -246,19 +243,18 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan $this->getPage()->getAdapter()->registerControlToRender($this->_container,$writer); } } - + } /** * TDropContainerEventParameter class - * + * * TDropContainerEventParameter encapsulate the parameter * data for <b>OnDrop</b> event of TDropContainer components - * + * * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2008, PradoSoft * @license http://www.pradosoft.com/license - * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ class TDropContainerEventParameter extends TEventParameter diff --git a/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php b/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php index 4f1dbbf8..53d6aead 100644 --- a/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php +++ b/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TEventTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -22,7 +21,6 @@ Prado::using('System.Web.UI.ActiveControls.TTriggeredCallback'); * {@link setPreventDefaultAction PreventDefaultAction} is set to true. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TEventTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php index 5309b7e8..012f2da3 100644 --- a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php +++ b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TInPlaceTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -38,9 +37,8 @@ Prado::using('System.Web.UI.ActiveControls.TActiveTextBox'); * * Since 3.1.2, you can set the {@link setReadOnly ReadOnly} property to make * the control not editable. This property can be also changed on callback - * + * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TInPlaceTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -145,7 +143,7 @@ class TInPlaceTextBox extends TActiveTextBox $client->setValue($this, $value); } } - + /** * Update ClientSide Readonly property * @param boolean value @@ -232,7 +230,7 @@ class TInPlaceTextBox extends TActiveTextBox if($this->hasEventHandler('OnLoadingText')) $options['LoadTextOnEdit'] = true; - + $options['ReadOnly']=$this->getReadOnly(); return $options; } diff --git a/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php b/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php index 46df7a22..bc250521 100644 --- a/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php +++ b/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTimeTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -26,7 +25,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallback'); * {@link setStartTimerOnLoad StartTimerOnLoad} is true. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TTimeTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TTriggeredCallback.php b/framework/Web/UI/ActiveControls/TTriggeredCallback.php index 2365326b..544707b0 100644 --- a/framework/Web/UI/ActiveControls/TTriggeredCallback.php +++ b/framework/Web/UI/ActiveControls/TTriggeredCallback.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -18,7 +17,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallback'); * property sets the control ID to observe the trigger. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php b/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php index e9db1bed..0b323066 100644 --- a/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php +++ b/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TValueTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -25,7 +24,6 @@ Prado::using('System.Web.UI.ActiveControls.TTriggeredCallback'); * observed, the polling interval is reset to the original value. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TValueTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/JuiControls/TJuiAutoComplete.php b/framework/Web/UI/JuiControls/TJuiAutoComplete.php index a8bf2d81..9f6432bf 100644 --- a/framework/Web/UI/JuiControls/TJuiAutoComplete.php +++ b/framework/Web/UI/JuiControls/TJuiAutoComplete.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJuiAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -77,7 +76,6 @@ Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter'); * "informal" are ignored as text for suggestions. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TJuiAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -360,7 +358,6 @@ class TJuiAutoComplete extends TActiveTextBox implements INamingContainer, IJuiO * suggestion selected by the user, -1 if not suggestion is selected. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TJuiAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -401,7 +398,6 @@ class TJuiAutoCompleteEventParameter extends TCallbackEventParameter * item template. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TJuiAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ diff --git a/framework/Web/UI/JuiControls/TJuiControlAdapter.php b/framework/Web/UI/JuiControls/TJuiControlAdapter.php index d92809d3..58ca34da 100644 --- a/framework/Web/UI/JuiControls/TJuiControlAdapter.php +++ b/framework/Web/UI/JuiControls/TJuiControlAdapter.php @@ -4,9 +4,8 @@ * * @author Fabio Bas <ctrlaltca@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2013-2013 PradoSoft + * @copyright Copyright © 2013-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJuiControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls */ @@ -19,7 +18,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * derived from a jQuery-ui widget. * * @author Fabio Bas <ctrlaltca@gmail.com> - * @version $Id: TJuiControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls * @since 3.3 */ @@ -84,11 +82,10 @@ class TJuiControlAdapter extends TActiveControlAdapter /** * IJuiOptions interface * - * IJuiOptions is the interface that must be implemented by controls using + * IJuiOptions is the interface that must be implemented by controls using * {@link TJuiControlOptions}. * * @author Fabio Bas <ctrlaltca@gmail.com> - * @version $Id: TJuiControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls * @since 3.3 */ @@ -109,7 +106,6 @@ interface IJuiOptions * The options array can then get retrieved using {@link toArray} and applied to the jQuery-ui widget. * * @author Fabio Bas <ctrlaltca@gmail.com> - * @version $Id: TJuiControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls * @since 3.3 */ diff --git a/framework/Web/UI/JuiControls/TJuiDraggable.php b/framework/Web/UI/JuiControls/TJuiDraggable.php index eb174eb0..19d334aa 100644 --- a/framework/Web/UI/JuiControls/TJuiDraggable.php +++ b/framework/Web/UI/JuiControls/TJuiDraggable.php @@ -4,9 +4,8 @@ * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2013-2013 PradoSoft + * @copyright Copyright © 2013-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJuiDraggable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls */ @@ -27,7 +26,6 @@ Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter'); * </code> * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> - * @version $Id: TJuiDraggable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls * @since 3.3 */ diff --git a/framework/Web/UI/JuiControls/TJuiDroppable.php b/framework/Web/UI/JuiControls/TJuiDroppable.php index e54d4eac..6c07e49c 100644 --- a/framework/Web/UI/JuiControls/TJuiDroppable.php +++ b/framework/Web/UI/JuiControls/TJuiDroppable.php @@ -4,9 +4,8 @@ * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2013-2013 PradoSoft + * @copyright Copyright © 2013-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJuiDroppable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls */ @@ -23,7 +22,7 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel'); * > * drag me * </com:TJuiDraggable> - * + * * <com:TJuiDroppable * ID="drop1" * Style="border: 1px solid blue; width:600px;height:600px; background-color: lime" @@ -45,7 +44,6 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel'); * </code> * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> - * @version $Id: TJuiDroppable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls * @since 3.3 */ @@ -105,19 +103,19 @@ class TJuiDroppable extends TActivePanel implements IJuiOptions, ICallbackEventH $this->onDrop($param->getCallbackParameter()); $this->onCallback($param); } - + /** - * Raises the onDrop event. - * The drop parameters are encapsulated into a {@link TDropContainerEventParameter} - * + * Raises the onDrop event. + * The drop parameters are encapsulated into a {@link TJuiDroppableEventParameter} + * * @param object $dropControlId */ public function onDrop ($dropParams) { $this->raiseEvent('OnDrop', $this, new TJuiDroppableEventParameter ($this->getResponse(), $dropParams)); - + } - + /** * This method is invoked when a callback is requested. The method raises * 'OnCallback' event to fire up the event handlers. If you override this @@ -148,14 +146,12 @@ class TJuiDroppable extends TActivePanel implements IJuiOptions, ICallbackEventH /** * TJuiDroppableEventParameter class - * + * * TJuiDroppableEventParameter encapsulate the parameter * data for <b>OnDrop</b> event of TJuiDroppable components - * - * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) - * @copyright Copyright © 2008, PradoSoft + * + * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> * @license http://www.pradosoft.com/license - * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $ * @package System.Web.UI.JuiControls */ class TJuiDroppableEventParameter extends TCallbackEventParameter diff --git a/framework/Web/UI/JuiControls/TJuiResizable.php b/framework/Web/UI/JuiControls/TJuiResizable.php index 5d70ebf3..f4553aef 100644 --- a/framework/Web/UI/JuiControls/TJuiResizable.php +++ b/framework/Web/UI/JuiControls/TJuiResizable.php @@ -4,9 +4,8 @@ * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2013-2013 PradoSoft + * @copyright Copyright © 2013-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJuiResizable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls */ @@ -30,7 +29,6 @@ Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter'); * </code> * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> - * @version $Id: TJuiResizable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls * @since 3.3 */ diff --git a/framework/Web/UI/JuiControls/TJuiSelectable.php b/framework/Web/UI/JuiControls/TJuiSelectable.php index 0818a1fc..e895c1f8 100644 --- a/framework/Web/UI/JuiControls/TJuiSelectable.php +++ b/framework/Web/UI/JuiControls/TJuiSelectable.php @@ -4,9 +4,8 @@ * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2013-2013 PradoSoft + * @copyright Copyright © 2013-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJuiSelectable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls */ @@ -29,11 +28,10 @@ Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter'); * $this->repeater1->dataBind(); * </code> * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> - * @version $Id: TJuiSelectable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls * @since 3.3 */ -class TJuiSelectable extends TActivePanel implements IJuiOptions +class TJuiSelectable extends TActivePanel implements IJuiOptions, ICallbackEventHandler { /** * Creates a new callback control, sets the adapter to @@ -73,6 +71,7 @@ class TJuiSelectable extends TActivePanel implements IJuiOptions protected function getPostBackOptions() { $options = $this->getOptions()->toArray(); + $options['stop'] = new TJavaScriptLiteral('function( event, ui ) { var selected = new Array(); jQuery(\'#'.$this->getClientID().' .ui-selected\').each(function(idx, item){ selected.push(item.id) }); Prado.Callback('.TJavascript::encode($this->getUniqueID()).', { \'indexes\' : selected }) }'); return $options; } @@ -91,6 +90,43 @@ class TJuiSelectable extends TActivePanel implements IJuiOptions } /** + * Raises callback event. This method is required bu {@link ICallbackEventHandler} + * interface. + * It raises the {@link onSelectedIndexChanged onSelectedIndexChanged} event, then, the {@link onCallback OnCallback} event + * This method is mainly used by framework and control developers. + * @param TCallbackEventParameter the parameter associated with the callback event + */ + public function raiseCallbackEvent($param) + { + $this->onSelectedIndexChanged($param->getCallbackParameter()); + $this->onCallback($param); + } + + /** + * Raises the onSelect event. + * The selection parameters are encapsulated into a {@link TJuiSelectableEventParameter} + * + * @param object $params + */ + public function onSelectedIndexChanged($params) + { + $this->raiseEvent('onSelectedIndexChanged', $this, new TJuiSelectableEventParameter ($this->getResponse(), $params)); + + } + + /** + * This method is invoked when a callback is requested. The method raises + * 'OnCallback' event to fire up the event handlers. If you override this + * method, be sure to call the parent implementation so that the event + * handler can be invoked. + * @param TCallbackEventParameter event parameter to be passed to the event handlers + */ + public function onCallback($param) + { + $this->raiseEvent('OnCallback', $this, $param); + } + + /** * @var ITemplate template for repeater items */ private $_repeater=null; @@ -132,7 +168,7 @@ class TJuiSelectable extends TActivePanel implements IJuiOptions $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater'); $repeater->setHeaderTemplate(new TJuiSelectableTemplate('<ul id="'.$this->getClientId().'_0'.'">')); $repeater->setFooterTemplate(new TJuiSelectableTemplate('</ul>')); - $repeater->setItemTemplate(new TTemplate('<li><%# $this->DataItem %></li>',null)); + $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->DataItem %></li>',null)); $repeater->setEmptyTemplate(new TJuiSelectableTemplate('<ul></ul>')); $this->getControls()->add($repeater); return $repeater; @@ -147,7 +183,6 @@ class TJuiSelectable extends TActivePanel implements IJuiOptions * item template. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TJuiAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -168,4 +203,19 @@ class TJuiSelectableTemplate extends TComponent implements ITemplate { $parent->getControls()->add($this->_template); } +} + +/** + * TJuiSelectableEventParameter class + * + * TJuiSelectableEventParameter encapsulate the parameter + * data for <b>OnSelectedIndexChanged</b> event of TJuiSelectable components + * + * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> + * @license http://www.pradosoft.com/license + * @package System.Web.UI.JuiControls + */ +class TJuiSelectableEventParameter extends TCallbackEventParameter +{ + public function getSelectedIndexes() { return $this->getCallbackParameter()->indexes; } }
\ No newline at end of file diff --git a/framework/Web/UI/JuiControls/TJuiSortable.php b/framework/Web/UI/JuiControls/TJuiSortable.php index bada066f..557d62ba 100644 --- a/framework/Web/UI/JuiControls/TJuiSortable.php +++ b/framework/Web/UI/JuiControls/TJuiSortable.php @@ -4,9 +4,8 @@ * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2013-2013 PradoSoft + * @copyright Copyright © 2013-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJuiSortable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls */ @@ -26,11 +25,10 @@ Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter'); * </code> * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> - * @version $Id: TJuiSortable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.JuiControls * @since 3.3 */ -class TJuiSortable extends TActivePanel implements IJuiOptions +class TJuiSortable extends TActivePanel implements IJuiOptions, ICallbackEventHandler { /** * Creates a new callback control, sets the adapter to @@ -70,6 +68,7 @@ class TJuiSortable extends TActivePanel implements IJuiOptions protected function getPostBackOptions() { $options = $this->getOptions()->toArray(); + $options['stop'] = new TJavaScriptLiteral("function( event, ui ) { Prado.Callback(".TJavascript::encode($this->getUniqueID()).", { 'order' : jQuery(this).sortable('toArray') }) }"); return $options; } @@ -88,33 +87,70 @@ class TJuiSortable extends TActivePanel implements IJuiOptions } /** + * Raises callback event. This method is required bu {@link ICallbackEventHandler} + * interface. + * It raises the {@link onSort onSort} event, then, the {@link onCallback OnCallback} event + * This method is mainly used by framework and control developers. + * @param TCallbackEventParameter the parameter associated with the callback event + */ + public function raiseCallbackEvent($param) + { + $this->onSort($param->getCallbackParameter()); + $this->onCallback($param); + } + + /** + * Raises the onSort event. + * The order parameters are encapsulated into a {@link TJuiSortableEventParameter} + * + * @param object $params + */ + public function onSort($params) + { + $this->raiseEvent('onSort', $this, new TJuiSortableEventParameter ($this->getResponse(), $params)); + + } + + /** + * This method is invoked when a callback is requested. The method raises + * 'OnCallback' event to fire up the event handlers. If you override this + * method, be sure to call the parent implementation so that the event + * handler can be invoked. + * @param TCallbackEventParameter event parameter to be passed to the event handlers + */ + public function onCallback($param) + { + $this->raiseEvent('OnCallback', $this, $param); + } + + /** * @var ITemplate template for repeater items */ private $_repeater=null; /** - * @param array data source for Selectables. + * @param array data source for Sortables. */ public function setDataSource($data) { - $this->getSelectables()->setDataSource($data); + $this->getSortables()->setDataSource($data); } /** - * Overrides parent implementation. Callback {@link renderSelectables()} when + * Overrides parent implementation. Callback {@link renderSortables()} when * page's IsCallback property is true. */ public function dataBind() { parent::dataBind(); if($this->getPage()->getIsCallback()) - $this->renderSelectables($this->getResponse()->createHtmlWriter()); + $this->renderSortables($this->getResponse()->createHtmlWriter()); } /** * @return TRepeater suggestion list repeater */ - public function getSelectables() + public function getSortables() { if($this->_repeater===null) $this->_repeater = $this->createRepeater(); @@ -122,14 +158,14 @@ class TJuiSortable extends TActivePanel implements IJuiOptions } /** - * @return TRepeater new instance of TRepater to render the list of Selectables. + * @return TRepeater new instance of TRepater to render the list of Sortables. */ protected function createRepeater() { $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater'); $repeater->setHeaderTemplate(new TJuiSortableTemplate('<ul id="'.$this->getClientId().'_0'.'">')); $repeater->setFooterTemplate(new TJuiSortableTemplate('</ul>')); - $repeater->setItemTemplate(new TTemplate('<li><%# $this->DataItem %></li>',null)); + $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->Data %></li>',null)); $repeater->setEmptyTemplate(new TJuiSortableTemplate('<ul></ul>')); $this->getControls()->add($repeater); return $repeater; @@ -144,7 +180,6 @@ class TJuiSortable extends TActivePanel implements IJuiOptions * item template. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TJuiAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -165,4 +200,19 @@ class TJuiSortableTemplate extends TComponent implements ITemplate { $parent->getControls()->add($this->_template); } +} + +/** + * TJuiSortableEventParameter class + * + * TJuiSortableEventParameter encapsulate the parameter + * data for <b>OnSort</b> event of TJuiSortable components + * + * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> + * @license http://www.pradosoft.com/license + * @package System.Web.UI.JuiControls + */ +class TJuiSortableEventParameter extends TCallbackEventParameter +{ + public function getOrder() { return $this->getCallbackParameter()->order; } }
\ No newline at end of file diff --git a/framework/Web/UI/TCachePageStatePersister.php b/framework/Web/UI/TCachePageStatePersister.php index 4f3d60cc..0914c650 100644 --- a/framework/Web/UI/TCachePageStatePersister.php +++ b/framework/Web/UI/TCachePageStatePersister.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCachePageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -54,7 +53,6 @@ * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCachePageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.1.1 */ diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index fd550ff1..4bef0e08 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -5,9 +5,8 @@ * @author Qiang Xue <qiang.xue@gmail.com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering) * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $ * @package System.Web.UI */ @@ -18,7 +17,6 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering) - * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -150,7 +148,7 @@ class TClientScriptManager extends TApplicationComponent $this->_registeredPradoScripts[$name]=true; else throw new TInvalidOperationException('csmanager_pradoscript_invalid',$name); - + if(($packages=array_keys($this->_registeredPradoScripts))!==array()) { $base = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH; @@ -365,7 +363,6 @@ class TClientScriptManager extends TApplicationComponent * $this->Page->ClientScript->registerStyleSheetFile($url, $url); * } * } - * ?> * </code> * * @param string a unique key identifying the file @@ -462,7 +459,7 @@ class TClientScriptManager extends TApplicationComponent public function registerScriptFile($key, $url) { $this->_scriptFiles[$key]=$url; - + $params=func_get_args(); $this->_page->registerCachingAction('Page.ClientScript','registerScriptFile',$params); } @@ -762,7 +759,7 @@ class TClientScriptManager extends TApplicationComponent $writer->write("<div style=\"visibility:hidden;\">\n".$str."</div>\n"); } - public function getHiddenFields() + public function getHiddenFields() { return $this->_hiddenFields; } @@ -785,7 +782,6 @@ class TClientScriptManager extends TApplicationComponent * between ActiveControls and validators. * * @author <weizhuo[at]gmail[dot]com> - * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ diff --git a/framework/Web/UI/TCompositeControl.php b/framework/Web/UI/TCompositeControl.php index 21e4c46f..5a54271d 100644 --- a/framework/Web/UI/TCompositeControl.php +++ b/framework/Web/UI/TCompositeControl.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCompositeControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -16,7 +15,6 @@ * by other controls. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCompositeControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index cbc6a409..e5e6fa18 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -64,7 +63,6 @@ Prado::using('System.Web.UI.TControlAdapter'); * They work together with page lifecycles to process a page request. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -1761,7 +1759,6 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable * controls to maintain a list of their child controls. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -1846,7 +1843,6 @@ class TControlCollection extends TList * controls to it. This is useful for controls that do not allow child controls. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -1879,7 +1875,6 @@ class TEmptyControlCollection extends TControlCollection * INamingContainer marks a control as a naming container. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -1893,7 +1888,6 @@ interface INamingContainer * If a control wants to respond to postback event, it must implement this interface. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -1914,7 +1908,6 @@ interface IPostBackEventHandler * If a control wants to load post data, it must implement this interface. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -1948,7 +1941,6 @@ interface IPostBackDataHandler * If a control wants to validate user input, it must implement this interface. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -1986,7 +1978,6 @@ interface IValidator * If a control wants to be validated by a validator, it must implement this interface. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -2012,7 +2003,6 @@ interface IValidatable * If a control wants to check broadcast event, it must implement this interface. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -2036,7 +2026,6 @@ interface IBroadcastEventReceiver * This interface must be implemented by theme. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -2056,7 +2045,6 @@ interface ITheme * parsed template structures. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -2079,7 +2067,6 @@ interface ITemplate * {@link TImageButton}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -2184,7 +2171,6 @@ interface ISurroundable * {@link setParameter Parameter} property. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -2246,7 +2232,6 @@ class TBroadcastEventParameter extends TEventParameter * with the command via {@link getCommandParameter CommandParameter} property. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -2291,7 +2276,6 @@ class TCommandEventParameter extends TEventParameter * consecutive static strings, expressions and statements. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ diff --git a/framework/Web/UI/TControlAdapter.php b/framework/Web/UI/TControlAdapter.php index 1ef2d1fb..2e89e5e7 100644 --- a/framework/Web/UI/TControlAdapter.php +++ b/framework/Web/UI/TControlAdapter.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -17,7 +16,6 @@ * various behaviors for the control to which the adapter is attached. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ diff --git a/framework/Web/UI/TForm.php b/framework/Web/UI/TForm.php index 9db8682c..c9280e9a 100644 --- a/framework/Web/UI/TForm.php +++ b/framework/Web/UI/TForm.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TForm.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -23,7 +22,6 @@ * URLs. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TForm.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -87,7 +85,7 @@ class TForm extends TControl $this->renderChildren($writer); $cs->renderHiddenFieldsEnd($writer); $page->endFormRender($writer); - + $cs->renderScriptFilesEnd($writer); $cs->renderEndScripts($writer); } diff --git a/framework/Web/UI/THtmlWriter.php b/framework/Web/UI/THtmlWriter.php index 9f070d5f..0339ac83 100644 --- a/framework/Web/UI/THtmlWriter.php +++ b/framework/Web/UI/THtmlWriter.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THtmlWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -32,7 +31,6 @@ * tags in HTML and XHTML. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THtmlWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -87,7 +85,7 @@ class THtmlWriter extends TApplicationComponent implements ITextWriter { return $this->_writer; } - + public function setWriter($writer) { $this->_writer = $writer; diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 394229da..2dc1cac3 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -22,7 +21,6 @@ Prado::using('System.Web.UI.TClientScriptManager'); * TPage class * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -293,7 +291,7 @@ class TPage extends TTemplateControl return $data; } } - + /** * Sets Adapter to TActivePageAdapter and calls apter to process the * callback request. @@ -304,6 +302,10 @@ class TPage extends TTemplateControl $this->setAdapter(new TActivePageAdapter($this)); + $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); + if(strlen($callbackEventParameter) > 0) + $this->_postData[TPage::FIELD_CALLBACK_PARAMETER]=TJavaScript::jsonDecode((string)$callbackEventParameter); + // Decode Callback postData from UTF-8 to current Charset if (($g=$this->getApplication()->getGlobalization(false))!==null && strtoupper($enc=$g->getCharset())!='UTF-8') @@ -1219,7 +1221,6 @@ class TPage extends TTemplateControl * classes. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.1 */ diff --git a/framework/Web/UI/TPageStatePersister.php b/framework/Web/UI/TPageStatePersister.php index 7d2330b7..bbb20098 100644 --- a/framework/Web/UI/TPageStatePersister.php +++ b/framework/Web/UI/TPageStatePersister.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -22,7 +21,6 @@ * traffic for transmitting bulky page state. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ diff --git a/framework/Web/UI/TSessionPageStatePersister.php b/framework/Web/UI/TSessionPageStatePersister.php index 5448fd22..a1a1f601 100644 --- a/framework/Web/UI/TSessionPageStatePersister.php +++ b/framework/Web/UI/TSessionPageStatePersister.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSessionPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -39,7 +38,6 @@ * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TSessionPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.1 */ diff --git a/framework/Web/UI/TTemplateControl.php b/framework/Web/UI/TTemplateControl.php index f5780928..df6482c6 100644 --- a/framework/Web/UI/TTemplateControl.php +++ b/framework/Web/UI/TTemplateControl.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTemplateControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -23,7 +22,6 @@ Prado::using('System.Web.UI.TCompositeControl'); * different extension name. For template file, the extension name is ".tpl". * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTemplateControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 91630241..0ffb6bec 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $ * @package System.Web.UI */ @@ -32,7 +31,6 @@ Prado::using('System.Web.UI.WebControls.TOutputCache'); * template manager module that can be accessed via {@link TPageService::getTemplateManager()}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -162,7 +160,6 @@ class TTemplateManager extends TModule * set their parent as $control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index ba007dc0..f8c86bb7 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -34,7 +33,6 @@ Prado::using('System.Web.Services.TPageService'); * and {@link getBufferOutput BufferOutput} are configurable properties of THttpResponse. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -206,7 +204,6 @@ class TThemeManager extends TModule * To apply a theme to a particular control, call {@link applySkin}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TAccordion.php b/framework/Web/UI/WebControls/TAccordion.php index dbf761a2..fc794cd4 100644 --- a/framework/Web/UI/WebControls/TAccordion.php +++ b/framework/Web/UI/WebControls/TAccordion.php @@ -4,9 +4,8 @@ * * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $ * @package System.Web.UI.WebControls * @since 3.2 */ @@ -59,7 +58,6 @@ * </code> * * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu> - * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $ * @package System.Web.UI.WebControls * @since 3.2 */ @@ -198,7 +196,7 @@ class TAccordion extends TWebControl implements IPostBackDataHandler } /** - * @return string CSS class for the whole accordion control div. + * @return string CSS class for the whole accordion control div. */ public function getCssClass() { @@ -426,15 +424,15 @@ class TAccordion extends TWebControl implements IPostBackDataHandler protected function registerStyleSheet() { $url = $this->getCssUrl(); - + if($url === '') { return; } - + if($url === 'default') { $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'accordion.css'); } - + if($url !== '') { $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); } @@ -540,13 +538,12 @@ class TAccordion extends TWebControl implements IPostBackDataHandler * Class TAccordionView. * * TAccordionView represents a single view in a {@link TAccordion}. - * + * * TAccordionView is represented inside the {@link TAccordion} with an header label whose text is defined by * the {@link setCaption Caption} property; optionally the label can be an hyperlink: use the * {@link setNavigateUrl NavigateUrl} property to define the destination url. * * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu> - * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $ * @package System.Web.UI.WebControls * @since 3.2 */ @@ -669,7 +666,7 @@ class TAccordionView extends TWebControl $writer->addAttribute('id',$this->getClientID().'_0'); $style=$this->getActive()?$this->getParent()->getActiveHeaderStyle():$this->getParent()->getHeaderStyle(); - + $style->addAttributesToRender($writer); $writer->renderBeginTag($this->getTagName()); @@ -690,7 +687,7 @@ class TAccordionView extends TWebControl $url = $this->getNavigateUrl(); if(($caption=$this->getCaption())==='') $caption=' '; - + if ($url!='') $writer->write("<a href=\"{$url}\">"); $writer->write("{$caption}"); @@ -703,9 +700,8 @@ class TAccordionView extends TWebControl * Class TAccordionViewCollection. * * TAccordionViewCollection is a collection of {@link TAccordionView} to be used inside a {@link TAccordion}. - * + * * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu> - * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $ * @package System.Web.UI.WebControls * @since 3.2 */ diff --git a/framework/Web/UI/WebControls/TBaseDataList.php b/framework/Web/UI/WebControls/TBaseDataList.php index 0ef22752..9ebe551e 100644 --- a/framework/Web/UI/WebControls/TBaseDataList.php +++ b/framework/Web/UI/WebControls/TBaseDataList.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TBaseDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -37,7 +36,6 @@ Prado::using('System.Util.TDataFieldAccessor'); * content can be specified via {@link setHorizontalAlign HorizontalAlign}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBaseDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index 074939c1..a23e2104 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -70,7 +69,6 @@ Prado::using('System.Web.UI.WebControls.TLabel'); * override the method {@link evaluateIsValid}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -513,7 +511,7 @@ abstract class TBaseValidator extends TLabel implements IValidator $target=$this->getValidationTarget(); // if the target is not a disabled web control if($target===null || - ($target!==null && + ($target!==null && !($target instanceof TWebControl && !$target->getEnabled(true)))) { if($this->evaluateIsValid()) @@ -625,7 +623,6 @@ abstract class TBaseValidator extends TLabel implements IValidator * See the quickstart documentation for further details. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -715,7 +712,6 @@ class TValidatorClientSide extends TClientSideOptions * - Fixed: Similar to Dynamic except that the error message physically occupies the page layout (even though it may not be visible) * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -738,7 +734,6 @@ class TValidatorDisplayStyle extends TEnumerable * - String * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TBoundColumn.php b/framework/Web/UI/WebControls/TBoundColumn.php index 7534fcbc..d7ac7750 100644 --- a/framework/Web/UI/WebControls/TBoundColumn.php +++ b/framework/Web/UI/WebControls/TBoundColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TBoundColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -42,7 +41,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn'); * For more details, see {@link TRepeater} and {@link TDataList}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBoundColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TBulletedList.php b/framework/Web/UI/WebControls/TBulletedList.php index e5c17b38..9cd3654e 100644 --- a/framework/Web/UI/WebControls/TBulletedList.php +++ b/framework/Web/UI/WebControls/TBulletedList.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -33,7 +32,6 @@ Prado::using('System.Web.UI.WebControls.TListControl'); * will be raised under such a circumstance. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -414,7 +412,6 @@ class TBulletedList extends TListControl implements IPostBackEventHandler * of the item that is currently being clicked. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -449,7 +446,6 @@ class TBulletedListEventParameter extends TEventParameter * for a {@link TBulletedList} control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -479,7 +475,6 @@ class TBulletStyle extends TEnumerable * - LinkButton: the bulleted list items are displayed as link buttons that can cause postbacks * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php index e7d0f5bf..f24985e6 100644 --- a/framework/Web/UI/WebControls/TButton.php +++ b/framework/Web/UI/WebControls/TButton.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -43,7 +42,6 @@ * if the button does not cause a postback. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -355,7 +353,6 @@ class TButton extends TWebControl implements IPostBackEventHandler, IButtonContr * - Button: a client button (normally does not perform form submission) * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TButtonColumn.php b/framework/Web/UI/WebControls/TButtonColumn.php index 258fecf2..939fc721 100644 --- a/framework/Web/UI/WebControls/TButtonColumn.php +++ b/framework/Web/UI/WebControls/TButtonColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -48,7 +47,6 @@ Prado::using('System.Web.UI.WebControls.TImageButton'); * datagrid cell is the first child. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TCaptcha.php b/framework/Web/UI/WebControls/TCaptcha.php index 79f402a5..4523ea40 100644 --- a/framework/Web/UI/WebControls/TCaptcha.php +++ b/framework/Web/UI/WebControls/TCaptcha.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCaptcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -57,7 +56,6 @@ Prado::using('System.Web.UI.WebControls.TImage'); * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCaptcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ diff --git a/framework/Web/UI/WebControls/TCaptchaValidator.php b/framework/Web/UI/WebControls/TCaptchaValidator.php index c8cc7aea..2758cac7 100644 --- a/framework/Web/UI/WebControls/TCaptchaValidator.php +++ b/framework/Web/UI/WebControls/TCaptchaValidator.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCaptchaValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -31,7 +30,6 @@ Prado::using('System.Web.UI.WebControls.TCaptcha'); * the CAPTCHA control that the user input should be compared with. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCaptchaValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index e12946be..a28beac7 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -36,7 +35,6 @@ * that may bring security vulnerabilities. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -127,7 +125,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl } /** - * Returns true if this control validated successfully. + * Returns true if this control validated successfully. * Defaults to true. * @return bool wether this control validated successfully. */ @@ -412,7 +410,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl /** * Check if we need a span tag to surround this control. The span tag will be created if - * the Text property is set for this control. + * the Text property is set for this control. * * @return bool wether this control needs a surrounding span tag */ @@ -519,7 +517,6 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl * - Right: right aligned * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TCheckBoxColumn.php b/framework/Web/UI/WebControls/TCheckBoxColumn.php index c0206676..8f67df55 100644 --- a/framework/Web/UI/WebControls/TCheckBoxColumn.php +++ b/framework/Web/UI/WebControls/TCheckBoxColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCheckBoxColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -38,7 +37,6 @@ Prado::using('System.Web.UI.WebControls.TCheckBox'); * datagrid cell is the first child. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCheckBoxColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php index 5122432c..029b6c89 100644 --- a/framework/Web/UI/WebControls/TCheckBoxList.php +++ b/framework/Web/UI/WebControls/TCheckBoxList.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -43,7 +42,6 @@ Prado::using('System.Web.UI.WebControls.TCheckBox'); * The alignment of the text besides each checkbox can be specified via {@link setTextAlign TextAlign}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -74,7 +72,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont */ protected function createRepeatedControl() { - return new TCheckBox; + return new TCheckBoxItem; } /** @@ -256,7 +254,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont { return false; } - + /** * @param boolean whether the control is to be enabled. */ @@ -264,8 +262,8 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont { parent::setEnabled($value); $value = !TPropertyValue::ensureBoolean($value); - // if this is an active control, - // and it's a callback, + // if this is an active control, + // and it's a callback, // and we can update clientside, // then update the 'disabled' attribute of the items. if(($this instanceof IActiveControl) && @@ -389,14 +387,14 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont /** * Wether the list should be rendered inside a span or not - * + * *@return boolean true if we need a span */ protected function getSpanNeeded () { return $this->getRepeatLayout()===TRepeatLayout::Raw; } - + /** * Renders the checkbox list control. * This method overrides the parent implementation. @@ -459,7 +457,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont } /** - * Returns true if this control validated successfully. + * Returns true if this control validated successfully. * Defaults to true. * @return bool wether this control validated successfully. */ @@ -491,13 +489,21 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont */ protected function getPostBackOptions() { - $options['ListID'] = $this->getClientID(); + $options['ID'] = $this->getClientID(); $options['ValidationGroup'] = $this->getValidationGroup(); $options['CausesValidation'] = $this->getCausesValidation(); $options['ListName'] = $this->getUniqueID(); $options['ItemCount'] = $this->getItemCount(); return $options; } - + } +class TCheckBoxItem extends TCheckBox { + /** + * Override client implementation to avoid emitting the javascript + */ + protected function renderClientControlScript($writer) + { + } +} diff --git a/framework/Web/UI/WebControls/TClientScript.php b/framework/Web/UI/WebControls/TClientScript.php index f28a507a..6fca14d3 100644 --- a/framework/Web/UI/WebControls/TClientScript.php +++ b/framework/Web/UI/WebControls/TClientScript.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -38,9 +37,8 @@ * set the {@link setFlushScriptFiles FlushScriptFiles} property to false, so Prado * can postpone the loading of all the referenced script files further down the page * generation cycle. - * + * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TColorPicker.php b/framework/Web/UI/WebControls/TColorPicker.php index fcb129b9..7b20318c 100644 --- a/framework/Web/UI/WebControls/TColorPicker.php +++ b/framework/Web/UI/WebControls/TColorPicker.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -23,17 +22,16 @@ * # <b>Simple</b> - Grid with 12 simple colors. * # <b>Basic</b> - Grid with the most common 70 colors. This is the default mode. * # <b>Full</b> - Full-featured color picker. - * + * * The <b>CssClass</b> property can be used to override the CSS class name * for the color picker panel. The <b>ColorStyle</b> property sets the packages * styles available. E.g. <b>default</b>. - * + * * If the <b>Mode</b> property is set to <b>Full</b>, the color picker panel will * display an "Ok" and "Cancel" buttons. You can customize the button labels setting the <b>OKButtonText</b> * and <b>CancelButtonText</b> properties. - * + * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -248,7 +246,6 @@ class TColorPicker extends TTextBox * # Full - Full-featured color picker. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -265,7 +262,6 @@ class TColorPickerMode extends TEnumerable * Client-side javascript code options. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1 */ diff --git a/framework/Web/UI/WebControls/TCompareValidator.php b/framework/Web/UI/WebControls/TCompareValidator.php index eaaa8f51..b902b67b 100644 --- a/framework/Web/UI/WebControls/TCompareValidator.php +++ b/framework/Web/UI/WebControls/TCompareValidator.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -40,7 +39,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator'); * LessThan and LessThanEqual. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -249,7 +247,6 @@ class TCompareValidator extends TBaseValidator * - LessThanEqual * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TConditional.php b/framework/Web/UI/WebControls/TConditional.php index 054e1a76..61cc3988 100644 --- a/framework/Web/UI/WebControls/TConditional.php +++ b/framework/Web/UI/WebControls/TConditional.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TConditional.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -39,7 +38,6 @@ * or {@link getFalseTemplate FalseTemplate}, but never both. And the condition is evaluated only once. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TConditional.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ diff --git a/framework/Web/UI/WebControls/TContent.php b/framework/Web/UI/WebControls/TContent.php index f0a67674..a2f15e3d 100644 --- a/framework/Web/UI/WebControls/TContent.php +++ b/framework/Web/UI/WebControls/TContent.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TContent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -25,7 +24,6 @@ * {@link TContent} and {@link TContentPlaceHolder} controls. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TContent.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TContentPlaceHolder.php b/framework/Web/UI/WebControls/TContentPlaceHolder.php index d9464fa3..8a4d7284 100644 --- a/framework/Web/UI/WebControls/TContentPlaceHolder.php +++ b/framework/Web/UI/WebControls/TContentPlaceHolder.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TContentPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -24,7 +23,6 @@ * {@link TContent} and {@link TContentPlaceHolder} controls. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TContentPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TCustomValidator.php b/framework/Web/UI/WebControls/TCustomValidator.php index b4987f06..6966a075 100644 --- a/framework/Web/UI/WebControls/TCustomValidator.php +++ b/framework/Web/UI/WebControls/TCustomValidator.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -48,7 +47,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator'); * with the TCustomValidator. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -153,7 +151,6 @@ class TCustomValidator extends TBaseValidator * <b>OnServerValidate</b> event of TCustomValidator components. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TDataBoundControl.php b/framework/Web/UI/WebControls/TDataBoundControl.php index 08d130c1..2a287aac 100644 --- a/framework/Web/UI/WebControls/TDataBoundControl.php +++ b/framework/Web/UI/WebControls/TDataBoundControl.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -39,7 +38,6 @@ Prado::using('System.Collections.TPagedDataSource'); * custom paging, set {@link setAllowCustomPaging AllowCustomPaging} to true. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -527,7 +525,6 @@ abstract class TDataBoundControl extends TWebControl * - Pager: pager * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -553,7 +550,6 @@ class TListItemType extends TEnumerable * {@link getItemType ItemType} property. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.0 */ diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php index 249d8108..96e799aa 100644 --- a/framework/Web/UI/WebControls/TDataGrid.php +++ b/framework/Web/UI/WebControls/TDataGrid.php @@ -9,9 +9,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -145,7 +144,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridPagerStyle'); * - Save the data in viewstate and get it back during postbacks. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1233,7 +1231,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer * Depending on the button type, a TLinkButton or a TButton may be created. * If it is enabled (clickable), its command name and parameter will also be set. * Derived classes may override this method to create additional types of buttons, such as TImageButton. - * @param mixed the container pager instance of TActiveDatagridPager + * @param mixed the container pager instance of TActiveDatagridPager * @param string button type, either LinkButton or PushButton * @param boolean whether the button should be enabled * @param string caption of the button @@ -1680,7 +1678,6 @@ class TDataGrid extends TBaseDataList implements INamingContainer * The {@link getItem Item} property indicates the datagrid item related with the event. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1718,7 +1715,6 @@ class TDataGridItemEventParameter extends TEventParameter * The {@link getPager Pager} property indicates the datagrid pager related with the event. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1759,7 +1755,6 @@ class TDataGridPagerEventParameter extends TEventParameter * raises the Command event. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1815,7 +1810,6 @@ class TDataGridCommandEventParameter extends TCommandEventParameter * gives the sort expression carried with the sort command. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1869,7 +1863,6 @@ class TDataGridSortCommandEventParameter extends TEventParameter * returns the new page index carried with the page command. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1923,7 +1916,6 @@ class TDataGridPageChangedEventParameter extends TEventParameter * gives the index of the item from the bound data source. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2060,7 +2052,6 @@ class TDataGridItem extends TTableRow implements INamingContainer * TDataGridPager represents a datagrid pager. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2119,7 +2110,6 @@ class TDataGridPager extends TPanel implements INamingContainer * TDataGridItemCollection represents a collection of data grid items. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2147,7 +2137,6 @@ class TDataGridItemCollection extends TList * TDataGridColumnCollection represents a collection of data grid columns. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2204,7 +2193,6 @@ class TDataGridColumnCollection extends TList * - Numeric: pager buttons are displayed as numeric page numbers * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -2224,7 +2212,6 @@ class TDataGridPagerMode extends TEnumerable * - PushButton: form submit buttons * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -2245,7 +2232,6 @@ class TDataGridPagerButtonType extends TEnumerable * - TopAndBottom: pager appears on both top and bottom of the data grid. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php index ad3be81f..1c8831d2 100644 --- a/framework/Web/UI/WebControls/TDataGridColumn.php +++ b/framework/Web/UI/WebControls/TDataGridColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -58,7 +57,6 @@ Prado::using('System.Web.UI.WebControls.TDataGrid'); * which is the major logic for managing the data and presentation of cells in the column. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -554,7 +552,6 @@ abstract class TDataGridColumn extends TApplicationComponent * - ImageButton: image buttons * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TDataGridItemRenderer.php b/framework/Web/UI/WebControls/TDataGridItemRenderer.php index 6e37a739..376eea17 100644 --- a/framework/Web/UI/WebControls/TDataGridItemRenderer.php +++ b/framework/Web/UI/WebControls/TDataGridItemRenderer.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataGridItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -20,7 +19,6 @@ Prado::using('System.Web.UI.WebControls.TItemDataRenderer'); * define an item renderer class specific for {@link TDataGrid}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGridItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.0 */ diff --git a/framework/Web/UI/WebControls/TDataGridPagerStyle.php b/framework/Web/UI/WebControls/TDataGridPagerStyle.php index 31c0380b..4e143e05 100644 --- a/framework/Web/UI/WebControls/TDataGridPagerStyle.php +++ b/framework/Web/UI/WebControls/TDataGridPagerStyle.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataGridPagerStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -18,7 +17,6 @@ Prado::using('System.Web.UI.WebControls.TDataGrid'); * TDataGridPagerStyle specifies the styles available for a datagrid pager. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataGridPagerStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php index 6b3c4a73..021fdf6d 100644 --- a/framework/Web/UI/WebControls/TDataList.php +++ b/framework/Web/UI/WebControls/TDataList.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -146,7 +145,6 @@ Prado::using('System.Web.UI.WebControls.TRepeatInfo'); * complex data may also have serializing problem if saved in viewstate. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1499,7 +1497,6 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * The {@link getItem Item} property indicates the DataList item related with the event. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1540,7 +1537,6 @@ class TDataListItemEventParameter extends TEventParameter * raises the Command event. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1595,7 +1591,6 @@ class TDataListCommandEventParameter extends TCommandEventParameter * is given by {@link getItemType ItemType} property. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1742,7 +1737,6 @@ class TDataListItem extends TWebControl implements INamingContainer, IItemDataRe * TDataListItemCollection represents a collection of data list items. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TDataListItemRenderer.php b/framework/Web/UI/WebControls/TDataListItemRenderer.php index df63c1f2..cf42c9a4 100644 --- a/framework/Web/UI/WebControls/TDataListItemRenderer.php +++ b/framework/Web/UI/WebControls/TDataListItemRenderer.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataListItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -26,7 +25,6 @@ Prado::using('System.Web.UI.WebControls.TItemDataRenderer'); * which allows TDataList to apply CSS styles to the renders. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataListItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.0 */ diff --git a/framework/Web/UI/WebControls/TDataRenderer.php b/framework/Web/UI/WebControls/TDataRenderer.php index 8bde0152..0e98a1b4 100644 --- a/framework/Web/UI/WebControls/TDataRenderer.php +++ b/framework/Web/UI/WebControls/TDataRenderer.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.2 */ @@ -22,7 +21,6 @@ * - {@link getData Data}: data associated with this renderer. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.2 */ diff --git a/framework/Web/UI/WebControls/TDataSourceControl.php b/framework/Web/UI/WebControls/TDataSourceControl.php index 93037c03..afe4de2d 100644 --- a/framework/Web/UI/WebControls/TDataSourceControl.php +++ b/framework/Web/UI/WebControls/TDataSourceControl.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -14,7 +13,6 @@ * IDataSource class * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -29,7 +27,6 @@ interface IDataSource * TDataSourceControl class * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -90,7 +87,6 @@ abstract class TDataSourceControl extends TControl implements IDataSource * TDataSourceControl class * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TDataSourceView.php b/framework/Web/UI/WebControls/TDataSourceView.php index 1e1ad7a9..b9a76a32 100644 --- a/framework/Web/UI/WebControls/TDataSourceView.php +++ b/framework/Web/UI/WebControls/TDataSourceView.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -14,7 +13,6 @@ * TDataSourceSelectParameters class * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -76,7 +74,6 @@ class TDataSourceSelectParameters extends TComponent * TDataSourceView class * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -179,7 +176,6 @@ abstract class TDataSourceView extends TComponent * TReadOnlyDataSourceView class * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TDataTypeValidator.php b/framework/Web/UI/WebControls/TDataTypeValidator.php index b9ddbf6c..3881bb84 100644 --- a/framework/Web/UI/WebControls/TDataTypeValidator.php +++ b/framework/Web/UI/WebControls/TDataTypeValidator.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDataTypeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -30,7 +29,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator'); * provided, the string will be assumed to be in GNU datetime format. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TDataTypeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php index 275fc557..f910f06e 100644 --- a/framework/Web/UI/WebControls/TDatePicker.php +++ b/framework/Web/UI/WebControls/TDatePicker.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -73,7 +72,6 @@ Prado::using('System.Web.UI.WebControls.TTextBox'); * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> - * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -276,7 +274,7 @@ class TDatePicker extends TTextBox { return $this->getViewState('UpToYear', intval(@date('Y'))+10); } - + /** * @param TDatePickerPositionMode calendar UI position */ @@ -894,9 +892,8 @@ class TDatePicker extends TTextBox * is changed. * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent * as parameter to this event - * + * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -930,7 +927,6 @@ class TDatePickerClientScript extends TClientSideOptions * - DropDownList: dropdown lists are used to pick up date values * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -952,7 +948,6 @@ class TDatePickerInputMode extends TEnumerable * - ImageButton: Shows an image next to the text input, clicking on the image shows the date picker, * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TDropDownList.php b/framework/Web/UI/WebControls/TDropDownList.php index 8dda857b..ab56bc7a 100644 --- a/framework/Web/UI/WebControls/TDropDownList.php +++ b/framework/Web/UI/WebControls/TDropDownList.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -39,7 +38,6 @@ Prado::using('System.Web.UI.WebControls.TListControl'); * available item in the dropdown list will be selected. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -136,7 +134,7 @@ class TDropDownList extends TListControl implements IPostBackDataHandler, IValid } /** - * Returns true if this control validated successfully. + * Returns true if this control validated successfully. * Defaults to true. * @return bool wether this control validated successfully. */ diff --git a/framework/Web/UI/WebControls/TDropDownListColumn.php b/framework/Web/UI/WebControls/TDropDownListColumn.php index 40e07aef..13a47aa7 100644 --- a/framework/Web/UI/WebControls/TDropDownListColumn.php +++ b/framework/Web/UI/WebControls/TDropDownListColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TDropDownListColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -54,7 +53,6 @@ Prado::using('System.Web.UI.WebControls.TDropDownList'); * datagrid cell is the first child. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TDropDownListColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TEditCommandColumn.php b/framework/Web/UI/WebControls/TEditCommandColumn.php index 2f69c001..d8db8059 100644 --- a/framework/Web/UI/WebControls/TEditCommandColumn.php +++ b/framework/Web/UI/WebControls/TEditCommandColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TEditCommandColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -47,7 +46,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn'); * datagrid cell is the first child. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TEditCommandColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TEmailAddressValidator.php b/framework/Web/UI/WebControls/TEmailAddressValidator.php index dffe912e..b5ed78c6 100644 --- a/framework/Web/UI/WebControls/TEmailAddressValidator.php +++ b/framework/Web/UI/WebControls/TEmailAddressValidator.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -24,7 +23,6 @@ Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator'); * checkdnsrr() is available in the installed PHP. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TExpression.php b/framework/Web/UI/WebControls/TExpression.php index 3cb1aa8c..f1fea77b 100644 --- a/framework/Web/UI/WebControls/TExpression.php +++ b/framework/Web/UI/WebControls/TExpression.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TExpression.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -22,7 +21,6 @@ * make sure {@link setExpression Expression} does not come directly from user input. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TExpression.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TFileUpload.php b/framework/Web/UI/WebControls/TFileUpload.php index c6dc595a..af2ad3f2 100644 --- a/framework/Web/UI/WebControls/TFileUpload.php +++ b/framework/Web/UI/WebControls/TFileUpload.php @@ -4,9 +4,8 @@ * * @author Marcus Nyeholt <tanus@users.sourceforge.net>, Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TFileUpload.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -28,7 +27,6 @@ * (whether it succeeds or not). * * @author Marcus Nyeholt <tanus@users.sourceforge.net>, Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TFileUpload.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -261,7 +259,7 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata } /** - * Returns true if this control validated successfully. + * Returns true if this control validated successfully. * Defaults to true. * @return bool wether this control validated successfully. */ diff --git a/framework/Web/UI/WebControls/TFlushOutput.php b/framework/Web/UI/WebControls/TFlushOutput.php index dba35c79..0dbe0692 100644 --- a/framework/Web/UI/WebControls/TFlushOutput.php +++ b/framework/Web/UI/WebControls/TFlushOutput.php @@ -5,7 +5,6 @@ * @author Berczi Gabor <gabor.berczi@devworx.hu> * @link http://www.pradosoft.com/ * @license http://www.pradosoft.com/license/ - * @version $Id: TFlushOutput.php $ * @package System.Web.UI.WebControls */ @@ -23,17 +22,16 @@ * <com:TFlushOutput /> * </code> * - * You can specify whether you want to keep buffering of the output + * You can specify whether you want to keep buffering of the output * (if it was enabled) till the next occourence of a <com: TFlushOutput /> - * or the end of the page rendering, or stop buffering, by using the + * or the end of the page rendering, or stop buffering, by using the * {@link setContinueBuffering ContinueBuffering}. * * @author Berczi Gabor <gabor.berczi@devworx.hu> - * @version $Id: TFlushOutput.php $ * @package System.Web.UI.WebControls * @since 3.1 */ -class TFlushOutput extends TControl +class TFlushOutput extends TControl { /** * @var boolean whether to continue buffering of output @@ -73,7 +71,7 @@ class TFlushOutput extends TControl public function render($writer) { //$writer->write('<!-- flush -->'); - // ajax responses can't be parsed by the client side before loaded and returned completely, + // ajax responses can't be parsed by the client side before loaded and returned completely, // so don't bother with flushing output somewhere mid-page if refreshing in a callback if (!$this->Page->IsCallback) { diff --git a/framework/Web/UI/WebControls/TFont.php b/framework/Web/UI/WebControls/TFont.php index 12da993b..a07b8621 100644 --- a/framework/Web/UI/WebControls/TFont.php +++ b/framework/Web/UI/WebControls/TFont.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TFont.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -16,7 +15,6 @@ * TFont encapsulates the CSS style fields related with font settings. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TFont.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php index 52ce3013..707bbfcc 100644 --- a/framework/Web/UI/WebControls/THead.php +++ b/framework/Web/UI/WebControls/THead.php @@ -4,9 +4,8 @@ * * @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI */ @@ -37,7 +36,6 @@ * theme will not be rendered. * * @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0 */ @@ -186,7 +184,6 @@ class THead extends TControl * attributes for a meta tag, respectively. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -321,7 +318,6 @@ class TMetaTag extends TComponent * contained in a {@link THead} control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/THeader1.php b/framework/Web/UI/WebControls/THeader1.php index db516679..8aa635b5 100644 --- a/framework/Web/UI/WebControls/THeader1.php +++ b/framework/Web/UI/WebControls/THeader1.php @@ -4,9 +4,8 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THeader1.php 2590 2008-12-10 11:34:24Z carlgmathisen $ * @package System.Web.UI.WebControls */ @@ -18,13 +17,12 @@ * This is also useful for the {@link TWebControlDecorator} (used by themes). * * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: THeader1.php 2541 2008-10-21 15:05:13Z javalizard $ * @package System.Web.UI.WebControls * @since 3.2a */ - -class THeader1 extends THtmlElement { - + +class THeader1 extends THtmlElement { + /** * @return string tag name */ @@ -32,5 +30,5 @@ class THeader1 extends THtmlElement { { return 'h1'; } - + } diff --git a/framework/Web/UI/WebControls/THeader2.php b/framework/Web/UI/WebControls/THeader2.php index be1d76ae..16631312 100644 --- a/framework/Web/UI/WebControls/THeader2.php +++ b/framework/Web/UI/WebControls/THeader2.php @@ -4,9 +4,8 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THeader2.php 2590 2008-12-10 11:34:24Z carlgmathisen $ * @package System.Web.UI.WebControls */ @@ -18,13 +17,12 @@ * This is also useful for the {@link TWebControlDecorator} (used by themes). * * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: THeader2.php 2541 2008-10-21 15:05:13Z javalizard $ * @package System.Web.UI.WebControls * @since 3.2a */ - -class THeader2 extends THtmlElement { - + +class THeader2 extends THtmlElement { + /** * @return string tag name */ @@ -32,5 +30,5 @@ class THeader2 extends THtmlElement { { return 'h2'; } - + } diff --git a/framework/Web/UI/WebControls/THeader3.php b/framework/Web/UI/WebControls/THeader3.php index ff96a190..64e48366 100644 --- a/framework/Web/UI/WebControls/THeader3.php +++ b/framework/Web/UI/WebControls/THeader3.php @@ -4,9 +4,8 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THeader3.php 2590 2008-12-10 11:34:24Z carlgmathisen $ * @package System.Web.UI.WebControls */ @@ -18,13 +17,12 @@ * This is also useful for the {@link TWebControlDecorator} (used by themes). * * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: THeader3.php 2541 2008-10-21 15:05:13Z javalizard $ * @package System.Web.UI.WebControls * @since 3.2a */ - -class THeader3 extends THtmlElement { - + +class THeader3 extends THtmlElement { + /** * @return string tag name */ @@ -32,5 +30,5 @@ class THeader3 extends THtmlElement { { return 'h3'; } - + } diff --git a/framework/Web/UI/WebControls/THeader4.php b/framework/Web/UI/WebControls/THeader4.php index 1374c700..6622dd34 100644 --- a/framework/Web/UI/WebControls/THeader4.php +++ b/framework/Web/UI/WebControls/THeader4.php @@ -4,9 +4,8 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THeader4.php 2590 2008-12-10 11:34:24Z carlgmathisen $ * @package System.Web.UI.WebControls */ @@ -18,13 +17,12 @@ * This is also useful for the {@link TWebControlDecorator} (used by themes). * * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: THeader4.php 2541 2008-10-21 15:05:13Z javalizard $ * @package System.Web.UI.WebControls * @since 3.2 */ - -class THeader4 extends THtmlElement { - + +class THeader4 extends THtmlElement { + /** * @return string tag name */ @@ -32,5 +30,5 @@ class THeader4 extends THtmlElement { { return 'h4'; } - + } diff --git a/framework/Web/UI/WebControls/THeader5.php b/framework/Web/UI/WebControls/THeader5.php index 911e17ed..4d061943 100644 --- a/framework/Web/UI/WebControls/THeader5.php +++ b/framework/Web/UI/WebControls/THeader5.php @@ -4,9 +4,8 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THeader5.php 2590 2008-12-10 11:34:24Z carlgmathisen $ * @package System.Web.UI.WebControls */ @@ -18,13 +17,12 @@ * This is also useful for the {@link TWebControlDecorator} (used by themes). * * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: THeader5.php 2541 2008-10-21 15:05:13Z javalizard $ * @package System.Web.UI.WebControls * @since 3.2 */ - -class THeader5 extends THtmlElement { - + +class THeader5 extends THtmlElement { + /** * @return string tag name */ @@ -32,5 +30,5 @@ class THeader5 extends THtmlElement { { return 'h5'; } - + } diff --git a/framework/Web/UI/WebControls/THeader6.php b/framework/Web/UI/WebControls/THeader6.php index a2891c3f..164c391c 100644 --- a/framework/Web/UI/WebControls/THeader6.php +++ b/framework/Web/UI/WebControls/THeader6.php @@ -4,9 +4,8 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THeader6.php 2590 2008-12-10 11:34:24Z carlgmathisen $ * @package System.Web.UI.WebControls */ @@ -18,13 +17,12 @@ * This is also useful for the {@link TWebControlDecorator} (used by themes). * * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: THeader6.php 2541 2008-10-21 15:05:13Z javalizard $ * @package System.Web.UI.WebControls * @since 3.2 */ - -class THeader6 extends THtmlElement { - + +class THeader6 extends THtmlElement { + /** * @return string tag name */ @@ -32,5 +30,5 @@ class THeader6 extends THtmlElement { { return 'h6'; } - + } diff --git a/framework/Web/UI/WebControls/THiddenField.php b/framework/Web/UI/WebControls/THiddenField.php index 041acdb2..d887a5e6 100644 --- a/framework/Web/UI/WebControls/THiddenField.php +++ b/framework/Web/UI/WebControls/THiddenField.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.xisc.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version $Id: THiddenField.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -19,7 +18,6 @@ * event will be raised. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THiddenField.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -113,7 +111,7 @@ class THiddenField extends TControl implements IPostBackDataHandler, IValidatabl } /** - * Returns true if this control validated successfully. + * Returns true if this control validated successfully. * Defaults to true. * @return bool wether this control validated successfully. */ diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php index 9d9ff3fa..fd26d0ab 100644 --- a/framework/Web/UI/WebControls/THtmlArea.php +++ b/framework/Web/UI/WebControls/THtmlArea.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -72,7 +71,6 @@ Prado::using('System.Web.UI.WebControls.TTextBox'); * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -491,7 +489,7 @@ class THtmlArea extends TTextBox if(count($option) == 2) { $value=trim(trim($option[1]),"'\""); - if (($s=strtolower($value))==='false') + if (($s=strtolower($value))==='false') $value=false; elseif ($s==='true') $value=true; diff --git a/framework/Web/UI/WebControls/THtmlArea4.php b/framework/Web/UI/WebControls/THtmlArea4.php index f98c2ddf..7ae4aa4e 100644 --- a/framework/Web/UI/WebControls/THtmlArea4.php +++ b/framework/Web/UI/WebControls/THtmlArea4.php @@ -4,9 +4,8 @@ * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THtmlArea4.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -20,7 +19,7 @@ Prado::using('System.Web.UI.WebControls.TTextBox'); * * THtmlArea4 wraps the visual editing functionalities provided by the * version 4 of TinyMCE project {@link http://tinymce.com/}. It has been - * developed as a plug'n'play substitute for {@link THtmlArea}, that is + * developed as a plug'n'play substitute for {@link THtmlArea}, that is * based on the previous iteration (version 3) of the same project. * Please note that both components can't be used together in the same page. * @@ -53,7 +52,6 @@ Prado::using('System.Web.UI.WebControls.TTextBox'); * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -430,7 +428,7 @@ class THtmlArea4 extends TTextBox if(count($option) == 2) { $value=trim(trim($option[1]),"'\""); - if (($s=strtolower($value))==='false') + if (($s=strtolower($value))==='false') $value=false; elseif ($s==='true') $value=true; diff --git a/framework/Web/UI/WebControls/THtmlElement.php b/framework/Web/UI/WebControls/THtmlElement.php index 5646a6ff..f5bee915 100644 --- a/framework/Web/UI/WebControls/THtmlElement.php +++ b/framework/Web/UI/WebControls/THtmlElement.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THtmlElement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -23,7 +22,6 @@ Prado::using('System.Web.UI.WebControls.TWebControl'); * * @author Qiang Xue <qiang.xue@gmail.com> * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: THtmlElement.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.2 */ @@ -49,18 +47,18 @@ class THtmlElement extends TWebControl { $this->_tagName=TPropertyValue::ensureString($value); } - + /** * This is the default tag when no other is specified - * @return string the default tag + * @return string the default tag */ public function getDefaultTagName() { return 'span'; } - + /** * This tells you if this TagName has deviated from the original - * @return boolean true if TagName has deviated from the default. + * @return boolean true if TagName has deviated from the default. */ public function getIsMutated() { return $this->_tagName !== null && $this->_tagName != $this->getDefaultTagName(); diff --git a/framework/Web/UI/WebControls/THyperLink.php b/framework/Web/UI/WebControls/THyperLink.php index 56aa5391..3cda0c48 100644 --- a/framework/Web/UI/WebControls/THyperLink.php +++ b/framework/Web/UI/WebControls/THyperLink.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.xisc.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -20,13 +19,12 @@ * the alignment of the image displayed is set by the * {@link setImageAlign ImageAlign} property and {@link getText Text} is * displayed as the alternate text of the image. - * + * * The link target is specified via the {@link setTarget Target} property. * If both {@link getImageUrl ImageUrl} and {@link getText Text} are empty, * the content enclosed within the control tag will be rendered. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -145,7 +143,7 @@ class THyperLink extends TWebControl implements IDataRenderer { return $this->getViewState('ImageHeight',''); } - + /** * Sets the height of the image in the THyperLink * @param string height of the image in the THyperLink @@ -171,7 +169,7 @@ class THyperLink extends TWebControl implements IDataRenderer { $this->setViewState('ImageUrl',$value,''); } - + /** * @return string width of the image in the THyperLink */ @@ -179,7 +177,7 @@ class THyperLink extends TWebControl implements IDataRenderer { return $this->getViewState('ImageWidth',''); } - + /** * Sets the width of the image in the THyperLink * @param string width of the image diff --git a/framework/Web/UI/WebControls/THyperLinkColumn.php b/framework/Web/UI/WebControls/THyperLinkColumn.php index 171accad..05060ea6 100644 --- a/framework/Web/UI/WebControls/THyperLinkColumn.php +++ b/framework/Web/UI/WebControls/THyperLinkColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: THyperLinkColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -45,7 +44,6 @@ Prado::using('System.Web.UI.WebControls.THyperLink'); * datagrid cell is the first child. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: THyperLinkColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -107,7 +105,7 @@ class THyperLinkColumn extends TDataGridColumn { return $this->getViewState('ImageHeight',''); } - + /** * @param string height of the image in the THyperLink */ @@ -123,7 +121,7 @@ class THyperLinkColumn extends TDataGridColumn { return $this->getViewState('ImageUrl',''); } - + /** * @param string url of the image in the THyperLink */ @@ -131,7 +129,7 @@ class THyperLinkColumn extends TDataGridColumn { $this->setViewState('ImageUrl',$value,''); } - + /** * @return string width of the image in the THyperLink */ @@ -139,7 +137,7 @@ class THyperLinkColumn extends TDataGridColumn { return $this->getViewState('ImageWidth',''); } - + /** * @param string width of the image in the THyperLink */ diff --git a/framework/Web/UI/WebControls/TImage.php b/framework/Web/UI/WebControls/TImage.php index 04a6d116..6ebbca5d 100644 --- a/framework/Web/UI/WebControls/TImage.php +++ b/framework/Web/UI/WebControls/TImage.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -21,7 +20,6 @@ * or {@link setDescriptionUrl DescriptionUrl} property, respectively. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TImageButton.php b/framework/Web/UI/WebControls/TImageButton.php index 0ee52a94..ff876b07 100644 --- a/framework/Web/UI/WebControls/TImageButton.php +++ b/framework/Web/UI/WebControls/TImageButton.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -52,7 +51,6 @@ Prado::using('System.Web.UI.WebControls.TImage'); * TImageButton displays the {@link setText Text} property as the hint text to the displayed image. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -378,7 +376,6 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven * {@link TImageButton::onClick Click} event of {@link TImageButton} controls. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TImageMap.php b/framework/Web/UI/WebControls/TImageMap.php index 340f5089..23409b1c 100644 --- a/framework/Web/UI/WebControls/TImageMap.php +++ b/framework/Web/UI/WebControls/TImageMap.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -33,7 +32,6 @@ Prado::using('System.Web.UI.WebControls.TImage'); * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -230,7 +228,6 @@ class TImageMap extends TImage implements IPostBackEventHandler * access {@link getPostBackValue PostBackValue}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -262,7 +259,6 @@ class TImageMapEventParameter extends TEventParameter * THotSpotCollection represents a collection of hotspots in an imagemap. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -293,7 +289,6 @@ class THotSpotCollection extends TList * and {@link TRectangleHotSpot}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -604,7 +599,6 @@ abstract class THotSpot extends TComponent * control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -682,7 +676,6 @@ class TCircleHotSpot extends THotSpot * TImageMap} control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -776,7 +769,6 @@ class TRectangleHotSpot extends THotSpot * TImageMap} control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -823,7 +815,6 @@ class TPolygonHotSpot extends THotSpot * - Inactive: the hotspot is inactive (not clickable) * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TInlineFrame.php b/framework/Web/UI/WebControls/TInlineFrame.php index 2c1371aa..09e82315 100644 --- a/framework/Web/UI/WebControls/TInlineFrame.php +++ b/framework/Web/UI/WebControls/TInlineFrame.php @@ -5,9 +5,8 @@ * @author Jason Ragsdale <jrags@jasrags.net> * @author Harry Pottash <hpottash@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -27,7 +26,6 @@ * Original Prado v2 IFrame Author Information * @author Jason Ragsdale <jrags@jasrags.net> * @author Harry Pottash <hpottash@gmail.com> - * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -239,7 +237,6 @@ class TInlineFrame extends TWebControl implements IDataRenderer * - Bottom: bottom aligned * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -264,7 +261,6 @@ class TInlineFrameAlign extends TEnumerable * - Both: show both horizontal and vertical scroll bars all the time. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TItemDataRenderer.php b/framework/Web/UI/WebControls/TItemDataRenderer.php index 2809e046..eb6fabef 100644 --- a/framework/Web/UI/WebControls/TItemDataRenderer.php +++ b/framework/Web/UI/WebControls/TItemDataRenderer.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TItemDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.2 */ @@ -28,7 +27,6 @@ Prado::using('System.Web.UI.WebControls.TDataRenderer'); * - {@link getData Data}: data associated with this renderer * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TItemDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.2 */ diff --git a/framework/Web/UI/WebControls/TJavascriptLogger.php b/framework/Web/UI/WebControls/TJavascriptLogger.php index 2af8bda6..2434237b 100644 --- a/framework/Web/UI/WebControls/TJavascriptLogger.php +++ b/framework/Web/UI/WebControls/TJavascriptLogger.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TJavascriptLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -26,14 +25,13 @@ * http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/ * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> - * @version $Id: TJavascriptLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ class TJavascriptLogger extends TWebControl { private static $_keyCodes = array( - '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57, + '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57, 'a'=>65, 'b'=>66, 'c'=>67, 'd'=>68, 'e'=>69, 'f'=>70, 'g'=>71, 'h'=>72, 'i'=>73, 'j'=>74, 'k'=>75, 'l'=>76, 'm'=>77, 'n'=>78, 'o'=>79, 'p'=>80, 'q'=>81, 'r'=>82, 's'=>83, 't'=>84, 'u'=>85, 'v'=>86, 'w'=>87, 'x'=>88, 'y'=>89, 'z'=>90); diff --git a/framework/Web/UI/WebControls/TKeyboard.php b/framework/Web/UI/WebControls/TKeyboard.php index 1260c5af..d423107a 100644 --- a/framework/Web/UI/WebControls/TKeyboard.php +++ b/framework/Web/UI/WebControls/TKeyboard.php @@ -4,9 +4,8 @@ * * @author Sergey Morkovkin <sergeymorkovkin@mail.ru> and Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TKeyboard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ @@ -33,7 +32,6 @@ * also be changed by specifying {@link setKeyboardCssClass KeyboardCssClass}. * * @author Sergey Morkovkin <sergeymorkovkin@mail.ru> and Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TKeyboard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ diff --git a/framework/Web/UI/WebControls/TLabel.php b/framework/Web/UI/WebControls/TLabel.php index 4552b1a5..6ffd025b 100644 --- a/framework/Web/UI/WebControls/TLabel.php +++ b/framework/Web/UI/WebControls/TLabel.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -26,7 +25,6 @@ * Make sure it does not contain dangerous characters that you want to avoid. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TLinkButton.php b/framework/Web/UI/WebControls/TLinkButton.php index a9e6f4cf..fe1ae33b 100644 --- a/framework/Web/UI/WebControls/TLinkButton.php +++ b/framework/Web/UI/WebControls/TLinkButton.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -50,7 +49,6 @@ * as an image button by enclosing an <img> tag as the body of TLinkButton. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TListBox.php b/framework/Web/UI/WebControls/TListBox.php index a616a2be..1d72f0c2 100644 --- a/framework/Web/UI/WebControls/TListBox.php +++ b/framework/Web/UI/WebControls/TListBox.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -32,7 +31,6 @@ Prado::using('System.Web.UI.WebControls.TListControl'); * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -223,7 +221,7 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl } /** - * Returns true if this control validated successfully. + * Returns true if this control validated successfully. * Defaults to true. * @return bool wether this control validated successfully. */ @@ -250,7 +248,6 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl * - Multiple: allow multiple selection * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index f9fdd77f..f8655761 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -6,9 +6,8 @@ * @author Robin J. Rogge <rojaro@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -79,7 +78,6 @@ Prado::using('System.Util.TDataFieldAccessor'); * be used to add a dummy list item that will be rendered first. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -794,7 +792,7 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer public function renderContents($writer) { $this->renderPrompt($writer); - + if($this->_items) { $writer->writeLine(); diff --git a/framework/Web/UI/WebControls/TListControlValidator.php b/framework/Web/UI/WebControls/TListControlValidator.php index 7d9801ef..04cc6ef6 100644 --- a/framework/Web/UI/WebControls/TListControlValidator.php +++ b/framework/Web/UI/WebControls/TListControlValidator.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TListControlValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -57,7 +56,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator'); * </code> * * @author Xiang Wei Zhuo <weizhuo[at]gmail.com> - * @version $Id: TListControlValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TListItem.php b/framework/Web/UI/WebControls/TListItem.php index e9bfa175..cf5e487a 100644 --- a/framework/Web/UI/WebControls/TListItem.php +++ b/framework/Web/UI/WebControls/TListItem.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TListItem.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -21,7 +20,6 @@ * if the list control supports so. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TListItem.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TLiteral.php b/framework/Web/UI/WebControls/TLiteral.php index da195f50..35d35e02 100644 --- a/framework/Web/UI/WebControls/TLiteral.php +++ b/framework/Web/UI/WebControls/TLiteral.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TLiteral.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -27,7 +26,6 @@ * does not contain unwanted characters that may bring security vulnerabilities. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLiteral.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TLiteralColumn.php b/framework/Web/UI/WebControls/TLiteralColumn.php index f40f8f4e..973ab801 100644 --- a/framework/Web/UI/WebControls/TLiteralColumn.php +++ b/framework/Web/UI/WebControls/TLiteralColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TLiteralColumn.php 1397 2006-09-07 07:55:53Z wei $ * @package System.Web.UI.WebControls */ @@ -29,7 +28,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn'); * If {@link setEncode Encode} is true, the static texts will be HTML-encoded. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TLiteralColumn.php 1397 2006-09-07 07:55:53Z wei $ * @package System.Web.UI.WebControls * @since 3.0.5 */ diff --git a/framework/Web/UI/WebControls/TMarkdown.php b/framework/Web/UI/WebControls/TMarkdown.php index 1a2855eb..75ca71af 100644 --- a/framework/Web/UI/WebControls/TMarkdown.php +++ b/framework/Web/UI/WebControls/TMarkdown.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMarkdown.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -39,7 +38,6 @@ Prado::using('System.3rdParty.Markdown.MarkdownParser'); * and enclosed within a pair of square brackets (e.g. [php]). * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TMarkdown.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.1 */ diff --git a/framework/Web/UI/WebControls/TMultiView.php b/framework/Web/UI/WebControls/TMultiView.php index 286f4e95..05725ff7 100644 --- a/framework/Web/UI/WebControls/TMultiView.php +++ b/framework/Web/UI/WebControls/TMultiView.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -32,7 +31,6 @@ * when its active view is changed during a postback. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -272,7 +270,6 @@ class TMultiView extends TControl * TViewCollection represents a collection that only takes {@link TView} instances * as collection elements. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -307,7 +304,6 @@ class TViewCollection extends TControlCollection * and when a view is deactivated, it raises {@link onDeactivate OnDeactivate}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TOutputCache.php b/framework/Web/UI/WebControls/TOutputCache.php index 89c0c849..2a5ce734 100644 --- a/framework/Web/UI/WebControls/TOutputCache.php +++ b/framework/Web/UI/WebControls/TOutputCache.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -63,7 +62,6 @@ * to determine whether the content is cached or not. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1 */ @@ -481,7 +479,7 @@ class TOutputCache extends TControl implements INamingContainer $textwriter = new TTextWriter(); $multiwriter = new TOutputCacheTextWriterMulti(array($writer->getWriter(),$textwriter)); $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $multiwriter); - + $stack=$this->getPage()->getCachingStack(); $stack->push($this); parent::render($htmlWriter); @@ -503,7 +501,6 @@ class TOutputCache extends TControl implements INamingContainer * <b>OnCheckDependency</b> event of {@link TOutputCache} control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -555,7 +552,6 @@ class TOutputCacheCheckDependencyEventParameter extends TEventParameter * <b>OnCalculateKey</b> event of {@link TOutputCache} control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -591,7 +587,6 @@ class TOutputCacheCalculateKeyEventParameter extends TEventParameter * * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu> * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.2 */ @@ -604,7 +599,7 @@ class TOutputCacheTextWriterMulti extends TTextWriter //parent::__construct(); $this->_writers = $writers; } - + public function write($s) { foreach($this->_writers as $writer) diff --git a/framework/Web/UI/WebControls/TPager.php b/framework/Web/UI/WebControls/TPager.php index 6379fedd..b4b9c2b0 100644 --- a/framework/Web/UI/WebControls/TPager.php +++ b/framework/Web/UI/WebControls/TPager.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -34,7 +33,7 @@ * * Since Prado 3.2.1, you can use the {@link setButtonCssClass ButtonCssClass} property to specify a css class * that will be applied to each button created by the pager in NextPrev or Numeric mode. - * + * * TPager raises an {@link onPageIndexChanged OnPageIndexChanged} event when * the end-user interacts with it and specifies a new page (e.g. clicking * on a page button that leads to a new page.) The new page index may be obtained @@ -45,7 +44,6 @@ * Multiple pagers can be associated with the same data-bound control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.2 */ @@ -727,7 +725,6 @@ class TPager extends TWebControl implements INamingContainer * returns the new page index carried with the page command. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.2 */ @@ -781,7 +778,6 @@ class TPagerPageChangedEventParameter extends TEventParameter * - DropDownList: a dropdown list is used to select pages * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -802,7 +798,6 @@ class TPagerMode extends TEnumerable * - PushButton: form submit buttons * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TPanel.php b/framework/Web/UI/WebControls/TPanel.php index cf20a864..2256420b 100644 --- a/framework/Web/UI/WebControls/TPanel.php +++ b/framework/Web/UI/WebControls/TPanel.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -35,7 +34,6 @@ Prado::using('System.Web.UI.WebControls.TPanelStyle'); * by setting the {@link setDefaultButton DefaultButton} property. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TPanelStyle.php b/framework/Web/UI/WebControls/TPanelStyle.php index cb49b715..d1dfe62e 100644 --- a/framework/Web/UI/WebControls/TPanelStyle.php +++ b/framework/Web/UI/WebControls/TPanelStyle.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -20,7 +19,6 @@ Prado::using('System.Web.UI.WebControls.TStyle'); * TPanelStyle represents the CSS style specific for panel HTML tag. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -239,7 +237,6 @@ class TPanelStyle extends TStyle * - RightToLeft: content in a panel is right to left * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -263,7 +260,6 @@ class TContentDirection extends TEnumerable * - Vertical: vertical scroll bar only * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TPlaceHolder.php b/framework/Web/UI/WebControls/TPlaceHolder.php index 020141cf..6809a402 100644 --- a/framework/Web/UI/WebControls/TPlaceHolder.php +++ b/framework/Web/UI/WebControls/TPlaceHolder.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -18,7 +17,6 @@ * by manipulating the {@link TControl::getControls Controls} property. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TRadioButton.php b/framework/Web/UI/WebControls/TRadioButton.php index dbb0dac0..d00f26b0 100644 --- a/framework/Web/UI/WebControls/TRadioButton.php +++ b/framework/Web/UI/WebControls/TRadioButton.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -49,7 +48,6 @@ Prado::using('System.Web.UI.WebControls.TRadioButtonList'); * that may bring security vulnerabilities. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TRadioButtonList.php b/framework/Web/UI/WebControls/TRadioButtonList.php index d93caaa2..3afe3ec2 100644 --- a/framework/Web/UI/WebControls/TRadioButtonList.php +++ b/framework/Web/UI/WebControls/TRadioButtonList.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -29,7 +28,6 @@ Prado::using('System.Web.UI.WebControls.TCheckBoxList'); * one radiobutton can be selected at a time. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -49,7 +47,7 @@ class TRadioButtonList extends TCheckBoxList */ protected function createRepeatedControl() { - return new TRadioButton; + return new TRadioButtonItem; } /** @@ -99,3 +97,11 @@ class TRadioButtonList extends TCheckBoxList } } +class TRadioButtonItem extends TRadioButton { + /** + * Override client implementation to avoid emitting the javascript + */ + protected function renderClientControlScript($writer) + { + } +} diff --git a/framework/Web/UI/WebControls/TRangeValidator.php b/framework/Web/UI/WebControls/TRangeValidator.php index 8b7550c8..8a3c0e35 100644 --- a/framework/Web/UI/WebControls/TRangeValidator.php +++ b/framework/Web/UI/WebControls/TRangeValidator.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -46,7 +45,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator'); * defaulted as UTF-8. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -350,7 +348,6 @@ class TRangeValidator extends TBaseValidator * - StringLength * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TRatingList.php b/framework/Web/UI/WebControls/TRatingList.php index f4d4adcf..c48b3cdb 100644 --- a/framework/Web/UI/WebControls/TRatingList.php +++ b/framework/Web/UI/WebControls/TRatingList.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRatingList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -22,7 +21,6 @@ Prado::using('System.Web.UI.WebControls.TRadioButtonList'); * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com> - * @version $Id: TRatingList.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -125,7 +123,7 @@ class TRatingList extends TRadioButtonList $index = $this->getRatingIndex($value); parent::setSelectedIndex($index); } - + public function setSelectedIndex($value) { $this->setRating($value+1); @@ -175,7 +173,7 @@ class TRatingList extends TRadioButtonList { if(($id=$this->getCaptionID())!=='') { - if($control=$this->getParent()->findControl($id)) + if($control=$this->getPage()->findControl($id)) return $control; } throw new TInvalidDataValueException( @@ -213,7 +211,7 @@ class TRatingList extends TRadioButtonList { return $this->getViewState('RatingStyle', 'default'); } - + /** * @return string rating style css class name. */ diff --git a/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/framework/Web/UI/WebControls/TRegularExpressionValidator.php index 890fb56e..2c155e28 100644 --- a/framework/Web/UI/WebControls/TRegularExpressionValidator.php +++ b/framework/Web/UI/WebControls/TRegularExpressionValidator.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRegularExpressionValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -43,7 +42,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator'); * Use a {@link TRequiredFieldValidator} to ensure the input is not empty. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRegularExpressionValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TRepeatInfo.php b/framework/Web/UI/WebControls/TRepeatInfo.php index 929d31e7..7b65b3b3 100644 --- a/framework/Web/UI/WebControls/TRepeatInfo.php +++ b/framework/Web/UI/WebControls/TRepeatInfo.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -17,7 +16,6 @@ Prado::using('System.Web.UI.WebControls.TTable'); * This interface must be implemented by classes who want to use {@link TRepeatInfo}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -70,7 +68,6 @@ interface IRepeatInfoUser * the column and repeat direction settings. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -526,7 +523,6 @@ class TRepeatInfo extends TComponent * - Horizontal * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -547,7 +543,6 @@ class TRepeatDirection extends TEnumerable * - Raw: the repeated contents are stacked together without any additional decorations * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php index c32636fd..a563a12d 100644 --- a/framework/Web/UI/WebControls/TRepeater.php +++ b/framework/Web/UI/WebControls/TRepeater.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -87,7 +86,6 @@ Prado::using('System.Util.TDataFieldAccessor'); * complex data may also have serializing problem if saved in viewstate. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -784,7 +782,6 @@ class TRepeater extends TDataBoundControl implements INamingContainer * The {@link getItem Item} property indicates the repeater item related with the event. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -825,7 +822,6 @@ class TRepeaterItemEventParameter extends TEventParameter * raises the Command event. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -880,7 +876,6 @@ class TRepeaterCommandEventParameter extends TCommandEventParameter * is given by {@link getItemType ItemType} property. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1001,7 +996,6 @@ class TRepeaterItem extends TControl implements INamingContainer, IItemDataRende * TRepeaterItemCollection represents a collection of repeater items. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TRepeaterItemRenderer.php b/framework/Web/UI/WebControls/TRepeaterItemRenderer.php index 0e39e765..1c41e65f 100644 --- a/framework/Web/UI/WebControls/TRepeaterItemRenderer.php +++ b/framework/Web/UI/WebControls/TRepeaterItemRenderer.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRepeaterItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -23,7 +22,6 @@ Prado::using('System.Web.UI.WebControls.TItemDataRenderer'); * the bubbling scheme for the OnCommand event of repeater items. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRepeaterItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.0 */ diff --git a/framework/Web/UI/WebControls/TRequiredFieldValidator.php b/framework/Web/UI/WebControls/TRequiredFieldValidator.php index 7a0bad8c..3db2457d 100644 --- a/framework/Web/UI/WebControls/TRequiredFieldValidator.php +++ b/framework/Web/UI/WebControls/TRequiredFieldValidator.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -29,7 +28,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator'); * set, it will be automatically considered as the validator's {@link setInitialValue InitialValue}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -99,7 +97,7 @@ class TRequiredFieldValidator extends TBaseValidator else return $this->validateStandardControl($control); } - + private function validateListControl($control) { $initial = trim($this->getInitialValue()); @@ -111,7 +109,7 @@ class TRequiredFieldValidator extends TBaseValidator } return $count > 0; } - + private function validateRadioButtonGroup($control) { $initial = trim($this->getInitialValue()); @@ -127,7 +125,7 @@ class TRequiredFieldValidator extends TBaseValidator } return false; } - + private function validateStandardControl($control) { $initial = trim($this->getInitialValue()); diff --git a/framework/Web/UI/WebControls/TSafeHtml.php b/framework/Web/UI/WebControls/TSafeHtml.php index 775086b4..b7b14f79 100644 --- a/framework/Web/UI/WebControls/TSafeHtml.php +++ b/framework/Web/UI/WebControls/TSafeHtml.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSafeHtml.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -34,7 +33,6 @@ * to ensure the contents gets parsed correctly. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TSafeHtml.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TSlider.php b/framework/Web/UI/WebControls/TSlider.php index a07c995f..e9573ea9 100644 --- a/framework/Web/UI/WebControls/TSlider.php +++ b/framework/Web/UI/WebControls/TSlider.php @@ -4,9 +4,8 @@ * * @author Christophe Boulain <Christophe.Boulain@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ @@ -26,10 +25,10 @@ * You can also provide the allowed values by setting the {@link SetValues Values} array. * * A 'Progress Indicator' can be displayed within the track with the {@link SetProgressIndicator ProgressIndicator} property. - * + * * The TSlider control can be easily customized using CssClasses. You can provide your own css file, using the * {@link SetCssUrl CssUrl} property. - * The css class for TSlider can be set by the {@link setCssClass CssClass} property. Default value is "Slider HorizontalSlider" + * The css class for TSlider can be set by the {@link setCssClass CssClass} property. Default value is "Slider HorizontalSlider" * for an horizontal slider, and "Slider VerticalSlider" for a vertical one. * * If {@link SetAutoPostBack AutoPostBack} property is true, postback is sent as soon as the value changed. @@ -42,7 +41,6 @@ * - ClientSide.onChange is called when the slider value has changed (at the end of a move). * * @author Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ @@ -145,7 +143,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer { $this->setViewState('StepSize', $value, 1.0); } - + /** * @return boolean wether to display a progress indicator or not. Defaults to true. */ @@ -219,7 +217,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer { $this->setViewState('Values', TPropertyValue::ensureArray($value), array()); } - + /** * @return boolean a value indicating whether an automatic postback to the server * will occur whenever the user modifies the slider value. Defaults to false. @@ -351,7 +349,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer $class=($this->getDirection()==TSliderDirection::Horizontal)?'HorizontalSlider':'VerticalSlider'; $writer->addAttribute('class', 'Slider '.$class); } - + } /** @@ -387,9 +385,9 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer } $writer->renderEndTag(); */ - + $writer->renderEndTag(); - + // Render the 'Handle' $writer->addAttribute('class', 'Handle'); $writer->addAttribute('id', $this->getClientID().'_handle'); @@ -508,7 +506,6 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer * The <tt>OnChange</tt> event is raised when the slider value is changed (or at the end of a move) * * @author Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ @@ -561,7 +558,6 @@ class TSliderClientScript extends TClientSideOptions * - Vertical : Vertical slider * * @author Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ diff --git a/framework/Web/UI/WebControls/TStatements.php b/framework/Web/UI/WebControls/TStatements.php index 32f98296..0602732b 100644 --- a/framework/Web/UI/WebControls/TStatements.php +++ b/framework/Web/UI/WebControls/TStatements.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TStatements.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -23,7 +22,6 @@ * make sure {@link setStatements Statements} does not come directly from user input. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStatements.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php index 4ba37d53..f30b3461 100644 --- a/framework/Web/UI/WebControls/TStyle.php +++ b/framework/Web/UI/WebControls/TStyle.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -21,7 +20,6 @@ Prado::using('System.Web.UI.WebControls.TFont'); * TStyle encapsulates the CSS style applied to a control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -418,7 +416,6 @@ class TStyle extends TComponent * - Hidden: the control is not displayed and is included in the layout. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1 */ @@ -435,7 +432,6 @@ class TDisplayStyle extends TEnumerable * TTableStyle represents the CSS style specific for HTML table. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -676,7 +672,6 @@ class TTableStyle extends TStyle * TTableItemStyle represents the CSS style specific for HTML table item. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -831,7 +826,6 @@ class TTableItemStyle extends TStyle * - Justify: the begin and end are justified * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -855,7 +849,6 @@ class THorizontalAlign extends TEnumerable * - Middle: middle aligned * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -879,7 +872,6 @@ class TVerticalAlign extends TEnumerable * - Both: both horizontal and vertical grid lines are shown * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TStyleSheet.php b/framework/Web/UI/WebControls/TStyleSheet.php index 5faf52f0..32c0faf1 100644 --- a/framework/Web/UI/WebControls/TStyleSheet.php +++ b/framework/Web/UI/WebControls/TStyleSheet.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TStyleSheet.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php index 0c6128f1..8f1564db 100644 --- a/framework/Web/UI/WebControls/TTabPanel.php +++ b/framework/Web/UI/WebControls/TTabPanel.php @@ -4,9 +4,8 @@ * * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ @@ -54,7 +53,6 @@ * </code> * * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ @@ -408,15 +406,15 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler protected function registerStyleSheet() { $url = $this->getCssUrl(); - + if($url === '') { return; } - + if($url === 'default') { $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css'); } - + if($url !== '') { $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); } @@ -540,7 +538,6 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler * setting the {@link setActive Active} property. * * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ @@ -694,7 +691,6 @@ class TTabView extends TWebControl * TTabViewCollection is used to maintain a list of views belong to a {@link TTabPanel}. * * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.1.1 */ diff --git a/framework/Web/UI/WebControls/TTable.php b/framework/Web/UI/WebControls/TTable.php index 5be68cbd..4102cd4b 100644 --- a/framework/Web/UI/WebControls/TTable.php +++ b/framework/Web/UI/WebControls/TTable.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -61,7 +60,6 @@ Prado::using('System.Web.UI.WebControls.TTableRow'); * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -358,7 +356,6 @@ class TTable extends TWebControl * TTableRowCollection is used to maintain a list of rows belong to a table. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -395,7 +392,6 @@ class TTableRowCollection extends TControlCollection * - Right: right aligned * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TTableCell.php b/framework/Web/UI/WebControls/TTableCell.php index 96254e62..d78aebbd 100644 --- a/framework/Web/UI/WebControls/TTableCell.php +++ b/framework/Web/UI/WebControls/TTableCell.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTableCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -28,7 +27,6 @@ * indicates whether the contents in the cell should be wrapped. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTableCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TTableFooterRow.php b/framework/Web/UI/WebControls/TTableFooterRow.php index 46d1a3be..32be1e12 100644 --- a/framework/Web/UI/WebControls/TTableFooterRow.php +++ b/framework/Web/UI/WebControls/TTableFooterRow.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTableFooterRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -21,7 +20,6 @@ Prado::using('System.Web.UI.WebControls.TTableRow'); * TTableFooterRow displays a table footer row. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTableFooterRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.1 */ diff --git a/framework/Web/UI/WebControls/TTableHeaderCell.php b/framework/Web/UI/WebControls/TTableHeaderCell.php index 80036d41..43b21b45 100644 --- a/framework/Web/UI/WebControls/TTableHeaderCell.php +++ b/framework/Web/UI/WebControls/TTableHeaderCell.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -22,7 +21,6 @@ Prado::using('System.Web.UI.WebControls.TTableCell'); * TTableHeaderCell displays a table header cell on a Web page. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -111,7 +109,6 @@ class TTableHeaderCell extends TTableCell * - Column: the scope is column-wise * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TTableHeaderRow.php b/framework/Web/UI/WebControls/TTableHeaderRow.php index 166a20e4..0e42a416 100644 --- a/framework/Web/UI/WebControls/TTableHeaderRow.php +++ b/framework/Web/UI/WebControls/TTableHeaderRow.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTableHeaderRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -21,7 +20,6 @@ Prado::using('System.Web.UI.WebControls.TTableRow'); * TTableHeaderRow displays a table header row. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTableHeaderRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.1 */ diff --git a/framework/Web/UI/WebControls/TTableRow.php b/framework/Web/UI/WebControls/TTableRow.php index a998e6fb..d0bc6bfb 100644 --- a/framework/Web/UI/WebControls/TTableRow.php +++ b/framework/Web/UI/WebControls/TTableRow.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -24,7 +23,6 @@ Prado::using('System.Web.UI.WebControls.TTableCell'); * {@link setVerticalAlign VerticalAlign} properties, respectively. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -160,7 +158,6 @@ class TTableRow extends TWebControl * TTableCellCollection is used to maintain a list of cells belong to a table row. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -195,7 +192,6 @@ class TTableCellCollection extends TControlCollection * - Footer: in table footer * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TTemplateColumn.php b/framework/Web/UI/WebControls/TTemplateColumn.php index 173476f2..947f0c47 100644 --- a/framework/Web/UI/WebControls/TTemplateColumn.php +++ b/framework/Web/UI/WebControls/TTemplateColumn.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTemplateColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -34,7 +33,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn'); * takes precedence. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTemplateColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index 969d2969..0d14dd7c 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -44,7 +43,6 @@ * Currently, no alternatives are available. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -593,7 +591,6 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable * - Password: the textbox will hide user input like a password input box * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -610,7 +607,6 @@ class TTextBoxMode extends TEnumerable * by a {@link TTextBox} control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php index 64878d49..a10171db 100644 --- a/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/framework/Web/UI/WebControls/TTextHighlighter.php @@ -4,9 +4,8 @@ * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -31,7 +30,6 @@ Prado::using('System.Web.UI.WebControls.TTextProcessor'); * because it needs to insert some CSS styles. * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> - * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -202,7 +200,6 @@ class TTextHighlighter extends TTextProcessor /** * @author Wei Zhuo<weizhuo[at]gmail[dot]com> - * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TTextProcessor.php b/framework/Web/UI/WebControls/TTextProcessor.php index e569e780..daba9b46 100644 --- a/framework/Web/UI/WebControls/TTextProcessor.php +++ b/framework/Web/UI/WebControls/TTextProcessor.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TTextProcessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -23,7 +22,6 @@ * Note, all child classes must implement {@link processText} method. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TTextProcessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI * @since 3.0.1 */ diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php index 00c96c90..3d5b61ca 100644 --- a/framework/Web/UI/WebControls/TValidationSummary.php +++ b/framework/Web/UI/WebControls/TValidationSummary.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -30,7 +29,6 @@ * {@link setEnableClientScript EnableClientScript} is true. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -430,7 +428,6 @@ class TValidationSummary extends TWebControl * See the quickstart documentation for further details. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -499,7 +496,6 @@ class TClientSideValidationSummaryOptions extends TClientSideOptions * - HeaderOnly: only the HeaderText will be display. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -523,7 +519,6 @@ class TValidationSummaryDisplayMode extends TEnumerable * - Fixed: Similar to Dynamic except that the error messages physically occupy the page layout (even though they may not be visible) * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TWebControl.php b/framework/Web/UI/WebControls/TWebControl.php index 0da4d88c..e0bd6194 100644 --- a/framework/Web/UI/WebControls/TWebControl.php +++ b/framework/Web/UI/WebControls/TWebControl.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TWebControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -35,7 +34,6 @@ Prado::using('System.Web.UI.WebControls.TWebControlDecorator'); * the body contents enclosed within the HTML tag. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWebControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -45,12 +43,12 @@ class TWebControl extends TControl implements IStyleable * @var boolean ensures the inclusion the id in the tag rendering. */ private $_ensureid=false; - + /** * @var TWebControlDecorator this render things before and after both the open and close tag */ protected $_decorator; - + /** * Subclasses can override getEnsureId or just set this property. eg. If your subclass @@ -80,7 +78,7 @@ class TWebControl extends TControl implements IStyleable $this->_decorator = Prado::createComponent('TWebControlDecorator', $this); return $this->_decorator; } - + /** * Copies basic control attributes from another control. * Properties including AccessKey, ToolTip, TabIndex, Enabled @@ -397,10 +395,10 @@ class TWebControl extends TControl implements IStyleable { $this->getStyle()->setWidth($value); } - + /** - * If your subclass overrides the onPreRender method be sure to call + * If your subclass overrides the onPreRender method be sure to call * this method through parent::onPreRender($param); so your sub-class can be decorated, * among other things. * @param TEventParameter event parameter to be passed to the event handlers @@ -408,7 +406,7 @@ class TWebControl extends TControl implements IStyleable public function onPreRender($param) { if($decorator = $this->getDecorator(false)) $decorator->instantiate(); - + parent::onPreRender($param); } @@ -494,7 +492,7 @@ class TWebControl extends TControl implements IStyleable $decorator->renderPostContentsText($writer); $writer->renderEndTag(); $decorator->renderPostTagText($writer); - } else + } else $writer->renderEndTag($writer); } } diff --git a/framework/Web/UI/WebControls/TWebControlAdapter.php b/framework/Web/UI/WebControls/TWebControlAdapter.php index 5de15419..6b969456 100644 --- a/framework/Web/UI/WebControls/TWebControlAdapter.php +++ b/framework/Web/UI/WebControls/TWebControlAdapter.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TWebControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -19,7 +18,6 @@ * browsers. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWebControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TWebControlDecorator.php b/framework/Web/UI/WebControls/TWebControlDecorator.php index 9b1c3652..d08d9c82 100644 --- a/framework/Web/UI/WebControls/TWebControlDecorator.php +++ b/framework/Web/UI/WebControls/TWebControlDecorator.php @@ -4,23 +4,22 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TWebControlDecorator.php 2541 2008-10-21 15:05:13Z qiang.xue $ * @package System.Web.UI.WebControls */ /** * TWebControlDecorator class - * + * * A TWebControlDecorator can be applied to a {@link TWebControl} to customize its rendering. - * TWebControlDecorator can add custom html code before and after both the open and close + * TWebControlDecorator can add custom html code before and after both the open and close * tag of a {@link TWebControl}. * The html code can be an user-defined text or an external template file that will be * instantiated and rendered in place. - * - * This is an easy way to have your look and feel depend upon the theme instead of writing + * + * This is an easy way to have your look and feel depend upon the theme instead of writing * specific html in your templates to achieve your website desires. * Here is an example of how to code your theme skin: * <code> @@ -51,40 +50,39 @@ * * * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: TWebControlDecorator.php 2541 2008-10-21 15:05:13Z qiang.xue $ * @package System.Web.UI.WebControls * @since 3.2 */ class TWebControlDecorator extends TComponent { - + /** * @var boolean tells if there should only be decoration around the inner content */ private $_internalonly; - + /** * @var boolean tells if the decoration uses state in its templates. If there are no templates - * in the instance of the decoration this variable is unused. + * in the instance of the decoration this variable is unused. */ private $_usestate = false; - + /** * @var TWebControl the control to decorate */ private $_control; - + /** * @var TControl to tell the decorator where to place the outer controls */ private $_outercontrol; - + /** - * @var boolean This tells if the Templates have been + * @var boolean This tells if the Templates have been */ private $_addedTemplateDecoration=false; - - + + /** * @var string the text that goes before the open tag */ @@ -101,9 +99,9 @@ class TWebControlDecorator extends TComponent { * @var string the text that goes after the close tag */ private $_posttagtext = ''; - - - + + + /** * @var TTemplate the template that goes before the open tag */ @@ -120,7 +118,7 @@ class TWebControlDecorator extends TComponent { * @var TTemplate the template that goes after the close tag */ private $_posttagtemplate; - + /** * Constructor. * Initializes the control . @@ -131,7 +129,7 @@ class TWebControlDecorator extends TComponent { $this->_control = $control; $this->_internalonly = $onlyinternal; } - + /** * @return boolean if the templates in this decoration need state. This defaults to false */ @@ -139,23 +137,23 @@ class TWebControlDecorator extends TComponent { { return $this->_usestate; } - + /** - * @param boolean $value true to tell the decoration that the templates need state and should be + * @param boolean $value true to tell the decoration that the templates need state and should be * placed in a control step before the state is saved. */ public function setUseState($value) { $this->_usestate = TPropertyValue::ensureBoolean($value); } - + /** * @return string gets the text before the open tag in the TWebControl */ public function getPreTagText() { return $this->_pretagtext; } - + /** * @param string sets the text before the open tag in the TWebControl */ @@ -163,15 +161,15 @@ class TWebControlDecorator extends TComponent { if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) $this->_pretagtext = TPropertyValue::ensureString($value); } - - + + /** * @return string the text after the open tag in the TWebControl */ public function getPreContentsText() { return $this->_precontentstext; } - + /** * @param string sets the text after the open tag in the TWebControl */ @@ -179,15 +177,15 @@ class TWebControlDecorator extends TComponent { if(!$this->_control->getIsSkinApplied()) $this->_precontentstext = TPropertyValue::ensureString($value); } - - + + /** * @return string the text before the close tag in the TWebControl */ public function getPostContentsText() { return $this->_postcontentstext; } - + /** * @param string sets the text before the close tag in the TWebControl */ @@ -195,15 +193,15 @@ class TWebControlDecorator extends TComponent { if(!$this->_control->getIsSkinApplied()) $this->_postcontentstext = TPropertyValue::ensureString($value); } - - + + /** * @return string the text before the close tag in the TWebControl */ public function getPostTagText() { return $this->_posttagtext; } - + /** * @param string sets the text after the close tag in the TWebControl */ @@ -211,15 +209,15 @@ class TWebControlDecorator extends TComponent { if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) $this->_posttagtext = TPropertyValue::ensureString($value); } - - + + /** * @return TTemplate|null the template before the open tag in the TWebControl. Defaults to null. */ public function getPreTagTemplate() { return $this->_pretagtemplate; } - + /** * @param TTemplate sets the template before the open tag in the TWebControl */ @@ -227,15 +225,15 @@ class TWebControlDecorator extends TComponent { if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) $this->_pretagtemplate = $value; } - - + + /** * @return TTemplate|null the template after the open tag in the TWebControl. Defaults to null. */ public function getPreContentsTemplate() { return $this->_precontentstemplate; } - + /** * @param TTemplate sets the template after the open tag in the TWebControl */ @@ -243,15 +241,15 @@ class TWebControlDecorator extends TComponent { if(!$this->_control->getIsSkinApplied()) $this->_precontentstemplate = $value; } - - + + /** * @return TTemplate|null the template before the close tag in the TWebControl. Defaults to null. */ public function getPostContentsTemplate() { return $this->_postcontentstemplate; } - + /** * @param TTemplate sets the template before the close tag in the TWebControl */ @@ -259,15 +257,15 @@ class TWebControlDecorator extends TComponent { if(!$this->_control->getIsSkinApplied()) $this->_postcontentstemplate = $value; } - - + + /** * @return TTemplate|null the template after the close tag in the TWebControl. Defaults to null. */ public function getPostTagTemplate() { return $this->_posttagtemplate; } - + /** * @param TTemplate sets the template before the close tag in the TWebControl */ @@ -275,17 +273,17 @@ class TWebControlDecorator extends TComponent { if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) $this->_posttagtemplate = $value; } - + /** - * this is a framework call. The Text decoration can't + * this is a framework call. The Text decoration can't * influence the object hierarchy because they are rendered into into the writer directly. - * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so + * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so * these controls don't have page states. This is as close to not influencing the page as possible. */ public function instantiate($outercontrol = null) { - if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || + if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || $this->getPostContentsTemplate() || $this->getPostTagTemplate()) { - + $this->_outercontrol = $outercontrol; if($this->getUseState()) $this->ensureTemplateDecoration(); @@ -293,53 +291,53 @@ class TWebControlDecorator extends TComponent { $this->_control->getPage()->onSaveStateComplete[] = array($this, 'ensureTemplateDecoration'); } } - - + + /** * This method places the templates around the open and close tag. This takes a parameter which is * to specify the control to get the outer template decoration. If no outer control is specified - * @param TComponent this indicates the component or control to get the outer tag elements, just in case it's + * @param TComponent this indicates the component or control to get the outer tag elements, just in case it's * different than attached TWebControl. If none is provided, the outer templates default to the attached * control * @return boolean returns true if the template decorations have been added */ public function ensureTemplateDecoration($sender=null, $param=null) { - + $control = $this->_control; $outercontrol = $this->_outercontrol; if($outercontrol === null) $outercontrol = $control; - + if($this->_addedTemplateDecoration) return $this->_addedTemplateDecoration; - + $this->_addedTemplateDecoration = true; - + if($this->getPreContentsTemplate()) { $precontents = Prado::createComponent('TCompositeControl'); $this->getPreContentsTemplate()->instantiateIn($precontents); $control->getControls()->insertAt(0, $precontents); } - + if($this->getPostContentsTemplate()) { $postcontents = Prado::createComponent('TCompositeControl'); $this->getPostContentsTemplate()->instantiateIn($postcontents); $control->getControls()->add($postcontents); } - + if(!$outercontrol->getParent()) return $this->_addedTemplateDecoration; - - + + if($this->getPreTagTemplate()) { $pretag = Prado::createComponent('TCompositeControl'); $this->getPreTagTemplate()->instantiateIn($pretag); $outercontrol->getParent()->getControls()->insertBefore($outercontrol, $pretag); } - + if($this->getPostTagTemplate()) { $posttag = Prado::createComponent('TCompositeControl'); @@ -348,8 +346,8 @@ class TWebControlDecorator extends TComponent { } return true; } - - + + /** * This method places the pre tag text into the {@link TTextWriter} * @param {@link TTextWriter} the writer to which the text is written @@ -357,7 +355,7 @@ class TWebControlDecorator extends TComponent { public function renderPreTagText($writer) { $writer->write($this->getPreTagText()); } - + /** * This method places the pre contents text into the {@link TTextWriter} * @param {@link TTextWriter} the writer to which the text is written @@ -365,7 +363,7 @@ class TWebControlDecorator extends TComponent { public function renderPreContentsText($writer) { $writer->write($this->getPreContentsText()); } - + /** * This method places the post contents text into the {@link TTextWriter} * @param {@link TTextWriter} the writer to which the text is written @@ -373,7 +371,7 @@ class TWebControlDecorator extends TComponent { public function renderPostContentsText($writer) { $writer->write($this->getPostContentsText()); } - + /** * This method places the post tag text into the {@link TTextWriter} * @param {@link TTextWriter} the writer to which the text is written diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php index 67cbc4e4..6b82a691 100644 --- a/framework/Web/UI/WebControls/TWizard.php +++ b/framework/Web/UI/WebControls/TWizard.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -77,7 +76,6 @@ Prado::using('System.Web.UI.WebControls.TWizardNavigationButtonStyle'); * - side bar: {@link getSideBarStyle SideBarStyle} and {@link getSideBarButtonStyle SideBarButtonStyle}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1449,7 +1447,6 @@ class TWizard extends TWebControl implements INamingContainer * set {@link setAllowReturn AllowReturn} to true. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1539,7 +1536,6 @@ class TWizardStep extends TView * TCompleteWizardStep represents a wizard step of type TWizardStepType::Complete. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1574,7 +1570,6 @@ class TCompleteWizardStep extends TWizardStep * if the navigation template is not specified, default navigation will be used. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1676,7 +1671,6 @@ class TTemplatedWizardStep extends TWizardStep implements INamingContainer * by a {@link TWizard}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1740,7 +1734,6 @@ class TWizardStepCollection extends TList * {@link getCancelButton CancelButton}, {@link getCompleteButton CompleteButton}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1832,7 +1825,6 @@ class TWizardNavigationContainer extends TControl implements INamingContainer * to true. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1897,7 +1889,6 @@ class TWizardNavigationEventParameter extends TEventParameter * TWizardSideBarTemplate class. * TWizardSideBarTemplate is the default template for wizard sidebar. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1922,7 +1913,6 @@ class TWizardSideBarTemplate extends TComponent implements ITemplate * TWizardSideBarListItemTemplate class. * TWizardSideBarListItemTemplate is the default template for each item in the sidebar datalist. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1945,7 +1935,6 @@ class TWizardSideBarListItemTemplate extends TComponent implements ITemplate * TWizardNavigationTemplate class. * TWizardNavigationTemplate is the base class for various navigation templates. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2017,7 +2006,6 @@ class TWizardNavigationTemplate extends TComponent implements ITemplate * TWizardStartNavigationTemplate is the template used as default wizard start navigation panel. * It consists of two buttons, Next and Cancel. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2047,7 +2035,6 @@ class TWizardStartNavigationTemplate extends TWizardNavigationTemplate * TWizardFinishNavigationTemplate is the template used as default wizard finish navigation panel. * It consists of three buttons, Previous, Complete and Cancel. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2081,7 +2068,6 @@ class TWizardFinishNavigationTemplate extends TWizardNavigationTemplate * TWizardStepNavigationTemplate is the template used as default wizard step navigation panel. * It consists of three buttons, Previous, Next and Cancel. * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2122,7 +2108,6 @@ class TWizardStepNavigationTemplate extends TWizardNavigationTemplate * - Link: a hyperlink button * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -2146,7 +2131,6 @@ class TWizardNavigationButtonType extends TEnumerable * - Finish: the last step before the Complete step. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ diff --git a/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php b/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php index f0873df8..c84f28a1 100644 --- a/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php +++ b/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id $ * @package System.Web.UI.WebControls @@ -25,7 +25,6 @@ Prado::using('System.Web.UI.WebControls.TStyle'); * Otherwise, {@link setButtonText ButtonText} will be displayed as the button caption. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TWizardNavigationButtonStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TXmlTransform.php b/framework/Web/UI/WebControls/TXmlTransform.php index 7b4d5cf7..c32ab440 100644 --- a/framework/Web/UI/WebControls/TXmlTransform.php +++ b/framework/Web/UI/WebControls/TXmlTransform.php @@ -5,7 +5,7 @@ * @author Knut Urdalen <knut.urdalen@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Web.UI.WebControls */ diff --git a/framework/Web/UI/WebControls/assets/captcha.php b/framework/Web/UI/WebControls/assets/captcha.php index ac71d696..1c35e6eb 100644 --- a/framework/Web/UI/WebControls/assets/captcha.php +++ b/framework/Web/UI/WebControls/assets/captcha.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: captcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Web.UI.WebControls.assets */ @@ -116,7 +115,7 @@ function displayToken($token,$fontSize,$theme) imagettftext($image,$size,$angle,$x+2,$y+2,$color,$font,$token[$i]); imagecolordeallocate($image,$color); } - + header('Content-Type: image/png'); imagepng($image); imagedestroy($image); diff --git a/framework/Wsat/TWsatARGenerator.php b/framework/Wsat/TWsatARGenerator.php index 7ae5e46e..c6cef1d5 100644 --- a/framework/Wsat/TWsatARGenerator.php +++ b/framework/Wsat/TWsatARGenerator.php @@ -3,7 +3,7 @@ /** * @author Daniel Sampedro Bello <darthdaniel85@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @since 3.3 @@ -43,7 +43,7 @@ class TWsatARGenerator /** * unquote chars - * @var array + * @var array */ private $uqChars = array('[', ']', '"', '`', "'"); @@ -77,7 +77,7 @@ class TWsatARGenerator $this->_classSufix = $_clas_sufix; } -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // <editor-fold defaultstate="collapsed" desc="Main APIs"> public function generate($tableName) { @@ -260,10 +260,10 @@ class TWsatARGenerator <?php /** * Auto generated by PRADO - WSAT on $date. - * @author $env_user + * @author $env_user */ -class $classname extends TActiveRecord -{ +class $classname extends TActiveRecord +{ const TABLE='$tablename'; $props @@ -271,9 +271,9 @@ $props public static function finder(\$className=__CLASS__) { return parent::finder(\$className); } - + $relations - + $toString } EOD; diff --git a/framework/Wsat/TWsatService.php b/framework/Wsat/TWsatService.php index 63bfebc7..3796bd48 100644 --- a/framework/Wsat/TWsatService.php +++ b/framework/Wsat/TWsatService.php @@ -3,7 +3,7 @@ /** * @author Daniel Sampedro Bello <darthdaniel85@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @since 3.3 @@ -12,15 +12,15 @@ /** * TWsatService class - * + * * Wsat is inspired in both Asp.Net - Web Site Administration Tool(WSAT) and Yii's Gii. * Wsat enables you to generate code saving your time in too many tedious tasks in a GUI fashion. - * + * * Current options: * 1- Generate one or all Active Record Classes from your DataBase. * 1.1- Automatically generate all relations between the AR Classes (new). * 1.2- Automatically generate the __toString() magic method in a smart way (new). - * + * * To use TWsatService, configure it in the application configuration file like following: * <code> * <services> @@ -30,7 +30,7 @@ * </code> * ...and then you need to go to http://localhost/yoursite/index.php?wsat=TWsatLogin * and generate code and configure your site. - * + * * Warning: You should only use Wsat in development mode. */ class TWsatService extends TPageService diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php index f0ce8430..4a3714de 100644 --- a/framework/Wsat/pages/TWsatGenerateAR.php +++ b/framework/Wsat/pages/TWsatGenerateAR.php @@ -3,7 +3,7 @@ /** * @author Daniel Sampedro Bello <darthdaniel85@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @since 3.3 diff --git a/framework/Wsat/pages/TWsatHome.php b/framework/Wsat/pages/TWsatHome.php index b5ae1bb4..b4beb07c 100644 --- a/framework/Wsat/pages/TWsatHome.php +++ b/framework/Wsat/pages/TWsatHome.php @@ -3,7 +3,7 @@ /** * @author Daniel Sampedro Bello <darthdaniel85@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @since 3.3 @@ -13,5 +13,5 @@ Prado::using("System.Wsat.TWsatARGenerator"); class TWsatHome extends TPage { - + }
\ No newline at end of file diff --git a/framework/Wsat/pages/TWsatLogin.php b/framework/Wsat/pages/TWsatLogin.php index 21994c07..051937d7 100644 --- a/framework/Wsat/pages/TWsatLogin.php +++ b/framework/Wsat/pages/TWsatLogin.php @@ -3,7 +3,7 @@ /** * @author Daniel Sampedro Bello <darthdaniel85@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @since 3.3 diff --git a/framework/Wsat/pages/TWsatScaffolding.php b/framework/Wsat/pages/TWsatScaffolding.php index b8e28b03..fe691dd9 100644 --- a/framework/Wsat/pages/TWsatScaffolding.php +++ b/framework/Wsat/pages/TWsatScaffolding.php @@ -3,7 +3,7 @@ /** * @author Daniel Sampedro Bello <darthdaniel85@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @since 3.3 @@ -13,5 +13,5 @@ Prado::using("System.Wsat.TWsatARGenerator"); class TWsatScaffolding extends TPage { - + }
\ No newline at end of file diff --git a/framework/Xml/TXmlDocument.php b/framework/Xml/TXmlDocument.php index b0252ae8..74e971bb 100644 --- a/framework/Xml/TXmlDocument.php +++ b/framework/Xml/TXmlDocument.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Xml */ @@ -22,7 +21,6 @@ * TBD: xpath * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Xml * @since 3.0 */ @@ -300,7 +298,6 @@ class TXmlElement extends TComponent * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Xml * @since 3.0 */ @@ -502,7 +499,6 @@ class TXmlDocument extends TXmlElement * You may manipulate the collection with the operations defined in {@link TList}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Xml * @since 3.0 */ diff --git a/framework/interfaces.php b/framework/interfaces.php index d05123ba..1c2bbc19 100644 --- a/framework/interfaces.php +++ b/framework/interfaces.php @@ -4,9 +4,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System */ @@ -16,7 +15,6 @@ * This interface must be implemented by application modules. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -43,7 +41,6 @@ interface IModule * This interface must be implemented by services. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -82,7 +79,6 @@ interface IService * This interface must be implemented by writers. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -106,7 +102,6 @@ interface ITextWriter * This interface must be implemented by user objects. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -159,7 +154,6 @@ interface IUser * {@link TPageStatePersister}, {@link TApplicationStatePersister}. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -184,7 +178,6 @@ interface IStatePersister * This interface must be implemented by cache managers. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -240,7 +233,6 @@ interface ICache * Classes implementing this interface must support serialization and unserialization. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -259,7 +251,6 @@ interface ICacheDependency * to end-users. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -278,7 +269,6 @@ interface IRenderable * This interface must be implemented by classes that are capable of performing databinding. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ @@ -296,7 +286,6 @@ interface IBindable * This interface should be implemented by classes that support CSS styles. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.1.0 */ @@ -322,7 +311,6 @@ interface IStyleable * Active controls must implement IActiveControl interface. * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.1 */ @@ -341,7 +329,6 @@ interface IActiveControl * interface. * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.1 */ @@ -363,7 +350,6 @@ interface ICallbackEventHandler * this interface must be implemented. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.1 */ diff --git a/framework/prado.php b/framework/prado.php index 0bb11789..1dd4bb47 100644 --- a/framework/prado.php +++ b/framework/prado.php @@ -12,9 +12,8 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2013 PradoSoft + * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: prado.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System */ @@ -32,7 +31,6 @@ if(!class_exists('Prado',false)) * Prado class. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: prado.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System * @since 3.0 */ diff --git a/framework/pradolite.php b/framework/pradolite.php index d9627d13..dfe5e1d2 100644 --- a/framework/pradolite.php +++ b/framework/pradolite.php @@ -1248,7 +1248,7 @@ class TTextWriter extends TComponent implements ITextWriter $this->write($str."\n"); } } -class TPriorityList extends TList +class TPriorityList extends TList { private $_d=array(); private $_o=false; @@ -1483,7 +1483,7 @@ class TPriorityList extends TList foreach($this->_d as $priority=>$items) { if(($index=array_search($item,$items,true))!==false) { $absindex+=$index; - return $withindex?array($priority,$index,$absindex, + return $withindex?array($priority,$index,$absindex, 'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority; } else $absindex+=count($items); @@ -1500,7 +1500,7 @@ class TPriorityList extends TList if($index>=($c=count($items))) $index-=$c; else - return $withindex?array($priority,$index,$absindex, + return $withindex?array($priority,$index,$absindex, 'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority; } return false; @@ -3129,7 +3129,7 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar if($this->getEnableCache()) { $cache = $this->getApplication()->getCache(); - if($cache !== null) + if($cache !== null) { $dependencies = null; if($this->getApplication()->getMode() !== TApplicationMode::Performance) @@ -4524,7 +4524,7 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable const IS_DISABLE_THEMING=0x10; const IS_CHILD_CREATED=0x20; const IS_CREATING_CHILD=0x40; - const RF_CONTROLS=0; const RF_CHILD_STATE=1; const RF_NAMED_CONTROLS=2; const RF_NAMED_CONTROLS_ID=3; const RF_SKIN_ID=4; const RF_DATA_BINDINGS=5; const RF_EVENTS=6; const RF_CONTROLSTATE=7; const RF_NAMED_OBJECTS=8; const RF_ADAPTER=9; const RF_AUTO_BINDINGS=10; + const RF_CONTROLS=0; const RF_CHILD_STATE=1; const RF_NAMED_CONTROLS=2; const RF_NAMED_CONTROLS_ID=3; const RF_SKIN_ID=4; const RF_DATA_BINDINGS=5; const RF_EVENTS=6; const RF_CONTROLSTATE=7; const RF_NAMED_OBJECTS=8; const RF_ADAPTER=9; const RF_AUTO_BINDINGS=10; private $_id=''; private $_uid; private $_parent; @@ -6385,7 +6385,7 @@ class TWebControlDecorator extends TComponent { $this->_posttagtemplate = $value; } public function instantiate($outercontrol = null) { - if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || + if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || $this->getPostContentsTemplate() || $this->getPostTagTemplate()) { $this->_outercontrol = $outercontrol; if($this->getUseState()) @@ -6684,7 +6684,7 @@ class TWebControl extends TControl implements IStyleable $decorator->renderPostContentsText($writer); $writer->renderEndTag(); $decorator->renderPostTagText($writer); - } else + } else $writer->renderEndTag($writer); } } @@ -7306,7 +7306,7 @@ class TClientScriptManager extends TApplicationComponent if($str!=='') $writer->write("<div style=\"visibility:hidden;\">\n".$str."</div>\n"); } - public function getHiddenFields() + public function getHiddenFields() { return $this->_hiddenFields; } @@ -9672,7 +9672,7 @@ class TPageConfiguration extends TComponent $this->loadFromPhp($fcontent,dirname($fname),$configPagePath); } else - { + { $dom=new TXmlDocument; if($dom->loadFromFile($fname)) $this->loadFromXml($dom,dirname($fname),$configPagePath); @@ -9759,7 +9759,7 @@ class TPageConfiguration extends TComponent if(isset($page['properties'])) { $properties=$page['properties']; - unset($page['properties']); + unset($page['properties']); } $matching=false; $id=($configPagePath==='')?$id:$configPagePath.'.'.$id; @@ -10173,7 +10173,7 @@ class TApplication extends TComponent const STATE_PERFORMANCE='Performance'; const PAGE_SERVICE_ID='page'; const CONFIG_FILE_XML='application.xml'; - const CONFIG_FILE_EXT_XML='.xml'; + const CONFIG_FILE_EXT_XML='.xml'; const CONFIG_TYPE_XML = 'xml'; const CONFIG_FILE_PHP='application.php'; const CONFIG_FILE_EXT_PHP='.php'; @@ -10822,7 +10822,7 @@ class TApplicationConfiguration extends TComponent $this->_properties[$name]=$value; } $this->_empty = false; - } + } if(isset($config['paths']) && is_array($config['paths'])) $this->loadPathsPhp($config['paths'],$configPath); if(isset($config['modules']) && is_array($config['modules'])) @@ -10946,7 +10946,7 @@ class TApplicationConfiguration extends TComponent $properties['id'] = $id; $this->_modules[$id]=array($type,$properties,$module); $this->_empty=false; - } + } } protected function loadModulesXml($modulesNode,$configPath) { @@ -10982,7 +10982,7 @@ class TApplicationConfiguration extends TComponent $properties['id'] = $id; $this->_services[$id] = array($type,$properties,$service); $this->_empty = false; - } + } } protected function loadServicesXml($servicesNode,$configPath) { @@ -11152,4 +11152,3 @@ class TShellApplication extends TApplication $this->initApplication(); } } -?>
\ No newline at end of file @@ -9,7 +9,7 @@ <body> <h1>PRADO Framework for PHP 5 </h1> <p>Version 3.2.3<br> -Copyright© 2004-2013 by <a href="http://www.pradosoft.com/">Prado Software</a><br> +Copyright© 2004-2014 by <a href="http://www.pradosoft.com/">Prado Software</a><br> All Rights Reserved. </p> @@ -152,7 +152,7 @@ The PRADO framework and the included demos are free software. They are released the terms of the following BSD License. </p> <p> -Copyright 2004-2013 by The PRADO Group (http://www.pradosoft.com)<br/> +Copyright 2004-2014 by The PRADO Group (http://www.pradosoft.com)<br/> All rights reserved. </p> <p> diff --git a/jQuery-PORTING.txt b/jQuery-PORTING.txt deleted file mode 100644 index 16b32769..00000000 --- a/jQuery-PORTING.txt +++ /dev/null @@ -1,103 +0,0 @@ -JAVASCRIPT - -Get element by id -OLD: $('element_id') -NEW: $('#element_id') // for the extended element -NEW: $('#element_id').get(0) // for the base DOM element ---- -Get element by css selector -OLD: $$('.class') -NEW: $('.class') ---- -Apply a function to multiple elements -OLD: $$('.class').each(Element.remove); -NEW: $('.class').remove(); ---- -Class creation/extension - -OLD: Class.create(Prado.WebUI.TActiveImageButton, { ... }) -OLD: Class.extend(Prado.WebUI.TActiveImageButton, { ... }) -NEW: jQuery.klass(Prado.WebUI.TActiveImageButton, { ... }) ---- -Extending an object -OLD: Object.extend(...) -NEW: jQuery.extend(...) ---- -Bind an event to a callback event handler -OLD: Event.observe(element, 'click', callback) -NEW: $(element).on('click', callback) ---- -Bind an event to a callback event handler -OLD: Event.stopObserving(element, 'click', callback) -NEW: $(element).off('click', callback) ---- -Stopping event propagation -OLD: Event.stop(event) -NEW: event.stopPropagation() or event.preventDefault() ---- -Detect keypress event: use the numeric codes -OLD: if(kc == Event.KEY_RETURN || kc == Event.KEY_SPACEBAR || kc == Event.KEY_TAB) -NEW: if(kc == 13 || kc == 32 || kc == 9) ---- -Implementing the postback handler for a PostBackControl; the function signature has changed (parameters are inverted): -OLD: onPostBack : function(event, options) -NEW: onPostBack : function(options, event) ---- -Execute a function when the pagfe has finished loading -OLD: document.observe("dom:loaded", function(event) { ... }); -NEW: $( document ).ready(function() { ... }); ---- -Create an animation effect with a "finish" callback -OLD: new Effect.Fade(element, {duration: 400, afterFinish: function() { // Animation complete. }); -NEW: $(element).fadeOut( 400, function() { // Animation complete. }); ---- -Declare a function to be used as event handler binding its "this" property -OLD: this.functionName.bindAsEventListener(this); -NEW: this.functionName.bind(this); ---- -Css class functions -OLD: addClassName, removeClassName, hasClassName -NEW: addClass, removeClass, hasClass ---- -Get event target -OLD: Event.element(event) -NEW: event.target ---- -Get event mouse position -OLD: Event.pointerX(event), Event.pointerY(event); -NEW: event.pageX, event.pageY; ---- -Fire events -OLD: Event.fireEvent(this.control, "change"); -NEW: $(element).trigger("change"); ---- -Test browser -OLD: Prado.Browser().ie -NEW: jQuery.support ---- -Focus an element -OLD: Prado.Element.focus(element); -NEW: $(element).focus(); ---- -Get element size -OLD: element.getWidth(), element.getHeight() -NEW: element.width, element.height - - - -CONTROLS - -TAutoCompleter doesn't exists anymore, use TJuiAutoComplete instead, upgrading the code: - * No more Frequency property. - * minChars property is now minLength - * only the ItemTemplate is supported for the Suggestions repeater; - * in the ItemTemplate you don't need to render the <li/> anymore, but only the content itself - * No Multiple selection support (by now, can be added in the future) ---- -TDraggable doesn't exists anymore, use TJuiDraggable instead, upgrading the code: - * Use jQuery-ui's Draggable options. ---- -TDropContainer doesn't exists anymore, use TJuiDroppable instead, upgrading the code: - * Use jQuery-ui's Droppable options. - * The event parameter format has changed a bit. ---- diff --git a/jQuery-WIP.txt b/jQuery-WIP.txt index 2507092a..f8a6a369 100644 --- a/jQuery-WIP.txt +++ b/jQuery-WIP.txt @@ -9,31 +9,27 @@ Targets: * port Effects (done) * port basic active controls (done) * create substitutes for exotic standard controls (date picker, accordion, colorpicker, slider, ..) (done) - * port exotic active controls (autocomplete, ...) (wip, using jquery-ui) - * get tests running (started, wip) - * ensure jQuery's compatibility mode with prototype (support old third party components from users? jQuery.noConflict(); by default?) + * port exotic active controls (done) + * get tests running (wip) + * ensure jQuery's compatibility mode with prototype (support old third party components from users? (done) * fix debug components (TJavascriptLogger) (done, but maybe dropping it is a good idea) - * implement some Jui components (maybe substitute old components with new, jquery-ui based ones?) (wip) - * port demos + * implement some Jui components (deprecate old scriptculous, create substituted based on jquery-ui) (wip) + * port demos using javascript + * add demos for new controls * document everything - DONE Basic postback controls (TButton, TCheckBox, TLinkButton, TRadioButton, TTextBox, ..) -Js-based controls (TTabPanel, TDatePicker, TColorPicker, TSlider, THtmlArea) +Js-based controls (TTabPanel, TDatePicker, TColorPicker, TSlider, THtmlArea, TAccordion, TRatingList) List, Data controls *Validators -Basic callback controls +Ajax queue +Basic callback controls (TActive*, TInPlaceTextBox) +Basic jquery-ui controls WIP TJuiAutoComplete TJuiDraggable,TJuiDroppable - -TBD -Implement Ajax queue -Port Scriptaculous-based controls (accordion, ...) -Port *ratings -Port inlineeditor Add JQuery-ui-Effects: clip, explode, transfer, switchclass Add JQuery-ui-Methods: show, hide, toggle? Add JQuery-ui-controls diff --git a/nbproject/project.properties b/nbproject/project.properties deleted file mode 100644 index 94429c9b..00000000 --- a/nbproject/project.properties +++ /dev/null @@ -1,7 +0,0 @@ -include.path=${php.global.include.path} -php.version=PHP_53 -source.encoding=UTF-8 -src.dir=. -tags.asp=false -tags.short=true -web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml deleted file mode 100644 index f4a5db2d..00000000 --- a/nbproject/project.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://www.netbeans.org/ns/project/1"> - <type>org.netbeans.modules.php.project</type> - <configuration> - <data xmlns="http://www.netbeans.org/ns/php-project/1"> - <name>prado</name> - </data> - <spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1"> - <word>namespace</word> - <word>previosly</word> - </spellchecker-wordlist> - </configuration> -</project> diff --git a/requirements/index.php b/requirements/index.php index b5b6dc82..2fd392ba 100644 --- a/requirements/index.php +++ b/requirements/index.php @@ -6,7 +6,6 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: index.php 3281 2013-03-13 21:01:40Z ctrlaltca $ * @package prado */ @@ -291,5 +290,3 @@ function getPradoVersion() } return ''; } - -?>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page index 7cb8c6b3..4ea65f04 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page @@ -37,6 +37,4 @@ AIP </com:TActivePanel> - <com:TJavascriptLogger /> - </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page index 2e192c19..a5788625 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page @@ -6,6 +6,4 @@ <com:TActiveLabel ID="label1" Text="Label 1" /> - <com:TJavascriptLogger /> - </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page index 431d42f2..cea4d3d8 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page @@ -25,5 +25,4 @@ position: absolute; right: 0; top: 0"> Loading... </div> - <com:TJavascriptLogger /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page index 7b983cd7..b4ce61d4 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page @@ -22,6 +22,5 @@ <com:TActiveButton ID="button2" Text="Show More!" Enabled="false"
OnCallback="button2_callback" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page index aa3be754..c6748403 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page @@ -7,5 +7,4 @@ <com:TActiveLabel ID="label1" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page index dc71a228..4fcd789a 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page @@ -26,6 +26,4 @@ <com:TButton ID="button5" Text="Post Back" OnClick="do_postback"/> </div> - <com:TJavascriptLogger /> - </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page index f0fc4b92..837cc580 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page @@ -1,9 +1,9 @@ <com:TForm ID="form1"> <h1>Active HiddenField Test Case</h1> - + <com:TActiveHiddenField ID="HiddenFieldEmpty" /> <com:TActiveHiddenField ID="HiddenFieldUsed" Value="My value" /> - + <div> <com:TActiveButton ID="Button1" Text="Set value to HiddenFieldEmpty" OnClick="onSetValue" /> <com:TActiveButton ID="Button2" Text="Get value from HiddenFieldUsed" OnClick="onGetValue" /> @@ -12,5 +12,4 @@ <div> <com:TActiveLabel ID="ResponseLabel" Text="Value of current hidden field" /> </div> - <com:TJavascriptLogger /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page index 59098052..740c3b21 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page @@ -1,6 +1,6 @@ <com:TForm ID="form1"> <h1>Active HyperLink Test Case</h1> - + <div style="margin:1em; padding:1em; border:1px solid #ccc; text-align:center;"> <com:TActiveHyperLink ID="link1" Text="Link 1" NavigateUrl="http://www.pradosoft.com" /> </div> @@ -8,6 +8,4 @@ <com:TActiveButton ID="button2" Text="Change Image" OnClick="change_image" /> <com:TActiveButton ID="button3" Text="Change Target" OnClick="change_target" /> <com:TActiveButton ID="button4" Text="Change URL" OnClick="change_url" /> - - <com:TJavascriptLogger /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page index 7696261a..ff0f588f 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page @@ -19,6 +19,4 @@ <com:TActiveButton ID="button3" Text="Change Align" OnClick="change_align" />
<com:TActiveButton ID="button4" Text="Change Description" OnClick="change_description" />
- <com:TJavascriptLogger />
-
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page index cb9f0322..39c53fe8 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page @@ -6,6 +6,4 @@ <com:TActiveLabel ID="label1" Text="Label 1" />
- <com:TJavascriptLogger />
-
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page index f7c6baaf..115b833a 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page @@ -23,6 +23,4 @@ <com:TActiveButton ID="button6" Text="Change to Multi-Select" OnClick="change_to_multiple" />
<com:TActiveButton ID="button7" Text="Change to Single-Select" OnClick="change_to_single" />
</div>
-
- <com:TJavascriptLogger />
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page index 318d53c3..bf13a61b 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page @@ -22,6 +22,4 @@ <com:TActiveButton ID="button6" Text="Change to Multi-Select" OnClick="change_to_multiple" />
<com:TActiveButton ID="button7" Text="Change to Single-Select" OnClick="change_to_single" />
</div>
-
- <com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page index 13133a32..645a2a92 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page @@ -16,5 +16,4 @@ }); }); </script> - <com:TJavascriptLogger /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page index 0795e46b..cb2802e5 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page @@ -12,6 +12,5 @@ <com:TActivePanel ID="pnlB">bar</com:TActivePanel>
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page index 26feb594..1c59cfed 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page @@ -17,6 +17,4 @@ <com:TActiveButton ID="button4" Text="Select Index 4" OnClick="select_index_4" />
</div>
- <com:TJavascriptLogger />
-
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page index 2bb4c9de..18e4fc37 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page @@ -34,5 +34,4 @@ position: absolute; right: 0; top: 0">
Loading...
</div>
- <com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page index 5f7959c5..fa0d8caa 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page @@ -3,6 +3,5 @@ <com:TActiveButton Text="Redirect to Default Page" OnClick="button_clicked" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page index b05ce62e..d0a750ac 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page @@ -2,5 +2,4 @@ <h1>ActiveTextBox Callback Test</h1> <com:TActiveTextBox ID="textbox1" AutoPostBack="true" OnCallback="textbox1_callback" /> <com:TActiveLabel ID="label1" Text="Label 1" /> - <com:TJavascriptLogger /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page index 477764c3..f4fffc63 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page @@ -58,7 +58,7 @@ <li> << <span class="select"><%# $this->Data %></span> - >> + >> </li> </prop:Suggestions.ItemTemplate> </com:TAutoComplete> @@ -79,7 +79,7 @@ OnSuggest="suggestCountries" OnCallback="callback_requested" OnSuggestionSelected="suggestion_selected" - ResultPanel.CssClass="autocomplete" + ResultPanel.CssClass="autocomplete" MinChars="4" Frequency="2" /> <p><br /></p> @@ -91,5 +91,4 @@ <p><br /></p> <p><br /></p> <p><br /></p> - <com:TJavascriptLogger /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/Callback.page b/tests/FunctionalTests/active-controls/protected/pages/Callback.page index d8744760..3404cf6e 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/Callback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/Callback.page @@ -1,15 +1,13 @@ <com:TForm>
<com:TCallback ID="callback1" OnCallback="callback1_Requested" />
- <script type="text/javascript">
+ <script type="text/javascript">
function do_callback1()
- {
+ {
var callback = <%= $this->callback1->ActiveControl->Javascript %>;
callback.dispatch();
- }
- </script>
+ }
+ </script>
<div onclick="do_callback1()">Click Me!</div>
- <com:TJavascriptLogger />
-
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page index a99fbf55..4c82da40 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page @@ -37,6 +37,4 @@ <span id="loader" style="display:none;" onfocus="alert('ok')" class="loader">Loading...</span>
- <com:TJavascriptLogger />
-
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page b/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page index acf56bfe..de4ea482 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page @@ -7,21 +7,20 @@ var link1 = Prado.CallbackRequest.getRequestById('<%= $this->link1->ClientID %>');
Prado.Callback('<%= $this->callback1->UniqueID %>', link1.getCallbackParameter());
</prop:ClientSide.OnSuccess>
-
+
</com:TCallbackOptions>
- <com:TActiveLinkButton
+ <com:TActiveLinkButton
ID="link1"
- Text="Tab 1"
- OnCallback="method2"
- ActiveControl.CallbackParameter="test"
+ Text="Tab 1"
+ OnCallback="method2"
+ ActiveControl.CallbackParameter="test"
ActiveControl.CallbackOptions="options1"/>
<com:TActiveLabel ID="status1" />
<com:TActiveLabel ID="status2" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page index f0f3044d..c5642712 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page @@ -1,10 +1,10 @@ <com:TForm ID="form1"> <h1>Control Adapter - State Tracking Tests</h1> <com:TActiveButton ID="button1" Text="Test Button 1" /> - <com:TActiveButton ID="button2" Text="Test Button 2" + <com:TActiveButton ID="button2" Text="Test Button 2" Attributes.onclick="alert('ok')" Style.Font.Size="12" Style.BackColor="blue" Style.Height="2em" /> - + <div style="margin:1em; padding: 0.5em; border:1px solid #ccc; text-align:center"> <com:TActiveButton ID="test1" Text="Enable/Disable Button 1" OnClick="change_enabled"/> <com:TActiveButton ID="test2" Text="Hide/Show Button 1" OnClick="change_visible"/> @@ -19,5 +19,4 @@ <com:TActiveButton ID="test8" Text="Change Button 1 Attributes" OnClick="change_attributes1"/> <com:TActiveButton ID="test9" Text="Change Button 2 Attributes" OnClick="change_attributes2"/> </div> - <com:TJavascriptLogger /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page index 3bed7d5b..4c0eaf03 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page @@ -10,7 +10,4 @@ <com:TActivePanel ID="placeholder" />
<com:TActiveLabel ID="label1" Text="Label 1" />
-
-
- <com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page index 08b7bb3e..28f27b8f 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page +++ b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page @@ -10,19 +10,19 @@ </div>
<span>Username:</span><br />
<com:TActiveTextBox ID="Username" />
- <com:TRequiredFieldValidator
+ <com:TRequiredFieldValidator
ID="validator1"
- ControlToValidate="Username"
- ValidationGroup="login"
+ ControlToValidate="Username"
+ ValidationGroup="login"
Text="...is required" Display="Dynamic"/>
<br />
<span>Password:</span><br />
<com:TActiveTextBox TextMode="Password" ID="Password" />
- <com:TActiveCustomValidator
- ID="validator2"
- ControlToValidate="Password"
+ <com:TActiveCustomValidator
+ ID="validator2"
+ ControlToValidate="Password"
Text="*"
OnServerValidate="validateUser" ValidationGroup="login" />
@@ -33,6 +33,5 @@ </div>
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page index b8fba648..d3447635 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page @@ -3,5 +3,4 @@ <com:TActiveButton ID="button1" Text="Delayed 4000" OnCallback="callback1" />
<com:TActiveButton ID="button2" Text="Delayed 2000" OnCallback="callback2" />
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page b/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page index df1db27a..09ec16ed 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page @@ -17,6 +17,5 @@ here. <com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page b/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page index 913f6a17..7863fafe 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page @@ -11,6 +11,5 @@ </com:TRepeater>
</com:TActivePanel>
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page index 889636f3..80d94cbb 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page @@ -27,5 +27,4 @@ <div style="padding: 2em; border:1px solid #ccc; margin-top:2em">
<com:TActiveLabel ID="label1" Text="Label 1" />
</div>
- <com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page index f4bf644c..2952c36c 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page +++ b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page @@ -1,7 +1,7 @@ <com:TForm>
<com:TLabel ForControl="DDropTurno" Text="Turno:"/>
-<com:TActiveDropDownList ID="DDropTurno"
+<com:TActiveDropDownList ID="DDropTurno"
onSelectedIndexChanged="trocaTurno" AutoPostBack="true"/>
<com:TLabel Text="Código:" ForControl="Codigo"/>
@@ -11,6 +11,5 @@ <com:TActiveTextBox ID="Descricao" MaxLength="25" Columns="25"/>
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page index ba3a35db..2a80a57a 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page +++ b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page @@ -60,19 +60,18 @@ ValidationGroup="Group"
/>
<br />
- <com:TActiveButton ID="active_button"
- Text="Active Submit"
+ <com:TActiveButton ID="active_button"
+ Text="Active Submit"
ValidationGroup="Group"
CausesValidation="true"
OnCallback="button_valid"
- />
- <com:TButton ID="passive_button"
- Text="Passive Submit"
+ />
+ <com:TButton ID="passive_button"
+ Text="Passive Submit"
ValidationGroup="Group"
CausesValidation="true"
OnClick="button_valid"
- />
+ />
<br />
<com:TActiveLabel ID="status" Text="Status:" />
- <com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page index 701bd74c..c265f9d2 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page @@ -4,7 +4,6 @@ <com:TActiveButton Text="Show Changes" OnClick="button_clicked"/>
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
<com:TPanel ID="Panel1">
</com:TPanel>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page index 0b662617..168b7b8c 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page +++ b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page @@ -5,7 +5,6 @@ <com:TActiveButton Text="Show Changes" OnClick="button_clicked"/>
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
<com:TPanel ID="Panel1">
</com:TPanel>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page index ab4798a8..248d1760 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page @@ -3,5 +3,4 @@ <com:Application.pages.DMessagesPanel ID="panel1" PanelCssClass="one1" />
<com:TActiveButton Text="Show" OnClick="show_clicked" />
<com:TActiveButton Text="Hide" OnClick="hide_clicked" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page index 7371086a..5e04cd28 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page @@ -36,6 +36,5 @@ This is the contents of panel C
</com:TActivePanel>
-<com:TJavascriptLogger />
</com:TForm>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page index 9d3a3d61..a7875c0d 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page +++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page @@ -3,10 +3,10 @@ <com:TCallback ID="callback1" OnCallback="callback1_requested" /> <com:TActivePanel ID="panel1"> <com:TPlaceHolder ID="content1" Visible="false"> - Something lalala + Something lalala <com:TActiveButton ID="button1" Text="Button 1" OnClick="button1_clicked" /> <com:TActiveLabel ID="label3" Text="Label 3" /> - + </com:TPlaceHolder> <com:TActiveLabel ID="label1" Text="Label 1" /> </com:TActivePanel> @@ -23,6 +23,5 @@ }) }) </script> - <com:TJavascriptLogger /> - + </com:TForm> diff --git a/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page index 2ce98f5b..64643177 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page @@ -5,6 +5,5 @@ <com:TActiveLabel ID="lblTest"/>
<com:TActiveButton OnCallback="btnTest_OnCallback" Text="Clickme"/>
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page b/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page index c7bf0952..24cdb366 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page @@ -12,6 +12,5 @@ <com:TActiveButton ID="button2" Text="populate list 2" OnClick="populate_list2" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page index 09ab2fbc..885b368f 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page @@ -19,6 +19,4 @@ })
</script>
- <com:TJavascriptLogger />
-
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page b/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page index 7de9c6ab..9d900e15 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page @@ -6,8 +6,8 @@ Display="Dynamic"
ValidationGroup="Group"
/>
- <br />
- <com:TActiveRadioButtonList
+ <br />
+ <com:TActiveRadioButtonList
ID="rad_button_list"
OnCallback="radChange">
<com:TListItem Value="yes" Text="Yes" />
@@ -16,15 +16,14 @@ </com:TActiveRadioButtonList>
<br />
<com:TActiveLabel
- ID="label"
+ ID="label"
Text="Choice : " />
<br /><br /><br />
<com:TActiveButton
ID="action_button"
Text="action"
OnCallback="action"
- ValidationGroup="Group" />
+ ValidationGroup="Group" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page index ba9c2e5d..d50e5929 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page @@ -93,6 +93,5 @@ Loading...
</div>
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page index b94fdbfb..59410b0b 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page +++ b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page @@ -56,6 +56,5 @@ <com:TActiveLabel ID="label1" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page index 7842cde9..6127c313 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page @@ -26,6 +26,5 @@ Main Panel <com:TActiveButton id="btn_replace" Text="Replace" OnCallback="replaceContent"/>
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page index fdd4a604..194f35d6 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page @@ -42,6 +42,5 @@ </div>
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page b/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page index f3332bad..460d2f71 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page @@ -19,6 +19,4 @@ <com:TActiveButton ID="button5" Text="Select Values 'value 2', 'value 5'" OnClick="select_values_25" /> </div> - <com:TJavascriptLogger /> - </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page index 41390e52..66c2a0c4 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page @@ -2,13 +2,11 @@ <h1 id="heading">TActiveFileUpload AutoPostBack Functional Test</h1> <com:TActiveFileUpload ID='uploader' OnFileUpload="uploadComplete" AutoPostBack="false"/> - + <com:TActiveButton ID="button1" Text="Submit File"/> - + <com:TActiveButton ID="button2" Text="This won't submit the file"/> - - <com:TActiveLabel ID="label1" Text="Label 1" /> - <com:TJavascriptLogger /> + <com:TActiveLabel ID="label1" Text="Label 1" /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page index 8c0a0d71..33ba6dda 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page @@ -61,7 +61,7 @@ <com:TActiveLabel ID="status" Text="Status:" />
- <com:TInPlaceTextBox
+ <com:TInPlaceTextBox
id="lblNewPackageTitle"
OnTextChanged="NewPackageSubject"
CssClass="textbox"
@@ -72,6 +72,4 @@ <com:TActiveButton Text="ad" OnCallback="button_clicked" />
- <com:TJavascriptLogger />
-
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page index 79fc17e0..1746c628 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page @@ -14,7 +14,6 @@ Maxlength="12"
ValidationGroup="post"
OnCallback="lookupZipCode"/>
-<com:TJavascriptLogger />
<com:TActiveTextBox ID="City" Columns="60" Maxlength="128" />
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page index a285f03d..680922a3 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page @@ -17,5 +17,4 @@ position: absolute; right: 0; top: 0"> Loading... </div> - <com:TJavascriptLogger /> </com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page index 1281cc5c..4097f69c 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page @@ -9,6 +9,5 @@ <com:TActiveLabel ID="label1" Text="Label 1" />
-<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php index c8fcfa57..880c46fe 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php @@ -1,13 +1,13 @@ <?php -class ActiveButtonTestCase extends PradoGenericSeleniumTest +class ActiveButtonTestCase extends PradoGenericSelenium2Test { function test() { $this->open("active-controls/index.php?page=ActiveButtonTest"); $this->verifyTextPresent("TActiveButton Functional Test"); $this->assertText("label1", "Label 1"); - $this->click("button2"); + $this->clickOnElement("button2"); $this->pause(800); $this->assertText("label1", "Button 1 was clicked using callback!"); } diff --git a/tests/FunctionalTests/features/protected/controls/Layout.tpl b/tests/FunctionalTests/features/protected/controls/Layout.tpl index dbd433b8..66b42f6c 100755 --- a/tests/FunctionalTests/features/protected/controls/Layout.tpl +++ b/tests/FunctionalTests/features/protected/controls/Layout.tpl @@ -27,7 +27,6 @@ <body>
<com:TForm>
<com:TContentPlaceHolder ID="Content" />
-<com:TJavascriptLogger />
</com:TForm>
</body>
</html>
\ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/RatingList.page b/tests/FunctionalTests/features/protected/pages/RatingList.page index 909180c7..eaf9a282 100755 --- a/tests/FunctionalTests/features/protected/pages/RatingList.page +++ b/tests/FunctionalTests/features/protected/pages/RatingList.page @@ -2,40 +2,46 @@ <h1>TRatingList Examples</h1>
<h2>Default TRatingList</h2>
- <com:TRatingList RepeatDirection="Vertical" Style="caption-side: right;">
+ <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="Execellent" />
+ <com:TListItem Text="Excellent" />
</com:TRatingList>
-<h2>TRatingList </h2>
- <com:TRatingList SelectedIndex="2">
+<h2>TRatingList in vertical mode, SelectedIndex=2</h2>
+ <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="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
</com:TRatingList>
-<h2>TRatingList </h2>
- <com:TRatingList RatingStyle="blocks" SelectedValue="Good">
+<h2>TRatingList with RatingStyle=blocks, AutoPostback=true, SelectedValue=Good</h2>
+ <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="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
</com:TRatingList>
+ Postback result: <com:TLabel ID="labelResult3" />
-<h2>TRatingList </h2>
- <com:TRatingList ID="Rating1" AllowInput="false" Caption="Rating:" Rating="4.6">
+<h2>TRatingList with AllowInput=false, Rating=4.6</h2>
+ <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="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
- </com:TRatingList>
+ </com:TRatingList>
+
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/RatingList.php b/tests/FunctionalTests/features/protected/pages/RatingList.php new file mode 100644 index 00000000..9592680a --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/RatingList.php @@ -0,0 +1,9 @@ +<?php + +class RatingList extends TPage +{ + protected function rating3_selectionChanged($sender, $param) + { + $this->labelResult3->Text=$this->Rating3->SelectedValue; + } +}
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php b/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php index 9aecda84..0165edac 100755 --- a/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php +++ b/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php @@ -6,7 +6,6 @@ * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense - * @version $Id: ToggleImageButton.php 2043 2007-06-30 15:07:50Z xue $ * */ diff --git a/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php b/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php index 934efcef..7bc53ba3 100755 --- a/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php +++ b/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php @@ -1,16 +1,15 @@ <?php /** * - * + * * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense - * @version $Id: ExtendedToggleImageButton.php 2039 2007-06-28 08:41:57Z tof $ - * + * */ prado::using ('Application.controls.ToggleImageButton'); class ExtendedToggleImageButton extends ToggleImageButton { - + }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.tpl b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl index bf2f8fab..b245a50d 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Layout.tpl +++ b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl @@ -1,7 +1,7 @@ -<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.0 Strict//EN"
+<!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">
<com:THead Title="PRADO Functional Tests">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
@@ -30,7 +30,6 @@ <com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
<div class="w3c">
<a href="http://validator.w3.org/check?uri=referer">
@@ -38,7 +37,7 @@ </a>
<a href="?page=ViewSource&path=<%= str_replace('.','/', $this->Request->ServiceParameter) %>.page"
style="margin: 0 1em;"
- onclick="window.open(this.href); return false;"
+ onclick="window.open(this.href); return false;"
onkeypress="window.open(this.href); return false;">View Source</a>
</div>
</body>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl b/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl index bf2f8fab..b245a50d 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl @@ -1,7 +1,7 @@ -<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.0 Strict//EN"
+<!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">
<com:THead Title="PRADO Functional Tests">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
@@ -30,7 +30,6 @@ <com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
<div class="w3c">
<a href="http://validator.w3.org/check?uri=referer">
@@ -38,7 +37,7 @@ </a>
<a href="?page=ViewSource&path=<%= str_replace('.','/', $this->Request->ServiceParameter) %>.page"
style="margin: 0 1em;"
- onclick="window.open(this.href); return false;"
+ onclick="window.open(this.href); return false;"
onkeypress="window.open(this.href); return false;">View Source</a>
</div>
</body>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket659.php b/tests/FunctionalTests/tickets/protected/pages/Ticket659.php index cb266fd7..85b87d55 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket659.php +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket659.php @@ -1,12 +1,11 @@ <?php /** * - * + * * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense - * @version $Id: Ticket659.php 2039 2007-06-28 08:41:57Z tof $ - * + * */ prado::using ('Application.pages.ExtendedToggleImageButton'); diff --git a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php index 73a2cc57..98492ffb 100644 --- a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php +++ b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php @@ -1,12 +1,11 @@ <?php /** * - * + * * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense - * @version $Id: ToggleTest.php 2039 2007-06-28 08:41:57Z tof $ - * + * */ prado::using ('Application.controls.ToggleImageButton'); @@ -15,5 +14,4 @@ class ToggleTest extends TPage { public function clickToggleButton ($sender, $param) { $this->lbl->Text=$sender->State; } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php index ff167b0e..9fe238b9 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php @@ -6,19 +6,20 @@ class Ticket656TestCase extends PradoGenericSeleniumTest $base = 'ctl0_Content_'; $this->open('tickets/index.php?page=Ticket656'); $this->assertTitle("Verifying Ticket 656"); - + // First test, current date $this->click($base."btnUpdate"); $this->pause(800); $this->assertText($base."lblStatus",date("d-m-Y")); - + // Then, set another date + $year=date('Y')-2; $this->select($base."datePicker_day",20); $this->select($base."datePicker_month", 10); - $this->select($base."datePicker_year", 2008); + $this->select($base."datePicker_year", $year); $this->click($base."btnUpdate"); $this->pause(800); - $this->assertText($base."lblStatus",date("d-m-Y", mktime(0,0,0,10,20,2008))); + $this->assertText($base."lblStatus",date("d-m-Y", mktime(0,0,0,10,20,$year))); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/Layout.tpl b/tests/FunctionalTests/validators/protected/pages/Layout.tpl index 25dbea09..47591ef3 100755 --- a/tests/FunctionalTests/validators/protected/pages/Layout.tpl +++ b/tests/FunctionalTests/validators/protected/pages/Layout.tpl @@ -33,7 +33,6 @@ <com:TForm>
<com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
</body>
</html>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php index ab37ec06..bbefd2a7 100755 --- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php +++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php @@ -28,8 +28,6 @@ class DatePickerTestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}validator6", ""); $this->assertVisible("{$base}validator8", ""); - $this->clickAndWait("{$base}submit1"); - $this->type("{$base}picker1", "13/4/$year"); $this->select("{$base}picker2_month", "label=9"); $this->select("{$base}picker2_day", "label=10"); diff --git a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php index f8b54eb0..8ee278f8 100755 --- a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php @@ -48,7 +48,7 @@ class RequiredFieldTestCase extends PradoGenericSeleniumTest $this->type("{$base}text1", "Hello"); $this->click("{$base}check1"); - $this->click("{$base}submit2"); + $this->clickAndWait("{$base}submit2"); $this->assertNotVisible("{$base}validator5"); $this->assertNotVisible("{$base}validator6"); diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php index 8d7fa46a..58c9977a 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php @@ -65,5 +65,3 @@ class ActiveRecordDynamicCallTestCase extends UnitTestCase var_dump($param); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php index e962046b..d9bd7420 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php @@ -41,5 +41,3 @@ class ActiveRecordFinderTestCase extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php index d173f005..09981f43 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php @@ -42,5 +42,4 @@ class ActiveRecordMySql5TestCase extends UnitTestCase $this->assertEqual($check->{$prop}, $blog->{$prop}); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php index fe1507cd..12b0796c 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php @@ -163,5 +163,3 @@ class ActiveRecordRegistryTestCase extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php index c356216b..676a0dd0 100644 --- a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php +++ b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php @@ -29,5 +29,3 @@ class BaseActiveRecordTestCase extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php b/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php index 4c489d49..36a96ab6 100644 --- a/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php +++ b/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php @@ -31,5 +31,3 @@ class CountRecordsTestCase extends UnitTestCase $this->assertEqual($finder->count(), 8); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php index de5b3b71..a320f38c 100644 --- a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php +++ b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php @@ -46,5 +46,3 @@ class CriteriaTestCase extends UnitTestCase $this->assertEqual($criteria->getParameters()->toArray(), $expect); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php b/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php index f848033c..0c09a9b0 100644 --- a/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php +++ b/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php @@ -27,5 +27,4 @@ class DeleteByPkTestCase extends UnitTestCase $this->assertEqual($finder->deleteByPk(array(100, 101), array(102, 103)),0); $this->assertEqual($finder->deleteByPk(array(array(100, 101), array(102, 103))),0); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/FindByPksTestCase.php b/tests/simple_unit/ActiveRecord/FindByPksTestCase.php index 4ccbddd5..32a79cea 100644 --- a/tests/simple_unit/ActiveRecord/FindByPksTestCase.php +++ b/tests/simple_unit/ActiveRecord/FindByPksTestCase.php @@ -60,5 +60,3 @@ class FindByPksTestCase extends UnitTestCase $this->assertEqual($dep->section_id, $sec_id); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php b/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php index e613cc30..14da0833 100644 --- a/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php +++ b/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php @@ -42,5 +42,3 @@ class FindBySqlTestCase extends UnitTestCase var_dump($users); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php b/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php index b960760e..86462ca6 100644 --- a/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php +++ b/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php @@ -171,5 +171,3 @@ class ForeignKeyTestCase extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php b/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php index 672c2d0f..29fbff42 100644 --- a/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php +++ b/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php @@ -238,5 +238,3 @@ class ForeignObjectUpdateTest extends UnitTestCase } //*/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php b/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php index c43db032..4b149503 100644 --- a/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php +++ b/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php @@ -188,5 +188,3 @@ class MultipleForeignKeyTestCase extends UnitTestCase $this->assertNotIdentical($arr, $arr->state2[0]->object2); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/RecordEventTestCase.php b/tests/simple_unit/ActiveRecord/RecordEventTestCase.php index 3e98d46b..12c57421 100644 --- a/tests/simple_unit/ActiveRecord/RecordEventTestCase.php +++ b/tests/simple_unit/ActiveRecord/RecordEventTestCase.php @@ -33,5 +33,3 @@ class RecordEventTestCase extends UnitTestCase //var_dump($param); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/SqliteTestCase.php b/tests/simple_unit/ActiveRecord/SqliteTestCase.php index 7d860b9a..ed0ea496 100644 --- a/tests/simple_unit/ActiveRecord/SqliteTestCase.php +++ b/tests/simple_unit/ActiveRecord/SqliteTestCase.php @@ -17,5 +17,3 @@ class SqliteTestCase extends UnitTestCase $this->assertNotNull($user); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/UserRecordTestCase.php b/tests/simple_unit/ActiveRecord/UserRecordTestCase.php index 34e45ca8..85b12594 100644 --- a/tests/simple_unit/ActiveRecord/UserRecordTestCase.php +++ b/tests/simple_unit/ActiveRecord/UserRecordTestCase.php @@ -62,5 +62,3 @@ class UserRecordTestCase extends UnitTestCase $this->assertEqual($user->$prop,$check->$prop); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php b/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php index adf0beed..bb13a96f 100644 --- a/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php +++ b/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php @@ -72,5 +72,4 @@ class ViewRecordTestCase extends UnitTestCase $this->pass(); } } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/Blogs.php b/tests/simple_unit/ActiveRecord/records/Blogs.php index 680b3141..6523f029 100644 --- a/tests/simple_unit/ActiveRecord/records/Blogs.php +++ b/tests/simple_unit/ActiveRecord/records/Blogs.php @@ -10,5 +10,3 @@ class Blogs extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/DepSections.php b/tests/simple_unit/ActiveRecord/records/DepSections.php index 6f37ae3e..bf01ed12 100644 --- a/tests/simple_unit/ActiveRecord/records/DepSections.php +++ b/tests/simple_unit/ActiveRecord/records/DepSections.php @@ -12,5 +12,3 @@ class DepSections extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php b/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php index 732610ae..b60c7930 100644 --- a/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php +++ b/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php @@ -14,5 +14,3 @@ class DepartmentRecord extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/ItemRecord.php b/tests/simple_unit/ActiveRecord/records/ItemRecord.php index 8585ebaf..e6707cde 100644 --- a/tests/simple_unit/ActiveRecord/records/ItemRecord.php +++ b/tests/simple_unit/ActiveRecord/records/ItemRecord.php @@ -45,5 +45,3 @@ class ItemRecord extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/SimpleUser.php b/tests/simple_unit/ActiveRecord/records/SimpleUser.php index cfba272e..b6748857 100644 --- a/tests/simple_unit/ActiveRecord/records/SimpleUser.php +++ b/tests/simple_unit/ActiveRecord/records/SimpleUser.php @@ -10,5 +10,3 @@ class SimpleUser extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/SqliteUsers.php b/tests/simple_unit/ActiveRecord/records/SqliteUsers.php index 8e5b9fde..f8fa12c5 100644 --- a/tests/simple_unit/ActiveRecord/records/SqliteUsers.php +++ b/tests/simple_unit/ActiveRecord/records/SqliteUsers.php @@ -12,5 +12,3 @@ class SqliteUsers extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/UserRecord.php b/tests/simple_unit/ActiveRecord/records/UserRecord.php index c4e8ce60..4ef98baf 100644 --- a/tests/simple_unit/ActiveRecord/records/UserRecord.php +++ b/tests/simple_unit/ActiveRecord/records/UserRecord.php @@ -34,5 +34,3 @@ class UserRecord extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php index f8a4257c..d309c1cc 100644 --- a/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php +++ b/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php @@ -42,5 +42,3 @@ class CommandBuilderMssqlTest extends UnitTestCase // var_dump($sql); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php index e248defd..e47914aa 100644 --- a/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php +++ b/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php @@ -15,5 +15,3 @@ class CommandBuilderMysqlTest extends UnitTestCase $this->mysql_meta_data()->getTableInfo("tests.table1"); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php index 63660aee..8e339073 100644 --- a/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php +++ b/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php @@ -72,5 +72,3 @@ class CommandBuilderPgsqlTest extends UnitTestCase $this->assertEqual($expect, $limit); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/MssqlColumnTest.php b/tests/simple_unit/DbCommon/MssqlColumnTest.php index 16d73bc4..f64615e8 100644 --- a/tests/simple_unit/DbCommon/MssqlColumnTest.php +++ b/tests/simple_unit/DbCommon/MssqlColumnTest.php @@ -44,5 +44,3 @@ class MssqlColumnTest extends UnitTestCase var_dump($result); }*/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/Mysql4ColumnTest.php b/tests/simple_unit/DbCommon/Mysql4ColumnTest.php index 234a212f..6216cdd7 100644 --- a/tests/simple_unit/DbCommon/Mysql4ColumnTest.php +++ b/tests/simple_unit/DbCommon/Mysql4ColumnTest.php @@ -250,5 +250,3 @@ class Mysql4ColumnTest extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/MysqlColumnTest.php b/tests/simple_unit/DbCommon/MysqlColumnTest.php index 08fdb545..57565ca1 100644 --- a/tests/simple_unit/DbCommon/MysqlColumnTest.php +++ b/tests/simple_unit/DbCommon/MysqlColumnTest.php @@ -250,5 +250,3 @@ class MysqlColumnTest extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/PgsqlColumnTest.php b/tests/simple_unit/DbCommon/PgsqlColumnTest.php index a16de964..5859c115 100644 --- a/tests/simple_unit/DbCommon/PgsqlColumnTest.php +++ b/tests/simple_unit/DbCommon/PgsqlColumnTest.php @@ -135,5 +135,3 @@ class PgsqlColumnTest extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/SqliteColumnTest.php b/tests/simple_unit/DbCommon/SqliteColumnTest.php index 246c4a27..712d2977 100644 --- a/tests/simple_unit/DbCommon/SqliteColumnTest.php +++ b/tests/simple_unit/DbCommon/SqliteColumnTest.php @@ -25,5 +25,4 @@ class SqliteColumnTest extends UnitTestCase //$table = new TTableGateway('Accounts', $conn); // var_dump($table->findAll()->readAll()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php index 80e9c1fd..0728baf7 100644 --- a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php +++ b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php @@ -41,5 +41,3 @@ class MysqlMessageSourceTestCase extends UnitTestCase } */ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/Soap/ContactManager.php b/tests/simple_unit/Soap/ContactManager.php index 290063b3..2fbeec48 100644 --- a/tests/simple_unit/Soap/ContactManager.php +++ b/tests/simple_unit/Soap/ContactManager.php @@ -23,12 +23,12 @@ class ContactManager{ $Contact->email = "me@you.com"; $Contact->id = 1; $Contact->name ="me"; - + $ret[] = $Contact; //debugObject("Contacten: ",$ret); return $ret; } - + /** * Gets the Contact with the given id. * @param int $id The id @@ -48,7 +48,7 @@ class ContactManager{ public function newContact() { return new Contact(); } - + /** * Saves a given Contact * @param Contact $Contact @@ -60,7 +60,7 @@ class ContactManager{ //$Contact->save(); return true; } - + /** * @return mixed * @soapmethod @@ -69,7 +69,7 @@ class ContactManager{ { return array(array(1,2), array("12", 1.2)); } - + /** * @return array * @soapmethod @@ -92,13 +92,13 @@ class ContactManager{ */ class Contact{ - /** + /** * @var int $id * @soapproperty */ public $id; - - /** + + /** * @var string $name * @soapproperty */ @@ -110,10 +110,10 @@ class Contact{ public $address; /** @var string $email - * @soapproperty + * @soapproperty */ public $email; - + /** * saves a Contact * @@ -134,24 +134,22 @@ class Contact{ */ class Address{ /** @var string $street - * @soapproperty + * @soapproperty */ public $street; - + /** @var string $nr * @soapproperty */ public $nr; - + /** @var string $zipcode * @soapproperty */ - public $zipcode; - + public $zipcode; + /** @var string $city * @soapproperty */ - public $city; + public $city; } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/Soap/SoapTestCase.php b/tests/simple_unit/Soap/SoapTestCase.php index fe151b04..3aaa60d3 100644 --- a/tests/simple_unit/Soap/SoapTestCase.php +++ b/tests/simple_unit/Soap/SoapTestCase.php @@ -35,7 +35,7 @@ class SoapTestCase extends UnitTestCase { try { - $result = $this->getClient()->getContact(1); + $result = $this->getClient()->getContact(1); $this->fail(); } catch (SoapFault $f) @@ -88,4 +88,3 @@ class SoapTestCase extends UnitTestCase } } -?> diff --git a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php index b3cde511..2ae051e8 100644 --- a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php +++ b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php @@ -83,5 +83,3 @@ class ActiveRecordSqlMapTest extends BaseCase $this->assertEqual($account1->{$prop}, $account2->{$prop}); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/BaseCase.php b/tests/simple_unit/SqlMap/BaseCase.php index b0961b5b..4f44a5b7 100644 --- a/tests/simple_unit/SqlMap/BaseCase.php +++ b/tests/simple_unit/SqlMap/BaseCase.php @@ -258,5 +258,3 @@ class TDateTime $this->_datetime = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/CacheTest.php b/tests/simple_unit/SqlMap/CacheTest.php index 131ddfbb..ff87cd3a 100644 --- a/tests/simple_unit/SqlMap/CacheTest.php +++ b/tests/simple_unit/SqlMap/CacheTest.php @@ -160,5 +160,3 @@ class CacheTest extends BaseCase $this->assertIdentical(0.5, $cache->getHitRatio()); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/DelegateTest.php b/tests/simple_unit/SqlMap/DelegateTest.php index 800e4240..80b23332 100644 --- a/tests/simple_unit/SqlMap/DelegateTest.php +++ b/tests/simple_unit/SqlMap/DelegateTest.php @@ -60,5 +60,3 @@ class DelegateTest extends BaseCase } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php b/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php index 436cd49e..be7a1820 100644 --- a/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php +++ b/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php @@ -7,5 +7,3 @@ class DynamicTest extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/GroupByTest.php b/tests/simple_unit/SqlMap/GroupByTest.php index 11bd86bb..a16211c3 100644 --- a/tests/simple_unit/SqlMap/GroupByTest.php +++ b/tests/simple_unit/SqlMap/GroupByTest.php @@ -39,5 +39,3 @@ class GroupByTest extends BaseCase /**/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/InheritanceTest.php b/tests/simple_unit/SqlMap/InheritanceTest.php index 82f86af3..81cad4a5 100644 --- a/tests/simple_unit/SqlMap/InheritanceTest.php +++ b/tests/simple_unit/SqlMap/InheritanceTest.php @@ -141,5 +141,4 @@ class CustomInheritance extends TSqlMapTypeHandler { throw new TDataMapperException('can not create'); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/ParameterMapTest.php b/tests/simple_unit/SqlMap/ParameterMapTest.php index fb29c162..557b9f4d 100644 --- a/tests/simple_unit/SqlMap/ParameterMapTest.php +++ b/tests/simple_unit/SqlMap/ParameterMapTest.php @@ -245,5 +245,3 @@ class ParameterMapTest extends BaseCase } /**/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/PropertyAccessTest.php b/tests/simple_unit/SqlMap/PropertyAccessTest.php index d580f965..80199628 100644 --- a/tests/simple_unit/SqlMap/PropertyAccessTest.php +++ b/tests/simple_unit/SqlMap/PropertyAccessTest.php @@ -73,5 +73,3 @@ class PropertyAccessTest extends BaseCase } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/ResultClassTest.php b/tests/simple_unit/SqlMap/ResultClassTest.php index 041c124e..773268b9 100644 --- a/tests/simple_unit/SqlMap/ResultClassTest.php +++ b/tests/simple_unit/SqlMap/ResultClassTest.php @@ -245,5 +245,3 @@ class ResultClassTest extends BaseCase /**/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/ResultMapTest.php b/tests/simple_unit/SqlMap/ResultMapTest.php index d545b65e..b14cee31 100644 --- a/tests/simple_unit/SqlMap/ResultMapTest.php +++ b/tests/simple_unit/SqlMap/ResultMapTest.php @@ -269,5 +269,3 @@ class ResultMapTest extends BaseCase */ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/SelectKeyTest.php b/tests/simple_unit/SqlMap/SelectKeyTest.php index a1efa640..464b94f1 100644 --- a/tests/simple_unit/SqlMap/SelectKeyTest.php +++ b/tests/simple_unit/SqlMap/SelectKeyTest.php @@ -116,5 +116,3 @@ class SelectKeyTest extends BaseCase $this->initScript('line-item-init.sql'); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/SqlMapCacheTest.php b/tests/simple_unit/SqlMap/SqlMapCacheTest.php index 1bb9b8d4..7c3495b5 100644 --- a/tests/simple_unit/SqlMap/SqlMapCacheTest.php +++ b/tests/simple_unit/SqlMap/SqlMapCacheTest.php @@ -73,5 +73,3 @@ class SqlMapCacheTest extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/StatementExtendsTest.php b/tests/simple_unit/SqlMap/StatementExtendsTest.php index f496f154..69beaa58 100644 --- a/tests/simple_unit/SqlMap/StatementExtendsTest.php +++ b/tests/simple_unit/SqlMap/StatementExtendsTest.php @@ -25,5 +25,3 @@ class StatementExtendsTest extends UnitTestCase $this->assertPattern('/img_progress/', $sql2); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/StatementTest.php b/tests/simple_unit/SqlMap/StatementTest.php index f9c3fb13..3f9f4506 100644 --- a/tests/simple_unit/SqlMap/StatementTest.php +++ b/tests/simple_unit/SqlMap/StatementTest.php @@ -1131,5 +1131,3 @@ class StatementTest extends BaseCase #endregion /**/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/TestQueryForMap.php b/tests/simple_unit/SqlMap/TestQueryForMap.php index 89676469..2de020a8 100644 --- a/tests/simple_unit/SqlMap/TestQueryForMap.php +++ b/tests/simple_unit/SqlMap/TestQueryForMap.php @@ -39,5 +39,3 @@ class TestQueryForMap extends BaseCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/common.php b/tests/simple_unit/SqlMap/common.php index 5146d123..020a296b 100644 --- a/tests/simple_unit/SqlMap/common.php +++ b/tests/simple_unit/SqlMap/common.php @@ -151,5 +151,3 @@ class BaseTestConfig } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/A.php b/tests/simple_unit/SqlMap/domain/A.php index af1f925d..a4f204e4 100644 --- a/tests/simple_unit/SqlMap/domain/A.php +++ b/tests/simple_unit/SqlMap/domain/A.php @@ -23,5 +23,3 @@ class A public function getF(){ return $this->_F; } public function setF($value){ $this->_F = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Account.php b/tests/simple_unit/SqlMap/domain/Account.php index 9502eb85..b4bcbcc8 100644 --- a/tests/simple_unit/SqlMap/domain/Account.php +++ b/tests/simple_unit/SqlMap/domain/Account.php @@ -32,5 +32,3 @@ class Account public function setCartOptions($value){ $this->_CartOptions = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/AccountBis.php b/tests/simple_unit/SqlMap/domain/AccountBis.php index d454f2a8..e48184b6 100644 --- a/tests/simple_unit/SqlMap/domain/AccountBis.php +++ b/tests/simple_unit/SqlMap/domain/AccountBis.php @@ -9,5 +9,3 @@ class AccountBis public $More; } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/AccountCollection.php b/tests/simple_unit/SqlMap/domain/AccountCollection.php index b14ece5e..06e30dc8 100644 --- a/tests/simple_unit/SqlMap/domain/AccountCollection.php +++ b/tests/simple_unit/SqlMap/domain/AccountCollection.php @@ -13,5 +13,3 @@ class AccountCollection extends TList $array->copyFrom($this); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/B.php b/tests/simple_unit/SqlMap/domain/B.php index 788b804e..ab42e6b6 100644 --- a/tests/simple_unit/SqlMap/domain/B.php +++ b/tests/simple_unit/SqlMap/domain/B.php @@ -19,5 +19,3 @@ class B public function getLibelle(){ return $this->_Libelle; } public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Book.php b/tests/simple_unit/SqlMap/domain/Book.php index 80877112..4c0670e8 100644 --- a/tests/simple_unit/SqlMap/domain/Book.php +++ b/tests/simple_unit/SqlMap/domain/Book.php @@ -5,7 +5,5 @@ class Book extends Document private $_PageNumber=''; public function getPageNumber(){ return $this->_PageNumber; } - public function setPageNumber($value){ $this->_PageNumber = $value; } + public function setPageNumber($value){ $this->_PageNumber = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/C.php b/tests/simple_unit/SqlMap/domain/C.php index 47118d44..642f97e9 100644 --- a/tests/simple_unit/SqlMap/domain/C.php +++ b/tests/simple_unit/SqlMap/domain/C.php @@ -11,5 +11,3 @@ class C public function getLibelle(){ return $this->_Libelle; } public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Category.php b/tests/simple_unit/SqlMap/domain/Category.php index db76edb4..895819e9 100644 --- a/tests/simple_unit/SqlMap/domain/Category.php +++ b/tests/simple_unit/SqlMap/domain/Category.php @@ -15,5 +15,3 @@ class Category public function getGuidString(){ return $this->_Guid; } public function setGuidString($value){ $this->_Guid = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Complex.php b/tests/simple_unit/SqlMap/domain/Complex.php index 99cb04b8..01082343 100644 --- a/tests/simple_unit/SqlMap/domain/Complex.php +++ b/tests/simple_unit/SqlMap/domain/Complex.php @@ -7,5 +7,3 @@ class Complex public function getMap(){ return $this->_map; } public function setMap(TMap $map){ $this->_map = $map; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/D.php b/tests/simple_unit/SqlMap/domain/D.php index 2cbd2883..f120e2d1 100644 --- a/tests/simple_unit/SqlMap/domain/D.php +++ b/tests/simple_unit/SqlMap/domain/D.php @@ -12,5 +12,3 @@ class D public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Document.php b/tests/simple_unit/SqlMap/domain/Document.php index 682f8eb3..518851e6 100644 --- a/tests/simple_unit/SqlMap/domain/Document.php +++ b/tests/simple_unit/SqlMap/domain/Document.php @@ -12,5 +12,3 @@ class Document public function setTitle($value){ $this->_Title = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/DocumentCollection.php b/tests/simple_unit/SqlMap/domain/DocumentCollection.php index c130db56..a2d5d89d 100644 --- a/tests/simple_unit/SqlMap/domain/DocumentCollection.php +++ b/tests/simple_unit/SqlMap/domain/DocumentCollection.php @@ -4,5 +4,3 @@ class DocumentCollection extends TList { } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/E.php b/tests/simple_unit/SqlMap/domain/E.php index 8473c156..c69c8027 100644 --- a/tests/simple_unit/SqlMap/domain/E.php +++ b/tests/simple_unit/SqlMap/domain/E.php @@ -12,5 +12,3 @@ class E public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/F.php b/tests/simple_unit/SqlMap/domain/F.php index 2bbbb2fb..159d8d63 100644 --- a/tests/simple_unit/SqlMap/domain/F.php +++ b/tests/simple_unit/SqlMap/domain/F.php @@ -12,5 +12,3 @@ class F public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/LineItem.php b/tests/simple_unit/SqlMap/domain/LineItem.php index f6908bbd..a989ab8b 100644 --- a/tests/simple_unit/SqlMap/domain/LineItem.php +++ b/tests/simple_unit/SqlMap/domain/LineItem.php @@ -28,5 +28,3 @@ class LineItem public function setPictureData($value){ $this->_PictureData = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/LineItemCollection.php b/tests/simple_unit/SqlMap/domain/LineItemCollection.php index 8bc95622..1c31dca3 100644 --- a/tests/simple_unit/SqlMap/domain/LineItemCollection.php +++ b/tests/simple_unit/SqlMap/domain/LineItemCollection.php @@ -4,5 +4,3 @@ class LineItemCollection extends TList { } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Newspaper.php b/tests/simple_unit/SqlMap/domain/Newspaper.php index 08716c6d..12ebce5b 100644 --- a/tests/simple_unit/SqlMap/domain/Newspaper.php +++ b/tests/simple_unit/SqlMap/domain/Newspaper.php @@ -8,5 +8,3 @@ class Newspaper extends Document public function setCity($value){ $this->_City = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Order.php b/tests/simple_unit/SqlMap/domain/Order.php index 312626fe..2b907ac6 100644 --- a/tests/simple_unit/SqlMap/domain/Order.php +++ b/tests/simple_unit/SqlMap/domain/Order.php @@ -67,5 +67,3 @@ class Order public function setFavouriteLineItem($value){ $this->_FavouriteLineItem = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Other.php b/tests/simple_unit/SqlMap/domain/Other.php index 9e78ab97..89f9d490 100644 --- a/tests/simple_unit/SqlMap/domain/Other.php +++ b/tests/simple_unit/SqlMap/domain/Other.php @@ -19,5 +19,3 @@ class Other public function getLong(){ return $this->_Long; } public function setLong($value){ $this->_Long = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Sample.php b/tests/simple_unit/SqlMap/domain/Sample.php index e03be2df..f2a8951f 100644 --- a/tests/simple_unit/SqlMap/domain/Sample.php +++ b/tests/simple_unit/SqlMap/domain/Sample.php @@ -51,5 +51,3 @@ class Sample public function getSequenceDate(){ return $this->_SequenceDate; } public function setSequenceDate($value){ $this->_SequenceDate = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Search.php b/tests/simple_unit/SqlMap/domain/Search.php index c01891a9..d2170044 100644 --- a/tests/simple_unit/SqlMap/domain/Search.php +++ b/tests/simple_unit/SqlMap/domain/Search.php @@ -19,5 +19,3 @@ class Search public function getStartDateAnd(){ return $this->_StartDateAnd; } public function setStartDateAnd($value){ $this->_StartDateAnd = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/User.php b/tests/simple_unit/SqlMap/domain/User.php index b21712a3..1106d1e9 100644 --- a/tests/simple_unit/SqlMap/domain/User.php +++ b/tests/simple_unit/SqlMap/domain/User.php @@ -23,5 +23,3 @@ class User public function getLastLogon(){ return $this->_LastLogon; } public function setLastLogon($value){ $this->_LastLogon = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/gen.php b/tests/simple_unit/SqlMap/gen.php index 855172ba..40ddc297 100644 --- a/tests/simple_unit/SqlMap/gen.php +++ b/tests/simple_unit/SqlMap/gen.php @@ -29,5 +29,3 @@ function print_funcs($props) echo $getter.$setter."\n"; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/queryForListLimitTest.php b/tests/simple_unit/SqlMap/queryForListLimitTest.php index 349314a5..af550dcb 100644 --- a/tests/simple_unit/SqlMap/queryForListLimitTest.php +++ b/tests/simple_unit/SqlMap/queryForListLimitTest.php @@ -36,5 +36,3 @@ class queryForListLimitTest extends BaseCase $this->assertEqual($list1[1][2],'Dalton'); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/BaseGatewayTest.php b/tests/simple_unit/TableGateway/BaseGatewayTest.php index 98b236ee..f3117ed2 100644 --- a/tests/simple_unit/TableGateway/BaseGatewayTest.php +++ b/tests/simple_unit/TableGateway/BaseGatewayTest.php @@ -90,5 +90,4 @@ class BaseGatewayTest extends UnitTestCase { $this->getGateway()->deleteAll('1=1'); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/CountTest.php b/tests/simple_unit/TableGateway/CountTest.php index 0e159ab0..97211e3c 100644 --- a/tests/simple_unit/TableGateway/CountTest.php +++ b/tests/simple_unit/TableGateway/CountTest.php @@ -12,5 +12,4 @@ class CountTest extends BaseGatewayTest $result = $this->getGateway2()->count('department_id = ?', 1); $this->assertEqual(4, $result); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/DeleteByPkTest.php b/tests/simple_unit/TableGateway/DeleteByPkTest.php index 57d9dd31..49b2d86c 100644 --- a/tests/simple_unit/TableGateway/DeleteByPkTest.php +++ b/tests/simple_unit/TableGateway/DeleteByPkTest.php @@ -48,5 +48,4 @@ class DeleteByPkTest extends BaseGatewayTest $this->assertEqual(2, $deleted); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/MagicCallTest.php b/tests/simple_unit/TableGateway/MagicCallTest.php index 8d42fba8..87f9e785 100644 --- a/tests/simple_unit/TableGateway/MagicCallTest.php +++ b/tests/simple_unit/TableGateway/MagicCallTest.php @@ -27,5 +27,4 @@ class MagicCallTest extends BaseGatewayTest $this->assertEqual(0, count($result)); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php b/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php index f34dcefc..96c9351d 100644 --- a/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php +++ b/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php @@ -52,5 +52,4 @@ class TableGatewayPgsqlTest extends BaseGatewayTest $this->assertEqual($result['username'], 'record2'); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/TableInfoGatewayTest.php b/tests/simple_unit/TableGateway/TableInfoGatewayTest.php index 51af7634..6c85248c 100644 --- a/tests/simple_unit/TableGateway/TableInfoGatewayTest.php +++ b/tests/simple_unit/TableGateway/TableInfoGatewayTest.php @@ -13,5 +13,4 @@ class TableInfoGatewayTest extends BaseGatewayTest $table = new TTableGateway($info, $conn); $this->assertEqual(count($table->findAll()->readAll()), 2); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/TestFindByPk.php b/tests/simple_unit/TableGateway/TestFindByPk.php index 5a7a081c..3756d35a 100644 --- a/tests/simple_unit/TableGateway/TestFindByPk.php +++ b/tests/simple_unit/TableGateway/TestFindByPk.php @@ -44,5 +44,4 @@ class TestFindByPk extends BaseGatewayTest $this->assertEqual($expect, $result); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/Tickets/Ticket589Test.php b/tests/simple_unit/Tickets/Ticket589Test.php index 2fedda6f..487181ff 100644 --- a/tests/simple_unit/Tickets/Ticket589Test.php +++ b/tests/simple_unit/Tickets/Ticket589Test.php @@ -18,5 +18,3 @@ class Ticket589Test extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/unit.php b/tests/simple_unit/unit.php index 63910f68..b0e7874d 100644 --- a/tests/simple_unit/unit.php +++ b/tests/simple_unit/unit.php @@ -5,5 +5,3 @@ $test_cases = dirname(__FILE__)."/"; $tester = new PradoUnitTester($test_cases); $tester->run(new HtmlReporter()); - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ws.php b/tests/simple_unit/ws.php index 703235d1..9096183e 100644 --- a/tests/simple_unit/ws.php +++ b/tests/simple_unit/ws.php @@ -5,5 +5,3 @@ include_once './Soap/ContactManager.php'; $app = new TApplication('.'); $app->run(); - -?>
\ No newline at end of file diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php new file mode 100644 index 00000000..66350e11 --- /dev/null +++ b/tests/test_tools/PradoGenericSelenium2Test.php @@ -0,0 +1,49 @@ +<?php +require_once 'PHPUnit/Extensions/Selenium2TestCase.php'; + +// TODO: stub +class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase +{ + static $browser='chrome'; + static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/'; + static $timeout=5; //seconds + static $wait=1000; //msecs + + protected function setUp() + { + $this->setBrowser(static::$browser); + $this->setBrowserUrl(static::$baseurl); + $this->setSeleniumServerRequestsTimeout(static::$timeout); + } + + public function setUpPage() + { + $this->timeouts()->implicitWait(static::$wait); + } + + protected function open($url) + { + $this->url($url); + } + + protected function tearDown() + { + } + + protected function verifyTextPresent($txt) + { + $this->assertContains($txt, $this->source()); + } + + protected function assertText($id, $txt) + { + $element = $this->byId($id); + $this->assertEquals($txt, $element->text()); + } + + protected function pause($msec) + { + usleep($msec*1000); + } + +}
\ No newline at end of file diff --git a/tests/test_tools/PradoGenericSeleniumTest.php b/tests/test_tools/PradoGenericSeleniumTest.php index 2c9ceb21..9a60f95a 100644 --- a/tests/test_tools/PradoGenericSeleniumTest.php +++ b/tests/test_tools/PradoGenericSeleniumTest.php @@ -1,7 +1,6 @@ <?php require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; -require_once 'PHPUnit/Extensions/Selenium2TestCase.php'; - + class PradoGenericSeleniumTest extends PHPUnit_Extensions_SeleniumTestCase { static $browser='*googlechrome'; @@ -17,26 +16,4 @@ class PradoGenericSeleniumTest extends PHPUnit_Extensions_SeleniumTestCase protected function tearDown() { } -} - -// TODO: stub -class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase -{ - static $browser='chrome'; - static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/'; - - protected function setUp() - { - $this->setBrowser(static::$browser); - $this->setBrowserUrl(static::$baseurl); - } - - protected function open($url) - { - $this->setBrowserUrl(static::$baseurl.$url); - } - - protected function tearDown() - { - } }
\ No newline at end of file diff --git a/tests/test_tools/README.txt b/tests/test_tools/README.txt index cfa02abe..6bc3aa79 100644 --- a/tests/test_tools/README.txt +++ b/tests/test_tools/README.txt @@ -4,7 +4,7 @@ Functional tests are browser based that tests the overall functional of a Prado === Writing Tests === -Lets test some part of a Prado application. Create a new php file, e.g. +Lets test some part of a Prado application. Create a new php file, e.g. testExample1.php @@ -21,11 +21,10 @@ class testExample1 extends SeleniumTestCase { //using xpath to find the button with value "Click Me!" $this->click('//input[@value="Click Me!"]'); - + //..more commands and assertions } } -?> </php> === Tests as part of Example code === @@ -50,9 +49,9 @@ class testMyButtonExample extends SeleniumTestCase { //get the test page url $page = Prado::getApplication()->getTestPage(__FILE__); - + //open MyButtonExample page - $this->open($page); + $this->open($page); } function testButtonClick() @@ -62,7 +61,6 @@ class testMyButtonExample extends SeleniumTestCase $this->click('//input[@value="Hello World!"]'); } } -?> </php> File: MyButtonExample.tpl @@ -108,7 +106,7 @@ Select the element with the specified @id attribute. If no match is found, sele Find an element using JavaScript traversal of the HTML Document Object Model. DOM locators ''must'' begin with "document.". * dom=document.forms['myForm'].myDropdown * dom=document.images[56] - + ==== '''xpath='''''xpathExpression''==== Locate an element using an XPath expression. XPath locators ''must'' begin with "//". * xpath=//img[@alt='The image alt text'] @@ -133,15 +131,15 @@ Select Option Specifiers provide different ways of specifying options of an HTML matches options based on their labels, i.e. the visible text. * label=regexp:^[Oo]ther -==== value=valuePattern ==== +==== value=valuePattern ==== matches options based on their values. * value=other -==== id=id ==== +==== id=id ==== matches options based on their ids. * id=option1 -==== index=index ==== +==== index=index ==== matches an option based on its index (offset from zero). * index=2 @@ -174,8 +172,8 @@ Selenium Actions examples: - open /mypage - open http://localhost/ + open /mypage + open http://localhost/ click( elementLocator ) @@ -183,9 +181,9 @@ Selenium Actions examples: - click aCheckbox - clickAndWait submitButton - clickAndWait anyLink + click aCheckbox + clickAndWait submitButton + clickAndWait anyLink note: Selenium will always automatically click on a popup dialog raised by the alert() or confirm() methods. (The exception is those raised during 'onload', which are not yet handled by Selenium). You must use [verify|assert]Alert or [verify|assert]Confirmation to tell Selenium that you expect the popup dialog. You may use chooseCancelOnNextConfirmation to click 'cancel' on the next confirmation dialog instead of clicking 'OK'. @@ -222,8 +220,8 @@ Selenium Actions examples: - selectWindow myPopupWindow - selectWindow null + selectWindow myPopupWindow + selectWindow null goBack() @@ -231,7 +229,7 @@ Selenium Actions examples: - goBack + goBack close() @@ -239,7 +237,7 @@ Selenium Actions examples: - close + close pause( milliseconds ) @@ -247,8 +245,8 @@ Selenium Actions examples: - pause 5000 - pause 2000 + pause 5000 + pause 2000 fireEvent( elementLocator, eventName ) @@ -310,7 +308,7 @@ Selenium Actions examples: - chooseCancelOnNextConfirmation + chooseCancelOnNextConfirmation answerOnNextPrompt( answerString ) @@ -318,7 +316,7 @@ Selenium Actions examples: - answerOnNextPrompt Kangaroo + answerOnNextPrompt Kangaroo Selenium Checks @@ -330,8 +328,8 @@ Selenium Checks examples: - verifyLocation /mypage - assertLocation /mypage + verifyLocation /mypage + assertLocation /mypage assertTitle( titlePattern ) @@ -339,8 +337,8 @@ Selenium Checks examples: - verifyTitle My Page - assertTitle My Page + verifyTitle My Page + assertTitle My Page assertValue( inputLocator, valuePattern ) @@ -396,8 +394,8 @@ Selenium Checks examples: - verifyTextPresent You are now logged in. - assertTextPresent You are now logged in. + verifyTextPresent You are now logged in. + assertTextPresent You are now logged in. assertTextNotPresent( text ) @@ -409,8 +407,8 @@ Selenium Checks examples: - verifyElementPresent submitButton - assertElementPresent //img[@alt='foo'] + verifyElementPresent submitButton + assertElementPresent //img[@alt='foo'] assertElementNotPresent( elementLocator ) @@ -418,8 +416,8 @@ Selenium Checks examples: - verifyElementNotPresent cancelButton - assertElementNotPresent cancelButton + verifyElementNotPresent cancelButton + assertElementNotPresent cancelButton assertTable( cellAddress, valuePattern ) @@ -436,8 +434,8 @@ Selenium Checks examples: - verifyVisible postcode - assertVisible postcode + verifyVisible postcode + assertVisible postcode assertNotVisible( elementLocator ) @@ -445,8 +443,8 @@ Selenium Checks examples: - verifyNotVisible postcode - assertNotVisible postcode + verifyNotVisible postcode + assertNotVisible postcode verifyEditable / assertEditable( inputLocator ) @@ -454,8 +452,8 @@ Selenium Checks examples: - verifyEditable shape - assertEditable colour + verifyEditable shape + assertEditable colour assertNotEditable( inputLocator ) @@ -473,8 +471,8 @@ Selenium Checks examples: - verifyAlert Invalid Phone Number - assertAlert Invalid Phone Number + verifyAlert Invalid Phone Number + assertAlert Invalid Phone Number assertConfirmation( messagePattern ) @@ -488,8 +486,8 @@ Selenium Checks examples: - assertConfirmation Remove this user? - verifyConfirmation Are you sure? + assertConfirmation Remove this user? + verifyConfirmation Are you sure? assertPrompt( messagePattern ) @@ -499,9 +497,9 @@ Selenium Checks examples: - answerOnNextPrompt Joe - click id=delegate - verifyPrompt Delegate to who? + answerOnNextPrompt Joe + click id=delegate + verifyPrompt Delegate to who? Parameter construction and Variables diff --git a/tests/test_tools/phpunit_bootstrap.php b/tests/test_tools/phpunit_bootstrap.php index 1154e5fc..23e25a1c 100644 --- a/tests/test_tools/phpunit_bootstrap.php +++ b/tests/test_tools/phpunit_bootstrap.php @@ -22,4 +22,5 @@ if (!@include_once VENDOR_DIR.'/autoload.php') { require_once(PRADO_FRAMEWORK_DIR.'/prado.php'); // for FunctionalTests -require_once(__DIR__.'/PradoGenericSeleniumTest.php');
\ No newline at end of file +require_once(__DIR__.'/PradoGenericSeleniumTest.php'); +require_once(__DIR__.'/PradoGenericSelenium2Test.php');
\ No newline at end of file diff --git a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php index abd10076..f3ae2391 100644 --- a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php +++ b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php @@ -1,11 +1,11 @@ <?php -if (!defined('T_ML_COMMENT')) +if (!defined('T_ML_COMMENT')) define('T_ML_COMMENT', T_COMMENT); -else +else define('T_DOC_COMMENT', T_ML_COMMENT); -class HtmlReporterWithCoverage extends HtmlReporter +class HtmlReporterWithCoverage extends HtmlReporter { protected $coverage = array(); @@ -19,7 +19,7 @@ class HtmlReporterWithCoverage extends HtmlReporter $this->base_dir = $base_dir; } - function paintHeader($test_name, $charset="UTF-8") + function paintHeader($test_name, $charset="UTF-8") { $this->sendNoCacheHeaders(); header('Content-Type: text/html; Charset='.$charset); @@ -31,30 +31,30 @@ class HtmlReporterWithCoverage extends HtmlReporter print "</head>\n<body>\n"; print "<h1>$test_name</h1>\n"; flush(); - - if (extension_loaded('xdebug')) + + if (extension_loaded('xdebug')) xdebug_start_code_coverage(XDEBUG_CC_UNUSED); - } + } /** * */ - function _getCss() + function _getCss() { $contents = parent::_getCss()."\n "; $contents .= ' - .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;} - .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: } - .coverage {margin: 0.4em; } + .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;} + .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: } + .coverage {margin: 0.4em; } .coverage a { padding-left: 0.5em; } - .coverage:after { - content: "."; - display: block; - height: 0; - clear: both; + .coverage:after { + content: "."; + display: block; + height: 0; + clear: both; visibility: hidden; } .coverage {display: inline-block;} @@ -66,9 +66,9 @@ class HtmlReporterWithCoverage extends HtmlReporter Return $contents; } - function paintFooter($test_name) + function paintFooter($test_name) { - if (extension_loaded('xdebug')) + if (extension_loaded('xdebug')) { $this->coverage = xdebug_get_code_coverage(); xdebug_stop_code_coverage(); @@ -93,10 +93,10 @@ class HtmlReporterWithCoverage extends HtmlReporter $dir = dirname(__FILE__); if(count($this->coverage) > 0) print '<h2>Code Coverage</h2>'; - - - ksort($this->coverage); - + + + ksort($this->coverage); + $details = array(); foreach($this->coverage as $file => $coverage) { @@ -110,7 +110,7 @@ class HtmlReporterWithCoverage extends HtmlReporter $width = $percentage * 3; $filename = str_replace($this->base_dir, '',$file); $link = $this->constructURL($filename, $coverage); - + $detail['total'] = $total; $detail['executed'] = $executed; $detail['width'] = $width; @@ -150,7 +150,7 @@ class HtmlReporterWithCoverage extends HtmlReporter } -class HTMLCoverageReport extends HtmlReporter +class HTMLCoverageReport extends HtmlReporter { protected $file; protected $lines; @@ -184,7 +184,7 @@ class HTMLCoverageReport extends HtmlReporter $this->paintFooter(); } - function paintHeader($file, $charset="UTF-8") + function paintHeader($file, $charset="UTF-8") { $total = $this->codelines($this->file); $executed = count($this->lines); @@ -218,21 +218,21 @@ class HTMLCoverageReport extends HtmlReporter $lines = ''; - foreach ($tokens as $token) + foreach ($tokens as $token) { - if (is_string($token)) + if (is_string($token)) { // simple 1-character token $lines .= $token; - } - else + } + else { // token array list($id, $text) = $token; - switch ($id) - { - case T_COMMENT: + switch ($id) + { + case T_COMMENT: case T_ML_COMMENT: // we've defined this case T_DOC_COMMENT: // and this // no action on comments @@ -265,4 +265,3 @@ class HTMLCoverageReport extends HtmlReporter } } -?> diff --git a/tests/test_tools/simpletest/authentication.php b/tests/test_tools/simpletest/authentication.php index cae366b3..86b68402 100644 --- a/tests/test_tools/simpletest/authentication.php +++ b/tests/test_tools/simpletest/authentication.php @@ -234,5 +234,4 @@ 'Authorization: Basic ' . base64_encode("$username:$password")); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/browser.php b/tests/test_tools/simpletest/browser.php index 44c8ddd4..410b18b9 100644 --- a/tests/test_tools/simpletest/browser.php +++ b/tests/test_tools/simpletest/browser.php @@ -220,7 +220,7 @@ function useFrames() { $this->_ignore_frames = false; } - + /** * Switches off cookie sending and recieving. * @access public @@ -228,7 +228,7 @@ function ignoreCookies() { $this->_user_agent->ignoreCookies(); } - + /** * Switches back on the cookie sending and recieving. * @access public @@ -257,7 +257,7 @@ } return $frameset; } - + /** * Assembles the parsing machinery and actually parses * a single page. Frees all of the builder memory and so @@ -1053,5 +1053,4 @@ } return $raw; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/collector.php b/tests/test_tools/simpletest/collector.php index 5bcde179..ded847c9 100644 --- a/tests/test_tools/simpletest/collector.php +++ b/tests/test_tools/simpletest/collector.php @@ -1,12 +1,11 @@ <?php /** - * This file contains the following classes: {@link SimpleCollector}, + * This file contains the following classes: {@link SimpleCollector}, * {@link SimplePatternCollector}. - * + * * @author Travis Swicegood <development@domain51.com> * @package SimpleTest * @subpackage UnitTester - * @version $Id: collector.php 1398 2006-09-08 19:31:03Z xue $ */ /** @@ -17,7 +16,7 @@ * @subpackage UnitTester */ class SimpleCollector { - + /** * Strips off any kind of slash at the end so as to normalise the path * @@ -25,12 +24,12 @@ class SimpleCollector { */ function _removeTrailingSlash($path) { return preg_replace('|[\\/]$|', '', $path); - + /** * @internal * Try benchmarking the following. It's more code, but by not using the - * regex, it may be faster? Also, shouldn't be looking for - * DIRECTORY_SEPERATOR instead of a manual "/"? + * regex, it may be faster? Also, shouldn't be looking for + * DIRECTORY_SEPERATOR instead of a manual "/"? */ if (substr($path, -1) == DIRECTORY_SEPERATOR) { return substr($path, 0, -1); @@ -54,12 +53,12 @@ class SimpleCollector { closedir($handle); } } - + /** * This method determines what should be done with a given file and adds * it via {@link GroupTest::addTestFile()} if necessary. * - * This method should be overriden to provide custom matching criteria, + * This method should be overriden to provide custom matching criteria, * such as pattern matching, recursive matching, etc. For an example, see * {@link SimplePatternCollector::_handle()}. * @@ -85,8 +84,8 @@ class SimpleCollector { */ class SimplePatternCollector extends SimpleCollector { protected $_pattern; - - + + /** * * @param string $pattern Perl compatible regex to test name against @@ -96,8 +95,8 @@ class SimplePatternCollector extends SimpleCollector { function SimplePatternCollector($pattern = '/php$/i') { $this->_pattern = $pattern; } - - + + /** * Attempts to add files that match a given pattern. * @@ -111,5 +110,4 @@ class SimplePatternCollector extends SimpleCollector { parent::_handle($test, $filename); } } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/test_tools/simpletest/compatibility.php b/tests/test_tools/simpletest/compatibility.php index 92cf70d3..a181793e 100644 --- a/tests/test_tools/simpletest/compatibility.php +++ b/tests/test_tools/simpletest/compatibility.php @@ -181,4 +181,3 @@ return array(); } } -?> diff --git a/tests/test_tools/simpletest/cookies.php b/tests/test_tools/simpletest/cookies.php index 4a2b0d4e..eba8776e 100644 --- a/tests/test_tools/simpletest/cookies.php +++ b/tests/test_tools/simpletest/cookies.php @@ -11,7 +11,7 @@ */ require_once(dirname(__FILE__) . '/url.php'); /**#@-*/ - + /** * Cookie data holder. Cookie rules are full of pretty * arbitary stuff. I have used... @@ -27,7 +27,7 @@ protected $_path; protected $_expiry; protected $_is_secure; - + /** * Constructor. Sets the stored values. * @param string $name Cookie key. @@ -49,7 +49,7 @@ } $this->_is_secure = $is_secure; } - + /** * Sets the host. The cookie rules determine * that the first two parts are taken for @@ -67,7 +67,7 @@ } return false; } - + /** * Accessor for the truncated host to which this * cookie applies. @@ -77,7 +77,7 @@ function getHost() { return $this->_host; } - + /** * Test for a cookie being valid for a host name. * @param string $host Host to test against. @@ -87,7 +87,7 @@ function isValidHost($host) { return ($this->_truncateHost($host) === $this->getHost()); } - + /** * Extracts just the domain part that determines a * cookie's host validity. @@ -104,7 +104,7 @@ } return false; } - + /** * Accessor for name. * @return string Cookie key. @@ -113,7 +113,7 @@ function getName() { return $this->_name; } - + /** * Accessor for value. A deleted cookie will * have an empty string for this. @@ -123,7 +123,7 @@ function getValue() { return $this->_value; } - + /** * Accessor for path. * @return string Valid cookie path. @@ -132,7 +132,7 @@ function getPath() { return $this->_path; } - + /** * Tests a path to see if the cookie applies * there. The test path must be longer or @@ -147,7 +147,7 @@ $this->getPath(), strlen($this->getPath())) == 0); } - + /** * Accessor for expiry. * @return string Expiry string. @@ -159,7 +159,7 @@ } return gmdate("D, d M Y H:i:s", $this->_expiry) . " GMT"; } - + /** * Test to see if cookie is expired against * the cookie format time or timestamp. @@ -180,7 +180,7 @@ } return ($this->_expiry < $now); } - + /** * Ages the cookie by the specified number of * seconds. @@ -192,7 +192,7 @@ $this->_expiry -= $interval; } } - + /** * Accessor for the secure flag. * @return boolean True if cookie needs SSL. @@ -201,7 +201,7 @@ function isSecure() { return $this->_is_secure; } - + /** * Adds a trailing and leading slash to the path * if missing. @@ -218,7 +218,7 @@ return $path; } } - + /** * Repository for cookies. This stuff is a * tiny bit browser dependent. @@ -227,7 +227,7 @@ */ class SimpleCookieJar { protected $_cookies; - + /** * Constructor. Jar starts empty. * @access public @@ -235,7 +235,7 @@ function SimpleCookieJar() { $this->_cookies = array(); } - + /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. @@ -258,7 +258,7 @@ } $this->_cookies = $surviving_cookies; } - + /** * Ages all cookies in the cookie jar. * @param integer $interval The old session is moved @@ -272,7 +272,7 @@ $this->_cookies[$i]->agePrematurely($interval); } } - + /** * Sets an additional cookie. If a cookie has * the same name and path it is replaced. @@ -290,7 +290,7 @@ } $this->_cookies[$this->_findFirstMatch($cookie)] = $cookie; } - + /** * Finds a matching cookie to write over or the * first empty slot if none. @@ -311,7 +311,7 @@ } return count($this->_cookies); } - + /** * Reads the most specific cookie value from the * browser cookies. Looks for the longest path that @@ -335,7 +335,7 @@ } return (isset($value) ? $value : false); } - + /** * Tests cookie for matching against search * criteria. @@ -359,7 +359,7 @@ } return true; } - + /** * Uses a URL to sift relevant cookies by host and * path. Results are list of strings of form "name=value". @@ -376,5 +376,4 @@ } return $pairs; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/detached.php b/tests/test_tools/simpletest/detached.php index 1f3638bb..06665781 100644 --- a/tests/test_tools/simpletest/detached.php +++ b/tests/test_tools/simpletest/detached.php @@ -92,5 +92,4 @@ function &_createParser($reporter) { return new SimpleTestXmlParser($reporter); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/dumper.php b/tests/test_tools/simpletest/dumper.php index a2ea30b0..9c3f745a 100644 --- a/tests/test_tools/simpletest/dumper.php +++ b/tests/test_tools/simpletest/dumper.php @@ -398,5 +398,4 @@ } return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/encoding.php b/tests/test_tools/simpletest/encoding.php index 0dc9fbfa..ca2083a3 100644 --- a/tests/test_tools/simpletest/encoding.php +++ b/tests/test_tools/simpletest/encoding.php @@ -5,7 +5,7 @@ * @subpackage WebTester * @version $Id: encoding.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include other SimpleTest class files */ @@ -20,7 +20,7 @@ class SimpleEncodedPair { protected $_key; protected $_value; - + /** * Stashes the data for rendering later. * @param string $key Form element name. @@ -30,7 +30,7 @@ $this->_key = $key; $this->_value = $value; } - + /** * The pair as a single string. * @return string Encoded pair. @@ -39,7 +39,7 @@ function asRequest() { return $this->_key . '=' . urlencode($this->_value); } - + /** * The MIME part as a string. * @return string MIME part encoding. @@ -51,7 +51,7 @@ $part .= "\r\n" . $this->_value; return $part; } - + /** * Is this the value we are looking for? * @param string $key Identifier. @@ -61,7 +61,7 @@ function isKey($key) { return $key == $this->_key; } - + /** * Is this the value we are looking for? * @return string Identifier. @@ -70,7 +70,7 @@ function getKey() { return $this->_key; } - + /** * Is this the value we are looking for? * @return string Content. @@ -90,7 +90,7 @@ protected $_key; protected $_content; protected $_filename; - + /** * Stashes the data for rendering later. * @param string $key Key to add value to. @@ -102,7 +102,7 @@ $this->_content = $content; $this->_filename = $filename; } - + /** * The pair as a single string. * @return string Encoded pair. @@ -111,7 +111,7 @@ function asRequest() { return ''; } - + /** * The MIME part as a string. * @return string MIME part encoding. @@ -125,7 +125,7 @@ $part .= "\r\n\r\n" . $this->_content; return $part; } - + /** * Attempts to figure out the MIME type from the * file extension and the content. @@ -138,7 +138,7 @@ } return 'application/octet-stream'; } - + /** * Tests each character is in the range 0-127. * @param string $ascii String to test. @@ -152,7 +152,7 @@ } return true; } - + /** * Is this the value we are looking for? * @param string $key Identifier. @@ -162,7 +162,7 @@ function isKey($key) { return $key == $this->_key; } - + /** * Is this the value we are looking for? * @return string Identifier. @@ -171,7 +171,7 @@ function getKey() { return $this->_key; } - + /** * Is this the value we are looking for? * @return string Content. @@ -190,7 +190,7 @@ */ class SimpleEncoding { protected $_request; - + /** * Starts empty. * @param array $query Hash of parameters. @@ -205,7 +205,7 @@ $this->clear(); $this->merge($query); } - + /** * Empties the request of parameters. * @access public @@ -213,7 +213,7 @@ function clear() { $this->_request = array(); } - + /** * Adds a parameter to the query. * @param string $key Key to add value to. @@ -232,7 +232,7 @@ $this->_addPair($key, $value); } } - + /** * Adds a new value into the request. * @param string $key Key to add value to. @@ -242,7 +242,7 @@ function _addPair($key, $value) { $this->_request[] = new SimpleEncodedPair($key, $value); } - + /** * Adds a MIME part to the query. Does nothing for a * form encoded packet. @@ -254,7 +254,7 @@ function attach($key, $content, $filename) { $this->_request[] = new SimpleAttachment($key, $content, $filename); } - + /** * Adds a set of parameters to this query. * @param array/SimpleQueryString $query Multiple values are @@ -270,7 +270,7 @@ } } } - + /** * Accessor for single value. * @return string/array False if missing, string @@ -293,7 +293,7 @@ return $values; } } - + /** * Accessor for listing of pairs. * @return array All pair objects. @@ -302,7 +302,7 @@ function getAll() { return $this->_request; } - + /** * Renders the query string as a URL encoded * request part. @@ -319,7 +319,7 @@ return implode('&', $statements); } } - + /** * Bundle of GET parameters. Can include * repeated parameters. @@ -327,7 +327,7 @@ * @subpackage WebTester */ class SimpleGetEncoding extends SimpleEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -338,7 +338,7 @@ function SimpleGetEncoding($query = false) { $this->SimpleEncoding($query); } - + /** * HTTP request method. * @return string Always GET. @@ -347,7 +347,7 @@ function getMethod() { return 'GET'; } - + /** * Writes no extra headers. * @param SimpleSocket $socket Socket to write to. @@ -355,7 +355,7 @@ */ function writeHeadersTo($socket) { } - + /** * No data is sent to the socket as the data is encoded into * the URL. @@ -364,7 +364,7 @@ */ function writeTo($socket) { } - + /** * Renders the query string as a URL encoded * request part for attaching to a URL. @@ -375,14 +375,14 @@ return $this->_encode(); } } - + /** * Bundle of URL parameters for a HEAD request. * @package SimpleTest * @subpackage WebTester */ class SimpleHeadEncoding extends SimpleGetEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -393,7 +393,7 @@ function SimpleHeadEncoding($query = false) { $this->SimpleGetEncoding($query); } - + /** * HTTP request method. * @return string Always HEAD. @@ -403,7 +403,7 @@ return 'HEAD'; } } - + /** * Bundle of POST parameters. Can include * repeated parameters. @@ -411,7 +411,7 @@ * @subpackage WebTester */ class SimplePostEncoding extends SimpleEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -422,7 +422,7 @@ function SimplePostEncoding($query = false) { $this->SimpleEncoding($query); } - + /** * HTTP request method. * @return string Always POST. @@ -431,7 +431,7 @@ function getMethod() { return 'POST'; } - + /** * Dispatches the form headers down the socket. * @param SimpleSocket $socket Socket to write to. @@ -441,7 +441,7 @@ $socket->write("Content-Length: " . (integer)strlen($this->_encode()) . "\r\n"); $socket->write("Content-Type: application/x-www-form-urlencoded\r\n"); } - + /** * Dispatches the form data down the socket. * @param SimpleSocket $socket Socket to write to. @@ -450,7 +450,7 @@ function writeTo($socket) { $socket->write($this->_encode()); } - + /** * Renders the query string as a URL encoded * request part for attaching to a URL. @@ -461,7 +461,7 @@ return ''; } } - + /** * Bundle of POST parameters in the multipart * format. Can include file uploads. @@ -470,7 +470,7 @@ */ class SimpleMultipartEncoding extends SimplePostEncoding { protected $_boundary; - + /** * Starts empty. * @param array $query Hash of parameters. @@ -482,7 +482,7 @@ $this->SimplePostEncoding($query); $this->_boundary = ($boundary === false ? uniqid('st') : $boundary); } - + /** * Dispatches the form headers down the socket. * @param SimpleSocket $socket Socket to write to. @@ -492,7 +492,7 @@ $socket->write("Content-Length: " . (integer)strlen($this->_encode()) . "\r\n"); $socket->write("Content-Type: multipart/form-data, boundary=" . $this->_boundary . "\r\n"); } - + /** * Dispatches the form data down the socket. * @param SimpleSocket $socket Socket to write to. @@ -501,7 +501,7 @@ function writeTo($socket) { $socket->write($this->_encode()); } - + /** * Renders the query string as a URL encoded * request part. @@ -517,5 +517,4 @@ $stream .= "--" . $this->_boundary . "--\r\n"; return $stream; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/errors.php b/tests/test_tools/simpletest/errors.php index a756bd7c..c10d68a5 100644 --- a/tests/test_tools/simpletest/errors.php +++ b/tests/test_tools/simpletest/errors.php @@ -178,5 +178,4 @@ $queue->add($severity, $message, $filename, $line, $super_globals); set_error_handler('simpleTestErrorHandler'); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/exceptions.php b/tests/test_tools/simpletest/exceptions.php index 63558ad1..30d35386 100644 --- a/tests/test_tools/simpletest/exceptions.php +++ b/tests/test_tools/simpletest/exceptions.php @@ -42,5 +42,4 @@ $test_case->exception($exception); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/expectation.php b/tests/test_tools/simpletest/expectation.php index 8513aff4..a660fa9c 100644 --- a/tests/test_tools/simpletest/expectation.php +++ b/tests/test_tools/simpletest/expectation.php @@ -717,4 +717,3 @@ "] should contain method [$method]"; } } -?> diff --git a/tests/test_tools/simpletest/form.php b/tests/test_tools/simpletest/form.php index 0e6aea14..fba26bf6 100644 --- a/tests/test_tools/simpletest/form.php +++ b/tests/test_tools/simpletest/form.php @@ -5,7 +5,7 @@ * @subpackage WebTester * @version $Id: form.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include SimpleTest files */ @@ -13,7 +13,7 @@ require_once(dirname(__FILE__) . '/encoding.php'); require_once(dirname(__FILE__) . '/selector.php'); /**#@-*/ - + /** * Form tag class to hold widget values. * @package SimpleTest @@ -30,7 +30,7 @@ protected $_widgets; protected $_radios; protected $_checkboxes; - + /** * Starts with no held controls/widgets. * @param SimpleTag $tag Form tag to read. @@ -48,7 +48,7 @@ $this->_radios = array(); $this->_checkboxes = array(); } - + /** * Creates the request packet to be sent by the form. * @param SimpleTag $tag Form tag to read. @@ -64,7 +64,7 @@ } return 'SimpleGetEncoding'; } - + /** * Sets the frame target within a frameset. * @param string $frame Name of frame. @@ -73,7 +73,7 @@ function setDefaultTarget($frame) { $this->_default_target = $frame; } - + /** * Accessor for method of form submission. * @return string Either get or post. @@ -82,7 +82,7 @@ function getMethod() { return ($this->_method ? strtolower($this->_method) : 'get'); } - + /** * Combined action attribute with current location * to get an absolute form target. @@ -97,7 +97,7 @@ $url = new SimpleUrl($action); return $url->makeAbsolute($base); } - + /** * Absolute URL of the target. * @return SimpleUrl URL target. @@ -110,7 +110,7 @@ } return $url; } - + /** * Creates the encoding for the current values in the * form. @@ -125,7 +125,7 @@ } return $encoding; } - + /** * ID field of form for unique identification. * @return string Unique tag ID. @@ -134,7 +134,7 @@ function getId() { return $this->_id; } - + /** * Adds a tag contents to the form. * @param SimpleWidget $tag Input tag to add. @@ -149,7 +149,7 @@ $this->_setWidget($tag); } } - + /** * Sets the widget into the form, grouping radio * buttons if any. @@ -165,7 +165,7 @@ $this->_widgets[] = $tag; } } - + /** * Adds a radio button, building a group if necessary. * @param SimpleRadioButtonTag $tag Incoming form control. @@ -178,7 +178,7 @@ } $this->_widgets[$this->_radios[$tag->getName()]]->addWidget($tag); } - + /** * Adds a checkbox, making it a group on a repeated name. * @param SimpleCheckboxTag $tag Incoming form control. @@ -198,7 +198,7 @@ $this->_widgets[$index]->addWidget($tag); } } - + /** * Extracts current value from form. * @param SimpleSelector $selector Criteria to apply. @@ -219,7 +219,7 @@ } return null; } - + /** * Sets a widget value within the form. * @param SimpleSelector $selector Criteria to apply. @@ -240,7 +240,7 @@ } return $success; } - + /** * Used by the page object to set widgets labels to * external label tags. @@ -257,7 +257,7 @@ } } } - + /** * Test to see if a form has a submit button. * @param SimpleSelector $selector Criteria to apply. @@ -272,7 +272,7 @@ } return false; } - + /** * Test to see if a form has an image control. * @param SimpleSelector $selector Criteria to apply. @@ -287,7 +287,7 @@ } return false; } - + /** * Gets the submit values for a selected button. * @param SimpleSelector $selector Criteria to apply. @@ -306,12 +306,12 @@ if ($additional) { $encoding->merge($additional); } - return $encoding; + return $encoding; } } return false; } - + /** * Gets the submit values for an image. * @param SimpleSelector $selector Criteria to apply. @@ -332,12 +332,12 @@ if ($additional) { $encoding->merge($additional); } - return $encoding; + return $encoding; } } return false; } - + /** * Simply submits the form without the submit button * value. Used when there is only one button or it @@ -349,4 +349,3 @@ return $this->_encode(); } } -?> diff --git a/tests/test_tools/simpletest/frames.php b/tests/test_tools/simpletest/frames.php index 60ced141..86e03157 100644 --- a/tests/test_tools/simpletest/frames.php +++ b/tests/test_tools/simpletest/frames.php @@ -584,5 +584,4 @@ } return null; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/http.php b/tests/test_tools/simpletest/http.php index 9344a5b9..78c91b7e 100644 --- a/tests/test_tools/simpletest/http.php +++ b/tests/test_tools/simpletest/http.php @@ -13,7 +13,7 @@ require_once(dirname(__FILE__) . '/cookies.php'); require_once(dirname(__FILE__) . '/url.php'); /**#@-*/ - + /** * Creates HTTP headers for the end point of * a HTTP request. @@ -22,7 +22,7 @@ */ class SimpleRoute { protected $_url; - + /** * Sets the target URL. * @param SimpleUrl $url URL as object. @@ -31,7 +31,7 @@ function SimpleRoute($url) { $this->_url = $url; } - + /** * Resource name. * @return SimpleUrl Current url. @@ -40,7 +40,7 @@ function getUrl() { return $this->_url; } - + /** * Creates the first line which is the actual request. * @param string $method HTTP request method, usually GET. @@ -51,7 +51,7 @@ return $method . ' ' . $this->_url->getPath() . $this->_url->getEncodedRequest() . ' HTTP/1.0'; } - + /** * Creates the host part of the request. * @return string Host line content. @@ -64,7 +64,7 @@ } return $line; } - + /** * Opens a socket to the route. * @param string $method HTTP request method, usually GET. @@ -86,7 +86,7 @@ } return $socket; } - + /** * Factory for socket. * @param string $scheme Protocol to use. @@ -105,7 +105,7 @@ return $socket; } } - + /** * Creates HTTP headers for the end point of * a HTTP request via a proxy server. @@ -116,7 +116,7 @@ protected $_proxy; protected $_username; protected $_password; - + /** * Stashes the proxy address. * @param SimpleUrl $url URL as object. @@ -131,7 +131,7 @@ $this->_username = $username; $this->_password = $password; } - + /** * Creates the first line which is the actual request. * @param string $method HTTP request method, usually GET. @@ -146,7 +146,7 @@ return $method . ' ' . $scheme . '://' . $url->getHost() . $port . $url->getPath() . $url->getEncodedRequest() . ' HTTP/1.0'; } - + /** * Creates the host part of the request. * @param SimpleUrl $url URL as object. @@ -158,7 +158,7 @@ $port = $this->_proxy->getPort() ? $this->_proxy->getPort() : 8080; return "$host:$port"; } - + /** * Opens a socket to the route. * @param string $method HTTP request method, usually GET. @@ -198,7 +198,7 @@ protected $_encoding; protected $_headers; protected $_cookies; - + /** * Builds the socket request from the different pieces. * These include proxy information, URL, cookies, headers, @@ -214,7 +214,7 @@ $this->_headers = array(); $this->_cookies = array(); } - + /** * Dispatches the content to the route's socket. * @param integer $timeout Connection timeout. @@ -231,7 +231,7 @@ $response = $this->_createResponse($socket); return $response; } - + /** * Sends the headers. * @param SimpleSocket $socket Open socket. @@ -251,7 +251,7 @@ $socket->write("\r\n"); $encoding->writeTo($socket); } - + /** * Adds a header line to the request. * @param string $header_line Text of full header line. @@ -260,7 +260,7 @@ function addHeaderLine($header_line) { $this->_headers[] = $header_line; } - + /** * Reads all the relevant cookies from the * cookie jar. @@ -271,7 +271,7 @@ function readCookiesFromJar($jar, $url) { $this->_cookies = $jar->selectAsPairs($url); } - + /** * Wraps the socket in a response parser. * @param SimpleSocket $socket Responding socket. @@ -286,7 +286,7 @@ return $response; } } - + /** * Collection of header lines in the response. * @package SimpleTest @@ -301,7 +301,7 @@ protected $_cookies; protected $_authentication; protected $_realm; - + /** * Parses the incoming header block. * @param string $headers Header block. @@ -320,7 +320,7 @@ $this->_parseHeaderLine($header_line); } } - + /** * Accessor for parsed HTTP protocol version. * @return integer HTTP error code. @@ -329,7 +329,7 @@ function getHttpVersion() { return $this->_http_version; } - + /** * Accessor for raw header block. * @return string All headers as raw string. @@ -338,7 +338,7 @@ function getRaw() { return $this->_raw_headers; } - + /** * Accessor for parsed HTTP error code. * @return integer HTTP error code. @@ -347,7 +347,7 @@ function getResponseCode() { return (integer)$this->_response_code; } - + /** * Returns the redirected URL or false if * no redirection. @@ -357,7 +357,7 @@ function getLocation() { return $this->_location; } - + /** * Test to see if the response is a valid redirect. * @return boolean True if valid redirect. @@ -367,7 +367,7 @@ return in_array($this->_response_code, array(301, 302, 303, 307)) && (boolean)$this->getLocation(); } - + /** * Test to see if the response is an authentication * challenge. @@ -379,7 +379,7 @@ (boolean)$this->_authentication && (boolean)$this->_realm; } - + /** * Accessor for MIME type header information. * @return string MIME type. @@ -388,7 +388,7 @@ function getMimeType() { return $this->_mime_type; } - + /** * Accessor for authentication type. * @return string Type. @@ -397,7 +397,7 @@ function getAuthentication() { return $this->_authentication; } - + /** * Accessor for security realm. * @return string Realm. @@ -406,7 +406,7 @@ function getRealm() { return $this->_realm; } - + /** * Writes new cookies to the cookie jar. * @param SimpleCookieJar $jar Jar to write to. @@ -449,7 +449,7 @@ $this->_realm = trim($matches[2]); } } - + /** * Parse the Set-cookie content. * @param string $cookie_line Text after "Set-cookie:" @@ -472,7 +472,7 @@ isset($cookie["expires"]) ? $cookie["expires"] : false); } } - + /** * Basic HTTP response. * @package SimpleTest @@ -484,7 +484,7 @@ protected $_sent; protected $_content; protected $_headers; - + /** * Constructor. Reads and parses the incoming * content and headers. @@ -507,7 +507,7 @@ } $this->_parse($raw); } - + /** * Splits up the headers and the rest of the content. * @param string $raw Content to parse. @@ -525,7 +525,7 @@ $this->_headers = new SimpleHttpHeaders($headers); } } - + /** * Original request method. * @return string GET, POST or HEAD. @@ -534,7 +534,7 @@ function getMethod() { return $this->_encoding->getMethod(); } - + /** * Resource name. * @return SimpleUrl Current url. @@ -543,7 +543,7 @@ function getUrl() { return $this->_url; } - + /** * Original request data. * @return mixed Sent content. @@ -552,7 +552,7 @@ function getRequestData() { return $this->_encoding; } - + /** * Raw request that was sent down the wire. * @return string Bytes actually sent. @@ -561,7 +561,7 @@ function getSent() { return $this->_sent; } - + /** * Accessor for the content after the last * header line. @@ -571,7 +571,7 @@ function getContent() { return $this->_content; } - + /** * Accessor for header block. The response is the * combination of this and the content. @@ -581,7 +581,7 @@ function getHeaders() { return $this->_headers; } - + /** * Accessor for any new cookies. * @return array List of new cookies. @@ -590,7 +590,7 @@ function getNewCookies() { return $this->_headers->getNewCookies(); } - + /** * Reads the whole of the socket output into a * single string. @@ -606,7 +606,7 @@ } return $all; } - + /** * Test to see if the packet from the socket is the * last one. @@ -620,5 +620,4 @@ } return ! $packet; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/invoker.php b/tests/test_tools/simpletest/invoker.php index d5bf4996..dfe9263c 100644 --- a/tests/test_tools/simpletest/invoker.php +++ b/tests/test_tools/simpletest/invoker.php @@ -136,4 +136,3 @@ $this->_invoker->after($method); } } -?> diff --git a/tests/test_tools/simpletest/mock_objects.php b/tests/test_tools/simpletest/mock_objects.php index 1636600e..b63d1760 100644 --- a/tests/test_tools/simpletest/mock_objects.php +++ b/tests/test_tools/simpletest/mock_objects.php @@ -1269,5 +1269,4 @@ } return $code; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/options.php b/tests/test_tools/simpletest/options.php index da4d8b2f..23008ff9 100644 --- a/tests/test_tools/simpletest/options.php +++ b/tests/test_tools/simpletest/options.php @@ -363,4 +363,3 @@ return array(); } } -?> diff --git a/tests/test_tools/simpletest/page.php b/tests/test_tools/simpletest/page.php index eeae0cc9..7d0ac7b8 100644 --- a/tests/test_tools/simpletest/page.php +++ b/tests/test_tools/simpletest/page.php @@ -128,7 +128,7 @@ function SimplePageBuilder() { $this->SimpleSaxListener(); } - + /** * Frees up any references so as to allow the PHP garbage * collection from unset() to work. @@ -177,7 +177,7 @@ $parser = new SimpleHtmlSaxParser($listener); return $parser; } - + /** * Start of element event. Opens a new tag. * @param string $name Element name. @@ -972,4 +972,3 @@ return null; } } -?> diff --git a/tests/test_tools/simpletest/parser.php b/tests/test_tools/simpletest/parser.php index d6c10579..94fd40d0 100644 --- a/tests/test_tools/simpletest/parser.php +++ b/tests/test_tools/simpletest/parser.php @@ -769,5 +769,4 @@ */ function addContent($text) { } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reflection_php4.php b/tests/test_tools/simpletest/reflection_php4.php index 4af685ec..df9c76cc 100644 --- a/tests/test_tools/simpletest/reflection_php4.php +++ b/tests/test_tools/simpletest/reflection_php4.php @@ -111,5 +111,4 @@ function getSignature($method) { return "function $method()"; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reflection_php5.php b/tests/test_tools/simpletest/reflection_php5.php index 58a30856..6d2ad360 100644 --- a/tests/test_tools/simpletest/reflection_php5.php +++ b/tests/test_tools/simpletest/reflection_php5.php @@ -124,7 +124,7 @@ } return array_unique($methods); } - + /** * Checks to see if the method signature has to be tightly * specified. @@ -207,7 +207,7 @@ } return "function $name()"; } - + /** * For a signature specified in an interface, full * details must be replicated to be a valid implementation. @@ -271,5 +271,4 @@ } return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/remote.php b/tests/test_tools/simpletest/remote.php index 7e6898cb..1868733d 100644 --- a/tests/test_tools/simpletest/remote.php +++ b/tests/test_tools/simpletest/remote.php @@ -23,7 +23,7 @@ protected $_url; protected $_dry_url; protected $_size; - + /** * Sets the location of the remote test. * @param string $url Test location. @@ -35,7 +35,7 @@ $this->_dry_url = $dry_url ? $dry_url : $url; $this->_size = false; } - + /** * Accessor for the test name for subclasses. * @return string Name of the test. @@ -67,7 +67,7 @@ } return true; } - + /** * Creates a new web browser object for fetching * the XML report. @@ -77,7 +77,7 @@ function &_createBrowser() { return new SimpleBrowser(); } - + /** * Creates the XML parser. * @param SimpleReporter $reporter Target of test results. @@ -87,7 +87,7 @@ function &_createParser($reporter) { return new SimpleTestXmlParser($reporter); } - + /** * Accessor for the number of subtests. * @return integer Number of test cases. @@ -111,5 +111,4 @@ } return $this->_size; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reporter.php b/tests/test_tools/simpletest/reporter.php index c8c1639d..a6b5a85a 100644 --- a/tests/test_tools/simpletest/reporter.php +++ b/tests/test_tools/simpletest/reporter.php @@ -363,5 +363,4 @@ $this->_within_test_case = false; } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/runner.php b/tests/test_tools/simpletest/runner.php index 57939f7a..d7303895 100644 --- a/tests/test_tools/simpletest/runner.php +++ b/tests/test_tools/simpletest/runner.php @@ -5,7 +5,7 @@ * @subpackage UnitTester * @version $Id: runner.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * Includes SimpleTest files and defined the root constant * for dependent libraries. @@ -19,7 +19,7 @@ define('SIMPLE_TEST', dirname(__FILE__) . '/'); } /**#@-*/ - + /** * This is called by the class runner to run a * single test method. Will also run the setUp() @@ -29,7 +29,7 @@ */ class SimpleInvoker { protected $_test_case; - + /** * Stashes the test case for later. * @param SimpleTestCase $test_case Test case to run. @@ -37,7 +37,7 @@ function SimpleInvoker($test_case) { $this->_test_case = $test_case; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -46,7 +46,7 @@ function getTestCase() { return $this->_test_case; } - + /** * Invokes a test method and buffered with setUp() * and tearDown() calls. @@ -59,7 +59,7 @@ $this->_test_case->tearDown(); } } - + /** * Do nothing decorator. Just passes the invocation * straight through. @@ -68,7 +68,7 @@ */ class SimpleInvokerDecorator { protected $_invoker; - + /** * Stores the invoker to wrap. * @param SimpleInvoker $invoker Test method runner. @@ -76,7 +76,7 @@ function SimpleInvokerDecorator($invoker) { $this->_invoker = $invoker; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -85,7 +85,7 @@ function getTestCase() { return $this->_invoker->getTestCase(); } - + /** * Invokes a test method and buffered with setUp() * and tearDown() calls. @@ -103,7 +103,7 @@ * @subpackage UnitTester */ class SimpleErrorTrappingInvoker extends SimpleInvokerDecorator { - + /** /** * Stores the invoker to wrap. @@ -112,7 +112,7 @@ function SimpleErrorTrappingInvoker($invoker) { $this->SimpleInvokerDecorator($invoker); } - + /** * Invokes a test method and dispatches any * untrapped errors. Called back from @@ -142,7 +142,7 @@ class SimpleRunner { protected $_test_case; protected $_scorer; - + /** * Takes in the test case and reporter to mediate between. * @param SimpleTestCase $test_case Test case to run. @@ -152,7 +152,7 @@ $this->_test_case = $test_case; $this->_scorer = $scorer; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -161,7 +161,7 @@ function getTestCase() { return $this->_test_case; } - + /** * Runs the test methods in the test case. * @param SimpleTest $test_case Test case to run test on. @@ -185,7 +185,7 @@ $this->_scorer->paintMethodEnd($method); } } - + /** * Tests to see if the method is the constructor and * so should be ignored. @@ -198,7 +198,7 @@ $this->_test_case, strtolower($method)); } - + /** * Tests to see if the method is a test that should * be run. Currently any method that starts with 'test' @@ -219,7 +219,7 @@ function paintMethodStart($test_name) { $this->_scorer->paintMethodStart($test_name); } - + /** * Paints the end of a test method. * @param string $test_name Name of test or other label. @@ -228,7 +228,7 @@ function paintMethodEnd($test_name) { $this->_scorer->paintMethodEnd($test_name); } - + /** * Chains to the wrapped reporter. * @param string $message Message is ignored. @@ -237,7 +237,7 @@ function paintPass($message) { $this->_scorer->paintPass($message); } - + /** * Chains to the wrapped reporter. * @param string $message Message is ignored. @@ -246,7 +246,7 @@ function paintFail($message) { $this->_scorer->paintFail($message); } - + /** * Chains to the wrapped reporter. * @param string $message Text of error formatted by @@ -256,7 +256,7 @@ function paintError($message) { $this->_scorer->paintError($message); } - + /** * Chains to the wrapped reporter. * @param Exception $exception Object thrown. @@ -265,7 +265,7 @@ function paintException($exception) { $this->_scorer->paintException($exception); } - + /** * Chains to the wrapped reporter. * @param string $message Text to display. @@ -274,7 +274,7 @@ function paintMessage($message) { $this->_scorer->paintMessage($message); } - + /** * Chains to the wrapped reporter. * @param string $message Text to display. @@ -283,7 +283,7 @@ function paintFormattedMessage($message) { $this->_scorer->paintFormattedMessage($message); } - + /** * Chains to the wrapped reporter. * @param string $type Event type as text. @@ -297,4 +297,3 @@ $this->_scorer->paintSignal($type, $payload); } } -?> diff --git a/tests/test_tools/simpletest/scorer.php b/tests/test_tools/simpletest/scorer.php index 2c81c954..48b7162b 100644 --- a/tests/test_tools/simpletest/scorer.php +++ b/tests/test_tools/simpletest/scorer.php @@ -773,5 +773,4 @@ $this->_reporters[$i]->paintSignal($type, $payload); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/selector.php b/tests/test_tools/simpletest/selector.php index 901815ad..6af21ff6 100644 --- a/tests/test_tools/simpletest/selector.php +++ b/tests/test_tools/simpletest/selector.php @@ -129,5 +129,4 @@ } return ($widget->getName() == $this->_label); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/shell_tester.php b/tests/test_tools/simpletest/shell_tester.php index 5719e9d3..5ac6013d 100644 --- a/tests/test_tools/simpletest/shell_tester.php +++ b/tests/test_tools/simpletest/shell_tester.php @@ -127,7 +127,7 @@ $shell = $this->_getShell(); return $shell->getOutputAsList(); } - + /** * Will trigger a pass if the two parameters have * the same value only. Otherwise a fail. This @@ -144,7 +144,7 @@ $second, $message); } - + /** * Will trigger a pass if the two parameters have * a different value. Otherwise a fail. This @@ -302,5 +302,4 @@ $shell = new SimpleShell(); return $shell; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/simple_test.php b/tests/test_tools/simpletest/simple_test.php index 3bb1d40e..cc39a08b 100644 --- a/tests/test_tools/simpletest/simple_test.php +++ b/tests/test_tools/simpletest/simple_test.php @@ -550,4 +550,3 @@ return 0; } } -?> diff --git a/tests/test_tools/simpletest/simpletest.php b/tests/test_tools/simpletest/simpletest.php index f859ac0f..df1536ac 100644 --- a/tests/test_tools/simpletest/simpletest.php +++ b/tests/test_tools/simpletest/simpletest.php @@ -278,5 +278,4 @@ function getDefaultProxyPassword() { return Simpletest::getDefaultProxyPassword(); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/socket.php b/tests/test_tools/simpletest/socket.php index 7b47aa9c..cfeed48a 100644 --- a/tests/test_tools/simpletest/socket.php +++ b/tests/test_tools/simpletest/socket.php @@ -212,5 +212,4 @@ function _openSocket($host, $port, $error_number, $error, $timeout) { return parent::_openSocket("tls://$host", $port, $error_number, $error, $timeout); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/tag.php b/tests/test_tools/simpletest/tag.php index 5d8de890..46fb740a 100644 --- a/tests/test_tools/simpletest/tag.php +++ b/tests/test_tools/simpletest/tag.php @@ -5,14 +5,14 @@ * @subpackage WebTester * @version $Id: tag.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include SimpleTest files */ require_once(dirname(__FILE__) . '/parser.php'); require_once(dirname(__FILE__) . '/encoding.php'); /**#@-*/ - + /** * HTML or XML tag. * @package SimpleTest @@ -22,7 +22,7 @@ protected $_name; protected $_attributes; protected $_content; - + /** * Starts with a named tag with attributes only. * @param string $name Tag name. @@ -36,7 +36,7 @@ $this->_attributes = $attributes; $this->_content = ''; } - + /** * Check to see if the tag can have both start and * end tags with content in between. @@ -46,7 +46,7 @@ function expectEndTag() { return true; } - + /** * The current tag should not swallow all content for * itself as it's searchable page content. Private @@ -68,7 +68,7 @@ function addContent($content) { $this->_content .= (string)$content; } - + /** * Adds an enclosed tag to the content. * @param SimpleTag $tag New tag. @@ -76,7 +76,7 @@ */ function addTag($tag) { } - + /** * Accessor for tag name. * @return string Name of tag. @@ -85,7 +85,7 @@ function getTagName() { return $this->_name; } - + /** * List of legal child elements. * @return array List of element names. @@ -94,7 +94,7 @@ function getChildElements() { return array(); } - + /** * Accessor for an attribute. * @param string $label Attribute name. @@ -108,7 +108,7 @@ } return (string)$this->_attributes[$label]; } - + /** * Sets an attribute. * @param string $label Attribute name. @@ -118,7 +118,7 @@ function _setAttribute($label, $value) { $this->_attributes[strtolower($label)] = $value; } - + /** * Accessor for the whole content so far. * @return string Content as big raw string. @@ -127,7 +127,7 @@ function getContent() { return $this->_content; } - + /** * Accessor for content reduced to visible text. Acts * like a text mode browser, normalising space and @@ -138,7 +138,7 @@ function getText() { return SimpleHtmlSaxParser::normalise($this->_content); } - + /** * Test to see if id attribute matches. * @param string $id ID to test against. @@ -149,14 +149,14 @@ return ($this->getAttribute('id') == $id); } } - + /** * Page title. * @package SimpleTest * @subpackage WebTester */ class SimpleTitleTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -166,14 +166,14 @@ $this->SimpleTag('title', $attributes); } } - + /** * Link. * @package SimpleTest * @subpackage WebTester */ class SimpleAnchorTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -182,7 +182,7 @@ function SimpleAnchorTag($attributes) { $this->SimpleTag('a', $attributes); } - + /** * Accessor for URL as string. * @return string Coerced as string. @@ -196,7 +196,7 @@ return $url; } } - + /** * Form element. * @package SimpleTest @@ -206,7 +206,7 @@ protected $_value; protected $_label; protected $_is_set; - + /** * Starts with a named tag with attributes only. * @param string $name Tag name. @@ -219,7 +219,7 @@ $this->_label = false; $this->_is_set = false; } - + /** * Accessor for name submitted as the key in * GET/POST variables hash. @@ -229,7 +229,7 @@ function getName() { return $this->getAttribute('name'); } - + /** * Accessor for default value parsed with the tag. * @return string Parsed value. @@ -238,7 +238,7 @@ function getDefault() { return $this->getAttribute('value'); } - + /** * Accessor for currently set value or default if * none. @@ -252,7 +252,7 @@ } return $this->_value; } - + /** * Sets the current form element value. * @param string $value New value. @@ -264,7 +264,7 @@ $this->_is_set = true; return true; } - + /** * Resets the form element value back to the * default. @@ -273,7 +273,7 @@ function resetValue() { $this->_is_set = false; } - + /** * Allows setting of a label externally, say by a * label tag. @@ -283,7 +283,7 @@ function setLabel($label) { $this->_label = trim($label); } - + /** * Reads external or internal label. * @param string $label Label to test. @@ -293,7 +293,7 @@ function isLabel($label) { return $this->_label == trim($label); } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -305,14 +305,14 @@ } } } - + /** * Text, password and hidden field. * @package SimpleTest * @subpackage WebTester */ class SimpleTextTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -324,7 +324,7 @@ $this->_setAttribute('value', ''); } } - + /** * Tag contains no content. * @return boolean False. @@ -333,7 +333,7 @@ function expectEndTag() { return false; } - + /** * Sets the current form element value. Cannot * change the value of a hidden field. @@ -348,14 +348,14 @@ return parent::setValue($value); } } - + /** * Submit button as input tag. * @package SimpleTest * @subpackage WebTester */ class SimpleSubmitTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -367,7 +367,7 @@ $this->_setAttribute('value', 'Submit'); } } - + /** * Tag contains no end element. * @return boolean False. @@ -376,7 +376,7 @@ function expectEndTag() { return false; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -386,7 +386,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -395,7 +395,7 @@ function getLabel() { return $this->getValue(); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -406,14 +406,14 @@ return trim($label) == trim($this->getLabel()); } } - + /** * Image button as input tag. * @package SimpleTest * @subpackage WebTester */ class SimpleImageSubmitTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -422,7 +422,7 @@ function SimpleImageSubmitTag($attributes) { $this->SimpleWidget('input', $attributes); } - + /** * Tag contains no end element. * @return boolean False. @@ -431,7 +431,7 @@ function expectEndTag() { return false; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -441,7 +441,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -453,7 +453,7 @@ } return $this->getAttribute('alt'); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -463,7 +463,7 @@ function isLabel($label) { return trim($label) == trim($this->getLabel()); } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -481,14 +481,14 @@ } } } - + /** * Submit button as button tag. * @package SimpleTest * @subpackage WebTester */ class SimpleButtonTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * Defaults are very browser dependent. @@ -498,7 +498,7 @@ function SimpleButtonTag($attributes) { $this->SimpleWidget('button', $attributes); } - + /** * Check to see if the tag can have both start and * end tags with content in between. @@ -508,7 +508,7 @@ function expectEndTag() { return true; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -518,7 +518,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -527,7 +527,7 @@ function getLabel() { return $this->getContent(); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -538,14 +538,14 @@ return trim($label) == trim($this->getLabel()); } } - + /** * Content tag for text area. * @package SimpleTest * @subpackage WebTester */ class SimpleTextAreaTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -554,7 +554,7 @@ function SimpleTextAreaTag($attributes) { $this->SimpleWidget('textarea', $attributes); } - + /** * Accessor for starting value. * @return string Parsed value. @@ -563,7 +563,7 @@ function getDefault() { return $this->_wrap(SimpleHtmlSaxParser::decodeHtml($this->getContent())); } - + /** * Applies word wrapping if needed. * @param string $value New value. @@ -573,7 +573,7 @@ function setValue($value) { return parent::setValue($this->_wrap($value)); } - + /** * Test to see if text should be wrapped. * @return boolean True if wrapping on. @@ -588,7 +588,7 @@ } return false; } - + /** * Performs the formatting that is peculiar to * this tag. There is strange behaviour in this @@ -613,7 +613,7 @@ } return $text; } - + /** * The content of textarea is not part of the page. * @return boolean True. @@ -623,14 +623,14 @@ return true; } } - + /** * File upload widget. * @package SimpleTest * @subpackage WebTester */ class SimpleUploadTag extends SimpleWidget { - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -639,7 +639,7 @@ function SimpleUploadTag($attributes) { $this->SimpleWidget('input', $attributes); } - + /** * Tag contains no content. * @return boolean False. @@ -648,7 +648,7 @@ function expectEndTag() { return false; } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -664,7 +664,7 @@ basename($this->getValue())); } } - + /** * Drop down widget. * @package SimpleTest @@ -673,7 +673,7 @@ class SimpleSelectionTag extends SimpleWidget { protected $_options; protected $_choice; - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -684,7 +684,7 @@ $this->_options = array(); $this->_choice = false; } - + /** * Adds an option tag to a selection field. * @param SimpleOptionTag $tag New option. @@ -695,7 +695,7 @@ $this->_options[] = $tag; } } - + /** * Text within the selection element is ignored. * @param string $content Ignored. @@ -703,7 +703,7 @@ */ function addContent($content) { } - + /** * Scans options for defaults. If none, then * the first option is selected. @@ -721,7 +721,7 @@ } return ''; } - + /** * Can only set allowed values. * @param string $value New choice. @@ -737,7 +737,7 @@ } return false; } - + /** * Accessor for current selection value. * @return string Value attribute or @@ -751,7 +751,7 @@ return $this->_options[$this->_choice]->getValue(); } } - + /** * Drop down widget. * @package SimpleTest @@ -760,7 +760,7 @@ class MultipleSelectionTag extends SimpleWidget { protected $_options; protected $_values; - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -771,7 +771,7 @@ $this->_options = array(); $this->_values = false; } - + /** * Adds an option tag to a selection field. * @param SimpleOptionTag $tag New option. @@ -782,7 +782,7 @@ $this->_options[] = $tag; } } - + /** * Text within the selection element is ignored. * @param string $content Ignored. @@ -790,7 +790,7 @@ */ function addContent($content) { } - + /** * Scans options for defaults to populate the * value array(). @@ -806,7 +806,7 @@ } return $default; } - + /** * Can only set allowed values. Any illegal value * will result in a failure, but all correct values @@ -833,7 +833,7 @@ $this->_values = $achieved; return true; } - + /** * Accessor for current selection value. * @return array List of currently set options. @@ -846,21 +846,21 @@ return $this->_values; } } - + /** * Option for selection field. * @package SimpleTest * @subpackage WebTester */ class SimpleOptionTag extends SimpleWidget { - + /** * Stashes the attributes. */ function SimpleOptionTag($attributes) { $this->SimpleWidget('option', $attributes); } - + /** * Does nothing. * @param string $value Ignored. @@ -870,7 +870,7 @@ function setValue($value) { return false; } - + /** * Test to see if a value matches the option. * @param string $compare Value to compare with. @@ -884,7 +884,7 @@ } return trim($this->getContent()) == $compare; } - + /** * Accessor for starting value. Will be set to * the option label if no value exists. @@ -897,7 +897,7 @@ } return $this->getAttribute('value'); } - + /** * The content of options is not part of the page. * @return boolean True. @@ -907,14 +907,14 @@ return true; } } - + /** * Radio button. * @package SimpleTest * @subpackage WebTester */ class SimpleRadioButtonTag extends SimpleWidget { - + /** * Stashes the attributes. * @param array $attributes Hash of attributes. @@ -925,7 +925,7 @@ $this->_setAttribute('value', 'on'); } } - + /** * Tag contains no content. * @return boolean False. @@ -934,7 +934,7 @@ function expectEndTag() { return false; } - + /** * The only allowed value sn the one in the * "value" attribute. @@ -951,7 +951,7 @@ } return parent::setValue($value); } - + /** * Accessor for starting value. * @return string Parsed value. @@ -964,14 +964,14 @@ return false; } } - + /** * Checkbox widget. * @package SimpleTest * @subpackage WebTester */ class SimpleCheckboxTag extends SimpleWidget { - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -983,7 +983,7 @@ $this->_setAttribute('value', 'on'); } } - + /** * Tag contains no content. * @return boolean False. @@ -992,7 +992,7 @@ function expectEndTag() { return false; } - + /** * The only allowed value in the one in the * "value" attribute. The default for this @@ -1014,7 +1014,7 @@ } return parent::setValue($value); } - + /** * Accessor for starting value. The default * value is "on". @@ -1028,7 +1028,7 @@ return false; } } - + /** * A group of multiple widgets with some shared behaviour. * @package SimpleTest @@ -1045,7 +1045,7 @@ function addWidget($widget) { $this->_widgets[] = $widget; } - + /** * Accessor to widget set. * @return array All widgets. @@ -1064,7 +1064,7 @@ function getAttribute($label) { return false; } - + /** * Fetches the name for the widget from the first * member. @@ -1076,7 +1076,7 @@ return $this->_widgets[0]->getName(); } } - + /** * Scans the widgets for one with the appropriate * ID field. @@ -1092,7 +1092,7 @@ } return false; } - + /** * Scans the widgets for one with the appropriate * attached label. @@ -1108,7 +1108,7 @@ } return false; } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -1125,7 +1125,7 @@ * @subpackage WebTester */ class SimpleCheckboxGroup extends SimpleTagGroup { - + /** * Accessor for current selected widget or false * if none. @@ -1142,7 +1142,7 @@ } return $this->_coerceValues($values); } - + /** * Accessor for starting value that is active. * @return string/array Widget values or false if none. @@ -1158,7 +1158,7 @@ } return $this->_coerceValues($values); } - + /** * Accessor for current set values. * @param string/array/boolean $values Either a single string, a @@ -1182,7 +1182,7 @@ } return true; } - + /** * Tests to see if a possible value set is legal. * @param string/array/boolean $values Either a single string, a @@ -1202,7 +1202,7 @@ } return ($values == $matches); } - + /** * Converts the output to an appropriate format. This means * that no values is false, a single value is just that @@ -1220,7 +1220,7 @@ return $values; } } - + /** * Converts false or string into array. The opposite of * the coercian method. @@ -1248,7 +1248,7 @@ * @subpackage WebTester */ class SimpleRadioGroup extends SimpleTagGroup { - + /** * Each tag is tried in turn until one is * successfully set. The others will be @@ -1270,7 +1270,7 @@ } return true; } - + /** * Tests to see if a value is allowed. * @param string Attempted value. @@ -1286,7 +1286,7 @@ } return false; } - + /** * Accessor for current selected widget or false * if none. @@ -1303,7 +1303,7 @@ } return false; } - + /** * Accessor for starting value that is active. * @return string/boolean Value of first checked @@ -1320,14 +1320,14 @@ return false; } } - + /** * Tag to keep track of labels. * @package SimpleTest * @subpackage WebTester */ class SimpleLabelTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1336,7 +1336,7 @@ function SimpleLabelTag($attributes) { $this->SimpleTag('label', $attributes); } - + /** * Access for the ID to attach the label to. * @return string For attribute. @@ -1346,14 +1346,14 @@ return $this->getAttribute('for'); } } - + /** * Tag to aid parsing the form. * @package SimpleTest * @subpackage WebTester */ class SimpleFormTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1363,14 +1363,14 @@ $this->SimpleTag('form', $attributes); } } - + /** * Tag to aid parsing the frames in a page. * @package SimpleTest * @subpackage WebTester */ class SimpleFrameTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1379,7 +1379,7 @@ function SimpleFrameTag($attributes) { $this->SimpleTag('frame', $attributes); } - + /** * Tag contains no content. * @return boolean False. @@ -1388,5 +1388,4 @@ function expectEndTag() { return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/test_case.php b/tests/test_tools/simpletest/test_case.php index 91a356d8..74253d80 100644 --- a/tests/test_tools/simpletest/test_case.php +++ b/tests/test_tools/simpletest/test_case.php @@ -687,4 +687,3 @@ return 0; } } -?> diff --git a/tests/test_tools/simpletest/unit_tester.php b/tests/test_tools/simpletest/unit_tester.php index 7a382b5f..672a3050 100644 --- a/tests/test_tools/simpletest/unit_tester.php +++ b/tests/test_tools/simpletest/unit_tester.php @@ -370,4 +370,3 @@ return $this->assertError(new PatternExpectation($pattern), $message); } } -?> diff --git a/tests/test_tools/simpletest/url.php b/tests/test_tools/simpletest/url.php index b208d1b3..dedc6a9b 100644 --- a/tests/test_tools/simpletest/url.php +++ b/tests/test_tools/simpletest/url.php @@ -521,5 +521,4 @@ static function getAllTopLevelDomains() { return 'com|edu|net|org|gov|mil|int|biz|info|name|pro|aero|coop|museum'; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/user_agent.php b/tests/test_tools/simpletest/user_agent.php index a901e6d4..161a1b68 100644 --- a/tests/test_tools/simpletest/user_agent.php +++ b/tests/test_tools/simpletest/user_agent.php @@ -14,11 +14,11 @@ require_once(dirname(__FILE__) . '/encoding.php'); require_once(dirname(__FILE__) . '/authentication.php'); /**#@-*/ - + if (! defined('DEFAULT_MAX_REDIRECTS')) { define('DEFAULT_MAX_REDIRECTS', 3); } - + if (! defined('DEFAULT_CONNECTION_TIMEOUT')) { define('DEFAULT_CONNECTION_TIMEOUT', 15); } @@ -39,7 +39,7 @@ protected $_proxy_password = false; protected $_connection_timeout = DEFAULT_CONNECTION_TIMEOUT; protected $_additional_headers = array(); - + /** * Starts with no cookies, realms or proxies. * @access public @@ -48,7 +48,7 @@ $this->_cookie_jar = new SimpleCookieJar(); $this->_authenticator = new SimpleAuthenticator(); } - + /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. Authorisation @@ -62,7 +62,7 @@ $this->_cookie_jar->restartSession($date); $this->_authenticator->restartSession(); } - + /** * Adds a header to every fetch. * @param string $header Header line to add to every @@ -72,7 +72,7 @@ function addHeader($header) { $this->_additional_headers[] = $header; } - + /** * Ages the cookies by the specified time. * @param integer $interval Amount in seconds. @@ -81,7 +81,7 @@ function ageCookies($interval) { $this->_cookie_jar->agePrematurely($interval); } - + /** * Sets an additional cookie. If a cookie has * the same name and path it is replaced. @@ -95,7 +95,7 @@ function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { $this->_cookie_jar->setCookie($name, $value, $host, $path, $expiry); } - + /** * Reads the most specific cookie value from the * browser cookies. @@ -109,7 +109,7 @@ function getCookieValue($host, $path, $name) { return $this->_cookie_jar->getCookieValue($host, $path, $name); } - + /** * Reads the current cookies within the base URL. * @param string $name Key of cookie to find. @@ -124,7 +124,7 @@ } return $this->getCookieValue($base->getHost(), $base->getPath(), $name); } - + /** * Switches off cookie sending and recieving. * @access public @@ -132,7 +132,7 @@ function ignoreCookies() { $this->_cookies_enabled = false; } - + /** * Switches back on the cookie sending and recieving. * @access public @@ -140,7 +140,7 @@ function useCookies() { $this->_cookies_enabled = true; } - + /** * Sets the socket timeout for opening a connection. * @param integer $timeout Maximum time in seconds. @@ -149,7 +149,7 @@ function setConnectionTimeout($timeout) { $this->_connection_timeout = $timeout; } - + /** * Sets the maximum number of redirects before * a page will be loaded anyway. @@ -159,7 +159,7 @@ function setMaximumRedirects($max) { $this->_max_redirects = $max; } - + /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL @@ -181,7 +181,7 @@ $this->_proxy_username = $username; $this->_proxy_password = $password; } - + /** * Test to see if the redirect limit is passed. * @param integer $redirects Count so far. @@ -191,7 +191,7 @@ function _isTooManyRedirects($redirects) { return ($redirects > $this->_max_redirects); } - + /** * Sets the identity for the current realm. * @param string $host Host to which realm applies. @@ -203,7 +203,7 @@ function setIdentity($host, $realm, $username, $password) { $this->_authenticator->setIdentityForRealm($host, $realm, $username, $password); } - + /** * Fetches a URL as a response object. Will keep trying if redirected. * It will also collect authentication realm information. @@ -228,7 +228,7 @@ } return $response; } - + /** * Fetches the page until no longer redirected or * until the redirect limit runs out. @@ -257,7 +257,7 @@ } while (! $this->_isTooManyRedirects(++$redirects)); return $response; } - + /** * Actually make the web request. * @param SimpleUrl $url Target to fetch. @@ -270,7 +270,7 @@ $response = $request->fetch($this->_connection_timeout); return $response; } - + /** * Creates a full page request. * @param SimpleUrl $url Target to fetch as url object. @@ -287,7 +287,7 @@ $this->_authenticator->addHeaders($request, $url); return $request; } - + /** * Builds the appropriate HTTP request object. * @param SimpleUrl $url Target to fetch as url object. @@ -299,7 +299,7 @@ $request = new SimpleHttpRequest($this->_createRoute($url), $encoding); return $request; } - + /** * Sets up either a direct route or via a proxy. * @param SimpleUrl $url Target to fetch as url object. @@ -318,7 +318,7 @@ } return $route; } - + /** * Adds additional manual headers. * @param SimpleHttpRequest $request Outgoing request. @@ -329,5 +329,4 @@ $request->addHeaderLine($header); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/web_tester.php b/tests/test_tools/simpletest/web_tester.php index c582a6ff..c6a48110 100644 --- a/tests/test_tools/simpletest/web_tester.php +++ b/tests/test_tools/simpletest/web_tester.php @@ -14,7 +14,7 @@ require_once(dirname(__FILE__) . '/page.php'); require_once(dirname(__FILE__) . '/expectation.php'); /**#@-*/ - + /** * Test for an HTML widget value match. * @package SimpleTest @@ -22,7 +22,7 @@ */ class FieldExpectation extends SimpleExpectation { protected $_value; - + /** * Sets the field value to compare against. * @param mixed $value Test value to match. Can be an @@ -38,7 +38,7 @@ } $this->_value = $value; } - + /** * Tests the expectation. True if it matches * a string value or an array value in any order. @@ -59,7 +59,7 @@ } return false; } - + /** * Tests for valid field comparisons with a single option. * @param mixed $value Value to type check. @@ -69,7 +69,7 @@ function _isSingle($value) { return is_string($value) || is_integer($value) || is_float($value); } - + /** * String comparison for simple field with a single option. * @param mixed $compare String to test against. @@ -85,7 +85,7 @@ } return ($this->_value == $compare); } - + /** * List comparison for multivalue field. * @param mixed $compare List in any order to test against. @@ -102,7 +102,7 @@ sort($compare); return ($this->_value === $compare); } - + /** * Returns a human readable test message. * @param mixed $compare Comparison value. @@ -125,7 +125,7 @@ } } } - + /** * Test for a specific HTTP header within a header block. * @package SimpleTest @@ -134,7 +134,7 @@ class HttpHeaderExpectation extends SimpleExpectation { protected $_expected_header; protected $_expected_value; - + /** * Sets the field and value to compare against. * @param string $header Case insenstive trimmed header name. @@ -150,7 +150,7 @@ $this->_expected_header = $this->_normaliseHeader($header); $this->_expected_value = $value; } - + /** * Accessor for aggregated object. * @return mixed Expectation set in constructor. @@ -159,7 +159,7 @@ function _getExpectation() { return $this->_expected_value; } - + /** * Removes whitespace at ends and case variations. * @param string $header Name of header. @@ -170,7 +170,7 @@ function _normaliseHeader($header) { return strtolower(trim($header)); } - + /** * Tests the expectation. True if it matches * a string value or an array value in any order. @@ -181,7 +181,7 @@ function test($compare) { return is_string($this->_findHeader($compare)); } - + /** * Searches the incoming result. Will extract the matching * line as text. @@ -198,7 +198,7 @@ } return false; } - + /** * Compares a single header line against the expectation. * @param string $line A single line to compare. @@ -215,7 +215,7 @@ } return $this->_testHeaderValue($value, $this->_expected_value); } - + /** * Tests the value part of the header. * @param string $value Value to test. @@ -232,7 +232,7 @@ } return (trim($value) == trim($expected)); } - + /** * Returns a human readable test message. * @param mixed $compare Raw header block to search. @@ -254,7 +254,7 @@ } } } - + /** * Test for a specific HTTP header within a header block that * should not be found. @@ -264,7 +264,7 @@ class NoHttpHeaderExpectation extends HttpHeaderExpectation { protected $_expected_header; protected $_expected_value; - + /** * Sets the field and value to compare against. * @param string $unwanted Case insenstive trimmed header name. @@ -274,7 +274,7 @@ function NoHttpHeaderExpectation($unwanted, $message = '%s') { $this->HttpHeaderExpectation($unwanted, false, $message); } - + /** * Tests that the unwanted header is not found. * @param mixed $compare Raw header block to search. @@ -284,7 +284,7 @@ function test($compare) { return ($this->_findHeader($compare) === false); } - + /** * Returns a human readable test message. * @param mixed $compare Raw header block to search. @@ -301,7 +301,7 @@ } } } - + /** * Test for a text substring. * @package SimpleTest @@ -309,7 +309,7 @@ */ class TextExpectation extends SimpleExpectation { protected $_substring; - + /** * Sets the value to compare against. * @param string $substring Text to search for. @@ -320,7 +320,7 @@ $this->SimpleExpectation($message); $this->_substring = $substring; } - + /** * Accessor for the substring. * @return string Text to match. @@ -329,7 +329,7 @@ function _getSubstring() { return $this->_substring; } - + /** * Tests the expectation. True if the text contains the * substring. @@ -340,7 +340,7 @@ function test($compare) { return (strpos($compare, $this->_substring) !== false); } - + /** * Returns a human readable test message. * @param mixed $compare Comparison value. @@ -358,7 +358,7 @@ $dumper->describeValue($compare) . "]"; } } - + /** * Describes a pattern match including the string * found and it's position. @@ -374,7 +374,7 @@ $dumper->clipString($subject, 100, $position) . "]"; } } - + /** * Fail if a substring is detected within the * comparison text. @@ -382,7 +382,7 @@ * @subpackage UnitTester */ class NoTextExpectation extends TextExpectation { - + /** * Sets the reject pattern * @param string $substring Text to search for. @@ -392,7 +392,7 @@ function NoTextExpectation($substring, $message = '%s') { $this->TextExpectation($substring, $message); } - + /** * Tests the expectation. False if the substring appears * in the text. @@ -403,7 +403,7 @@ function test($compare) { return ! parent::test($compare); } - + /** * Returns a human readable test message. * @param string $compare Comparison value. @@ -422,7 +422,7 @@ } } } - + /** * Test case for testing of web pages. Allows * fetching of pages, parsing of HTML and @@ -433,7 +433,7 @@ class WebTestCase extends SimpleTestCase { protected $_browser; protected $_ignore_errors = false; - + /** * Creates an empty test case. Should be subclassed * with test methods for a functional test case. @@ -444,7 +444,7 @@ function WebTestCase($label = false) { $this->SimpleTestCase($label); } - + /** * Announces the start of the test. * @param string $method Test method just started. @@ -464,7 +464,7 @@ $this->unsetBrowser(); parent::after($method); } - + /** * Gets a current browser reference for setting * special expectations or for detailed @@ -475,7 +475,7 @@ function &getBrowser() { return $this->_browser; } - + /** * Gets a current browser reference for setting * special expectations or for detailed @@ -486,7 +486,7 @@ function setBrowser($browser) { return $this->_browser = $browser; } - + /** * Clears the current browser reference to help the * PHP garbage collector. @@ -495,7 +495,7 @@ function unsetBrowser() { unset($this->_browser); } - + /** * Creates a new default web browser object. * Will be cleared at the end of the test method. @@ -506,7 +506,7 @@ $browser = new SimpleBrowser(); return $browser; } - + /** * Gets the last response error. * @return string Last low level HTTP error. @@ -515,7 +515,7 @@ function getTransportError() { return $this->_browser->getTransportError(); } - + /** * Accessor for the currently selected URL. * @return string Current location or false if @@ -525,7 +525,7 @@ function getUrl() { return $this->_browser->getUrl(); } - + /** * Dumps the current request for debugging. * @access public @@ -533,7 +533,7 @@ function showRequest() { $this->dump($this->_browser->getRequest()); } - + /** * Dumps the current HTTP headers for debugging. * @access public @@ -541,7 +541,7 @@ function showHeaders() { $this->dump($this->_browser->getHeaders()); } - + /** * Dumps the current HTML source for debugging. * @access public @@ -549,7 +549,7 @@ function showSource() { $this->dump($this->_browser->getContent()); } - + /** * Dumps the visible text only for debugging. * @access public @@ -557,7 +557,7 @@ function showText() { $this->dump(wordwrap($this->_browser->getContentAsText(), 80)); } - + /** * Simulates the closing and reopening of the browser. * Temporary cookies will be discarded and timed @@ -575,7 +575,7 @@ } $this->_browser->restart($date); } - + /** * Moves cookie expiry times back into the past. * Useful for testing timeouts and expiries. @@ -585,7 +585,7 @@ function ageCookies($interval) { $this->_browser->ageCookies($interval); } - + /** * Disables frames support. Frames will not be fetched * and the frameset page will be used instead. @@ -594,7 +594,7 @@ function ignoreFrames() { $this->_browser->ignoreFrames(); } - + /** * Switches off cookie sending and recieving. * @access public @@ -602,7 +602,7 @@ function ignoreCookies() { $this->_browser->ignoreCookies(); } - + /** * Skips errors for the next request only. You might * want to confirm that a page is unreachable for @@ -612,7 +612,7 @@ function ignoreErrors() { $this->_ignore_errors = true; } - + /** * Issues a fail if there is a transport error anywhere * in the current frameset. Only one such error is @@ -640,7 +640,7 @@ function addHeader($header) { $this->_browser->addHeader($header); } - + /** * Sets the maximum number of redirects before * the web page is loaded regardless. @@ -654,7 +654,7 @@ } $this->_browser->setMaximumRedirects($max); } - + /** * Sets the socket timeout for opening a connection and * receiving at least one byte of information. @@ -664,7 +664,7 @@ function setConnectionTimeout($timeout) { $this->_browser->setConnectionTimeout($timeout); } - + /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL @@ -677,7 +677,7 @@ function useProxy($proxy, $username = false, $password = false) { $this->_browser->useProxy($proxy, $username, $password); } - + /** * Fetches a page into the page buffer. If * there is no base for the URL then the @@ -691,7 +691,7 @@ function get($url, $parameters = false) { return $this->_failOnError($this->_browser->get($url, $parameters)); } - + /** * Fetches a page by POST into the page buffer. * If there is no base for the URL then the @@ -705,7 +705,7 @@ function post($url, $parameters = false) { return $this->_failOnError($this->_browser->post($url, $parameters)); } - + /** * Does a HTTP HEAD fetch, fetching only the page * headers. The current base URL is unchanged by this. @@ -717,7 +717,7 @@ function head($url, $parameters = false) { return $this->_failOnError($this->_browser->head($url, $parameters)); } - + /** * Equivalent to hitting the retry button on the * browser. Will attempt to repeat the page fetch. @@ -727,7 +727,7 @@ function retry() { return $this->_failOnError($this->_browser->retry()); } - + /** * Equivalent to hitting the back button on the * browser. @@ -738,7 +738,7 @@ function back() { return $this->_failOnError($this->_browser->back()); } - + /** * Equivalent to hitting the forward button on the * browser. @@ -749,7 +749,7 @@ function forward() { return $this->_failOnError($this->_browser->forward()); } - + /** * Retries a request after setting the authentication * for the current realm. @@ -764,7 +764,7 @@ return $this->_failOnError( $this->_browser->authenticate($username, $password)); } - + /** * Gets the cookie value for the current browser context. * @param string $name Name of cookie. @@ -774,7 +774,7 @@ function getCookie($name) { return $this->_browser->getCurrentCookieValue($name); } - + /** * Sets a cookie in the current browser. * @param string $name Name of cookie. @@ -787,7 +787,7 @@ function setCookie($name, $value, $host = false, $path = "/", $expiry = false) { $this->_browser->setCookie($name, $value, $host, $path, $expiry); } - + /** * Accessor for current frame focus. Will be * false if no frame has focus. @@ -799,7 +799,7 @@ function getFrameFocus() { return $this->_browser->getFrameFocus(); } - + /** * Sets the focus by index. The integer index starts from 1. * @param integer $choice Chosen frame. @@ -809,7 +809,7 @@ function setFrameFocusByIndex($choice) { return $this->_browser->setFrameFocusByIndex($choice); } - + /** * Sets the focus by name. * @param string $name Chosen frame. @@ -819,7 +819,7 @@ function setFrameFocus($name) { return $this->_browser->setFrameFocus($name); } - + /** * Clears the frame focus. All frames will be searched * for content. @@ -828,7 +828,7 @@ function clearFrameFocus() { return $this->_browser->clearFrameFocus(); } - + /** * Clicks a visible text item. Will first try buttons, * then links and then images. @@ -839,7 +839,7 @@ function click($label) { return $this->_failOnError($this->_browser->click($label)); } - + /** * Clicks the submit button by label. The owning * form will be submitted by this. @@ -853,7 +853,7 @@ return $this->_failOnError( $this->_browser->clickSubmit($label, $additional)); } - + /** * Clicks the submit button by name attribute. The owning * form will be submitted by this. @@ -866,7 +866,7 @@ return $this->_failOnError( $this->_browser->clickSubmitByName($name, $additional)); } - + /** * Clicks the submit button by ID attribute. The owning * form will be submitted by this. @@ -879,7 +879,7 @@ return $this->_failOnError( $this->_browser->clickSubmitById($id, $additional)); } - + /** * Clicks the submit image by some kind of label. Usually * the alt tag or the nearest equivalent. The owning @@ -897,7 +897,7 @@ return $this->_failOnError( $this->_browser->clickImage($label, $x, $y, $additional)); } - + /** * Clicks the submit image by the name. Usually * the alt tag or the nearest equivalent. The owning @@ -915,7 +915,7 @@ return $this->_failOnError( $this->_browser->clickImageByName($name, $x, $y, $additional)); } - + /** * Clicks the submit image by ID attribute. The owning * form will be submitted by this. Clicking outside of @@ -932,7 +932,7 @@ return $this->_failOnError( $this->_browser->clickImageById($id, $x, $y, $additional)); } - + /** * Submits a form by the ID. * @param string $id Form ID. No button information @@ -943,7 +943,7 @@ function submitFormById($id) { return $this->_failOnError($this->_browser->submitFormById($id)); } - + /** * Follows a link by name. Will click the first link * found with this link text by default, or a later @@ -957,7 +957,7 @@ function clickLink($label, $index = 0) { return $this->_failOnError($this->_browser->clickLink($label, $index)); } - + /** * Follows a link by id attribute. * @param string $id ID attribute value. @@ -967,7 +967,7 @@ function clickLinkById($id) { return $this->_failOnError($this->_browser->clickLinkById($id)); } - + /** * Will trigger a pass if the two parameters have * the same value only. Otherwise a fail. This @@ -984,7 +984,7 @@ $second, $message); } - + /** * Will trigger a pass if the two parameters have * a different value. Otherwise a fail. This @@ -1001,7 +1001,7 @@ $second, $message); } - + /** * Tests for the presence of a link label. Match is * case insensitive with normalised space. @@ -1032,7 +1032,7 @@ $this->_browser->isLink($label), sprintf($message, "Link [$label] should not exist")); } - + /** * Tests for the presence of a link id attribute. * @param string $id Id attribute value. @@ -1061,7 +1061,7 @@ $this->_browser->isLinkById($id), sprintf($message, "Link ID [$id] should not exist")); } - + /** * Sets all form fields with that label, or name if there * is no label attached. @@ -1073,7 +1073,7 @@ function setField($label, $value) { return $this->_browser->setField($label, $value); } - + /** * Sets all form fields with that name. * @param string $name Name of field in forms. @@ -1084,7 +1084,7 @@ function setFieldByName($name, $value) { return $this->_browser->setFieldByName($name, $value); } - + /** * Sets all form fields with that name. * @param string/integer $id Id of field in forms. @@ -1095,7 +1095,7 @@ function setFieldById($id, $value) { return $this->_browser->setFieldById($id, $value); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form will always @@ -1113,7 +1113,7 @@ $value = $this->_browser->getField($label); return $this->_assertFieldValue($label, $value, $expected, $message); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form element will always @@ -1131,7 +1131,7 @@ $value = $this->_browser->getFieldByName($name); return $this->_assertFieldValue($name, $value, $expected, $message); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form will always @@ -1149,7 +1149,7 @@ $value = $this->_browser->getFieldById($id); return $this->_assertFieldValue($id, $value, $expected, $message); } - + /** * Tests the field value against the expectation. * @param string $identifier Name, ID or label. @@ -1173,7 +1173,7 @@ } return $this->assert($expected, $value, $message); } - + /** * Checks the response code against a list * of possible values. @@ -1190,7 +1190,7 @@ implode(", ", $responses) . "] got [$code]"); return $this->assertTrue(in_array($code, $responses), $message); } - + /** * Checks the mime type against a list * of possible values. @@ -1206,7 +1206,7 @@ implode(", ", $types) . "] got [$type]"); return $this->assertTrue(in_array($type, $types), $message); } - + /** * Attempt to match the authentication type within * the security realm we are currently matching. @@ -1230,7 +1230,7 @@ $message); } } - + /** * Checks that no authentication is necessary to view * the desired page. @@ -1243,7 +1243,7 @@ $this->_browser->getAuthentication() . "]"); return $this->assertFalse($this->_browser->getAuthentication(), $message); } - + /** * Attempts to match the current security realm. * @param string $realm Name of security realm. @@ -1260,7 +1260,7 @@ $this->_browser->getRealm(), "Expected realm -> $message"); } - + /** * Checks each header line for the required value. If no * value is given then only an existence check is made. @@ -1277,7 +1277,7 @@ $this->_browser->getHeaders(), $message); } - + /** * @deprecated */ @@ -1303,14 +1303,14 @@ $this->_browser->getHeaders(), $message); } - + /** * @deprecated */ function assertNoUnwantedHeader($header, $message = '%s') { return $this->assertNoHeader($header, $message); } - + /** * Tests the text between the title tags. * @param string $title Expected title. @@ -1324,7 +1324,7 @@ } return $this->assert($title, $this->_browser->getTitle(), $message); } - + /** * Will trigger a pass if the text is found in the plain * text form of the page. @@ -1339,14 +1339,14 @@ $this->_browser->getContentAsText(), $message); } - + /** * @deprecated */ function assertWantedText($text, $message = '%s') { return $this->assertText($text, $message); } - + /** * Will trigger a pass if the text is not found in the plain * text form of the page. @@ -1361,14 +1361,14 @@ $this->_browser->getContentAsText(), $message); } - + /** * @deprecated */ function assertNoUnwantedText($text, $message = '%s') { return $this->assertNoText($text, $message); } - + /** * Will trigger a pass if the Perl regex pattern * is found in the raw content. @@ -1384,14 +1384,14 @@ $this->_browser->getContent(), $message); } - + /** * @deprecated */ function assertWantedPattern($pattern, $message = '%s') { return $this->assertPattern($pattern, $message); } - + /** * Will trigger a pass if the perl regex pattern * is not present in raw content. @@ -1407,14 +1407,14 @@ $this->_browser->getContent(), $message); } - + /** * @deprecated */ function assertNoUnwantedPattern($pattern, $message = '%s') { return $this->assertNoPattern($pattern, $message); } - + /** * Checks that a cookie is set for the current page * and optionally checks the value. @@ -1437,7 +1437,7 @@ } return $this->assert($expected, $value, "Expecting cookie [$name] -> $message"); } - + /** * Checks that no cookie is present or that it has * been successfully cleared. @@ -1451,5 +1451,4 @@ $this->getCookie($name) === false, sprintf($message, "Not expecting cookie [$name]")); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/xml.php b/tests/test_tools/simpletest/xml.php index 9d1ab3b2..54b53011 100644 --- a/tests/test_tools/simpletest/xml.php +++ b/tests/test_tools/simpletest/xml.php @@ -611,4 +611,3 @@ function _default($expat, $default) { } } -?> diff --git a/tests/unit/AllTests.php b/tests/unit/AllTests.php index 7b8027b3..eb08a5f7 100644 --- a/tests/unit/AllTests.php +++ b/tests/unit/AllTests.php @@ -50,5 +50,3 @@ class AllTests { if(PHPUnit_MAIN_METHOD == 'AllTests::main') { AllTests::main(); } - -?>
\ No newline at end of file diff --git a/tests/unit/Caching/AllTests.php b/tests/unit/Caching/AllTests.php index bffe3b2f..179840fc 100644 --- a/tests/unit/Caching/AllTests.php +++ b/tests/unit/Caching/AllTests.php @@ -12,14 +12,14 @@ class Caching_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Caching'); - + $suite->addTestSuite('TSqliteCacheTest'); $suite->addTestSuite('TAPCCacheTest'); $suite->addTestSuite('TMemCacheTest'); - + return $suite; } } @@ -27,4 +27,3 @@ class Caching_AllTests { if(PHPUnit_MAIN_METHOD == 'Caching_AllTests::main') { Caching_AllTests::main(); } -?> diff --git a/tests/unit/Caching/TAPCCacheTest.php b/tests/unit/Caching/TAPCCacheTest.php index 3cb04361..ccb6ee85 100644 --- a/tests/unit/Caching/TAPCCacheTest.php +++ b/tests/unit/Caching/TAPCCacheTest.php @@ -26,7 +26,7 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase { } catch(TConfigurationException $e) { self::markTestSkipped($e->getMessage()); } - + } } @@ -38,24 +38,24 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase { public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPrimaryCache() { self::$cache->PrimaryCache = true; self::assertEquals(true, self::$cache->PrimaryCache); self::$cache->PrimaryCache = false; self::assertEquals(false, self::$cache->PrimaryCache); } - + public function testKeyPrefix() { self::$cache->KeyPrefix = 'prefix'; self::assertEquals('prefix', self::$cache->KeyPrefix); } - + public function testSetAndGet() { self::$cache->set('key', 'value'); self::assertEquals('value', self::$cache->get('key')); } - + public function testAdd() { try { self::$cache->add('anotherkey', 'value'); @@ -65,12 +65,12 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase { } self::assertEquals('value', self::$cache->get('anotherkey')); } - + public function testDelete() { self::$cache->delete('key'); self::assertEquals(false, self::$cache->get('key')); } - + public function testFlush() { $this->testSetAndGet(); self::assertEquals(true, self::$cache->flush()); @@ -78,4 +78,3 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Caching/TDirectoryCacheDependencyTest.php b/tests/unit/Caching/TDirectoryCacheDependencyTest.php index c5c75dec..10da9b58 100644 --- a/tests/unit/Caching/TDirectoryCacheDependencyTest.php +++ b/tests/unit/Caching/TDirectoryCacheDependencyTest.php @@ -78,5 +78,3 @@ class TDirectoryCacheDependencyTest extends PHPUnit_Framework_TestCase @unlink($tempFile); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Caching/TFileCacheDependencyTest.php b/tests/unit/Caching/TFileCacheDependencyTest.php index b4bc89d3..24f2721b 100644 --- a/tests/unit/Caching/TFileCacheDependencyTest.php +++ b/tests/unit/Caching/TFileCacheDependencyTest.php @@ -54,5 +54,3 @@ class TFileCacheDependencyTest extends PHPUnit_Framework_TestCase @unlink($tempFile); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Caching/TMemCacheTest.php b/tests/unit/Caching/TMemCacheTest.php index 8c1fa934..3d0d651f 100644 --- a/tests/unit/Caching/TMemCacheTest.php +++ b/tests/unit/Caching/TMemCacheTest.php @@ -33,34 +33,34 @@ class TMemCacheTest extends PHPUnit_Framework_TestCase { public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPrimaryCache() { self::$cache->PrimaryCache = true; self::assertEquals(true, self::$cache->PrimaryCache); self::$cache->PrimaryCache = false; self::assertEquals(false, self::$cache->PrimaryCache); } - + public function testKeyPrefix() { self::$cache->KeyPrefix = 'prefix'; self::assertEquals('prefix', self::$cache->KeyPrefix); } - + public function testSetAndGet() { self::$cache->set('key', 'value'); self::assertEquals('value', self::$cache->get('key')); } - + public function testAdd() { self::$cache->add('anotherkey', 'value'); self::assertEquals('value', self::$cache->get('anotherkey')); } - + public function testDelete() { self::$cache->delete('key'); self::assertEquals(false, self::$cache->get('key')); } - + public function testFlush() { $this->testSetAndGet(); self::assertEquals(true, self::$cache->flush()); @@ -68,4 +68,3 @@ class TMemCacheTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Caching/TSqliteCacheTest.php b/tests/unit/Caching/TSqliteCacheTest.php index fd4ab1bf..b979b0ec 100644 --- a/tests/unit/Caching/TSqliteCacheTest.php +++ b/tests/unit/Caching/TSqliteCacheTest.php @@ -15,7 +15,7 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase { self::markTestSkipped('The SQLite extension is not available'); } else { if(self::$app === null) { - + $basePath = dirname(__FILE__).'/mockapp'; $runtimePath = $basePath.'/runtime'; if(!is_writable($runtimePath)) { @@ -37,38 +37,38 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase { public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPrimaryCache() { self::$cache->PrimaryCache = true; self::assertEquals(true, self::$cache->PrimaryCache); self::$cache->PrimaryCache = false; self::assertEquals(false, self::$cache->PrimaryCache); } - + public function testKeyPrefix() { self::$cache->KeyPrefix = 'prefix'; self::assertEquals('prefix', self::$cache->KeyPrefix); } - + public function testDbFile() { self::assertEquals('sqlite.cache', basename(self::$cache->DbFile)); } - + public function testSetAndGet() { self::$cache->set('key', 'value'); self::assertEquals('value', self::$cache->get('key')); } - + public function testAdd() { self::$cache->add('key', 'value'); self::assertEquals('value', self::$cache->get('key')); } - + public function testDelete() { self::$cache->delete('key'); self::assertEquals(false, self::$cache->get('key')); } - + public function testFlush() { $this->testAdd(); self::assertEquals(true, self::$cache->flush()); @@ -76,4 +76,3 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Collections/AllTests.php b/tests/unit/Collections/AllTests.php index f290be31..3c286132 100644 --- a/tests/unit/Collections/AllTests.php +++ b/tests/unit/Collections/AllTests.php @@ -16,10 +16,10 @@ class Collections_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Collections'); - + $suite->addTestSuite('TListTest'); $suite->addTestSuite('TMapTest'); $suite->addTestSuite('TQueueTest'); @@ -27,7 +27,7 @@ class Collections_AllTests { $suite->addTestSuite('TAttributeCollectionTest'); $suite->addTestSuite('TPagedListTest'); $suite->addTestSuite('TPagedDataSourceTest'); - + return $suite; } } @@ -35,4 +35,3 @@ class Collections_AllTests { if(PHPUnit_MAIN_METHOD == 'Collections_AllTests::main') { Collections_AllTests::main(); } -?> diff --git a/tests/unit/Collections/TAttributeCollectionTest.php b/tests/unit/Collections/TAttributeCollectionTest.php index 5805f2d0..f61f58b3 100644 --- a/tests/unit/Collections/TAttributeCollectionTest.php +++ b/tests/unit/Collections/TAttributeCollectionTest.php @@ -19,7 +19,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { self::assertEquals('value', $collection->Property); self::assertEquals(true, $collection->canGetProperty('Property')); } - + public function testCanNotGetUndefinedProperty() { $collection = new TAttributeCollection(array(), true); self::assertEquals(false, $collection->canGetProperty('Property')); @@ -37,7 +37,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { self::assertEquals('value', $collection->itemAt('Property')); self::assertEquals(true, $collection->canSetProperty('Property')); } - + public function testCanNotSetPropertyIfReadOnly() { $collection = new TAttributeCollection(array(), true); try { @@ -47,7 +47,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidOperationException was not raised'); } - + public function testGetCaseSensitive() { $collection = new TAttributeCollection(); $collection->setCaseSensitive(false); @@ -55,40 +55,40 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { $collection->setCaseSensitive(true); self::assertEquals(true, $collection->getCaseSensitive()); } - + public function testSetCaseSensitive() { $collection = new TAttributeCollection(); $collection->Property = 'value'; $collection->setCaseSensitive(false); self::assertEquals('value', $collection->itemAt('property')); } - + public function testItemAt() { $collection = new TAttributeCollection(); $collection->Property = 'value'; self::assertEquals('value', $collection->itemAt('Property')); } - + public function testAdd() { $collection = new TAttributeCollection(); $collection->add('Property', 'value'); self::assertEquals('value', $collection->itemAt('Property')); } - + public function testRemove() { $collection = new TAttributeCollection(); $collection->add('Property', 'value'); $collection->remove('Property'); self::assertEquals(0, count($collection)); } - + public function testContains() { $collection = new TAttributeCollection(); self::assertEquals(false, $collection->contains('Property')); $collection->Property = 'value'; self::assertEquals(true, $collection->contains('Property')); } - + public function testHasProperty() { $collection = new TAttributeCollection(); self::assertEquals(false, $collection->hasProperty('Property')); @@ -98,4 +98,3 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Collections/TListTest.php b/tests/unit/Collections/TListTest.php index 349d87ed..9d6950b9 100644 --- a/tests/unit/Collections/TListTest.php +++ b/tests/unit/Collections/TListTest.php @@ -8,7 +8,7 @@ class ListItem { * @package System.Collections */ class TListTest extends PHPUnit_Framework_TestCase { - + protected $list; protected $item1, $item2, $item3, $item4; @@ -21,7 +21,7 @@ class TListTest extends PHPUnit_Framework_TestCase { $this->list->add($this->item1); $this->list->add($this->item2); } - + public function tearDown() { $this->list=null; $this->item1=null; @@ -29,7 +29,7 @@ class TListTest extends PHPUnit_Framework_TestCase { $this->item3=null; $this->item4=null; } - + public function testConstruct() { $a=array(1,2,3); $list=new TList($a); @@ -37,19 +37,19 @@ class TListTest extends PHPUnit_Framework_TestCase { $list2=new TList($this->list); $this->assertEquals(2,$list2->getCount()); } - + public function testGetReadOnly() { $list = new TList(null, true); self::assertEquals(true, $list->getReadOnly(), 'List is not read-only'); $list = new TList(null, false); self::assertEquals(false, $list->getReadOnly(), 'List is read-only'); } - + public function testGetCount() { $this->assertEquals(2,$this->list->getCount()); $this->assertEquals(2,$this->list->Count); } - + public function testItemAt() { $this->assertTrue($this->list->itemAt(0) === $this->item1); $this->assertTrue($this->list->itemAt(1) === $this->item2); @@ -59,14 +59,14 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } } - + public function testAdd() { $this->assertEquals(2,$this->list->add(null)); $this->assertEquals(3,$this->list->add($this->item3)); $this->assertEquals(4,$this->list->getCount()); $this->assertEquals(3,$this->list->indexOf($this->item3)); } - + public function testCanNotAddWhenReadOnly() { $list = new TList(array(), true); try { @@ -75,7 +75,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testInsertAt() { $this->assertNull($this->list->insertAt(0,$this->item3)); $this->assertEquals(3,$this->list->getCount()); @@ -88,7 +88,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } } - + public function testCanNotInsertAtWhenReadOnly() { $list = new TList(array(), true); try { @@ -102,7 +102,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testInsertBefore() { try { $this->list->insertBefore($this->item4,$this->item3); @@ -116,7 +116,7 @@ class TListTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1,$this->list->indexOf($this->item1)); $this->assertEquals(2,$this->list->indexOf($this->item2)); } - + public function testCanNotInsertBeforeWhenReadOnly() { $list = new TList(array(5), true); try { @@ -130,7 +130,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testInsertAfter() { try { $this->list->insertAfter($this->item4,$this->item3); @@ -144,7 +144,7 @@ class TListTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1,$this->list->indexOf($this->item2)); $this->assertEquals(2,$this->list->indexOf($this->item3)); } - + public function testCanNotInsertAfterWhenReadOnly() { $list = new TList(array(5), true); try { @@ -158,7 +158,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testRemove() { $this->assertEquals(0,$this->list->remove($this->item1)); $this->assertEquals(1,$this->list->getCount()); @@ -170,7 +170,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(Exception $e) { } } - + public function testCanNotRemoveWhenReadOnly() { $list = new TList(array(1, 2, 3), true); try { @@ -178,7 +178,7 @@ class TListTest extends PHPUnit_Framework_TestCase { self::fail('An expected TInvalidOperationException was not raised'); } catch(TInvalidOperationException $e) { } - + $list = new TList(array(1, 2, 3), true); try { $list->remove(10); @@ -186,7 +186,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testRemoveAt() { $this->list->add($this->item3); $this->assertEquals($this->item2, $this->list->removeAt(1)); @@ -199,7 +199,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } } - + public function testCanNotRemoveAtWhenReadOnly() { $list = new TList(array(1, 2, 3), true); try { @@ -207,7 +207,7 @@ class TListTest extends PHPUnit_Framework_TestCase { self::fail('An expected TInvalidOperationException was not raised'); } catch(TInvalidOperationException $e) { } - + $list = new TList(array(1, 2, 3), true); try { $list->removeAt(10); @@ -215,14 +215,14 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testClear() { $this->list->clear(); $this->assertEquals(0,$this->list->getCount()); $this->assertEquals(-1,$this->list->indexOf($this->item1)); $this->assertEquals(-1,$this->list->indexOf($this->item2)); } - + public function testCanNotClearWhenReadOnly() { $list = new TList(array(1, 2, 3), true); try { @@ -232,19 +232,19 @@ class TListTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidOperationException was not raised'); } - + public function testContains() { $this->assertTrue($this->list->contains($this->item1)); $this->assertTrue($this->list->contains($this->item2)); $this->assertFalse($this->list->contains($this->item3)); } - + public function testIndexOf() { $this->assertEquals(0,$this->list->indexOf($this->item1)); $this->assertEquals(1,$this->list->indexOf($this->item2)); $this->assertEquals(-1,$this->list->indexOf($this->item3)); } - + public function testCopyFrom() { $array=array($this->item3,$this->item1); $this->list->copyFrom($array); @@ -255,7 +255,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataTypeException $e) { } } - + public function testMergeWith() { $array=array($this->item3,$this->item1); $this->list->mergeWith($array); @@ -266,12 +266,12 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataTypeException $e) { } } - + public function testToArray() { $array=$this->list->toArray(); $this->assertTrue(count($array)==2 && $array[0]===$this->item1 && $array[1]===$this->item2); } - + public function testArrayRead() { $this->assertTrue($this->list[0]===$this->item1); $this->assertTrue($this->list[1]===$this->item2); @@ -281,7 +281,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } } - + public function testGetIterator() { $n=0; $found=0; @@ -295,25 +295,25 @@ class TListTest extends PHPUnit_Framework_TestCase { } $this->assertTrue($n==2 && $found==2); } - + public function testArrayMisc() { $this->assertEquals($this->list->Count,count($this->list)); $this->assertTrue(isset($this->list[1])); $this->assertFalse(isset($this->list[2])); } - + public function testOffsetSetAdd() { $list = new TList(array(1, 2, 3)); $list->offsetSet(null, 4); self::assertEquals(array(1, 2, 3, 4), $list->toArray()); } - + public function testOffsetSetReplace() { $list = new TList(array(1, 2, 3)); $list->offsetSet(1, 4); self::assertEquals(array(1, 4, 3), $list->toArray()); } - + public function testOffsetUnset() { $list = new TList(array(1, 2, 3)); $list->offsetUnset(1); @@ -321,5 +321,3 @@ class TListTest extends PHPUnit_Framework_TestCase { } } - -?>
\ No newline at end of file diff --git a/tests/unit/Collections/TMapTest.php b/tests/unit/Collections/TMapTest.php index 0634a2a3..da198eb4 100644 --- a/tests/unit/Collections/TMapTest.php +++ b/tests/unit/Collections/TMapTest.php @@ -176,11 +176,10 @@ class TMapTest extends PHPUnit_Framework_TestCase { $this->assertTrue(isset($this->map['key1'])); $this->assertFalse(isset($this->map['unknown key'])); } - + public function testToArray() { $map = new TMap(array('key' => 'value')); self::assertEquals(array('key' => 'value'), $map->toArray()); } } -?> diff --git a/tests/unit/Collections/TPagedDataSourceTest.php b/tests/unit/Collections/TPagedDataSourceTest.php index 92f4061b..ebb8e60d 100644 --- a/tests/unit/Collections/TPagedDataSourceTest.php +++ b/tests/unit/Collections/TPagedDataSourceTest.php @@ -16,55 +16,54 @@ class TPagedDataSourceTest extends PHPUnit_Framework_TestCase { public function testDataSource() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPageSize() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCurrentPageIndex() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAllowPaging() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAllowCustomPaging() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testVirtualItemCount() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCount() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPageCount() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsFirstPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsLastPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFirstIndexInPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testDataSourceCount() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIterator() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Collections/TPagedListTest.php b/tests/unit/Collections/TPagedListTest.php index 2d884736..a225db61 100644 --- a/tests/unit/Collections/TPagedListTest.php +++ b/tests/unit/Collections/TPagedListTest.php @@ -3,26 +3,26 @@ Prado::using('System.Collections.TPagedList'); class MyPagedList extends TPagedList { - + private $_isPageIndexChanged = false; private $_hasFetchedData = false; - + public function pageIndexChanged($sender, $param) { $this->_isPageIndexChanged = true; } - + public function fetchData($sender, $param) { $this->_hasFetchedData = true; } - + public function isPageIndexChanged() { return $this->_isPageIndexChanged; } - + public function hasFetchedData() { return $this->_hasFetchedData; } - + } /** @@ -58,7 +58,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->PageSize = 5; self::assertEquals(5, $list->PageSize); } - + public function testCanNotSetInvalidPageSize() { $list = new TPagedList(); try { @@ -68,14 +68,14 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidDataValueException was not raised'); } - + public function testCurrentPageIndex() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; $list->CurrentPageIndex = 2; self::assertEquals(2, $list->CurrentPageIndex); } - + public function testOnPageIndexChanged() { $list = new TPagedList(array(1, 2, 3, 4, 5)); $list->PageSize = 1; @@ -87,7 +87,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->onPageIndexChanged(new TPagedListPageChangedEventParameter($oldPage)); self::assertEquals(true, $myList->isPageIndexChanged()); } - + public function testOnFetchData() { $list = new TPagedList(array(1, 2, 3, 4)); $list->CustomPaging = true; @@ -95,18 +95,18 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->gotoPage(0); $myList = new MyPagedList(); $list->attachEventHandler('OnFetchData', array($myList, 'fetchData')); - self::assertEquals(false, $myList->hasFetchedData()); + self::assertEquals(false, $myList->hasFetchedData()); $list->onFetchData(new TPagedListFetchDataEventParameter($list->CurrentPageIndex, $list->PageSize*$list->CurrentPageIndex, $list->PageSize)); self::assertEquals(true, $myList->hasFetchedData()); } - + public function testGotoPage() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; self::assertEquals(2, $list->gotoPage(2)); self::assertEquals(false, $list->gotoPage(4)); } - + public function testNextPage() { $list = new TPagedList(array(1, 2)); $list->PageSize = 1; @@ -114,7 +114,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { self::assertEquals(1, $list->nextPage()); self::assertEquals(false, $list->nextPage()); } - + public function testPreviousPage() { $list = new TPagedList(array(1, 2)); $list->PageSize = 1; @@ -122,7 +122,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { self::assertEquals(0, $list->previousPage()); self::assertEquals(false, $list->previousPage()); } - + public function testVirtualCount() { $list = new TPagedList(array(1, 2)); $list->VirtualCount = -10; @@ -130,7 +130,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->VirtualCount = 5; self::assertEquals(5, $list->VirtualCount); } - + public function testPageCount() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; @@ -141,7 +141,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->CustomPaging = false; self::assertEquals(3, $list->PageCount); } - + public function testIsFirstPage() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; @@ -150,7 +150,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->gotoPage(1); self::assertEquals(false, $list->IsFirstPage); } - + public function testIsLastPage() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; @@ -159,7 +159,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->gotoPage(2); self::assertEquals(true, $list->IsLastPage); } - + public function testGetCount() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; @@ -167,7 +167,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->CustomPaging = true; self::assertEquals(3, $list->Count); } - + public function testGetIterator() { $list = new TPagedList(array(1, 2)); $list->CustomPaging = true; @@ -181,12 +181,12 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $found++; } if($index === 1 && $item === 2) { - $found++; + $found++; } } self::assertTrue($n == 2 && $found == 2); } - + public function testItemAt() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; @@ -196,27 +196,27 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->CurrentPageIndex = 0; self::assertEquals(1, $list[0]); } - + public function testIndexOf() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; self::assertEquals(0, $list->indexOf(1)); self::assertEquals(-1, $list->indexOf(0)); } - + public function testOffsetExists() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; self::assertEquals(true, isset($list[0])); self::assertEquals(false, isset($list[4])); } - + public function testOffsetGet() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; self::assertEquals(2, $list[1]); } - + public function testToArray() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; @@ -225,4 +225,3 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Collections/TPriorityMapTest.php b/tests/unit/Collections/TPriorityMapTest.php index 7c6ed498..847e09fe 100644 --- a/tests/unit/Collections/TPriorityMapTest.php +++ b/tests/unit/Collections/TPriorityMapTest.php @@ -22,10 +22,10 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->item5=new TPriorityMapTest_MapItem; $this->map->add('key1',$this->item1); $this->map->add('key2',$this->item2); - + //Test the priority capabilities } - + public function setUpPriorities() { $this->map->add('key3', $this->item3, 0); $this->map->add('key4', $this->item4, 100); @@ -45,16 +45,16 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals(3,$map->getCount()); $map2=new TPriorityMap($this->map); $this->assertEquals(2,$map2->getCount()); - + /* Test the priority functionality of TPriorityMap */ - + $map3=new TPriorityMap($this->map, false, 100, -1); $this->assertEquals(100,$map3->getDefaultPriority()); $this->assertEquals(-1,$map3->getPrecision()); } - + /* Test that TPriorityMap complies with TMap */ - + public function testGetReadOnly() { $map = new TPriorityMap(null, true); @@ -202,46 +202,46 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertTrue(isset($this->map['key1'])); $this->assertFalse(isset($this->map['unknown key'])); } - + public function testToArray() { $map = new TPriorityMap(array('key' => 'value')); self::assertEquals(array('key' => 'value'), $map->toArray()); } - - - - + + + + /* Test the priority functionality of TPriorityMap */ - - + + public function testDefaultPriorityAndPrecision() { - + $this->assertEquals(10, $this->map->DefaultPriority); - + $this->map->DefaultPriority = 5; $this->assertEquals(5, $this->map->getDefaultPriority()); - + $this->assertEquals(8, $this->map->Precision); - + $this->map->Precision = 0; $this->assertEquals(0, $this->map->getPrecision()); - + ; - + $this->assertEquals(5, $this->map->add('key3', $this->item3)); $this->assertEquals(10, $this->map->add('key4', $this->item1, 10)); $this->assertTrue(10 == $this->map->add('key4', $this->item1, 10.01)); $this->assertTrue(100 == $this->map->add('key4', $this->item1, 100)); $this->map->Precision = 1; $this->assertTrue(10.1 == $this->map->add('key5', $this->item1, 10.1)); - + $this->assertEquals(5, $this->map->getCount()); } - + public function testAddWithPriorityAndPriorityOfAt() { - + $this->setUpPriorities(); - + $this->assertEquals(5, $this->map->getCount()); $this->assertEquals(10, $this->map->priorityOf($this->item1)); $this->assertEquals(0, $this->map->priorityOf($this->item3)); @@ -249,74 +249,74 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1, $this->map->priorityOf($this->item5)); $this->assertEquals(false, $this->map->priorityOf(null)); $this->assertEquals(false, $this->map->priorityOf('foo')); - + $this->assertEquals(10, $this->map->priorityAt('key1')); $this->assertEquals(0, $this->map->priorityAt('key3')); $this->assertEquals(100, $this->map->priorityAt('key4')); $this->assertEquals(1, $this->map->priorityAt('key5')); $this->assertEquals(false, $this->map->priorityAt(null)); $this->assertEquals(false, $this->map->priorityAt('foo')); - + } - + public function testRemoveWithPriorityAndItemsAtWithPriority() { - + $this->setUpPriorities(); - + $this->assertEquals(5, $this->map->getCount()); $this->map->remove('key6'); $this->assertEquals(5, $this->map->getCount()); $this->map->remove('key6', null); $this->assertEquals(5, $this->map->getCount()); - - + + // key5 is at priority 1... not the default priority defined by null... nothing should happen here $this->map->remove('key5', null); $this->assertEquals(5, $this->map->getCount()); - + // key5 is at priority 1... not 50... nothing should happen here $this->map->remove('key5', 50); $this->assertEquals(5, $this->map->getCount()); - - - + + + $this->assertEquals(array('key3'=>$this->item3), $this->map->itemsAtPriority(0)); $this->assertEquals(array('key1'=>$this->item1, 'key2'=>$this->item2), $this->map->itemsAtPriority($this->map->DefaultPriority)); - + $this->assertEquals($this->item2, $this->map->itemAt('key2')); $this->assertEquals($this->item2, $this->map->itemAt('key2', 10)); $this->assertNull($this->map->itemAt('key2', 11)); //'key2' doesn't exist and priority 11... it is only at priority 10 $this->assertNull($this->map->itemAt('key2', 10.1)); //'key2' doesn't exist and priority 10.1... it is only at priority 10 - + $this->assertEquals($this->item4, $this->map->remove('key4')); $this->assertEquals(4, $this->map->getCount()); - + $this->assertEquals($this->item5, $this->map->remove('key5')); $this->assertEquals(3, $this->map->getCount()); } public function testIteratorAndArrayWithPriorities() { - + $this->setUpPriorities(); - + // This is the primary reason for a TPriorityMap $array = $this->map->toArray(); - + $ordered_keys = array_keys($array); $this->assertEquals('key3', $ordered_keys[0]); $this->assertEquals('key5', $ordered_keys[1]); $this->assertEquals('key1', $ordered_keys[2]); $this->assertEquals('key2', $ordered_keys[3]); $this->assertEquals('key4', $ordered_keys[4]); - + $ordered_values = array_values($array); $this->assertEquals($this->item3, $ordered_values[0]); $this->assertEquals($this->item5, $ordered_values[1]); $this->assertEquals($this->item1, $ordered_values[2]); $this->assertEquals($this->item2, $ordered_values[3]); $this->assertEquals($this->item4, $ordered_values[4]); - + $iter = $this->map->getIterator(); - + $this->assertTrue($iter->valid()); $this->assertEquals('key3', $iter->key()); $this->assertEquals($this->item1, $iter->current()); @@ -341,31 +341,31 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals(null, $iter->key()); $this->assertEquals(null, $iter->current()); } - - + + public function testGetPriorities() { $this->setUpPriorities(); - + $priorities = $this->map->getPriorities(); - + $this->assertEquals(0, $priorities[0]); $this->assertEquals(1, $priorities[1]); $this->assertEquals(10, $priorities[2]); $this->assertEquals(100, $priorities[3]); $this->assertEquals(false, isset($priorities[4])); } - - + + public function testCopyAndMergeWithPriorities() { $this->setUpPriorities(); - + $map1 = new TPriorityMap(); $map1->add('key1', $this->item1); $map1->add('keyc', 'valuec'); $map1->copyFrom($this->map); - + $this->assertEquals(5, $map1->getCount()); - + $array = $map1->toArray(); $ordered_keys = array_keys($array); $this->assertEquals('key3', $ordered_keys[0]); @@ -373,24 +373,24 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals('key1', $ordered_keys[2]); $this->assertEquals('key2', $ordered_keys[3]); $this->assertEquals('key4', $ordered_keys[4]); - + $ordered_values = array_values($array); $this->assertEquals($this->item3, $ordered_values[0]); $this->assertEquals($this->item5, $ordered_values[1]); $this->assertEquals($this->item1, $ordered_values[2]); $this->assertEquals($this->item2, $ordered_values[3]); $this->assertEquals($this->item4, $ordered_values[4]); - - - + + + $map2 = new TPriorityMap(); $map2->add('startkey', 'startvalue', -1000); $map2->add('key5', 'value5', 40); $map2->add('endkey', 'endvalue', 1000); $map2->mergeWith($this->map); - + $this->assertEquals(7, $map2->getCount()); - + $array = $map2->toArray(); $ordered_keys = array_keys($array); $this->assertEquals('startkey', $ordered_keys[0]); @@ -400,7 +400,7 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals('key2', $ordered_keys[4]); $this->assertEquals('key4', $ordered_keys[5]); $this->assertEquals('endkey', $ordered_keys[6]); - + $ordered_values = array_values($array); $this->assertEquals('startvalue', $ordered_values[0]); $this->assertEquals($this->item3, $ordered_values[1]); @@ -409,81 +409,80 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals($this->item2, $ordered_values[4]); $this->assertEquals($this->item4, $ordered_values[5]); $this->assertEquals('endvalue', $ordered_values[6]); - + $this->assertEquals(1, $map2->priorityAt('key5')); $this->assertEquals(1, $map2->priorityOf($this->item5)); } - + public function testSetPriorityAt() { - + $this->assertEquals(10, $this->map->priorityAt('key2')); $this->assertEquals(10, $this->map->setPriorityAt('key2', 1)); $this->assertEquals(1, $this->map->priorityAt('key2')); $this->assertEquals(1, $this->map->setPriorityAt('key2')); $this->assertEquals(10, $this->map->priorityAt('key2')); } - + public function testToArrayBelowPriority() { $this->setUpPriorities(); - + $array = $this->map->toArrayBelowPriority(1); $this->assertEquals(array('key3'=> $this->item3), $array); $this->assertEquals(1, count($array)); - + $array = $this->map->toArrayBelowPriority(1, true); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array); $this->assertEquals(2, count($array)); - + $array = $this->map->toArrayBelowPriority(2); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array); $this->assertEquals(2, count($array)); - + $array = $this->map->toArrayBelowPriority(10); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array); $this->assertEquals(2, count($array)); - + $array = $this->map->toArrayBelowPriority(10, true); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2), $array); $this->assertEquals(4, count($array)); - + $array = $this->map->toArrayBelowPriority(100); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2), $array); $this->assertEquals(4, count($array)); - + $array = $this->map->toArrayBelowPriority(100, true); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array); $this->assertEquals(5, count($array)); } - + public function testToArrayAbovePriority() { $this->setUpPriorities(); - + $array = $this->map->toArrayAbovePriority(100, false); $this->assertEquals(0, count($array)); - + $array = $this->map->toArrayAbovePriority(100, true); $this->assertEquals(1, count($array)); $this->assertEquals(array('key4' => $this->item4), $array); - + $array = $this->map->toArrayAbovePriority(11); $this->assertEquals(array('key4' => $this->item4), $array); $this->assertEquals(1, count($array)); - + $array = $this->map->toArrayAbovePriority(10, false); $this->assertEquals(array('key4' => $this->item4), $array); $this->assertEquals(1, count($array)); - + $array = $this->map->toArrayAbovePriority(10); $this->assertEquals(array('key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array); $this->assertEquals(3, count($array)); - + $array = $this->map->toArrayAbovePriority(0); $this->assertEquals(array('key3' => $this->item3, 'key5' => $this->item5, 'key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array); $this->assertEquals(5, count($array)); } - - - + + + } -?> diff --git a/tests/unit/Collections/TQueueTest.php b/tests/unit/Collections/TQueueTest.php index efee7cb7..da60eae3 100644 --- a/tests/unit/Collections/TQueueTest.php +++ b/tests/unit/Collections/TQueueTest.php @@ -31,7 +31,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { $queue->copyFrom($data); self::assertEquals(array(4, 5, 6), $queue->toArray()); } - + public function testCanNotCopyFromNonTraversableTypes() { $queue = new TQueue(); $data = new stdClass(); @@ -42,7 +42,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidDataTypeException was not raised'); } - + public function testClear() { $queue = new TQueue(array(1, 2, 3)); $queue->clear(); @@ -59,7 +59,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { $queue = new TQueue(array(1,2,3)); self::assertEquals(1, $queue->peek()); } - + public function testCanNotPeekAnEmptyQueue() { $queue = new TQueue(); try { @@ -76,7 +76,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { self::assertEquals(1, $first); self::assertEquals(array(2, 3), $queue->toArray()); } - + public function testCanNotDequeueAnEmptyQueue() { $queue = new TQueue(); try { @@ -105,7 +105,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { $found++; } if($index === 1 && $item === 2) { - $found++; + $found++; } } self::assertTrue($n == 2 && $found == 2); @@ -117,7 +117,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { $queue = new TQueue(array(1, 2, 3)); self::assertEquals(3, $queue->getCount()); } - + public function testCountable() { $queue = new TQueue(); self::assertEquals(0, count($queue)); @@ -127,4 +127,3 @@ class TQueueTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Collections/TStackTest.php b/tests/unit/Collections/TStackTest.php index 89a42749..80dc77c3 100644 --- a/tests/unit/Collections/TStackTest.php +++ b/tests/unit/Collections/TStackTest.php @@ -31,7 +31,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { $stack->copyFrom($data); self::assertEquals(array(4, 5, 6), $stack->toArray()); } - + public function testCanNotCopyFromNonTraversableTypes() { $stack = new TStack(); $data = new stdClass(); @@ -42,7 +42,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidDataTypeException was not raised'); } - + public function testClear() { $stack = new TStack(array(1, 2, 3)); $stack->clear(); @@ -59,7 +59,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { $stack = new TStack(array(1)); self::assertEquals(1, $stack->peek()); } - + public function testCanNotPeekAnEmptyStack() { $stack = new TStack(); try { @@ -76,7 +76,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { self::assertEquals(3, $last); self::assertEquals(array(1, 2), $stack->toArray()); } - + public function testCanNotPopAnEmptyStack() { $stack = new TStack(); try { @@ -105,7 +105,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { $found++; } if($index === 1 && $item === 2) { - $found++; + $found++; } } self::assertTrue($n == 2 && $found == 2); @@ -117,7 +117,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { $stack = new TStack(array(1, 2, 3)); self::assertEquals(3, $stack->getCount()); } - + public function testCount() { $stack = new TStack(); self::assertEquals(0, count($stack)); @@ -127,4 +127,3 @@ class TStackTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Data/DataGateway/AllTests.php b/tests/unit/Data/DataGateway/AllTests.php index f9ba1ddc..6007ae70 100644 --- a/tests/unit/Data/DataGateway/AllTests.php +++ b/tests/unit/Data/DataGateway/AllTests.php @@ -12,12 +12,12 @@ class Data_DataGateway_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Data.DataGateway'); - + $suite->addTestSuite('TSqlCriteriaTest'); - + return $suite; } } @@ -25,4 +25,3 @@ class Data_DataGateway_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_DataGateway_AllTests::main') { Data_DataGateway_AllTests::main(); } -?> diff --git a/tests/unit/Data/DataGateway/TSqlCriteriaTest.php b/tests/unit/Data/DataGateway/TSqlCriteriaTest.php index fb9c72b2..ce22ef1d 100644 --- a/tests/unit/Data/DataGateway/TSqlCriteriaTest.php +++ b/tests/unit/Data/DataGateway/TSqlCriteriaTest.php @@ -17,7 +17,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testConditionWithOrderByColumnNames() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC"; @@ -27,7 +27,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(true, isset($criteria->OrdersBy['field2'])); self::assertEquals('DESC', $criteria->OrdersBy['field2']); } - + public function testConditionWithOrderByExpression() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY RAND()"; @@ -42,7 +42,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals("SELECT * FROM table_references", $criteria->Condition); self::assertEquals(2, $criteria->Limit); } - + public function testConditionWithOrderByAndLimitAndOffset() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC LIMIT 3, 2"; @@ -50,7 +50,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithOrderByAndLimitAndOffsetVariant() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC LIMIT 2 OFFSET 3"; @@ -58,14 +58,14 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithLimit() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 2"; self::assertEquals("SELECT * FROM table_references", $criteria->Condition); self::assertEquals(2, $criteria->Limit); } - + public function testConditionWithLimitAndOffset() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 3, 2"; @@ -73,7 +73,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithLimitAndOffsetVariant() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 2 OFFSET 3"; @@ -85,27 +85,26 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { public function testParameters() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsNamedParameters() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOrdersBy() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLimit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOffset() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testToString() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Data/SqlMap/AllTests.php b/tests/unit/Data/SqlMap/AllTests.php index 3adaa29c..08870eb3 100644 --- a/tests/unit/Data/SqlMap/AllTests.php +++ b/tests/unit/Data/SqlMap/AllTests.php @@ -27,4 +27,3 @@ class Data_SqlMap_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_AllTests::main') { Data_SqlMap_AllTests::main(); } -?> diff --git a/tests/unit/Data/SqlMap/DataMapper/AllTests.php b/tests/unit/Data/SqlMap/DataMapper/AllTests.php index 47b8522f..d685d474 100644 --- a/tests/unit/Data/SqlMap/DataMapper/AllTests.php +++ b/tests/unit/Data/SqlMap/DataMapper/AllTests.php @@ -24,5 +24,4 @@ class Data_SqlMap_DataMapper_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_DataMapper_AllTests::main') { Data_SqlMap_DataMapper_AllTests::main(); -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php index 61747c6b..3f5493c7 100644 --- a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php +++ b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php @@ -265,5 +265,3 @@ class _PropertyAccessTestHelperDynamicProperties } } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/SqlMap/DynamicParameterTest.php b/tests/unit/Data/SqlMap/DynamicParameterTest.php index 64f5e35c..136111db 100644 --- a/tests/unit/Data/SqlMap/DynamicParameterTest.php +++ b/tests/unit/Data/SqlMap/DynamicParameterTest.php @@ -105,5 +105,3 @@ class DynamicParameterTest extends PHPUnit_Framework_TestCase } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbCommandTest.php b/tests/unit/Data/TDbCommandTest.php index a75674bf..55d7d559 100644 --- a/tests/unit/Data/TDbCommandTest.php +++ b/tests/unit/Data/TDbCommandTest.php @@ -216,5 +216,3 @@ class TDbCommandTest extends PHPUnit_Framework_TestCase } } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbConnectionTest.php b/tests/unit/Data/TDbConnectionTest.php index 8f6ff34f..e7e3ef74 100644 --- a/tests/unit/Data/TDbConnectionTest.php +++ b/tests/unit/Data/TDbConnectionTest.php @@ -121,5 +121,3 @@ class TDbConnectionTest extends PHPUnit_Framework_TestCase $this->assertEquals(TDbNullConversionMode::NullToEmptyString,$this->_connection1->NullConversion); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbDataReaderTest.php b/tests/unit/Data/TDbDataReaderTest.php index 98aa0385..0595f3e2 100644 --- a/tests/unit/Data/TDbDataReaderTest.php +++ b/tests/unit/Data/TDbDataReaderTest.php @@ -174,5 +174,3 @@ class TDbDataReaderTest extends PHPUnit_Framework_TestCase $this->assertEquals($name,'my name 2'); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbTransactionTest.php b/tests/unit/Data/TDbTransactionTest.php index c608bce1..a901394d 100644 --- a/tests/unit/Data/TDbTransactionTest.php +++ b/tests/unit/Data/TDbTransactionTest.php @@ -68,5 +68,3 @@ class TDbTransactionTest extends PHPUnit_Framework_TestCase $this->assertEquals(count($result),2); } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/AllTests.php b/tests/unit/I18N/core/AllTests.php index 43bbdb36..bf5fb813 100644 --- a/tests/unit/I18N/core/AllTests.php +++ b/tests/unit/I18N/core/AllTests.php @@ -15,16 +15,16 @@ class I18N_core_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.I18N.core'); - + $suite->addTestSuite('CultureInfoTest'); $suite->addTestSuite('DateFormatTest'); $suite->addTestSuite('DateTimeFormatInfoTest'); $suite->addTestSuite('NumberFormatInfoTest'); $suite->addTestSuite('NumberFormatTest'); - + return $suite; } } @@ -32,4 +32,3 @@ class I18N_core_AllTests { if(PHPUnit_MAIN_METHOD == 'I18N_core_AllTests::main') { I18N_core_AllTests::main(); } -?> diff --git a/tests/unit/I18N/core/ChoiceFormatTest.php b/tests/unit/I18N/core/ChoiceFormatTest.php index ef397e05..2c8ab5cb 100644 --- a/tests/unit/I18N/core/ChoiceFormatTest.php +++ b/tests/unit/I18N/core/ChoiceFormatTest.php @@ -97,5 +97,3 @@ class ChoiceFormatTest extends PHPUnit_Framework_TestCase } } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/CultureInfoTest.php b/tests/unit/I18N/core/CultureInfoTest.php index 6c1eda06..58c8f235 100644 --- a/tests/unit/I18N/core/CultureInfoTest.php +++ b/tests/unit/I18N/core/CultureInfoTest.php @@ -8,16 +8,16 @@ Prado::using('System.I18N.core.CultureInfo'); */ class CultureInfoTest extends PHPUnit_Framework_TestCase { protected $culture; - + function setUp() { $this->culture = CultureInfo::getInvariantCulture(); } - + function testCultureName() { $name = 'en'; - + $this->assertEquals($name, $this->culture->Name); - + //the default/invariant culture should be neutral $this->assertTrue($this->culture->IsNeutralCulture); } @@ -26,18 +26,18 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase { $allCultures = CultureInfo::getCultures(); $neutralCultures = CultureInfo::getCultures(CultureInfo::NEUTRAL); $specificCultures = CultureInfo::getCultures(CultureInfo::SPECIFIC); - + //there should be 246 cultures all together. $this->assertEquals(count($allCultures),246); $this->assertEquals(count($neutralCultures),76); - $this->assertEquals(count($specificCultures),170); + $this->assertEquals(count($specificCultures),170); } function testParentCultures() { $zh_CN = new CultureInfo('zh_CN'); $parent = $zh_CN->Parent; $grandparent = $parent->Parent; - + $this->assertEquals($zh_CN->Name, 'zh_CN'); $this->assertEquals($parent->Name, 'zh'); $this->assertEquals($grandparent->Name, 'en'); @@ -54,17 +54,17 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase { $au = array('$', 'Australian Dollar'); $this->assertEquals($au, $culture->Currencies['AUD']); } - + function testLanguages() { $culture = new CultureInfo('fr_BE'); $this->assertEquals($culture->Languages['fr'], 'français'); } - + function testScripts() { $culture = new CultureInfo('fr'); $this->assertEquals($culture->Scripts['Armn'], 'arménien'); } - + function testTimeZones() { $culture = new CultureInfo('fi'); $zone = array( @@ -83,5 +83,3 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals($culture->getEnglishName(), 'iw'); } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/DateFormatTest.php b/tests/unit/I18N/core/DateFormatTest.php index 8015bd74..d8350204 100644 --- a/tests/unit/I18N/core/DateFormatTest.php +++ b/tests/unit/I18N/core/DateFormatTest.php @@ -10,86 +10,84 @@ class DateFormatTest extends PHPUnit_Framework_TestCase { public function testStandardPatterns() { $dateFormatter = new DateFormat(); - + $time = @mktime(9, 9, 9, 9, 1, 2004); $zone = @date('T', $time); //var_dump(date('c',$time)); //for ShortDatePattern "M/d/yy" $this->assertEquals('9/1/04', $dateFormatter->format($time, 'd')); //var_dump(date('c',strtotime($dateFormatter->format($time,'d')))); - + //for LongDatePattern "MMMM d, yyyy" $wants = 'September 1, 2004'; $this->assertEquals($wants, $dateFormatter->format($time, 'D')); //var_dump(date('c',strtotime($dateFormatter->format($time,'D')))); - + //for Full date and time "MMMM d, yyyy h:mm a" $wants = 'September 1, 2004 9:09 AM'; $this->assertEquals($wants, $dateFormatter->format($time, 'f')); //var_dump(date('c',strtotime($dateFormatter->format($time,'f')))); - + //for FullDateTimePattern "MMMM d, yyyy h:mm:ss a z" $wants = 'September 1, 2004 9:09:09 AM '.$zone; $this->assertEquals($wants, $dateFormatter->format($time, 'F')); - + //for General "M/d/yy h:mm a" $wants = '9/1/04 9:09 AM'; $this->assertEquals($wants, $dateFormatter->format($time, 'g')); //var_dump(date('c',strtotime($dateFormatter->format($time,'g')))); - + //for General "M/d/yy h:mm:ss a z" $wants = '9/1/04 9:09:09 AM '.$zone; - $this->assertEquals($wants, $dateFormatter->format($time, 'G')); - + $this->assertEquals($wants, $dateFormatter->format($time, 'G')); + //for MonthDayPattern "MMMM dd" (invariant) $wants = 'September 01'; $this->assertEquals($wants, $dateFormatter->format($time, 'm')); //var_dump(date('c',strtotime($dateFormatter->format($time,'m')))); - + //for RFC1123Pattern "EEE, dd MMM yyyy HH:mm:ss" (invariant) $wants = 'Wed, 01 Sep 2004 09:09:09'; - $this->assertEquals($wants, $dateFormatter->format($time, 'r')); + $this->assertEquals($wants, $dateFormatter->format($time, 'r')); //var_dump(date('c',strtotime($dateFormatter->format($time,'r')))); - + //for SortableDateTimePattern "yyyy-MM-ddTHH:mm:ss" (invariant) $wants = '2004-09-01T09:09:09'; - $this->assertEquals($wants, $dateFormatter->format($time, 's')); + $this->assertEquals($wants, $dateFormatter->format($time, 's')); //var_dump(date('c',strtotime($dateFormatter->format($time,'s')))); - + //for ShortTimePattern "H:mm a" $wants = '9:09 AM'; - $this->assertEquals($wants, $dateFormatter->format($time, 't')); + $this->assertEquals($wants, $dateFormatter->format($time, 't')); //(date('c',strtotime($dateFormatter->format($time,'t')))); - + //for LongTimePattern "H:mm:ss a z" $wants = '9:09:09 AM '.$zone; - $this->assertEquals($wants, $dateFormatter->format($time, 'T')); - - //for UniversalSortableDateTimePattern "yyyy-MM-dd HH:mm:ss z" + $this->assertEquals($wants, $dateFormatter->format($time, 'T')); + + //for UniversalSortableDateTimePattern "yyyy-MM-dd HH:mm:ss z" //(invariant) $wants = '2004-09-01 09:09:09 '.$zone; - $this->assertEquals($wants, $dateFormatter->format($time, 'u')); - + $this->assertEquals($wants, $dateFormatter->format($time, 'u')); + //for Full date and time "EEEE dd MMMM yyyy HH:mm:ss" (invariant) $wants = 'Wednesday 01 September 2004 09:09:09'; - $this->assertEquals($wants, $dateFormatter->format($time, 'U')); + $this->assertEquals($wants, $dateFormatter->format($time, 'U')); //var_dump(date('c',strtotime($dateFormatter->format($time,'U')))); - + //for YearMonthPattern "yyyy MMMM" (invariant) $wants = '2004 September'; - $this->assertEquals($wants, $dateFormatter->format($time, 'y')); + $this->assertEquals($wants, $dateFormatter->format($time, 'y')); //var_dump(date('c',strtotime($dateFormatter->format($time,'y')))); } - + public function testCustomPatterns() { $dateFormatter = new DateFormat(); - + $time = @mktime(9, 9, 9, 9, 1, 2004); - + $pattern = "'Hello' EEEE, 'it should be' MMM yyyy HH:mm:ss!!!"; $wants = 'Hello Wednesday, it should be Sep 2004 09:09:09!!!'; - $this->assertEquals($wants, $dateFormatter->format($time, $pattern)); + $this->assertEquals($wants, $dateFormatter->format($time, $pattern)); } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/DateTimeFormatInfoTest.php b/tests/unit/I18N/core/DateTimeFormatInfoTest.php index 442a6b85..ac93e1c7 100644 --- a/tests/unit/I18N/core/DateTimeFormatInfoTest.php +++ b/tests/unit/I18N/core/DateTimeFormatInfoTest.php @@ -9,20 +9,20 @@ Prado::using('System.I18N.core.DateTimeFormatInfo'); class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { protected $format; - + function setUp() { $this->format = DateTimeFormatInfo::getInstance('en'); } - + function testAbbreviatedDayNames() { $names = $this->format->AbbreviatedDayNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),7,'Must have 7 day names'); - + //assuming invariant culture. $days = array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hel', 'wor'); $this->format->AbbreviatedDayNames = $data; @@ -31,16 +31,16 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); } - + function testNarrowDayNames() { $names = $this->format->NarrowDayNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),7,'Must have 7 day names'); - + //assuming invariant culture. $days = array("S", "M", "T", "W", "T", "F", "S"); $this->assertEquals($names, $days); - + //try to set the data $data = array('H', 'w'); $this->format->NarrowDayNames = $data; @@ -49,17 +49,17 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); } - + function testDayNames() { $names = $this->format->DayNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),7,'Must have 7 day names'); - + //assuming invariant culture. $days = array( "Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hello', 'world'); $this->format->DayNames = $data; @@ -68,18 +68,18 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); } - + function testMonthNames() { $names = $this->format->MonthNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),12,'Must have 12 month names'); - + //assuming invariant culture. $days = array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hello', 'world'); $this->format->MonthNames = $data; @@ -88,17 +88,17 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); } - + function testNarrowMonthNames() { $names = $this->format->NarrowMonthNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),12,'Must have 12 month names'); - + //assuming invariant culture. $days = array( "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hello', 'world'); $this->format->NarrowMonthNames = $data; @@ -112,13 +112,13 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $names = $this->format->AbbreviatedMonthNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),12,'Must have 12 month names'); - + //assuming invariant culture. $days = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hello', 'world'); $this->format->AbbreviatedMonthNames = $data; @@ -134,7 +134,7 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals('AD', $this->format->getEra(1)); $this->assertEquals('BC', $this->format->getEra(0)); } - + function testAMPMMarkers() { $am_pm = array('AM','PM'); $data = $this->format->AMPMMarkers; @@ -142,7 +142,7 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals($am_pm, $data); $this->assertEquals('AM', $this->format->AMDesignator); $this->assertEquals('PM', $this->format->PMDesignator); - + //try to set the data $data = array('Hello', 'world'); $this->format->AMPMMarkers = $data; @@ -150,10 +150,10 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertTrue(is_array($newNames),'Must be an array!'); $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); - + $this->format->AMDesignator = 'TTTT'; $this->assertEquals('TTTT',$this->format->AMDesignator); - + $this->format->PMDesignator = 'SSS'; $this->assertEquals('SSS',$this->format->PMDesignator); } @@ -171,37 +171,36 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { 'ShortDatePattern' => 'M/d/yy', 'DateTimeOrderPattern' => '{1} {0}' ); - + foreach($patterns as $property => $pattern) { $this->assertEquals($pattern, $this->format->$property); } - + $hello = 'Hello'; $world = 'world'; $expectedResult = $hello.' '.$world; $this->assertEquals($expectedResult, $this->format->formatDateTime($hello, $world)); } - + function testInvariantInfo() { $format = DateTimeFormatInfo::getInstance(); - + //the variant datetime format for medium date //should be the follow $pattern = 'MMM d, yyyy'; - + $this->assertEquals($pattern, $format->MediumDatePattern); - + $invariant = $format->getInvariantInfo(); - + $this->assertSame($format, $invariant); } - + function testGetInstance() { $format = DateTimeFormatInfo::getInstance('zh_CN'); - + $pattern = 'yyyy-M-d'; $this->assertEquals($pattern, $format->MediumDatePattern); - } -} -?>
\ No newline at end of file + } +}
\ No newline at end of file diff --git a/tests/unit/I18N/core/NumberFormatInfoTest.php b/tests/unit/I18N/core/NumberFormatInfoTest.php index d522144f..6243095a 100644 --- a/tests/unit/I18N/core/NumberFormatInfoTest.php +++ b/tests/unit/I18N/core/NumberFormatInfoTest.php @@ -8,27 +8,27 @@ Prado::using('System.I18N.core.NumberFormatInfo'); * @package System.I18N.core */ class NumberFormatInfoTest extends PHPUnit_Framework_TestCase { - + function testCurrencyPatterns() { $numberInfo = NumberFormatInfo::getCurrencyInstance(); - + //there should be 2 decimal places. $this->assertEquals($numberInfo->DecimalDigits,2); $this->assertEquals($numberInfo->DecimalSeparator,'.'); $this->assertEquals($numberInfo->GroupSeparator,','); - + //there should be only 1 grouping of size 3 $groupsize = array(3,false); $this->assertEquals($numberInfo->GroupSizes, $groupsize); - + //the default negative pattern prefix and postfix $negPattern = array('-¤',''); $this->assertEquals($numberInfo->NegativePattern, $negPattern); - + //the default positive pattern prefix and postfix $negPattern = array('¤',''); $this->assertEquals($numberInfo->PositivePattern, $negPattern); - + //the default currency symbol $this->assertEquals($numberInfo->CurrencySymbol, 'US$'); $this->assertEquals($numberInfo->getCurrencySymbol('JPY'), '¥'); @@ -38,51 +38,49 @@ class NumberFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals($numberInfo->PositiveSign, '+'); $this->assertEquals($numberInfo->NaNSymbol, '�'); $this->assertEquals($numberInfo->PercentSymbol, '%'); - $this->assertEquals($numberInfo->PerMilleSymbol, '‰'); + $this->assertEquals($numberInfo->PerMilleSymbol, '‰'); } function testPatternsSet() { $numberInfo = NumberFormatInfo::getInstance(); - + $numberInfo->DecimalDigits = 0; $this->assertEquals($numberInfo->DecimalDigits,0); - + $numberInfo->DecimalSeparator = ','; $this->assertEquals($numberInfo->DecimalSeparator,','); - + $numberInfo->GroupSeparator = ' '; $this->assertEquals($numberInfo->GroupSeparator,' '); - + $numberInfo->GroupSizes = array(2,3); $groupsize = array(2,3); $this->assertEquals($numberInfo->GroupSizes, $groupsize); - + $numberInfo->NegativePattern = array('-$$','.'); $negPattern = array('-$$','.'); $this->assertEquals($numberInfo->NegativePattern, $negPattern); - + $numberInfo->PositivePattern = array('YY','.'); $negPattern = array('YY','.'); $this->assertEquals($numberInfo->PositivePattern, $negPattern); - + //the default CurrencySymbol symbol $numberInfo->CurrencySymbol = '$$$'; $this->assertEquals($numberInfo->CurrencySymbol, '$$$'); } - + function testLocalizedPatterns() { $fr = NumberFormatInfo::getInstance('fr'); $de = NumberFormatInfo::getInstance('de'); $en = NumberFormatInfo::getInstance('en_US'); - + $this->assertEquals($fr->DecimalSeparator, ','); $this->assertEquals($de->DecimalSeparator, ','); $this->assertEquals($en->DecimalSeparator, '.'); - + $this->assertEquals($fr->GroupSeparator, ' '); $this->assertEquals($de->GroupSeparator, '.'); $this->assertEquals($en->GroupSeparator, ','); } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/NumberFormatTest.php b/tests/unit/I18N/core/NumberFormatTest.php index 958f05f4..ef8add77 100644 --- a/tests/unit/I18N/core/NumberFormatTest.php +++ b/tests/unit/I18N/core/NumberFormatTest.php @@ -14,7 +14,7 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { $wanted = '123,456,789.125156'; $this->assertEquals($wanted, $formatter->format($number)); - + //currency $wanted = 'US$123,456,789.13'; $this->assertEquals($wanted, $formatter->format($number,'c')); @@ -25,21 +25,21 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { $de = new NumberFormat('de'); $ja = new NumberFormat('ja_JP'); $it = new NumberFormat('it_IT'); - + $number = '123456789.125156'; - + //french $wanted = '123 456 789,13 F'; $this->assertEquals($wanted, $fr->format($number,'c','FRF')); - + //german $wanted = 'DES 123.456.789,13'; $this->assertEquals($wanted, $de->format($number,'c','DES')); - + //japanese $wanted = '¥123,456,789'; $this->assertEquals($wanted, $ja->format($number,'c','JPY')); - + //custom/unkown currency $wanted = 'DLL123,456,789'; $this->assertEquals($wanted, $ja->format($number,'c','DLL')); @@ -52,54 +52,54 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { function testCustomFormat() { $formatter = new NumberFormat(); $number = '123456789.125156'; - + //primay and secondary grouping test $pattern = '#,###,##.###'; $wanted = '1,234,567,89.125156'; $this->assertEquals($wanted, $formatter->format($number, $pattern)); - + //4 digits grouping test $pattern = '#,####.###'; $wanted = '1,2345,6789.125156'; $this->assertEquals($wanted, $formatter->format($number, $pattern)); - + //custom percentage $pattern = '#,###.00%'; $wanted = '123,456,789.13%'; $this->assertEquals($wanted, $formatter->format($number, $pattern)); } - + function testPercentageFormat() { $formatter = new NumberFormat(); $number = '0.125156'; $wanted = '12%'; $this->assertEquals($wanted, $formatter->format($number, 'p')); } - + function testQuotes() { $formatter = new NumberFormat(); $number = '123456789.125156'; - + $pattern = "# o'clock"; $wanted = "123456789 o'clock"; $this->assertEquals($wanted, $formatter->format($number, $pattern)); - + } - + function testPadding() { $formatter = new NumberFormat(); $number = '5'; - + $pattern = '0000'; $wanted = '0005'; - + $this->assertEquals($wanted, $formatter->format($number, $pattern)); } - + function testFormatWithANegativeValue() { $formatter = new NumberFormat(); $number = "-1.2"; - + $wanted = "-1.2"; $this->assertEquals($wanted, $formatter->format($number)); } @@ -110,33 +110,33 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { $expected = "10E"; $this->assertEquals('10E', $formatter->format($number, 'e')); } - + function testRounding() { $formatter = new NumberFormat(); - + $number = 349.999; $pattern = '#.00'; $expected = '350.00'; - + $this->assertEquals($expected, $formatter->format($number, $pattern)); } function testRounding2() { $formatter = new NumberFormat(); - + $number = 349.99; $pattern = '#.00'; $expected = '349.99'; - + $this->assertEquals($expected, $formatter->format($number, $pattern)); } function testLocalizedCurrencyFormats2() { $it = new NumberFormat('it_IT'); - + $number = 12.41; $wanted = '12,41'; $this->assertEquals($wanted, $it->format($number,'d')); @@ -149,7 +149,7 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { $wanted = '10.010,23'; $this->assertEquals($wanted, $it->format($number,'d')); - $old= setlocale(LC_ALL,"0"); + $old= setlocale(LC_ALL,"0"); setlocale(LC_ALL,"it_IT"); $number = 12.41; @@ -167,5 +167,3 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { setlocale(LC_ALL,$old); } } - -?>
\ No newline at end of file diff --git a/tests/unit/IO/AllTests.php b/tests/unit/IO/AllTests.php index 01bbd95d..c789169f 100644 --- a/tests/unit/IO/AllTests.php +++ b/tests/unit/IO/AllTests.php @@ -11,13 +11,13 @@ class IO_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.IO'); - + $suite->addTestSuite('TTarFileExtractorTest'); $suite->addTestSuite('TTextWriterTest'); - + return $suite; } } @@ -25,4 +25,3 @@ class IO_AllTests { if(PHPUnit_MAIN_METHOD == 'IO_AllTests::main') { IO_AllTests::main(); } -?> diff --git a/tests/unit/IO/TTarFileExtractorTest.php b/tests/unit/IO/TTarFileExtractorTest.php index 66b66831..860560b1 100644 --- a/tests/unit/IO/TTarFileExtractorTest.php +++ b/tests/unit/IO/TTarFileExtractorTest.php @@ -14,10 +14,9 @@ class TTarFileExtractorTest extends PHPUnit_Framework_TestCase { public function testDestruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testExtract() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/IO/TTextWriterTest.php b/tests/unit/IO/TTextWriterTest.php index d23fec36..087812d7 100644 --- a/tests/unit/IO/TTextWriterTest.php +++ b/tests/unit/IO/TTextWriterTest.php @@ -20,7 +20,7 @@ class TTextWriterTest extends PHPUnit_Framework_TestCase { $writer->write("more text\n"); self::assertEquals("some text\nmore text\n", $writer->flush()); } - + public function testWriteLine() { $writer = new TTextWriter(); $writer->writeLine('some text'); @@ -28,4 +28,3 @@ class TTextWriterTest extends PHPUnit_Framework_TestCase { } } -?> diff --git a/tests/unit/Security/AllTests.php b/tests/unit/Security/AllTests.php index 40316719..e71307a9 100644 --- a/tests/unit/Security/AllTests.php +++ b/tests/unit/Security/AllTests.php @@ -14,16 +14,16 @@ class Security_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Security'); - + $suite->addTestSuite('TAuthManagerTest'); $suite->addTestSuite('TAuthorizationRuleTest'); $suite->addTestSuite('TSecurityManagerTest'); $suite->addTestSuite('TUserManagerTest'); $suite->addTestSuite('TUserTest'); - + return $suite; } } @@ -31,4 +31,3 @@ class Security_AllTests { if(PHPUnit_MAIN_METHOD == 'Security_AllTests::main') { Security_AllTests::main(); } -?> diff --git a/tests/unit/Security/TAuthManagerTest.php b/tests/unit/Security/TAuthManagerTest.php index 03244a22..3b8b9305 100644 --- a/tests/unit/Security/TAuthManagerTest.php +++ b/tests/unit/Security/TAuthManagerTest.php @@ -8,7 +8,7 @@ Prado::using('System.Xml.TXmlDocument'); * @package System.Security */ class TAuthManagerTest extends PHPUnit_Framework_TestCase { - + public static $app = null; public static $usrMgr = null; @@ -18,7 +18,7 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase { if(self::$app === null) { self::$app = new TApplication(dirname(__FILE__).'/app'); } - + // Make a fake user manager module if (self::$usrMgr === null) { self::$usrMgr=new TUserManager (); @@ -39,26 +39,26 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase { $authManager->init(null); self::fail ('Expected TConfigurationException not thrown'); } catch (TConfigurationException $e) {} - + $authManager->setUserManager('users'); $authManager->init (null); self::assertEquals(self::$usrMgr, $authManager->getUserManager()); } - + public function testUserManager() { $authManager=new TAuthManager (); $authManager->setUserManager('users'); $authManager->init(null); self::assertEquals(self::$usrMgr, $authManager->getUserManager()); - + // test change try { $authManager->setUserManager('invalid'); self::fail ('Expected TInvalidOperationException not thrown'); } catch (TInvalidOperationException $e) {} - + } - + public function testLoginPage() { $authManager=new TAuthManager (); $authManager->setUserManager('users'); @@ -66,7 +66,7 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase { $authManager->setLoginPage ('LoginPage'); self::assertEquals('LoginPage', $authManager->getLoginPage()); } - + public function testDoAuthentication() { throw new PHPUnit_Framework_IncompleteTestError(); // Not yet finished, Session won't start because of headers :( :( @@ -76,41 +76,40 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase { $authManager->init(null); $authManager->setLoginPage ('LoginPage'); self::$app->raiseEvent ('onAuthentication', self::$app, null); - + } - + public function testDoAuthorization() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLeave() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testReturnUrl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnAuthenticate() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnAuthorize() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testUpdateSessionUser() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLogin() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLogout() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Security/TAuthorizationRuleTest.php b/tests/unit/Security/TAuthorizationRuleTest.php index 5d5f2d97..5bfa6c2c 100644 --- a/tests/unit/Security/TAuthorizationRuleTest.php +++ b/tests/unit/Security/TAuthorizationRuleTest.php @@ -16,35 +16,34 @@ class TAuthorizationRuleTest extends PHPUnit_Framework_TestCase { public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAction() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testUsers() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRoles() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testVerb() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGuestApplied() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testEveryoneApplied() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsUserAllowed() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Security/TSecurityManagerTest.php b/tests/unit/Security/TSecurityManagerTest.php index 09c261cf..9c319a5a 100644 --- a/tests/unit/Security/TSecurityManagerTest.php +++ b/tests/unit/Security/TSecurityManagerTest.php @@ -22,39 +22,39 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { $sec->init(null); self::assertEquals ($sec, self::$app->getSecurityManager()); } - + public function testValidationKey() { $sec=new TSecurityManager (); $sec->init (null); // Random validation key $valkey=$sec->getValidationKey (); self::assertEquals($valkey, self::$app->getGlobalState(TSecurityManager::STATE_VALIDATION_KEY)); - + $sec->setValidationKey ('aKey'); self::assertEquals('aKey',$sec->getValidationKey()); - + try { $sec->setValidationKey (''); self::fail ('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} } - + public function testEncryptionKey() { $sec=new TSecurityManager (); $sec->init (null); // Random encryption key $valkey=$sec->getEncryptionKey (); self::assertEquals($valkey, self::$app->getGlobalState(TSecurityManager::STATE_ENCRYPTION_KEY)); - + $sec->setEncryptionKey ('aKey'); self::assertEquals('aKey',$sec->getEncryptionKey()); - + try { $sec->setEncryptionKey (''); self::fail ('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} } - + public function testValidation() { $sec=new TSecurityManager (); $sec->init (null); @@ -67,7 +67,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { self::fail ('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} } - + public function testEncryption() { $sec=new TSecurityManager (); $sec->init (null); @@ -79,7 +79,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals('NotExisting', $sec->getCryptAlgorithm()); } } - + public function testEncryptDecrypt() { $sec=new TSecurityManager (); $sec->init (null); @@ -101,13 +101,13 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals($plainText,$decrypted); - // try change key + // try change key $sec->setEncryptionKey ('anotherKey'); self::assertNotEquals($plainText, $sec->decrypt($encrypted)); } } - - + + public function testHashData() { $sec=new TSecurityManager (); $sec->init (null); @@ -118,7 +118,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals (54, strlen($hashed)); // The initial text should be after the initial hash self::assertEquals ('A text to hash', substr($hashed,40)); - + // Same tests with MD5 $sec->setValidationKey('AnotherKey'); $sec->setValidation('MD5'); @@ -128,7 +128,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { // The initial text should be after the initial hash self::assertEquals ('A text to hash', substr($hashed,32)); } - + public function testValidateData() { $sec=new TSecurityManager (); $sec->init (null); @@ -142,8 +142,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { // and a test without tampered data self::assertFalse($sec->validateData('bad')); } - + } -?> diff --git a/tests/unit/Security/TUserManagerTest.php b/tests/unit/Security/TUserManagerTest.php index edb7ea6f..91b9d0c6 100644 --- a/tests/unit/Security/TUserManagerTest.php +++ b/tests/unit/Security/TUserManagerTest.php @@ -6,18 +6,18 @@ Prado::using('System.Security.TUserManager'); * @package System.Security */ class TUserManagerTest extends PHPUnit_Framework_TestCase { - + public static $app=null; public static $config=null; - + public function setUp() { - + if(self::$app === null) { self::$app = new TApplication(dirname(__FILE__).'/app'); prado::setPathofAlias('App', dirname(__FILE__)); } - + if (self::$config === null) { // Simulate a config file self::$config=new TXmlDocument('1.0','utf8'); @@ -41,21 +41,21 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { $userManager->init (new TXmlDocument()); // Empty config self::assertEquals(array('joe'=>'demo','john'=>'demo', 'test' => 'test'), $userManager->getUsers()); unlink (dirname(__FILE__).'/users.xml'); - } + } } - + public function testUsers() { $userManager=new TUserManager (); $userManager->init (self::$config); self::assertEquals(array('joe'=>'demo','john'=>'demo', 'test' => 'test'), $userManager->getUsers()); } - + public function testRoles() { $userManager=new TUserManager (); $userManager->init (self::$config); self::assertEquals(array('joe'=>array ('Writer'), 'john'=>array ('Administrator','Writer'), 'test' => array ('Reader', 'User')), $userManager->getRoles()); } - + public function testUserFile() { $userManager=new TUserManager (); try { @@ -71,7 +71,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals(dirname(__FILE__).'/users.xml', $userManager->getUserFile()); unlink (dirname(__FILE__).'/users.xml'); $userManager=null; - } + } $userManager=new TUserManager (); $userManager->init (self::$config); try { @@ -79,14 +79,14 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { self::fail ('Exception TInvalidOperationException not thrown'); } catch (TInvalidOperationException $e) {} } - + public function testGuestName() { $userManager=new TUserManager (); self::assertEquals('Guest', $userManager->getGuestName()); $userManager->setGuestName('Invite'); self::assertEquals('Invite', $userManager->getGuestName()); } - + public function testPasswordMode() { $userManager=new TUserManager (); $userManager->setPasswordMode('Clear'); @@ -99,9 +99,9 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { $userManager->setPasswordMode('Invalid'); self::fail ('Exception TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} - + } - + public function testValidateUser() { $userManager=new TUserManager (); $userManager->init (self::$config); @@ -109,7 +109,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { self::assertTrue($userManager->validateUser('Joe', 'demo')); self::assertFalse($userManager->validateUser('John', 'bad')); } - + public function testUser() { $userManager=new TUserManager (); $userManager->init (self::$config); @@ -123,7 +123,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { self::assertFalse($user->getIsGuest()); self::assertNull($userManager->getUser('badUser')); } - + public function testSwitchToGuest() { $userManager=new TUserManager (); $userManager->init (self::$config); @@ -134,4 +134,3 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Security/TUserTest.php b/tests/unit/Security/TUserTest.php index 6fa337e0..3692b97c 100644 --- a/tests/unit/Security/TUserTest.php +++ b/tests/unit/Security/TUserTest.php @@ -32,18 +32,18 @@ class TUserTest extends PHPUnit_Framework_TestCase { self::assertEquals('Guest', $user->getName()); self::assertEquals(self::$mgr, $user->getManager()); } - + public function testManager() { $user = new TUser (self::$mgr); self::assertEquals(self::$mgr, $user->getManager()); } - + public function testName() { $user = new TUser (self::$mgr); $user->setName('joe'); self::assertEquals('joe', $user->getName()); } - + public function testIsGuest() { $user = new TUser (self::$mgr); $user->setName('John'); @@ -54,7 +54,7 @@ class TUserTest extends PHPUnit_Framework_TestCase { self::assertTrue($user->getIsGuest()); self::assertEquals(array(),$user->getRoles()); } - + public function testRoles() { $user=new TUser(self::$mgr); $user->setRoles(array('Administrator','Writer')); @@ -62,7 +62,7 @@ class TUserTest extends PHPUnit_Framework_TestCase { $user->setRoles('Reader,User'); self::assertEquals(array('Reader','User'), $user->getRoles()); } - + public function testIsInRole() { $user=new TUser(self::$mgr); $user->setRoles(array('Administrator','Writer')); @@ -71,7 +71,7 @@ class TUserTest extends PHPUnit_Framework_TestCase { self::assertTrue($user->IsInRole('Writer')); self::assertFalse($user->isInRole('Reader')); } - + public function testSaveToString() { $user = new TUser (self::$mgr); $user->setName('John'); @@ -81,20 +81,20 @@ class TUserTest extends PHPUnit_Framework_TestCase { $assumedState=array ('Name' => 'John', 'IsGuest' => false, 'Roles' => array ('Administrator', 'Writer')); self::assertEquals(serialize($assumedState), $user->saveToString()); } - + public function testLoadFromString() { $user = new TUser (self::$mgr); $user->setName('John'); $user->setIsGuest(false); $user->setRoles('Administrator, Writer'); $save=$user->saveToString(); - + $user2 = new TUser (self::$mgr); $user2->loadFromString($save); - + self::assertEquals($user, $user2); } - + /* getState & setState are protected methods, will be tested with other tests. public function testState() { throw new PHPUnit_Framework_IncompleteTestError(); @@ -111,4 +111,3 @@ class TUserTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/TComponentTest.php b/tests/unit/TComponentTest.php index 93668dc0..9a2299da 100644 --- a/tests/unit/TComponentTest.php +++ b/tests/unit/TComponentTest.php @@ -13,24 +13,24 @@ class NewComponent extends TComponent { public function getAutoGlobalListen() { return true; - } + } public function getText() { return $this->_text; } - + public function setText($value) { $this->_text=$value; } - + public function getReadOnlyProperty() { return 'read only'; } - + public function getJsReadOnlyJsProperty() { return 'js read only'; } - + public function getObject() { if(!$this->_object) { $this->_object=new NewComponent; @@ -38,19 +38,19 @@ class NewComponent extends TComponent { } return $this->_object; } - + public function onMyEvent($param) { $this->raiseEvent('OnMyEvent',$this,$param); } - + public function myEventHandler($sender,$param) { $this->_eventHandled=true; } - + public function eventReturnValue($sender,$param) { return $param->Return; } - + public function isEventHandled() { return $this->_eventHandled; } @@ -82,14 +82,14 @@ class NewComponentNoListen extends NewComponent { class DynamicCatchingComponent extends NewComponentNoListen implements IDynamicMethods { public function __dycall($method, $args) { - + } } class GlobalRaiseComponent extends NewComponent implements IDynamicMethods { private $_callorder = array(); - + public function getCallOrders() { return $this->_callorder; @@ -128,7 +128,7 @@ class FooClassBehavior extends TClassBehavior { class FooFooClassBehavior extends FooClassBehavior { public function faafaaEverMore($object, $laa, $sol) { - + } } @@ -146,7 +146,7 @@ class FooBehavior extends TBehavior { } } class FooFooBehavior extends FooBehavior { - + public function faafaaEverMore($laa, $sol) { return sqrt($laa * $laa + $sol * $sol); } @@ -162,11 +162,11 @@ class PreBarBehavior extends TBehavior { class BarBehavior extends PreBarBehavior implements IInstanceCheck { private $_instanceReturn = null; - + public function moreFunction($laa, $sol) { return pow($laa+$sol+1, 2); } - + public function isinstanceof($class, $instance=null) { return $this->_instanceReturn; } @@ -200,7 +200,7 @@ class BehaviorTestBehavior extends TBehavior { public function getReadOnly() { return true; } - + public function onBehaviorEvent($sender, $param,$responsetype=null,$postfunction=null) { return $this->getOwner()->raiseEvent('onBehaviorEvent',$sender,$param,$responsetype,$postfunction); } @@ -264,40 +264,40 @@ class dy3ClassTextReplace extends dy1ClassTextReplace { class IntraObjectExtenderBehavior extends TBehavior { - + private $lastCall = null; private $arglist = null; - + public function getLastCall() { $v = $this->lastCall; $this->lastCall = null; return $v; } - + public function getLastArgumentList() { $v = $this->arglist; $this->arglist = null; return $v; } - - - + + + public function dyListen($fx, $chain) { $this->lastCall = 1; $this->arglist = func_get_args(); - + return $chain->dyListen($fx); // Calls the next event, within a chain } public function dyUnlisten($fx, $chain) { $this->lastCall = 2; $this->arglist = func_get_args(); - + return $chain->dyUnlisten($fx); } public function dyPreRaiseEvent($name,$sender,$param,$responsetype,$postfunction, $chain) { $this->lastCall = 3; $this->arglist = func_get_args(); - + return $chain->dyPreRaiseEvent($name);// Calls the next event, within a chain, if parameters are left off, they are filled in with // the original parameters passed to the dynamic event. Parameters can be passed if they are changed. } @@ -409,7 +409,7 @@ class TDynamicClassBehavior extends TClassBehavior implements IDynamicMethods { * @package System */ class TComponentTest extends PHPUnit_Framework_TestCase { - + protected $component; public function setUp() { @@ -424,21 +424,21 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->component->unlisten(); $this->component = null; } - - + + public function testGetListeningToGlobalEvents() { $this->assertEquals(true, $this->component->getListeningToGlobalEvents()); $this->component->unlisten(); $this->assertEquals(false, $this->component->getListeningToGlobalEvents()); } - - + + public function testConstructorAutoListen() { // the default object auto installs class behavior hooks $this->assertEquals(1, $this->component->getEventHandlers('fxAttachClassBehavior')->getCount()); $this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount()); $this->assertTrue($this->component->getListeningToGlobalEvents()); - + // this object does not auto install class behavior hooks, thus not changing the global event structure. // Creating a new instance should _not_ influence the fxAttachClassBehavior and fxDetachClassBehavior // count. @@ -447,655 +447,655 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount()); $this->assertEquals(1, $component_nolisten->getEventHandlers('fxAttachClassBehavior')->getCount()); $this->assertEquals(1, $component_nolisten->getEventHandlers('fxDetachClassBehavior')->getCount()); - - // tests order of class behaviors when a parent and class have class behavior. + + // tests order of class behaviors when a parent and class have class behavior. // The child should override the parent object-oriented programming style $this->component->attachClassBehavior('Bar', 'BarBehavior', 'NewComponentNoListen'); $this->component->attachClassBehavior('FooBar', 'FooBarBehavior', 'NewComponent'); - + //create new object with new class behaviors built in, defined in the two lines above $component = new NewComponentNoListen; - + $this->assertEquals(25, $component->moreFunction(2, 2)); - + $this->assertEquals(25, $component->Bar->moreFunction(2, 2)); $this->assertEquals(8, $component->FooBar->moreFunction(2, 2)); - + $component->unlisten();// unwind object and class behaviors $this->component->detachClassBehavior('FooBar', 'NewComponent'); $this->component->detachClassBehavior('Bar', 'NewComponentNoListen'); - + } - - + + public function testListenAndUnlisten() { - + $component = new NewComponentNoListen(); - + $this->assertEquals(false, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(1, $component->getEventHandlers('fxAttachClassBehavior')->getCount()); - + $this->assertEquals(2, $component->listen()); - + $this->assertEquals(true, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(2, $component->getEventHandlers('fxAttachClassBehavior')->getCount()); - + $this->assertEquals(2, $component->unlisten()); - + $this->assertEquals(false, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(1, $component->getEventHandlers('fxAttachClassBehavior')->getCount()); } - - + + public function testListenAndUnlistenWithDynamicEventCatching() { - + $component = new DynamicCatchingComponent(); - + $this->assertEquals(false, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(0, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount()); - + // this adds the fxAttachClassBehavior, fxDetachClassBehavior, and __dycall of the component $this->assertEquals(3, $component->listen()); - + $this->assertEquals(true, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(1, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount()); - + $this->assertEquals(3, $component->unlisten()); - + $this->assertEquals(false, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(0, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount()); } - - - + + + //Test Class behaviors public function testAttachClassBehavior() { - + // ensure that the class is listening $this->assertEquals(1, $this->component->getEventHandlers('fxAttachClassBehavior')->getCount()); - + //Test that the component is not a FooClassBehavior $this->assertNull($this->component->asa('FooClassBehavior'), "Component is already a FooClassBehavior and should not have this behavior"); - + //Add the FooClassBehavior $this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior); - + //Test that the existing listening component can be a FooClassBehavior $this->assertNotNull($this->component->asa('FooClassBehavior'), "Component is does not have the FooClassBehavior and should have this behavior"); - + // test if the function modifies new instances of the object $anothercomponent = new NewComponent(); - + //The new component should be a FooClassBehavior $this->assertNotNull($anothercomponent->asa('FooClassBehavior'), "anothercomponent does not have the FooClassBehavior"); - + // test when overwriting an existing class behavior, it should throw an TInvalidOperationException try { $this->component->attachClassBehavior('FooClassBehavior', new BarClassBehavior); $this->fail('TInvalidOperationException not raised when overwriting an existing behavior'); } catch(TInvalidOperationException $e) { } - - + + // test when overwriting an existing class behavior, it should throw an TInvalidOperationException try { $this->component->attachClassBehavior('FooBarBehavior', 'FooBarBehavior', 'TComponent'); $this->fail('TInvalidOperationException not raised when trying to place a behavior on the root object TComponent'); } catch(TInvalidOperationException $e) { } - - + + // test if the function does not modify any existing objects that are not listening // The FooClassBehavior is already a part of the class behaviors thus the new instance gets the behavior. $nolistencomponent = new NewComponentNoListen(); - + // test if the function modifies all existing objects that are listening // Adding a behavior to the first object, the second instance should automatically get the class behavior. // This is because the second object is listening to the global events of class behaviors $this->component->attachClassBehavior('BarClassBehavior', new BarClassBehavior); $this->assertNotNull($anothercomponent->asa('BarClassBehavior'), "anothercomponent is does not have the BarClassBehavior"); - + // The no listen object should not have the BarClassBehavior because it was added as a class behavior after the object was instanced $this->assertNull($nolistencomponent->asa('BarClassBehavior'), "nolistencomponent has the BarClassBehavior and should not"); - + // But the no listen object should have the FooClassBehavior because the class behavior was installed before the object was instanced $this->assertNotNull($nolistencomponent->asa('FooClassBehavior'), "nolistencomponent is does not have the FooClassBehavior"); - + //Clear out what was done during this test $anothercomponent->unlisten(); $this->component->detachClassBehavior('FooClassBehavior'); $this->component->detachClassBehavior('BarClassBehavior'); - + // Test attaching of single object behaviors as class-wide behaviors $this->component->attachClassBehavior('BarBehaviorObject', 'BarBehavior'); $this->assertTrue($this->component->asa('BarBehaviorObject') instanceof BarBehavior); $this->assertEquals($this->component->BarBehaviorObject->Owner, $this->component); $this->component->detachClassBehavior('BarBehaviorObject'); } - - - - - + + + + + public function testDetachClassBehavior() { // ensure that the component is listening $this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount()); - + $prenolistencomponent = new NewComponentNoListen(); - + //Attach a class behavior $this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior); - + //Create new components that listen and don't listen to global events $anothercomponent = new NewComponent(); $postnolistencomponent = new NewComponentNoListen(); - + //ensures that all the Components are properly initialized $this->assertEquals(2, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount()); $this->assertNotNull($this->component->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior"); $this->assertNull($prenolistencomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior"); $this->assertNotNull($anothercomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior"); $this->assertNotNull($postnolistencomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior"); - - + + $this->component->detachClassBehavior('FooClassBehavior'); - + $this->assertNull($this->component->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior"); $this->assertNull($prenolistencomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior"); $this->assertNull($anothercomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior"); $this->assertNotNull($postnolistencomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior"); - - + + //tear down function variables $anothercomponent->unlisten(); } - + public function testGetClassHierarchy() { $component = new DynamicCatchingComponent; $this->assertEquals(array('TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy()); $this->assertEquals(array('TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy(false)); $this->assertEquals(array('tcomponent', 'newcomponent', 'newcomponentnolisten', 'dynamiccatchingcomponent'), $component->getClassHierarchy(true)); } - - + + public function testAsA() { $anothercomponent = new NewComponent(); - + // ensure the component does not have the FooClassBehavior $this->assertNull($this->component->asa('FooClassBehavior')); $this->assertNull($this->component->asa('FooFooClassBehavior')); $this->assertNull($this->component->asa('BarClassBehavior')); $this->assertNull($this->component->asa('NonExistantClassBehavior')); - + $this->assertNull($anothercomponent->asa('FooClassBehavior')); $this->assertNull($anothercomponent->asa('FooFooClassBehavior')); $this->assertNull($anothercomponent->asa('BarClassBehavior')); $this->assertNull($anothercomponent->asa('NonExistantClassBehavior')); - + // add the class behavior $this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior); - + //Check that the component has only the class behavior assigned $this->assertNotNull($this->component->asa('FooClassBehavior')); $this->assertNull($this->component->asa('FooFooClassBehavior')); $this->assertNull($this->component->asa('BarClassBehavior')); $this->assertNull($this->component->asa('NonExistantClassBehavior')); - + //Check that the component has only the class behavior assigned $this->assertNotNull($anothercomponent->asa('FooClassBehavior')); $this->assertNull($anothercomponent->asa('FooFooClassBehavior')); $this->assertNull($anothercomponent->asa('BarClassBehavior')); $this->assertNull($anothercomponent->asa('NonExistantClassBehavior')); - + // remove the class behavior $this->component->detachClassBehavior('FooClassBehavior'); - + // Check the function doesn't have the behavior any more $this->assertNull($this->component->asa('FooClassBehavior')); $this->assertNull($this->component->asa('FooFooClassBehavior')); $this->assertNull($this->component->asa('BarClassBehavior')); $this->assertNull($this->component->asa('NonExistantClassBehavior')); - + $this->assertNull($anothercomponent->asa('FooClassBehavior')); $this->assertNull($anothercomponent->asa('FooFooClassBehavior')); $this->assertNull($anothercomponent->asa('BarClassBehavior')); $this->assertNull($anothercomponent->asa('NonExistantClassBehavior')); - - - - + + + + $this->component->attachBehavior('BarBehavior', new BarBehavior); - + //Check that the component has only the object behavior assigned $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('FooFooBehavior')); $this->assertNotNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('NonExistantBehavior')); - + //Check that the component has the behavior assigned $this->assertNull($anothercomponent->asa('FooBehavior')); $this->assertNull($anothercomponent->asa('FooFooBehavior')); $this->assertNull($anothercomponent->asa('BarBehavior')); $this->assertNull($anothercomponent->asa('NonExistantBehavior')); - + $this->component->detachBehavior('BarBehavior'); - + //Check that the component has no object behaviors assigned $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('FooFooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('NonExistantBehavior')); - + //Check that the component has no behavior assigned $this->assertNull($anothercomponent->asa('FooBehavior')); $this->assertNull($anothercomponent->asa('FooFooBehavior')); $this->assertNull($anothercomponent->asa('BarBehavior')); $this->assertNull($anothercomponent->asa('NonExistantBehavior')); - + $anothercomponent->unlisten(); } - + public function testIsA() { //This doesn't check the IInstanceCheck functionality, separate function - + $this->assertTrue($this->component->isa('TComponent')); $this->assertTrue($this->component->isa('NewComponent')); $this->assertFalse($this->component->isa(new FooBehavior)); $this->assertFalse($this->component->isa('FooBehavior')); - + //Ensure there is no BarBehavior $this->assertNull($this->component->asa('FooFooBehavior')); - + $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooFooBehavior')); - + $this->component->attachBehavior('FooFooBehavior', new FooFooBehavior); - + $this->assertNotNull($this->component->asa('FooFooBehavior')); - + $this->assertTrue($this->component->isa('FooBehavior')); $this->assertTrue($this->component->isa('FooFooBehavior')); - + $this->component->disableBehaviors(); // It still has the behavior $this->assertNotNull($this->component->asa('FooFooBehavior')); - + // But it is not expressed $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooFooBehavior')); - + $this->component->enableBehaviors(); $this->assertNotNull($this->component->asa('FooFooBehavior')); - + $this->assertTrue($this->component->isa('FooFooBehavior')); - - - + + + $this->component->attachBehavior('FooBarBehavior', new FooBarBehavior); - + $this->assertTrue($this->component->isa('FooBehavior')); $this->assertTrue($this->component->isa('FooBarBehavior')); - + $this->component->disableBehavior('FooBarBehavior'); - + $this->assertTrue($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); - + $this->component->enableBehavior('FooBarBehavior'); $this->component->disableBehavior('FooFooBehavior'); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertTrue($this->component->isa('FooBarBehavior')); - + $this->component->disableBehavior('FooBarBehavior'); $this->component->disableBehavior('FooFooBehavior'); - + $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); - + $this->component->enableBehavior('FooBarBehavior'); $this->component->enableBehavior('FooFooBehavior'); - + $this->assertTrue($this->component->isa('FooFooBehavior')); $this->assertTrue($this->component->isa('FooBarBehavior')); - - + + $this->component->detachBehavior('FooFooBehavior'); $this->component->detachBehavior('FooBarBehavior'); - + $this->assertFalse($this->component->isa(new FooBehavior)); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa(new FooFooBehavior)); $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertFalse($this->component->isa(new FooBarBehavior)); $this->assertFalse($this->component->isa('FooBarBehavior')); - + } - + public function testIsA_with_IInstanceCheck() { - + $this->assertTrue($this->component->isa('NewComponent')); $this->assertFalse($this->component->isa('PreBarBehavior')); - + $this->component->attachBehavior('BarBehavior', $behavior = new BarBehavior); - + $behavior->setInstanceReturn(null); - + $this->assertTrue($this->component->isa('NewComponent')); $this->assertTrue($this->component->isa('PreBarBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); - + // This forces the iso on the BarBehavior to respond to any class with false $behavior->setInstanceReturn(false); $this->assertFalse($this->component->isa('PreBarBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); - + //This forces the isa on the BarBehavior to respond to any class with true $behavior->setInstanceReturn(true); $this->assertTrue($this->component->isa('FooBehavior')); - - + + } - + public function testAttachDetachBehavior() { - + try { $this->component->faaEverMore(true, true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); - + try { $this->component->attachBehavior('FooBehavior', new TComponent); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TInvalidDataTypeException $e) {} - + $this->component->attachBehavior('FooBehavior', new FooBehavior); - + $this->assertNotNull($this->component->asa('FooBehavior')); $this->assertTrue($this->component->isa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); - + try { $this->assertTrue($this->component->faaEverMore(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - + try { $this->component->noMethodHere(true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->assertTrue($this->component->disableBehavior('FooBehavior')); - + //BarBehavior is not a behavior at this time $this->assertNull($this->component->disableBehavior('BarBehavior')); - + try { $this->component->faaEverMore(true, true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->assertTrue($this->component->enableBehavior('FooBehavior')); - + //BarBehavior is not a behavior at this time $this->assertNull($this->component->enableBehavior('BarBehavior')); - + try { $this->assertTrue($this->component->faaEverMore(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - + $this->component->detachBehavior('FooBehavior'); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); - + } - + public function testAttachDetachBehaviors() { $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNull($this->component->asa('PreBarBehavior')); - + $this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior, 'PreBarBehavior' => new PreBarBehavior)); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNotNull($this->component->asa('FooFooBehavior')); $this->assertNotNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNotNull($this->component->asa('PreBarBehavior')); - + $this->assertTrue($this->component->isa('FooFooBehavior')); $this->assertTrue($this->component->isa('FooBehavior')); $this->assertTrue($this->component->isa('BarBehavior')); $this->assertTrue($this->component->isa('PreBarBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); - + $this->component->detachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior)); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('FooFooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNotNull($this->component->asa('PreBarBehavior')); - + $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); $this->assertTrue($this->component->isa('PreBarBehavior')); - - - + + + // testing if we can detachBehaviors just by the name of the behavior instead of an array of the behavior $this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior)); - + $this->assertTrue($this->component->isa('FooBehavior')); $this->assertTrue($this->component->isa('BarBehavior')); - + $this->component->detachBehaviors(array('FooFooBehavior', 'BarBehavior')); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('FooFooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); - + $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); } - - + + public function testClearBehaviors() { - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNull($this->component->asa('PreBarBehavior')); - + $this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior, 'PreBarBehavior' => new PreBarBehavior)); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNotNull($this->component->asa('FooFooBehavior')); $this->assertNotNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNotNull($this->component->asa('PreBarBehavior')); - + $this->component->clearBehaviors(); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNull($this->component->asa('PreBarBehavior')); } - + public function testEnableDisableBehavior() { - + $this->assertNull($this->component->enableBehavior('FooBehavior')); $this->assertNull($this->component->disableBehavior('FooBehavior')); - + try { $this->component->faaEverMore(true, true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->component->attachBehavior('FooBehavior', new FooBehavior); - + $this->assertTrue($this->component->isa('FooBehavior')); try { $this->assertTrue($this->component->faaEverMore(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - + $this->assertTrue($this->component->disableBehavior('FooBehavior')); - + $this->assertFalse($this->component->isa('FooBehavior')); - + try { $this->component->faaEverMore(true, true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->assertTrue($this->component->enableBehavior('FooBehavior')); - + $this->assertTrue($this->component->isa('FooBehavior')); try { $this->assertTrue($this->component->faaEverMore(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - - - + + + $this->assertNull($this->component->enableBehavior('BarClassBehavior')); $this->assertNull($this->component->disableBehavior('BarClassBehavior')); - + try { $this->component->moreFunction(true, true); $this->fail('TApplicationException not raised trying to execute an undefined class method'); } catch(TApplicationException $e) {} - + $this->component->attachClassBehavior('BarClassBehavior', new BarClassBehavior); - + $this->assertFalse($this->component->enableBehavior('BarClassBehavior')); $this->assertFalse($this->component->disableBehavior('BarClassBehavior')); - + try { $this->assertTrue($this->component->moreFunction(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - + $this->component->detachClassBehavior('BarClassBehavior'); } - - + + public function testBehaviorFunctionCalls() { - + $this->component->attachBehavior('FooBarBehavior', $behavior = new FooBarBehavior); $this->component->attachClassBehavior('FooClassBehavior', $classbehavior = new FooClassBehavior); - + // Test the Class Methods $this->assertEquals(12, $this->component->faaEverMore(3, 4)); - + // Check that the called object is shifted in front of the array of a class behavior call $this->assertEquals($this->component, $this->component->getLastClassObject()); - - + + //Test the FooBarBehavior $this->assertEquals(27, $this->component->moreFunction(3, 3)); - + $this->assertTrue($this->component->disableBehavior('FooBarBehavior')); try { $this->assertNull($this->component->moreFunction(3, 4)); $this->fail('TApplicationException not raised trying to execute a disabled behavior'); } catch(TApplicationException $e) {} $this->assertTrue($this->component->enableBehavior('FooBarBehavior')); - + // Test the global event space, this should work and return false because no function implements these methods $this->assertNull($this->component->fxSomeUndefinedGlobalEvent()); $this->assertNull($this->component->dySomeUndefinedIntraObjectEvent()); - + $this->component->detachClassBehavior('FooClassBehavior'); - - - + + + // test object instance behaviors implemented through class-wide behaviors $this->component->attachClassBehavior('FooFooBehaviorAsClass', 'FooFooBehavior'); - + $component = new NewComponent; - + $this->assertEquals(5, $this->component->faafaaEverMore(3, 4)); $this->assertEquals(10, $component->faafaaEverMore(6, 8)); - + $this->component->detachClassBehavior('FooFooBehaviorAsClass'); $component->unlisten(); $component = null; - + try { $this->component->faafaaEverMore(3, 4); $this->fail('TApplicationException not raised trying to execute a disabled behavior'); } catch(TApplicationException $e) {} - - - + + + // make a call to an unpatched fx and dy call so that it's passed through to the __dycall function $dynamicComponent = new DynamicCallComponent; - + $this->assertNull($dynamicComponent->fxUndefinedEvent()); $this->assertNull($dynamicComponent->dyUndefinedEvent()); - + //This tests the dynamic __dycall function $this->assertEquals(1024, $dynamicComponent->dyPowerFunction(2, 10)); $this->assertEquals(5, $dynamicComponent->dyDivisionFunction(10, 2)); - + $this->assertEquals(2048, $dynamicComponent->fxPowerFunction(2, 10)); $this->assertEquals(10, $dynamicComponent->fxDivisionFunction(10, 2)); - + $dynamicComponent->unlisten(); - + } - + public function testHasProperty() { $this->assertTrue($this->component->hasProperty('Text'), "Component hasn't property Text"); $this->assertTrue($this->component->hasProperty('text'), "Component hasn't property text"); $this->assertFalse($this->component->hasProperty('Caption'), "Component has property Caption"); - + $this->assertTrue($this->component->hasProperty('ColorAttribute'), "Component hasn't property JsColorAttribute"); $this->assertTrue($this->component->hasProperty('colorattribute'), "Component hasn't property JsColorAttribute"); $this->assertFalse($this->component->canGetProperty('PastelAttribute'), "Component has property JsPastelAttribute"); - + $this->assertTrue($this->component->hasProperty('JSColorAttribute'), "Component hasn't property JsColorAttribute"); $this->assertTrue($this->component->hasProperty('jscolorattribute'), "Component hasn't property JsColorAttribute"); $this->assertFalse($this->component->hasProperty('jsPastelAttribute'), "Component has property JsPastelAttribute"); - + $this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement"); $this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->hasProperty('Excitement'), "Component hasn't property Excitement"); @@ -1107,27 +1107,27 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement"); $this->component->enableBehavior('ExcitementPropBehavior'); $this->assertTrue($this->component->hasProperty('Excitement'), "Component hasn't property Excitement"); - + $this->component->detachBehavior('ExcitementPropBehavior'); - + $this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement"); - + } public function testCanGetProperty() { $this->assertTrue($this->component->canGetProperty('Text')); $this->assertTrue($this->component->canGetProperty('text')); $this->assertFalse($this->component->canGetProperty('Caption')); - + $this->assertTrue($this->component->canGetProperty('ColorAttribute')); $this->assertTrue($this->component->canGetProperty('colorattribute')); $this->assertFalse($this->component->canGetProperty('PastelAttribute')); - + $this->assertTrue($this->component->canGetProperty('JSColorAttribute')); $this->assertTrue($this->component->canGetProperty('jscolorattribute')); $this->assertFalse($this->component->canGetProperty('jsPastelAttribute')); - - + + $this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement"); $this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->canGetProperty('Excitement'), "Component hasn't property Excitement"); @@ -1139,9 +1139,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement"); $this->component->enableBehavior('ExcitementPropBehavior'); $this->assertTrue($this->component->canGetProperty('Excitement'), "Component hasn't property Excitement"); - + $this->component->detachBehavior('ExcitementPropBehavior'); - + $this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement"); } @@ -1149,15 +1149,15 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertTrue($this->component->canSetProperty('Text')); $this->assertTrue($this->component->canSetProperty('text')); $this->assertFalse($this->component->canSetProperty('Caption')); - + $this->assertTrue($this->component->canSetProperty('ColorAttribute')); $this->assertTrue($this->component->canSetProperty('colorattribute')); $this->assertFalse($this->component->canSetProperty('PastelAttribute')); - + $this->assertTrue($this->component->canSetProperty('JSColorAttribute')); $this->assertTrue($this->component->canSetProperty('jscolorattribute')); $this->assertFalse($this->component->canSetProperty('jsPastelAttribute')); - + $this->assertFalse($this->component->canSetProperty('Excitement'), "Component has property Excitement"); $this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->canSetProperty('Excitement'), "Component hasn't property Excitement"); @@ -1169,7 +1169,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->canSetProperty('Excitement'), "Component has property Excitement"); $this->component->enableBehavior('ExcitementPropBehavior'); $this->assertTrue($this->component->canSetProperty('Excitement'), "Component hasn't property Excitement"); - + $this->component->detachBehavior('ExcitementPropBehavior'); } @@ -1180,55 +1180,55 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->assertTrue($this->component->OnMyEvent instanceof TPriorityList); try { $value2=$this->component->onUndefinedEvent; $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - - //Without the function parenthesis, the function is _not_ called but the __get + + //Without the function parenthesis, the function is _not_ called but the __get // method is called and the global events (list) are accessed $this->assertTrue($this->component->fxAttachClassBehavior instanceof TPriorityList); $this->assertTrue($this->component->fxDetachClassBehavior instanceof TPriorityList); - + // even undefined global events have a list as every object is able to access every event $this->assertTrue($this->component->fxUndefinedEvent instanceof TPriorityList); - - + + // Test the behaviors within the __get function $this->component->enableBehaviors(); - + try { $value2=$this->component->Excitement; $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->component->attachBehavior('BehaviorTestBehavior', $behavior = new BehaviorTestBehavior); $this->assertEquals('faa', $this->component->Excitement); - + $this->component->disableBehaviors(); - + try { $this->assertEquals('faa', $this->component->Excitement); $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->component->enableBehaviors(); $this->assertEquals('faa', $this->component->getExcitement()); - + $this->component->disableBehavior('BehaviorTestBehavior'); - + $this->assertEquals($behavior, $this->component->BehaviorTestBehavior); try { $behavior = $this->component->BehaviorTestBehavior2; $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + try { $this->assertEquals('faa', $this->component->Excitement); $this->fail('exception not raised when getting undefined property'); @@ -1236,13 +1236,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } $this->component->enableBehavior('BehaviorTestBehavior'); $this->assertEquals('faa', $this->component->getExcitement()); - - + + // behaviors allow on and fx events to be passed through. $this->assertTrue($this->component->onBehaviorEvent instanceof TPriorityList); - + } - + public function testSetProperty() { $value='new value'; $this->component->Text=$value; @@ -1253,64 +1253,64 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when setting undefined property'); } catch(TInvalidOperationException $e) { } - + // Test get only properties is a set function try { $this->component->ReadOnlyProperty = 'setting read only'; $this->fail('a property without a set function was set to a new value without error'); } catch(TInvalidOperationException $e) { } - + try { $this->component->ReadOnlyJsProperty = 'jssetting read only'; $this->fail('a js property without a set function was set to a new value without error'); } catch(TInvalidOperationException $e) { } - + try { $this->component->JsReadOnlyJsProperty = 'jssetting read only'; $this->fail('a js property without a set function was set to a new value without error'); } catch(TInvalidOperationException $e) { } - + $this->assertEquals(0, $this->component->getEventHandlers('onMyEvent')->getCount()); $this->component->onMyEvent = array($this->component,'myEventHandler'); $this->assertEquals(1, $this->component->getEventHandlers('onMyEvent')->getCount()); $this->component->onMyEvent[] = array($this->component,'Object.myEventHandler'); $this->assertEquals(2, $this->component->getEventHandlers('onMyEvent')->getCount()); - + $this->component->getEventHandlers('onMyEvent')->clear(); - + // Test the behaviors within the __get function $this->component->enableBehaviors(); - + try { $this->component->Excitement = 'laa'; $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->component->attachBehavior('BehaviorTestBehavior', $behavior1 = new BehaviorTestBehavior); $this->component->Excitement = 'laa'; $this->assertEquals('laa', $this->component->Excitement); $this->assertEquals('sol', $this->component->Excitement = 'sol'); - - + + $this->component->disableBehaviors(); - + try { $this->component->Excitement = false; $this->assertEquals(false, $this->component->Excitement); $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->component->enableBehaviors(); $this->component->Excitement = 'faa'; $this->assertEquals('faa', $this->component->getExcitement()); - + $this->component->disableBehavior('BehaviorTestBehavior'); - + try { $this->component->Excitement = false; $this->assertEquals(false, $this->component->Excitement); @@ -1320,82 +1320,82 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->component->enableBehavior('BehaviorTestBehavior'); $this->component->Excitement = 'sol'; $this->assertEquals('sol', $this->component->Excitement); - - + + $this->component->attachBehavior('BehaviorTestBehavior2', $behavior2 = new BehaviorTestBehavior); - + $this->assertEquals('sol', $this->component->Excitement); $this->assertEquals('faa', $behavior2->Excitement); - + // this sets Excitement for both because they are not uniquely named $this->component->Excitement = 'befaad'; - + $this->assertEquals('befaad', $this->component->Excitement); $this->assertEquals('befaad', $behavior1->Excitement); $this->assertEquals('befaad', $behavior2->Excitement); - - + + $this->component->detachBehavior('BehaviorTestBehavior2'); - + // behaviors allow on and fx events to be passed through. $this->assertTrue($this->component->BehaviorTestBehavior->onBehaviorEvent instanceof TPriorityList); - + $this->assertEquals(0, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); $this->component->onBehaviorEvent = array($this->component,'myEventHandler'); $this->assertEquals(1, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); $this->component->onBehaviorEvent[] = array($this->component,'Object.myEventHandler'); $this->assertEquals(2, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); - + $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->clear(); } - - + + public function testIsSetFunction() { $this->assertTrue(isset($this->component->fxAttachClassBehavior)); $this->component->unlisten(); - + $this->assertFalse(isset($this->component->onMyEvent)); $this->assertFalse(isset($this->component->undefinedEvent)); $this->assertFalse(isset($this->component->fxAttachClassBehavior)); - + $this->assertFalse(isset($this->component->BehaviorTestBehavior)); $this->assertFalse(isset($this->component->onBehaviorEvent)); - + $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); - + $this->assertTrue(isset($this->component->BehaviorTestBehavior)); $this->assertFalse(isset($this->component->onBehaviorEvent)); - + $this->component->attachEventHandler('onBehaviorEvent','foo'); $this->assertTrue(isset($this->component->onBehaviorEvent)); - + $this->component->attachEventHandler('onMyEvent','foo'); $this->assertTrue(isset($this->component->onMyEvent)); - + $this->assertTrue(isset($this->component->Excitement)); $this->component->Excitement = null; $this->assertFalse(isset($this->component->Excitement)); $this->assertFalse(isset($this->component->UndefinedBehaviorProperty)); - - + + } - - + + public function testUnsetFunction() { - + $this->assertEquals('default', $this->component->getText()); unset($this->component->Text); $this->assertNull($this->component->getText()); - + unset($this->component->UndefinedProperty); - + // object events $this->assertEquals(0, $this->component->onMyEvent->Count); $this->component->attachEventHandler('onMyEvent','foo'); $this->assertEquals(1, $this->component->onMyEvent->Count); unset($this->component->onMyEvent); $this->assertEquals(0, $this->component->onMyEvent->Count); - + //global events $this->assertEquals(1, $this->component->fxAttachClassBehavior->Count); $component = new NewComponent(); @@ -1404,22 +1404,22 @@ class TComponentTest extends PHPUnit_Framework_TestCase { // retain the other object event $this->assertEquals(1, $this->component->fxAttachClassBehavior->Count); $component->unlisten(); - + try { unset($this->component->Object); $this->fail('TInvalidOperationException not raised when unsetting get only property'); } catch(TInvalidOperationException $e) {} - + $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->asa('BehaviorTestBehavior') instanceof BehaviorTestBehavior); $this->assertFalse($this->component->asa('BehaviorTestBehavior2') instanceof BehaviorTestBehavior); - + $this->assertEquals('faa', $this->component->Excitement); unset($this->component->Excitement); $this->assertNull($this->component->Excitement); $this->component->Excitement = 'sol'; $this->assertEquals('sol', $this->component->Excitement); - + // Test the disabling of unset within behaviors $this->component->disableBehaviors(); unset($this->component->Excitement); @@ -1430,60 +1430,60 @@ class TComponentTest extends PHPUnit_Framework_TestCase { unset($this->component->Excitement); $this->component->enableBehavior('BehaviorTestBehavior'); $this->assertEquals('sol', $this->component->Excitement); - + unset($this->component->Excitement); $this->assertNull($this->component->Excitement); - + try { unset($this->component->ReadOnly); $this->fail('TInvalidOperationException not raised when unsetting get only property'); } catch(TInvalidOperationException $e) {} - + $this->component->onBehaviorEvent = 'foo'; $this->assertEquals(1, count($this->component->onBehaviorEvent)); $this->assertEquals(1, count($this->component->BehaviorTestBehavior->onBehaviorEvent)); unset($this->component->onBehaviorEvent); $this->assertEquals(0, count($this->component->onBehaviorEvent)); $this->assertEquals(0, count($this->component->BehaviorTestBehavior->onBehaviorEvent)); - + // Remove behavior via unset unset($this->component->BehaviorTestBehavior); $this->assertFalse($this->component->asa('BehaviorTestBehavior') instanceof BehaviorTestBehavior); - + } public function testGetSubProperty() { $this->assertTrue('object text'===$this->component->getSubProperty('Object.Text')); } - + public function testSetSubProperty() { $this->component->setSubProperty('Object.Text','new object text'); $this->assertEquals('new object text',$this->component->getSubProperty('Object.Text')); } - + public function testHasEvent() { $this->assertTrue($this->component->hasEvent('OnMyEvent')); $this->assertTrue($this->component->hasEvent('onmyevent')); $this->assertFalse($this->component->hasEvent('onYourEvent')); - + // fx won't throw an error if any of these fx function are called on an object. // It is a special prefix event designation that every object responds to all events. $this->assertTrue($this->component->hasEvent('fxAttachClassBehavior')); $this->assertTrue($this->component->hasEvent('fxattachclassbehavior')); - + $this->assertTrue($this->component->hasEvent('fxNonExistantGlobalEvent')); $this->assertTrue($this->component->hasEvent('fxnonexistantglobalevent')); - + $this->assertTrue($this->component->hasEvent('dyNonExistantLocalEvent')); $this->assertTrue($this->component->hasEvent('fxnonexistantlocalevent')); - - + + //Test behavior events $this->assertFalse($this->component->hasEvent('onBehaviorEvent')); $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->hasEvent('onBehaviorEvent')); $this->assertTrue($this->component->BehaviorTestBehavior->hasEvent('onBehaviorEvent')); - + $this->component->disableBehavior('BehaviorTestBehavior'); $this->assertFalse($this->component->hasEvent('onBehaviorEvent')); $this->component->enableBehavior('BehaviorTestBehavior'); @@ -1494,20 +1494,20 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->hasEventHandler('OnMyEvent')); $this->component->attachEventHandler('OnMyEvent','foo'); $this->assertTrue($this->component->hasEventHandler('OnMyEvent')); - + $this->assertFalse($this->component->hasEventHandler('fxNonExistantGlobalEvent')); $this->component->attachEventHandler('fxNonExistantGlobalEvent','foo'); $this->assertTrue($this->component->hasEventHandler('fxNonExistantGlobalEvent')); - + //Test behavior events $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); $this->assertFalse($this->component->BehaviorTestBehavior->hasEventHandler('onBehaviorEvent')); - + $this->component->attachEventHandler('onBehaviorEvent','foo'); $this->assertTrue($this->component->hasEventHandler('onBehaviorEvent')); - + $this->component->disableBehavior('BehaviorTestBehavior'); $this->assertFalse($this->component->hasEvent('onBehaviorEvent')); $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); @@ -1526,7 +1526,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when getting event handlers for undefined event'); } catch(TInvalidOperationException $e) { } - + $list=$this->component->getEventHandlers('fxRandomEvent'); $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0)); $this->component->attachEventHandler('fxRandomEvent','foo'); @@ -1536,9 +1536,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { $this->fail('exception raised when getting event handlers for universal global event'); } - - - + + + //Test behavior events try { $list=$this->component->getEventHandlers('onBehaviorEvent'); @@ -1546,13 +1546,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); - + $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); $list=$this->component->getEventHandlers('onBehaviorEvent'); $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0)); $this->component->attachEventHandler('onBehaviorEvent','foo'); $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===1)); - + $this->component->disableBehavior('BehaviorTestBehavior'); try { $list=$this->component->getEventHandlers('onBehaviorEvent'); @@ -1561,11 +1561,11 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } $this->component->enableBehavior('BehaviorTestBehavior'); $this->assertTrue(($this->component->getEventHandlers('onBehaviorEvent') instanceof TPriorityList) && ($list->getCount()===1)); - + } public function testAttachEventHandler() { - + $this->component->attachEventHandler('OnMyEvent','foo'); $this->assertEquals(1, $this->component->getEventHandlers('OnMyEvent')->getCount()); try { @@ -1573,7 +1573,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when attaching event handlers for undefined event'); } catch(TInvalidOperationException $e) { } - + //Testing the priorities of attaching events $this->component->attachEventHandler('OnMyEvent','foopre', 5); $this->component->attachEventHandler('OnMyEvent','foopost', 15); @@ -1584,8 +1584,8 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertEquals('foo', $list[1]); $this->assertEquals('foobar', $list[2]); $this->assertEquals('foopost', $list[3]); - - + + //Test attaching behavior events try { $this->component->attachEventHandler('onBehaviorEvent','foo'); @@ -1593,9 +1593,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); - + $this->component->attachEventHandler('onBehaviorEvent','foo'); - + //Testing the priorities of attaching behavior events $this->component->attachEventHandler('onBehaviorEvent','foopre', 5); $this->component->attachEventHandler('onBehaviorEvent','foopost', 15); @@ -1608,7 +1608,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertEquals('foobar', $list[2]); $this->assertEquals('foobarfoobar', $list[3]); $this->assertEquals('foopost', $list[4]); - + $this->component->disableBehavior('BehaviorTestBehavior'); try { $this->component->attachEventHandler('onBehaviorEvent','bar'); @@ -1616,37 +1616,37 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } $this->component->enableBehavior('BehaviorTestBehavior'); - + } public function testDetachEventHandler() { - + $this->component->attachEventHandler('OnMyEvent','foo'); $this->assertEquals(1, $this->component->getEventHandlers('OnMyEvent')->getCount()); - + $this->component->attachEventHandler('OnMyEvent','foopre', 5); $this->component->attachEventHandler('OnMyEvent','foopost', 15); $this->component->attachEventHandler('OnMyEvent','foobar', 10); $this->component->attachEventHandler('OnMyEvent','foobarfoobar', 10); - - - + + + $this->component->detachEventHandler('OnMyEvent','foo'); $list = $this->component->getEventHandlers('OnMyEvent'); $this->assertEquals(4, $list->getCount()); - + $this->assertEquals('foopre', $list[0]); $this->assertEquals('foobar', $list[1]); $this->assertEquals('foobarfoobar', $list[2]); $this->assertEquals('foopost', $list[3]); - + $this->component->detachEventHandler('OnMyEvent','foopre', null); $this->assertEquals(4, $list->getCount()); - + $this->component->detachEventHandler('OnMyEvent','foopre', 5); $this->assertEquals(3, $list->getCount()); - - + + // Now do detaching of behavior on events try { $this->component->attachEventHandler('onBehaviorEvent','foo'); @@ -1654,29 +1654,29 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); - + $this->component->attachEventHandler('onBehaviorEvent','foo'); $this->assertEquals(1, $this->component->getEventHandlers('onBehaviorEvent')->getCount()); - + $this->component->attachEventHandler('onBehaviorEvent','foopre', 5); $this->component->attachEventHandler('onBehaviorEvent','foopost', 15); $this->component->attachEventHandler('onBehaviorEvent','foobar', 10); $this->component->attachEventHandler('onBehaviorEvent','foobarfoobar', 10); - - - + + + $this->component->detachEventHandler('onBehaviorEvent','foo'); $list = $this->component->getEventHandlers('onBehaviorEvent'); $this->assertEquals(4, $list->getCount()); - + $this->assertEquals('foopre', $list[0]); $this->assertEquals('foobar', $list[1]); $this->assertEquals('foobarfoobar', $list[2]); $this->assertEquals('foopost', $list[3]); - + $this->component->detachEventHandler('onBehaviorEvent','foopre', null); $this->assertEquals(4, $list->getCount()); - + $this->component->detachEventHandler('onBehaviorEvent','foopre', 5); $this->assertEquals(3, $list->getCount()); } @@ -1693,14 +1693,14 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->Object->isEventHandled()); $this->component->raiseEvent('OnMyEvent',$this,null); $this->assertTrue($this->component->Object->isEventHandled()); - + $this->component->resetEventHandled(); $this->component->Object->resetEventHandled(); - - + + // Test a behavior on event $this->component->attachBehavior('test', new BehaviorTestBehavior); - + $this->component->attachEventHandler('onBehaviorEvent',array($this->component,'myEventHandler')); $this->assertFalse($this->component->isEventHandled()); $this->component->raiseEvent('onBehaviorEvent',$this,null); @@ -1709,13 +1709,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->Object->isEventHandled()); $this->component->raiseEvent('onBehaviorEvent',$this,null); $this->assertTrue($this->component->Object->isEventHandled()); - + //test behavior enabled/disabled events $this->component->disableBehavior('test'); - + $this->component->resetEventHandled(); $this->component->Object->resetEventHandled(); - + try { $this->component->attachEventHandler('onBehaviorEvent',array($this->component,'myEventHandler')); $this->fail('exception not raised when getting event handlers for undefined event'); @@ -1726,172 +1726,172 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when getting event handlers for undefined event'); } catch(TInvalidOperationException $e) {} $this->assertFalse($this->component->isEventHandled()); - + $this->component->enableBehavior('test'); - - - + + + //Test the return types of this function - + $this->assertFalse($this->component->isEventHandled()); $this->assertFalse($this->component->Object->isEventHandled()); $this->assertEquals(array(), $this->component->onBehaviorEvent($this,$this->component)); $this->assertTrue($this->component->isEventHandled()); $this->assertTrue($this->component->Object->isEventHandled()); - + // This accumulates all the responses from each of the events $arr=$this->component->onBehaviorEvent($this, $this->component, TEventResults::EVENT_RESULT_ALL); $this->assertEquals($this, $arr[0]['sender']); $this->assertEquals($this->component, $arr[0]['param']); $this->assertTrue(null === $arr[0]['response']); - + $this->assertEquals($this, $arr[1]['sender']); $this->assertEquals($this->component, $arr[1]['param']); $this->assertTrue(null === $arr[1]['response']); - + $this->assertEquals(2, count($arr)); - + // This tests without the default filtering-out of null $arr=$this->component->onBehaviorEvent($this, $this->component, false); $this->assertEquals(array(null, null), $arr); - - + + unset($this->component->onBehaviorEvent); $this->assertEquals(0, $this->component->onBehaviorEvent->Count); - + $this->component->onBehaviorEvent = array($this, 'returnValue4'); $this->component->onBehaviorEvent = array($this, 'returnValue1'); - + // Test the per event post processing function $arr=$this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction')); $this->assertEquals(array(exp(4), exp(1)), $arr); $arr=$this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction2')); $this->assertEquals(array(sin(4), sin(1)), $arr); - - + + //Testing Feed-forward functionality unset($this->component->onBehaviorEvent); - + $this->component->onBehaviorEvent = array($this, 'ffValue4'); $this->component->onBehaviorEvent = array($this, 'ffValue2'); $arr=$this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD); $this->assertEquals(array(20, 40), $arr); - - + + unset($this->component->onBehaviorEvent); - + //Order of these events affects the response order in feed forward $this->component->onBehaviorEvent = array($this, 'ffValue2'); $this->component->onBehaviorEvent = array($this, 'ffValue4'); $arr=$this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD); $this->assertEquals(array(10, 40), $arr); } - + public function returnValue1(){return 1;} public function returnValue4(){return 4;} public function postEventFunction($sender, $param, $caller, $response){return exp($response);} public function postEventFunction2($sender, $param, $caller, $response){return sin($response);} public function ffValue2($sender, $param){return $param*2;} public function ffValue4($sender, $param){return $param*4;} - - + + public function testGlobalEventListenerInRaiseEvent() { //TODO Test the Global Event Listener } - - + + public function testIDynamicMethodsOnBehavior() { - + //Add Behavior with dynamic call $this->component->attachBehavior('TDynamicBehavior', new TDynamicBehavior); - + //Check that the behavior is working as it should $this->assertTrue($this->component->isa('TDynamicBehavior')); $this->assertNull($this->component->getLastBehaviorDynamicMethodCalled()); - + // call basic behavior implemented method from object (containing behavior) $this->assertEquals(42, $this->component->TestBehaviorMethod(6, 7)); - + //Test out undefined behavior/host object method try { $this->component->objectAndBehaviorUndefinedMethod(); $this->fail('exception not raised when evaluating an undefined method by the object and behavior'); } catch(TApplicationException $e) { } - + // calling undefined dynamic method, caught by the __dycall method in the behavior and implemented // this behavior catches undefined dynamic event and divides param1 by param 2 $this->assertEquals(22, $this->component->dyTestDynamicBehaviorMethod(242, 11)); $this->assertEquals('dyTestDynamicBehaviorMethod', $this->component->getLastBehaviorDynamicMethodCalled()); - + // calling undefined dynamic method, caught by the __dycall in the behavior and ignored $this->assertNull($this->component->dyUndefinedIntraEvent(242, 11)); $this->assertEquals('dyUndefinedIntraEvent', $this->component->getLastBehaviorDynamicMethodCalled()); - + //call behavior defined dynamic event // param1 * 2 * param2 $this->assertEquals(2420, $this->component->dyTestIntraEvent(121, 10)); - + $this->component->detachBehavior('TDynamicBehavior'); $this->assertFalse($this->component->isa('TDynamicBehavior')); - - - + + + //Add Class Behavior with dynamic call $this->component->attachBehavior('TDynamicClassBehavior', new TDynamicClassBehavior); - + //Check that the behavior is working as it should $this->assertTrue($this->component->isa('TDynamicClassBehavior')); $this->assertNull($this->component->getLastBehaviorDynamicMethodCalled()); - + // call basic behavior implemented method from object (containing behavior) $this->assertEquals(42, $this->component->TestBehaviorMethod(6, 7)); - + //Test out undefined behavior/host object method try { $this->component->objectAndBehaviorUndefinedMethod(); $this->fail('exception not raised when evaluating an undefined method by the object and behavior'); } catch(TApplicationException $e) { } - + // calling undefined dynamic method, caught by the __dycall method in the behavior and implemented // this behavior catches undefined dynamic event and divides param1 by param 2 $this->assertEquals(22, $this->component->dyTestDynamicClassBehaviorMethod(242, 11)); $this->assertEquals('dyTestDynamicClassBehaviorMethod', $this->component->getLastBehaviorDynamicMethodCalled()); - + // calling undefined dynamic method, caught by the __dycall in the behavior and ignored $this->assertNull($this->component->dyUndefinedIntraEvent(242, 11)); $this->assertEquals('dyUndefinedIntraEvent', $this->component->getLastBehaviorDynamicMethodCalled()); - + //call behavior defined dynamic event // param1 * 2 * param2 $this->assertEquals(2420, $this->component->dyTestIntraEvent(121, 10)); - + $this->component->detachBehavior('TDynamicClassBehavior'); $this->assertFalse($this->component->isa('TDynamicClassBehavior')); - + } - + // This also tests the priority of the common global raiseEvent events public function testIDynamicMethodsOnBehaviorGlobalEvents() { $component = new GlobalRaiseComponent(); - + // common function has a default priority of 10 $component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'commonRaiseEventListener')); $component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'postglobalRaiseEventListener'), 1); $component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'preglobalRaiseEventListener'), -1); - + $this->assertEquals(5, $this->component->fxGlobalListener->getCount()); $this->assertEquals(1, $this->component->fxPrimaryGlobalEvent->getCount()); $this->assertEquals(1, $this->component->fxPrimaryGlobalEvent->getCount(), 'fxPrimaryGlobalEvent is not installed on test object'); - + // call the global event on a different object than the test object $res = $this->component->raiseEvent('fxPrimaryGlobalEvent', $this, null, TEventResults::EVENT_RESULT_ALL); - + $this->assertEquals(6, count($res)); $this->assertEquals(array('pregl', 'primary', 'postgl', 'fxGL', 'fxcall', 'com'), $component->getCallOrders()); - + $component->unlisten(); } @@ -1907,10 +1907,10 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(Exception $e) { } } - - - - + + + + public function testEvaluateStatements() { $statements='$a="test string"; echo $a;'; $this->assertEquals('test string',$this->component->evaluateStatements($statements)); @@ -1921,169 +1921,167 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(Exception $e) { } } - - + + public function testDynamicFunctionCall() { - + $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); - + $this->component->attachBehavior('dy1', new dy1TextReplace); $this->assertFalse($this->component->dy1->isCalled()); $this->assertEquals(' aa bb cc __ __ ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy1->isCalled()); - + $this->component->attachBehavior('dy2', new dy2TextReplace); $this->assertFalse($this->component->dy2->isCalled()); $this->assertEquals(' aa bb cc __ __ || || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy2->isCalled()); - + $this->component->attachBehavior('dy3', new dy3TextReplace); $this->assertFalse($this->component->dy3->isCalled()); $this->assertEquals(' aa bb cc __ __ || || ?? ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy3->isCalled()); - + $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyUndefinedEvent(' aa bb cc __ .. ++ || !! ?? ')); - + $this->assertEquals(0.25, $this->component->dyPowerFunction(2,2)); - - + + $this->component->detachBehavior('dy1'); $this->component->detachBehavior('dy2'); $this->component->detachBehavior('dy3'); - + //test class behaviors of dynamic events and the argument list order - + $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); - + $this->component->attachBehavior('dy1', new dy1ClassTextReplace); $this->assertFalse($this->component->dy1->isCalled()); $this->assertEquals(' aa bb cc .. .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy1->isCalled()); - + $this->component->attachBehavior('dy2', new dy2ClassTextReplace); $this->assertFalse($this->component->dy2->isCalled()); $this->assertEquals(' aa bb cc .. .. ++ ++ !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy2->isCalled()); - + $this->component->attachBehavior('dy3', new dy3ClassTextReplace); $this->assertFalse($this->component->dy3->isCalled()); $this->assertEquals(' aa bb cc .. .. ++ ++ !! ^_^ ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy3->isCalled()); - + $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyUndefinedEvent(' aa bb cc __ .. ++ || !! ?? ')); - + $this->assertEquals(0.25, $this->component->dyPowerFunction(2,2)); - - + + } - - - - + + + + public function testDynamicIntraObjectEvents() { - + $this->component->attachBehavior('IntraEvents', new IntraObjectExtenderBehavior); - + $this->assertNull($this->component->IntraEvents->LastCall); - + //unlisten first, this object listens upon instantiation. $this->component->unlisten(); $this->assertEquals(2, $this->component->IntraEvents->LastCall); - + // ensures that IntraEvents nulls the last call variable when calling this getter $this->assertNull($this->component->IntraEvents->LastCall); - + //listen next to undo the unlisten $this->component->listen(); $this->assertEquals(1, $this->component->IntraEvents->LastCall); - - + + $this->assertEquals(3, $this->component->evaluateExpression('1+2')); $this->assertEquals(7, $this->component->IntraEvents->LastCall); - + $statements='$a="test string"; echo $a;'; $this->assertEquals('test string', $this->component->evaluateStatements($statements)); $this->assertEquals(8, $this->component->IntraEvents->LastCall); - + $component2 = new NewComponentNoListen(); $this->assertNull($this->component->createdOnTemplate($component2)); $this->assertEquals(9, $this->component->IntraEvents->LastCall); - + $this->assertNull($this->component->addParsedObject($component2)); $this->assertEquals(10, $this->component->IntraEvents->LastCall); - - - + + + $behavior = new BarBehavior; $this->assertEquals($behavior, $this->component->attachBehavior('BarBehavior', $behavior)); $this->assertEquals(11, $this->component->IntraEvents->LastCall); - + $this->assertNull($this->component->disableBehaviors()); $this->assertNull($this->component->enableBehaviors()); $this->assertEquals(27, $this->component->IntraEvents->LastCall); - + $this->assertTrue($this->component->disableBehavior('BarBehavior')); $this->assertEquals(16, $this->component->IntraEvents->LastCall); - + $this->assertTrue($this->component->enableBehavior('BarBehavior')); $this->assertEquals(15, $this->component->IntraEvents->LastCall); - + $this->assertEquals($behavior, $this->component->detachBehavior('BarBehavior')); $this->assertEquals(12, $this->component->IntraEvents->LastCall); - - + + $this->component->attachEventHandler('OnMyEvent',array($this->component,'myEventHandler')); $this->component->raiseEvent('OnMyEvent',$this,null); - + //3 + 4 + 5 + 6 = 18 (the behavior adds these together when each raiseEvent dynamic intra event is called) $this->assertEquals(18, $this->component->IntraEvents->LastCall); } - - - + + + public function testJavascriptGetterSetter() { - + $this->assertFalse(isset($this->component->ColorAttribute)); $this->assertFalse(isset($this->component->JsColorAttribute)); - + $this->component->ColorAttribute = "('#556677', '#abcdef', 503987)"; $this->assertEquals("('#556677', '#abcdef', 503987)", $this->component->ColorAttribute); - + $this->assertTrue(isset($this->component->ColorAttribute)); $this->assertTrue(isset($this->component->JsColorAttribute)); - + $this->component->ColorAttribute = "new Array(1, 2, 3, 4, 5)"; $this->assertEquals("new Array(1, 2, 3, 4, 5)", $this->component->JsColorAttribute); - + $this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]"; $this->assertEquals("['#112233', '#fedcba', 22009837]", $this->component->ColorAttribute); } - - + + public function testJavascriptIssetUnset() { - + $this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]"; $this->assertEquals("['#112233', '#fedcba', 22009837]", $this->component->ColorAttribute); - + unset($this->component->ColorAttribute); - + $this->assertFalse(isset($this->component->ColorAttribute)); $this->assertFalse(isset($this->component->JsColorAttribute)); - + $this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]"; - + $this->assertTrue(isset($this->component->ColorAttribute)); $this->assertTrue(isset($this->component->JsColorAttribute)); - + unset($this->component->JsColorAttribute); - + $this->assertFalse(isset($this->component->ColorAttribute)); $this->assertFalse(isset($this->component->JsColorAttribute)); - + } - - - -} -?>
\ No newline at end of file + + +} diff --git a/tests/unit/Util/AllTests.php b/tests/unit/Util/AllTests.php index 8ab99a50..a6a217d7 100644 --- a/tests/unit/Util/AllTests.php +++ b/tests/unit/Util/AllTests.php @@ -11,13 +11,13 @@ class Util_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Util'); - + $suite->addTestSuite('TDateTimeStampTest'); $suite->addTestSuite('TLoggerTest'); - + return $suite; } } @@ -25,4 +25,3 @@ class Util_AllTests { if(PHPUnit_MAIN_METHOD == 'Util_AllTests::main') { Util_AllTests::main(); } -?> diff --git a/tests/unit/Util/TDateTimeStampTest.php b/tests/unit/Util/TDateTimeStampTest.php index 6ae4b128..37784ef3 100644 --- a/tests/unit/Util/TDateTimeStampTest.php +++ b/tests/unit/Util/TDateTimeStampTest.php @@ -7,7 +7,7 @@ Prado::using('System.Util.TDateTimeStamp'); * @package System.Util */ class TDateTimeStampTest extends PHPUnit_Framework_TestCase { - + public function testGetTimeStampAndFormat() { $s = new TDateTimeStamp; $t = $s->getTimeStamp(0,0,0); @@ -126,4 +126,3 @@ class TDateTimeStampTest extends PHPUnit_Framework_TestCase { } } -?> diff --git a/tests/unit/Util/TLoggerTest.php b/tests/unit/Util/TLoggerTest.php index 49d5d316..03b36c5b 100644 --- a/tests/unit/Util/TLoggerTest.php +++ b/tests/unit/Util/TLoggerTest.php @@ -16,11 +16,10 @@ class TLoggerTest extends PHPUnit_Framework_TestCase { public function testLog() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetLogs() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Util/TSimpleDateFormatterTest.php b/tests/unit/Util/TSimpleDateFormatterTest.php index b989fcf5..ce6f1234 100644 --- a/tests/unit/Util/TSimpleDateFormatterTest.php +++ b/tests/unit/Util/TSimpleDateFormatterTest.php @@ -16,49 +16,48 @@ class TSimpleDateFormatterTest extends PHPUnit_Framework_TestCase { public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPattern() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCharset() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFormat() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testMonthPattern() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testDayPattern() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testYearPattern() { $formatter = new TSimpleDateFormatter("yyyy"); self::assertEquals("2008-01-01", date('Y-m-d', $formatter->parse("2008"))); } - + public function testMissingYearPattern() { $formatter = new TSimpleDateFormatter("MM/dd"); self::assertEquals(date("Y-10-22"), date('Y-m-d', $formatter->parse("10/22"))); } - + public function testDayMonthYearOrdering() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsValidDate() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testParse() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Web/AllTests.php b/tests/unit/Web/AllTests.php index f9b3b91d..ffd98978 100644 --- a/tests/unit/Web/AllTests.php +++ b/tests/unit/Web/AllTests.php @@ -20,10 +20,10 @@ class Web_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Web'); - + $suite->addTestSuite('TAssetManagerTest'); $suite->addTestSuite('TCacheHttpSessionTest'); $suite->addTestSuite('THttpCookieCollectionTest'); @@ -33,9 +33,9 @@ class Web_AllTests { $suite->addTestSuite('THttpSessionTest'); $suite->addTestSuite('THttpUtilityTest'); $suite->addTestSuite('TUriTest'); - + $suite->addTest(Web_UI_AllTests::suite()); - + return $suite; } } @@ -43,4 +43,3 @@ class Web_AllTests { if(PHPUnit_MAIN_METHOD == 'Web_AllTests::main') { Web_AllTests::main(); } -?> diff --git a/tests/unit/Web/TAssetManagerTest.php b/tests/unit/Web/TAssetManagerTest.php index 89349a0d..13d2d6c1 100644 --- a/tests/unit/Web/TAssetManagerTest.php +++ b/tests/unit/Web/TAssetManagerTest.php @@ -26,26 +26,26 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3'; $_SERVER['REMOTE_HOST'] = 'localhost'; - + if (self::$app===null) { self::$app=new TApplication(dirname(__FILE__).'/app'); } - + if (self::$assetDir===null) self::$assetDir= dirname(__FILE__).'/assets'; - // Make asset directory if not exists + // Make asset directory if not exists if (!file_exists (self::$assetDir)) { - if (is_writable(dirname(self::$assetDir))) + if (is_writable(dirname(self::$assetDir))) mkdir (self::$assetDir) ; - else + else throw new Exception ('Directory '.dirname(self::$assetDir).' is not writable'); } elseif (!is_dir (self::$assetDir)) { throw new Exception (self::$assetDir.' exists and is not a directory'); } // Define an alias to asset directory prado::setPathofAlias('AssetAlias', self::$assetDir); - + } - + private function removeDirectory ($dir) { // Let's be sure $dir is a directory to avoir any error. Clear the cache ! clearstatcache(); @@ -53,7 +53,7 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { foreach (scandir($dir) as $content) { if ($content==='.' or $content==='..') continue; // skip . and .. $content=$dir.'/'.$content; - if (is_dir($content)) + if (is_dir($content)) $this->removeDirectory ($content); // Recursivly remove directories else unlink ($content); // Remove file @@ -62,21 +62,21 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { rmdir ($dir); } } - + public function tearDown () { // Make some cleaning :) - $this->removeDirectory(self::$assetDir); + $this->removeDirectory(self::$assetDir); } - + public function testInit() { - + $manager=new TAssetManager (); $manager->init (null); - + self::assertEquals(self::$assetDir, $manager->getBasePath()); self::assertEquals($manager, self::$app->getAssetManager()); - + // No, remove asset directory, and catch the exception if (is_dir(self::$assetDir)) $this->removeDirectory (self::$assetDir); try { @@ -92,12 +92,12 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { $manager->setBasePath('invalid'); self::fail('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} - + // Next, standard asset directory, should work - + $manager->setBasePath ('AssetAlias'); self::assertEquals(self::$assetDir, $manager->getBasePath()); - + // Finally, test to change after init $manager->init (null); try { @@ -111,20 +111,20 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { $manager=new TAssetManager (); $manager->setBaseUrl ('/assets/'); self::assertEquals("/assets", $manager->getBaseUrl()); - + $manager->init (null); try { $manager->setBaseUrl ('/test'); self::fail ('Expected TInvalidOperationException not thrown'); } catch (TInvalidOperationException $e) {} - + } public function testPublishFilePath() { $manager=new TAssetManager(); $manager->setBaseUrl('/'); $manager->init (null); - + // Try to publish a single file $fileToPublish=dirname(__FILE__).'/data/pradoheader.gif'; $publishedUrl = $manager->publishFilePath($fileToPublish); @@ -132,19 +132,19 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals($publishedFile, $manager->getPublishedPath($fileToPublish)); self::assertEquals($publishedUrl, $manager->getPublishedUrl($fileToPublish)); self::assertTrue(is_file($publishedFile)); - + // try to publish invalid file try { $manager->publishFilePath('invalid_file'); self::fail('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} } - + public function testPublishFilePathWithDirectory () { $manager=new TAssetManager(); $manager->setBaseUrl('/'); $manager->init (null); - + // Try to publish a directory $dirToPublish=dirname(__FILE__).'/data'; $publishedUrl = $manager->publishFilePath($dirToPublish); @@ -153,23 +153,23 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals($publishedUrl, $manager->getPublishedUrl($dirToPublish)); self::assertTrue(is_dir($publishedDir)); self::assertTrue(is_file($publishedDir.'/pradoheader.gif')); - + } public function testPublishTarFile() { $manager=new TAssetManager(); $manager->setBaseUrl('/'); $manager->init (null); - + $tarFile=dirname(__FILE__).'/data/aTarFile.tar'; $md5File=dirname(__FILE__).'/data/aTarFile.md5'; - + // First, try with bad md5 try { $manager->publishTarFile($tarFile, 'badMd5File'); self::fail('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} - + // Then, try with real md5 file $publishedUrl=$manager->publishTarFile($tarFile, $md5File); $publishedDir=self::$assetDir.$publishedUrl; @@ -178,5 +178,4 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { self::assertTrue(is_file($publishedDir.'/aTarFile.md5')); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/TCacheHttpSessionTest.php b/tests/unit/Web/TCacheHttpSessionTest.php index 15c2a382..8475cd37 100644 --- a/tests/unit/Web/TCacheHttpSessionTest.php +++ b/tests/unit/Web/TCacheHttpSessionTest.php @@ -11,14 +11,14 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase protected $app = null; protected static $cache = null; protected static $session = null; - + protected function setUp() { if(!extension_loaded('memcache')) { self::markTestSkipped('The memcache extension is not available'); } - else + else { $basePath = dirname(__FILE__).'/app'; $runtimePath = $basePath.'/runtime'; @@ -33,14 +33,14 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase $this->app->setModule('MyCache',self::$cache); } } - + protected function tearDown() { $this->app = null; $this->cache = null; $this->session = null; } - + public function testInit() { $session = new TCacheHttpSession(); @@ -53,7 +53,7 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase { } unset($session); - + $session = new TCacheHttpSession(); try { @@ -66,12 +66,12 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase { } unset($session); - + self::$session = new TCacheHttpSession(); try { self::$session->setCacheModuleID('MyCache'); - self::$session->init(null); + self::$session->init(null); } catch(TConfigurationException $e) { @@ -79,50 +79,49 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase self::markTestSkipped('Cannot continue this test'); } } - + public function testGetCache() { $cache = self::$session->getCache(); $this->assertEquals(true, $cache instanceof TMemCache); } - + public function testCacheModuleID() { $id = 'value'; self::$session->setCacheModuleID($id); self::assertEquals($id, self::$session->getCacheModuleID()); } - + public function testKeyPrefix() { $id = 'value'; self::$session->setKeyPrefix($id); self::assertEquals($id, self::$session->getKeyPrefix()); } - + public function testSetAndGet() { self::$session['key'] = 'value'; self::assertEquals('value', self::$session['key']); } - + public function testAdd() { self::$session->add('anotherkey', 'value'); self::assertEquals('value', self::$session['anotherkey']); } - + public function testRemove() { self::$session->remove('key'); self::assertEquals(false, self::$session['key']); } - + public function testDestroyAndIsStarted() { $this->testSetAndGet(); self::$session->destroy(); self::assertEquals(false, self::$session->getIsStarted()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpCookieCollectionTest.php b/tests/unit/Web/THttpCookieCollectionTest.php index 68ea8777..aa091788 100644 --- a/tests/unit/Web/THttpCookieCollectionTest.php +++ b/tests/unit/Web/THttpCookieCollectionTest.php @@ -28,7 +28,7 @@ class THttpCookieCollectionTest extends PHPUnit_Framework_TestCase { $coll->removeAt(0); self::fail('Invalid Value exception not raised'); } catch (TInvalidDataValueException $e) {} - + $coll->insertAt(0, new THttpCookie('name','value')); self::assertEquals('value',$coll->removeAt(0)->getValue()); } @@ -46,5 +46,4 @@ class THttpCookieCollectionTest extends PHPUnit_Framework_TestCase { self::assertEquals ('value', $coll->findCookieByName('name')->getValue()); self::assertNull ($coll->findCookieByName('invalid')); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpCookieTest.php b/tests/unit/Web/THttpCookieTest.php index 31d8e572..206ef105 100644 --- a/tests/unit/Web/THttpCookieTest.php +++ b/tests/unit/Web/THttpCookieTest.php @@ -49,5 +49,4 @@ class THttpCookieTest extends PHPUnit_Framework_TestCase { $cookie->setSecure(true); self::assertTrue($cookie->getSecure()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpRequestTest.php b/tests/unit/Web/THttpRequestTest.php index 1807bbe2..7f5da17d 100644 --- a/tests/unit/Web/THttpRequestTest.php +++ b/tests/unit/Web/THttpRequestTest.php @@ -503,5 +503,4 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase { $module->init ($config); self::assertEquals('testService', $request->resolveRequest(array ('page', 'testService'))); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpResponseTest.php b/tests/unit/Web/THttpResponseTest.php index dadbd768..0855bf4d 100644 --- a/tests/unit/Web/THttpResponseTest.php +++ b/tests/unit/Web/THttpResponseTest.php @@ -7,18 +7,18 @@ Prado::using('System.Web.THttpResponse'); * @package System.Web */ class THttpResponseTest extends PHPUnit_Framework_TestCase { - + public static $app=null; public function setUp () { if (self::$app===null) self::$app=new TApplication(dirname(__FILE__).'/app'); ob_start(); } - + public function tearDown () { ob_end_flush(); } - + public function testInit() { $response=new THttpResponse (); $response->init (null); @@ -43,7 +43,7 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { $response->setCacheControl('invalid'); self::fail ('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} - + } public function testSetContentType() { @@ -62,7 +62,7 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { self::assertEquals('UTF-8', $response->getCharset()); $response->setCharset ('ISO8859-1'); self::assertEquals('ISO8859-1', $response->getCharset()); - + } public function testSetBufferOutput() { @@ -101,17 +101,17 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { } public function testWriteFile() { - + // Don't know how to test headers :(( ... throw new PHPUnit_Framework_IncompleteTestError(); - + $response=new THttpResponse (); $response->setBufferOutput(true); // Suppress warning with headers $response->writeFile(dirname(__FILE__).'/data/aTarFile.md5', null, 'text/plain', array ('Pragma: public', 'Expires: 0')); - + self::assertContains('4b1ecb0b243918a8bbfbb4515937be98 aTarFile.tar', ob_get_clean()); - + } public function testRedirect() { @@ -157,5 +157,4 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { public function testCreateHtmlWriter() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpSessionTest.php b/tests/unit/Web/THttpSessionTest.php index 7de0f8a5..aca83077 100644 --- a/tests/unit/Web/THttpSessionTest.php +++ b/tests/unit/Web/THttpSessionTest.php @@ -110,5 +110,4 @@ class THttpSessionTest extends PHPUnit_Framework_TestCase { public function testOffsetUnset() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpUtilityTest.php b/tests/unit/Web/THttpUtilityTest.php index 85fcf7f4..7f4e6705 100644 --- a/tests/unit/Web/THttpUtilityTest.php +++ b/tests/unit/Web/THttpUtilityTest.php @@ -18,5 +18,4 @@ class THttpUtilityTest extends PHPUnit_Framework_TestCase { $html = THttpUtility::htmlDecode('<tag key="value">'); self::assertEquals('<tag key="value">', $html); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/TUriTest.php b/tests/unit/Web/TUriTest.php index a8c65b9e..b610cd1b 100644 --- a/tests/unit/Web/TUriTest.php +++ b/tests/unit/Web/TUriTest.php @@ -6,17 +6,17 @@ Prado::using('System.Web.THttpRequest'); * @package System.Web */ class TUriTest extends PHPUnit_Framework_TestCase { - + const URISTR='http://login:p@ssw0rd:compl3x@www.pradosoft.com:80/demos/quickstart/index.php?page=test¶m1=test2#anchor'; - + public function setUp () { $this->uri=new TUri(self::URISTR); } - + public function tearDown() { $this->uri=null; } - + public function testConstruct() { $url="http://www.pradosoft.com/"; $uri=new TUri ($url); @@ -27,7 +27,7 @@ class TUriTest extends PHPUnit_Framework_TestCase { $url=new TUri($url); self::fail ('exception not raised with an invalid URL'); } catch (TInvalidDataValueException $e) { - + } } @@ -66,5 +66,4 @@ class TUriTest extends PHPUnit_Framework_TestCase { public function testGetFragment() { self::assertEquals('anchor', $this->uri->getFragment()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/ActiveControls/AllTests.php b/tests/unit/Web/UI/ActiveControls/AllTests.php index ef2dfb91..68989996 100644 --- a/tests/unit/Web/UI/ActiveControls/AllTests.php +++ b/tests/unit/Web/UI/ActiveControls/AllTests.php @@ -11,11 +11,11 @@ class Web_UI_ActiveControls_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Web.UI.ActiveControls'); - - $suite->addTestSuite('TActiveHiddenFieldTest'); + + $suite->addTestSuite('TActiveHiddenFieldTest'); return $suite; } } @@ -23,4 +23,3 @@ class Web_UI_ActiveControls_AllTests { if(PHPUnit_MAIN_METHOD == 'Web_UI_ActiveControls_AllTests::main') { Web_UI_ActiveControls_AllTests::main(); } -?> diff --git a/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php b/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php index 58821747..6e80bd12 100644 --- a/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php +++ b/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php @@ -14,5 +14,3 @@ class TActiveHiddenFieldTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Test', $field->getValue()); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Web/UI/AllTests.php b/tests/unit/Web/UI/AllTests.php index 71b088e4..6885c337 100644 --- a/tests/unit/Web/UI/AllTests.php +++ b/tests/unit/Web/UI/AllTests.php @@ -23,10 +23,10 @@ class Web_UI_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Web.UI'); - + $suite->addTestSuite('TClientScriptManagerTest'); $suite->addTestSuite('TControlAdapterTest'); $suite->addTestSuite('TControlTest'); @@ -40,7 +40,7 @@ class Web_UI_AllTests { $suite->addTestSuite('THtmlWriterTest'); $suite->addTestSuite('TPageStatePersisterTest'); $suite->addTestSuite('TSessionPageStatePersisterTest'); - + return $suite; } } @@ -48,4 +48,3 @@ class Web_UI_AllTests { if(PHPUnit_MAIN_METHOD == 'Web_UI_AllTests::main') { Web_UI_AllTests::main(); } -?> diff --git a/tests/unit/Web/UI/TClientScriptManagerTest.php b/tests/unit/Web/UI/TClientScriptManagerTest.php index ea360f91..efce0009 100644 --- a/tests/unit/Web/UI/TClientScriptManagerTest.php +++ b/tests/unit/Web/UI/TClientScriptManagerTest.php @@ -144,5 +144,4 @@ class TClientScriptManagerTest extends PHPUnit_Framework_TestCase { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TControlAdapterTest.php b/tests/unit/Web/UI/TControlAdapterTest.php index 2a173fd8..ff687cc8 100644 --- a/tests/unit/Web/UI/TControlAdapterTest.php +++ b/tests/unit/Web/UI/TControlAdapterTest.php @@ -15,46 +15,45 @@ class TControlAdapterTest extends PHPUnit_Framework_TestCase { public function testGetControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCreateChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoadState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSaveState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnUnload() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRenderChildren() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TControlTest.php b/tests/unit/Web/UI/TControlTest.php index 670926be..b6741167 100644 --- a/tests/unit/Web/UI/TControlTest.php +++ b/tests/unit/Web/UI/TControlTest.php @@ -15,266 +15,265 @@ class TControlTest extends PHPUnit_Framework_TestCase { public function test__get() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasAdapter() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetAdapter() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetParent() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetNamingContainer() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetTemplateControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetSourceTemplateControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetControlStage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetUniqueID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFocus() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetClientID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetSkinID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnableTheming() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetCustomData() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetVisible() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnabled() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasAttributes() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetAttributes() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testHasAttribute() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetAttribute() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRemoveAttribute() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnableViewState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetControlState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testTrackViewState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetViewState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testClearViewState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testBindProperty() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testUnbindProperty() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAutoBindProperty() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testDataBind() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testEnsureChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCreateChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFindControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFindControlsByType() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFindControlsByID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testClearNamingContainer() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterObject() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testUnregisterObject() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsObjectRegistered() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasChildInitialized() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasInitialized() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasLoadedPostData() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasLoaded() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasPreRendered() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetRegisteredObject() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetAllowChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAddParsedObject() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAddedControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRemovedControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnDataBinding() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnUnload() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testBubbleEvent() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testBroadcastEvent() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRenderControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRenderChildren() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSaveState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoadState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testApplyStyleSheetSkin() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TFormTest.php b/tests/unit/Web/UI/TFormTest.php index 74cbdb59..7fb6d2b7 100644 --- a/tests/unit/Web/UI/TFormTest.php +++ b/tests/unit/Web/UI/TFormTest.php @@ -15,22 +15,21 @@ class TFormTest extends PHPUnit_Framework_TestCase { public function testRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetDefaultButton() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetMethod() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnctype() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetName() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/THtmlWriterTest.php b/tests/unit/Web/UI/THtmlWriterTest.php index 080e2e26..cf3b27e3 100644 --- a/tests/unit/Web/UI/THtmlWriterTest.php +++ b/tests/unit/Web/UI/THtmlWriterTest.php @@ -31,7 +31,7 @@ class TestWriter extends TComponent implements ITextWriter { $this->write($str."\n"); } - + // Accessors to get value of private vars during tests public function getFlushedContent() { return $this->_flushedContent; } public function getStr() { return $this->_str; } @@ -77,7 +77,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer->addAttribute('value','Prado & Cie'); $result=self::readAttribute($writer, '_attributes'); self::assertEquals('text',$result['type']); - self::assertEquals(THttpUtility::htmlEncode('Prado & Cie'), $result['value']); + self::assertEquals(THttpUtility::htmlEncode('Prado & Cie'), $result['value']); } public function testRemoveAttribute() { @@ -129,21 +129,21 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer=new THtmlWriter(self::$output); $writer->write('Some Text');; self::assertEquals('Some Text', self::$output->flush()); - + } public function testWriteLine() { $writer=new THtmlWriter(self::$output); $writer->writeLine('Some Text');; self::assertEquals("Some Text\n", self::$output->flush()); - + } public function testWriteBreak() { $writer=new THtmlWriter(self::$output); $writer->writeBreak(); self::assertEquals("<br/>", self::$output->flush()); - + } public function testRenderBeginTag() { @@ -163,5 +163,4 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { self::assertEquals('<div>Div Content</div>', self::$output->flush()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TPageStatePersisterTest.php b/tests/unit/Web/UI/TPageStatePersisterTest.php index 2734b142..8ee1cfc9 100644 --- a/tests/unit/Web/UI/TPageStatePersisterTest.php +++ b/tests/unit/Web/UI/TPageStatePersisterTest.php @@ -7,18 +7,17 @@ Prado::using('System.Web.UI.TPageStatePersister'); * @package System.Web.UI */ class TPageStatePersisterTest extends PHPUnit_Framework_TestCase { - + public function testSetAndGetPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSave() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TPageTest.php b/tests/unit/Web/UI/TPageTest.php index a10d9e59..c1593816 100644 --- a/tests/unit/Web/UI/TPageTest.php +++ b/tests/unit/Web/UI/TPageTest.php @@ -15,173 +15,172 @@ class TPageTest extends PHPUnit_Framework_TestCase { public function testRun() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetCallbackClient() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetCallbackEventTarget() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetCallbackEventParameter() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetForm() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetValidators() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testValidate() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsValid() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetTheme() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetStyleSheetTheme() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testApplyControlSkin() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testApplyControlStyleSheet() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetClientScript() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnInitComplete() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnLoadComplete() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreRenderComplete() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnSaveStateComplete() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsPostBack() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsCallback() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSaveState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoadState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterRequiresPostData() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetPostBackEventTarget() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetPostBackEventParameter() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsLoadingPostData() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testEnsureRenderInForm() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testBeginFormRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testEndFormRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetFocus() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetClientSupportsJavaScript() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetHead() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetTitle() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetClientState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetRequestClientState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetStatePersisterClass() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetStatePersister() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnableStateValidation() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnableStateEncryption() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetPagePath() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterCachingAction() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetCachingStack() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TSessionPageStatePersisterTest.php b/tests/unit/Web/UI/TSessionPageStatePersisterTest.php index b8758b30..9153ad42 100644 --- a/tests/unit/Web/UI/TSessionPageStatePersisterTest.php +++ b/tests/unit/Web/UI/TSessionPageStatePersisterTest.php @@ -7,22 +7,21 @@ Prado::using('System.Web.UI.TSessionPageStatePersister'); * @package System.Web.UI */ class TSessionPageStatePersisterTest extends PHPUnit_Framework_TestCase { - + public function testSetAndGetPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetHistorySize() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSave() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TTemplateControlTest.php b/tests/unit/Web/UI/TTemplateControlTest.php index 97ea8c1d..7276a2b0 100644 --- a/tests/unit/Web/UI/TTemplateControlTest.php +++ b/tests/unit/Web/UI/TTemplateControlTest.php @@ -15,34 +15,33 @@ class TTemplateControlTest extends PHPUnit_Framework_TestCase { public function testGetIsSourceTemplateControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTemplateDirectory() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCreateChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterContent() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterContentPlaceHolder() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetMasterClass() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetMaster() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testInjectContent() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TTemplateManagerTest.php b/tests/unit/Web/UI/TTemplateManagerTest.php index 46c17538..dfe452bf 100644 --- a/tests/unit/Web/UI/TTemplateManagerTest.php +++ b/tests/unit/Web/UI/TTemplateManagerTest.php @@ -7,18 +7,17 @@ Prado::using('System.Web.UI.TTemplateManager'); * @package System.Web.UI */ class TTemplateManagerTest extends PHPUnit_Framework_TestCase { - + public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTemplateByClassName() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTemplateByFileName() { throw new PHPUnit_Framework_IncompleteTestError(); } - -} -?>
\ No newline at end of file + +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TTemplateTest.php b/tests/unit/Web/UI/TTemplateTest.php index 2bb6599b..2d802094 100644 --- a/tests/unit/Web/UI/TTemplateTest.php +++ b/tests/unit/Web/UI/TTemplateTest.php @@ -7,42 +7,41 @@ Prado::using('System.Web.UI.TTemplateManager'); * @package System.Web.UI */ class TTemplateTest extends PHPUnit_Framework_TestCase { - + public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTemplateFile() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsSourceTemplate() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetContextPath() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetDirective() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHashCode() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetItems() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testInstantiateIn() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIncludedFiles() { throw new PHPUnit_Framework_IncompleteTestError(); } - -} -?>
\ No newline at end of file + +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TThemeManagerTest.php b/tests/unit/Web/UI/TThemeManagerTest.php index 1a514d2b..028b222a 100644 --- a/tests/unit/Web/UI/TThemeManagerTest.php +++ b/tests/unit/Web/UI/TThemeManagerTest.php @@ -7,26 +7,25 @@ Prado::using('System.Web.UI.TThemeManager'); * @package System.Web.UI */ class TThemeManagerTest extends PHPUnit_Framework_TestCase { - + public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTheme() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetAvailableThemes() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetBasePath() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetBaseUrl() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TThemeTest.php b/tests/unit/Web/UI/TThemeTest.php index e7fa376d..aeeeee65 100644 --- a/tests/unit/Web/UI/TThemeTest.php +++ b/tests/unit/Web/UI/TThemeTest.php @@ -7,34 +7,33 @@ Prado::using('System.Web.UI.TThemeManager'); * @package System.Web.UI */ class TThemeTest extends PHPUnit_Framework_TestCase { - + public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetName() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetBaseUrl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetBasePath() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testApplySkin() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetStyleSheetFiles() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetJavaScriptFiles() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/WebControls/AllTests.php b/tests/unit/Web/UI/WebControls/AllTests.php index 7d0b1632..5ffa45a2 100644 --- a/tests/unit/Web/UI/WebControls/AllTests.php +++ b/tests/unit/Web/UI/WebControls/AllTests.php @@ -14,15 +14,15 @@ class Web_UI_WebControls_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Web.UI.WebControls'); - + $suite->addTestSuite('TDropDownListTest'); $suite->addTestSuite('TLabelTest'); $suite->addTestSuite('TRequiredFieldValidatorTest'); $suite->addTestSuite('TXmlTransformTest'); - + return $suite; } } @@ -30,4 +30,3 @@ class Web_UI_WebControls_AllTests { if(PHPUnit_MAIN_METHOD == 'Web_UI_WebControls_AllTests::main') { Web_UI_WebControls_AllTests::main(); } -?> diff --git a/tests/unit/Web/UI/WebControls/TDropDownListTest.php b/tests/unit/Web/UI/WebControls/TDropDownListTest.php index 503466fe..d27ebb9c 100644 --- a/tests/unit/Web/UI/WebControls/TDropDownListTest.php +++ b/tests/unit/Web/UI/WebControls/TDropDownListTest.php @@ -27,4 +27,3 @@ class TDropDownListTest extends PHPUnit_Framework_TestCase { } } -?> diff --git a/tests/unit/Web/UI/WebControls/TLabelTest.php b/tests/unit/Web/UI/WebControls/TLabelTest.php index 0e5577d5..88d8aec8 100644 --- a/tests/unit/Web/UI/WebControls/TLabelTest.php +++ b/tests/unit/Web/UI/WebControls/TLabelTest.php @@ -15,5 +15,3 @@ class TLabelTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Test', $label->getText()); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php b/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php index 894c3899..43ed2c9d 100644 --- a/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php +++ b/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php @@ -19,5 +19,3 @@ class TRequiredFieldValidatorTest extends PHPUnit_Framework_TestCase { $this->assertEquals('', $value); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Web/UI/WebControls/TXmlTransformTest.php b/tests/unit/Web/UI/WebControls/TXmlTransformTest.php index 6c6d9456..f93e9897 100644 --- a/tests/unit/Web/UI/WebControls/TXmlTransformTest.php +++ b/tests/unit/Web/UI/WebControls/TXmlTransformTest.php @@ -51,7 +51,7 @@ class TXmlTransformTest extends PHPUnit_Framework_TestCase { $transform->setTransformContent($expected); $this->assertEquals($expected, $transform->getTransformContent()); } - + public function testSetTransformPathAsFile() { $expected = $this->transformPath; $transform = new TXmlTransform(); @@ -120,10 +120,9 @@ class TXmlTransformTest extends PHPUnit_Framework_TestCase { $actual = $textWriter->flush(); self::assertEquals($expected, $actual); } - + public function testRenderWithBodyAsDocumentAndTransformPath() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Xml/AllTests.php b/tests/unit/Xml/AllTests.php index d934786b..afb4c7a8 100644 --- a/tests/unit/Xml/AllTests.php +++ b/tests/unit/Xml/AllTests.php @@ -12,14 +12,14 @@ class Xml_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Xml'); - + $suite->addTestSuite('TXmlDocumentTest'); $suite->addTestSuite('TXmlElementTest'); $suite->addTestSuite('TXmlElementListTest'); - + return $suite; } } @@ -27,4 +27,3 @@ class Xml_AllTests { if(PHPUnit_MAIN_METHOD == 'Xml_AllTests::main') { Xml_AllTests::main(); } -?> diff --git a/tests/unit/Xml/TXmlDocumentTest.php b/tests/unit/Xml/TXmlDocumentTest.php index 2ab95641..54e4b5aa 100644 --- a/tests/unit/Xml/TXmlDocumentTest.php +++ b/tests/unit/Xml/TXmlDocumentTest.php @@ -34,7 +34,7 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase { $xmldoc->loadFromFile('unexistentXmlFile.xml'); self::fail('Expected TIOException not thrown'); } catch (TIOException $e) {} - + self::assertTrue($xmldoc->loadFromFile($file)); self::assertEquals('1.0', $xmldoc->getVersion()); self::assertEquals('UTF-8',$xmldoc->getEncoding()); @@ -61,9 +61,9 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase { // Result string should be : $resultString="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <node param=\"attribute1\"\n</root>"; self::assertEquals($xmlString, $magicString); - + } - + public function testSaveToFile() { $file=dirname(__FILE__).'/data/tmp.xml'; if (!is_writable(dirname($file))) self::markTestSkipped(dirname($file).' must be writable for this test'); @@ -77,4 +77,3 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase { if (is_file($file)) unlink ($file); } } -?> diff --git a/tests/unit/Xml/TXmlElementListTest.php b/tests/unit/Xml/TXmlElementListTest.php index b124dfbe..7667c64d 100644 --- a/tests/unit/Xml/TXmlElementListTest.php +++ b/tests/unit/Xml/TXmlElementListTest.php @@ -23,7 +23,7 @@ class TXmlElementListTest extends PHPUnit_Framework_TestCase { $newElement=new TXmlElement('newTag'); $list->insertAt(0,$newElement); self::assertEquals($newElement,$list->itemAt(0)); - + } public function testRemoveAt() { @@ -34,4 +34,3 @@ class TXmlElementListTest extends PHPUnit_Framework_TestCase { self::assertEquals($newElement,$list->removeAt(0)); } } -?> diff --git a/tests/unit/Xml/TXmlElementTest.php b/tests/unit/Xml/TXmlElementTest.php index d7b86832..49cae36f 100644 --- a/tests/unit/Xml/TXmlElementTest.php +++ b/tests/unit/Xml/TXmlElementTest.php @@ -7,7 +7,7 @@ Prado::using('System.Xml.TXmlDocument'); */ class TXmlElementTest extends PHPUnit_Framework_TestCase { - public function setUp() { + public function setUp() { } public function testConstruct() { @@ -80,4 +80,3 @@ class TXmlElementTest extends PHPUnit_Framework_TestCase { self::assertEquals('<tag key="value">value</tag>', (string)$element); } } -?> |