diff options
author | Christophe.Boulain <> | 2010-02-15 09:20:35 +0000 |
---|---|---|
committer | Christophe.Boulain <> | 2010-02-15 09:20:35 +0000 |
commit | d860219f366a8fbe63b03d26c69525d4e6bd4f3a (patch) | |
tree | 6520a9a0a70a941d122de10d8f5ae9e3883a0ac6 | |
parent | 94e94e0a8566f23d16658a04c55b0bbfdd6689aa (diff) |
Merge from r2765 (and some others) 3.1
Added TActiveTableRow QST page
Corrected an uninitialized array in TScaffoldBase
18 files changed, 228 insertions, 27 deletions
diff --git a/.gitattributes b/.gitattributes index 964ffa6d..9de5ae6c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1333,6 +1333,8 @@ demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample4. demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample4.php -text demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample5.page -text demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample5.php -text +demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page -text +demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.php -text demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page -text demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php -text demos/quickstart/protected/pages/ActiveControls/Samples/config.xml -text @@ -3012,6 +3014,8 @@ tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php -te tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page -text tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php -text tests/FunctionalTests/active-controls/protected/pages/Sessioned/config.xml -text +tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page -text +tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.php -text tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page -text tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.php -text tests/FunctionalTests/active-controls/protected/pages/TestMasterPage.php -text @@ -29,6 +29,7 @@ BUG: Issue#188 - TDbCache doesn't check if db connection is active. (Yves) BUG: Issue#189 - Page State corrupted when EnableStateValidation=False (Christophe) BUG: Issue#191 - Bad parsing of MySQL ENUM type column (Yves) BUG: Issue#192 - soap-enc:Array not a valid complex type (mosonyi at esix.hu) +BUG: Issue#189 - Page State corrupted when EnableStateValidation=False (Christophe) BUG: Issue#198 - "Undefined variable: tagName" after error in application configuration. (Christophe) BUG: Issue#200 - TShellApplication failed when no service are defined in application configuration. (Christophe) BUG: Issue#208 - TDbConnection.Charset not working properly (googlenew at pcforum.hu, Christophe) @@ -42,7 +43,9 @@ EHN: Add property TValidationSummary.ScrollToSummary to server-side control sinc EHN: Add property TransactionClass (defaults to System.Data.TDbTransaction) to TDbConnection and modify beginTransaction() (Yves) ENH: Modify TDbTableInfo::getColumnNames() to store result in private class member (Yves) ENH: Issue#215 - Add ClientSide property to TDropContainer (googlenew at pcforum.hu, Christophe) +ENH: Issue#222 - Add Columns property to TInPlaceTextBox (Christophe) CHG: Issue#218 - Change URL of Javascript Logger (Christophe) +BUG: Issue#198 - "Undefined variable: tagName" after error in application configuration. (Christophe) Version 3.1.6 July 22, 2009 BUG: Issue#98 - Missing file in quickstart demo (Chrisotphe) @@ -52,6 +55,7 @@ BUG: Issue#117 - Consider TValidationSummary.DisplayMode="HeaderOnly" if TValida BUG: Issue#164 - CultureInfo::validCulture should be declared as a static method (Christophe) BUG: Issue#168 - TSqlMapXmlConfiguration: CacheModel properties are not set (Yves) BUG: Issue#172 - TDbCache fails to recognize need to re-create cache table (Yves) +BUG: Issue#105 - Enabling/disabling TFileUpload on TPanel (Carl) BUG: Issue#178 - TActiveFileUpload progress indicator is misleading (Christophe, googlenew-at-pcforum.hu) ENH: Issue#174 - TErrorHandler: HTTP error messages contains sensitive information (Yves) ENH: Issue#175 - TBulletedList: Introduce TBulletStyle::None (Yves) diff --git a/demos/quickstart/protected/pages/ActiveControls/Home.page b/demos/quickstart/protected/pages/ActiveControls/Home.page index 4897226c..d23f689f 100644 --- a/demos/quickstart/protected/pages/ActiveControls/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Home.page @@ -85,6 +85,12 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria </li>
<li>
+ * <a href="?page=ActiveControls.ActiveTableRow">TActiveTableRow and TActiveTableCell</a>
+ represents a table row (or cell) which can be updated on callback, and can raise a callback
+ when clicked.
+ </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.
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page new file mode 100644 index 00000000..e96a22a5 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page @@ -0,0 +1,20 @@ +<com:TContent ID="body">
+<!-- $Id: Home.page 1650 2007-01-24 06:55:32Z wei $ -->
+<h1>TActiveTableRow and TActiveTableCellSamples</h1>
+
+<com:TTable CssClass="sampletable">
+ <com:TActiveTableRow id="row1" CssClass="sampletable">
+ <com:TActiveTableCell id="r1c1" OnCellSelected="clickCell">Click to change cell content</com:TActiveTableCell>
+ <com:TActiveTableCell id="r1c2"OnCellSelected="clickCell">Click to change cell content</com:TActiveTableCell>
+ </com:TActiveTableRow>
+ <com:TActiveTableRow id="row2" CssClass="sampletable" OnRowSelected="clickRow">
+ <com:TActiveTableCell id="r2c1">Click to change row content</com:TActiveTableCell>
+ <com:TActiveTableCell id="r2c2">Click to change row content</com:TActiveTableCell>
+ </com:TActiveTableRow>
+
+</com:TTable>
+
+<com:TActiveLabel id="lblResult"/>
+<com:TJavascriptLogger />
+
+<div class="last-modified">$Id: Home.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.php new file mode 100644 index 00000000..b056eba8 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.php @@ -0,0 +1,22 @@ +<?php
+
+// $Id: Home.php 1405 2006-09-10 01:03:56Z wei $
+class Home extends TPage
+{
+
+ public function clickCell ($sender, $param)
+ {
+ $sender->Text .= "<br/>Clicked";
+ $this->lblResult->Text='You clicked on cell #'.$param->SelectedCellIndex.' with id='.$sender->id;
+ $sender->render($param->NewWriter);
+ }
+
+ public function clickRow ($sender, $param)
+ {
+ $sender->BackColor="yellow";
+ $this->lblResult->Text='You clicked on row #'.$param->SelectedRowIndex.' with id='.$sender->id;
+ $sender->render($param->NewWriter);
+ }
+}
+
+?>
\ No newline at end of file diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php index 9c548308..b41a593e 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php @@ -4,7 +4,7 @@ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Scaffold
@@ -65,6 +65,7 @@ abstract class TScaffoldBase extends TTemplateControl */
protected function getRecordPkValues($record)
{
+ $data=array();
foreach($this->getTableInfo()->getColumns() as $name=>$column)
{
if($column->getIsPrimaryKey())
diff --git a/framework/Exceptions/messages/messages-fr.txt b/framework/Exceptions/messages/messages-fr.txt index 5dce3812..d6785fdf 100644 --- a/framework/Exceptions/messages/messages-fr.txt +++ b/framework/Exceptions/messages/messages-fr.txt @@ -409,3 +409,9 @@ feedservice_id_required = TFeedService requires 'id' attribute in its feed e feedservice_feedtype_invalid = The class feed '{0}' must implement IFeedContentProvider interface. feedservice_class_required = TFeedService requires 'class' attribute in its feed elements. feedservice_feed_unknown = Unknown feed '{0}' requested. + +tactivetablecell_control_outoftable = {0} '{1}' must be enclosed within a TTableRow control. +tactivetablecell_control_notincollection = {0} '{1}' no member of the TTableCellCollection of the parent TTableRow control. + +tactivetablerow_control_outoftable = {0} '{1}' must be enclosed within a TTable control. +tactivetablerow_control_notincollection = {0} '{1}' no member of the TTableRowCollection of the parent TTable control.
\ No newline at end of file diff --git a/framework/Exceptions/messages/messages.txt b/framework/Exceptions/messages/messages.txt index 402b3252..b20c0f8b 100644 --- a/framework/Exceptions/messages/messages.txt +++ b/framework/Exceptions/messages/messages.txt @@ -201,6 +201,7 @@ page_control_outofform = {0} '{1}' must be enclosed within TForm. page_head_duplicated = A page can contain at most one THead. page_head_required = A THead control is needed in page template in order to render CSS and js in the HTML head section. page_statepersister_invalid = Page state persister must implement IPageStatePersister interface. +page_csmanagerclass_invalid = ClientScriptManager class '{0}' must be an instance of TClientScriptManager. csmanager_pradoscript_invalid = Unknown Prado script library name '{0}'. csmanager_invalid_packages = Unkownn packages '{1}' for javascript packages defined in '{0}'. Valid packages are '{2}'. diff --git a/framework/TApplication.php b/framework/TApplication.php index d9298d90..22c871f7 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -1468,7 +1468,7 @@ class TApplicationConfiguration extends TComponent break; } default: - throw new TConfigurationException('appconfig_paths_invalid',$tagName); + throw new TConfigurationException('appconfig_paths_invalid',$element->getTagName()); } } } diff --git a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js index 052a18b0..4d0facc2 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js @@ -110,6 +110,8 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( {
if(this.options.MaxLength > 0)
options['maxlength'] = this.options.MaxLength;
+ if(this.options.Columns > 0)
+ options['size'] = this.options.Columns;
this.editField = INPUT(options);
}
else
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index e4f9804c..f36d10cd 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -105,6 +105,11 @@ class TPageService extends TService */
private $_basePageClass='TPage';
/**
+ * @var string clientscript manager class in namespace format
+ * @since 3.1.7
+ */
+ private $_clientScriptManagerClass='System.Web.UI.TClientScriptManager';
+ /**
* @var string default page
*/
private $_defaultPage='Home';
@@ -427,6 +432,25 @@ class TPageService extends TService }
/**
+ * Sets the clientscript manager class (in namespace format).
+ * @param string class name
+ * @since 3.1.7
+ */
+ public function setClientScriptManagerClass($value)
+ {
+ $this->_clientScriptManagerClass=$value;
+ }
+
+ /**
+ * @return string clientscript manager class in namespace format. Defaults to 'System.Web.UI.TClientScriptManager'.
+ * @since 3.1.7
+ */
+ public function getClientScriptManagerClass()
+ {
+ return $this->_clientScriptManagerClass;
+ }
+
+ /**
* Runs the service.
* This will create the requested page, initializes it with the property values
* specified in the configuration, and executes the page.
diff --git a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php index b8dd666b..a82ee4ec 100644 --- a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php +++ b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php @@ -218,9 +218,9 @@ class TInPlaceTextBox extends TActiveTextBox $options['ExternalControl'] = $this->getExternalControlID();
$options['AutoHide'] = $this->getAutoHideTextBox() == false ? '' : true;
$options['AutoPostBack'] = $this->getAutoPostBack() == false ? '' : true;
+ $options['Columns'] = $this->getColumns();
if($this->getTextMode()==='MultiLine')
{
- $options['Columns'] = $this->getColumns();
$options['Rows'] = $this->getRows();
$options['Wrap'] = $this->getWrap()== false ? '' : true;
}
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 4681f876..4a2ea474 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -586,8 +586,17 @@ class TPage extends TTemplateControl */
public function getClientScript()
{
- if(!$this->_clientScript)
- $this->_clientScript=new TClientScriptManager($this);
+ if(!$this->_clientScript) {
+ $className = $classPath = $this->getService()->getClientScriptManagerClass();
+ Prado::using($className);
+ if(($pos=strrpos($className,'.'))!==false)
+ $className=substr($className,$pos+1);
+
+ if(!class_exists($className,false) || ($className!=='TClientScriptManager' && !is_subclass_of($className,'TClientScriptManager')))
+ throw new THttpException(404,'page_csmanagerclass_invalid',$classPath);
+
+ $this->_clientScript=new $className($this);
+ }
return $this->_clientScript;
}
diff --git a/framework/Web/UI/WebControls/TFileUpload.php b/framework/Web/UI/WebControls/TFileUpload.php index 6658e93d..fbd14703 100644 --- a/framework/Web/UI/WebControls/TFileUpload.php +++ b/framework/Web/UI/WebControls/TFileUpload.php @@ -4,7 +4,7 @@ *
* @author Marcus Nyeholt <tanus@users.sourceforge.net>, Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -59,7 +59,7 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata */
private $_errorCode=UPLOAD_ERR_NO_FILE;
private $_dataChanged=false;
- private $_isValid=true; + private $_isValid=true;
/**
* @return string tag name of the file upload control
@@ -80,6 +80,9 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata parent::addAttributesToRender($writer);
$writer->addAttribute('type','file');
$writer->addAttribute('name',$this->getUniqueID());
+ $isEnabled=$this->getEnabled(true);
+ if(!$isEnabled && $this->getEnabled()) // in this case parent will not render 'disabled'
+ $writer->addAttribute('disabled','disabled');
}
/**
@@ -256,23 +259,23 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata {
return $this->getFileName();
}
- - /** - * Returns true if this control validated successfully. - * Defaults to true. - * @return bool wether this control validated successfully. - */ - public function getIsValid() - { - return $this->_isValid; - } - /** - * @param bool wether this control is valid. - */ - public function setIsValid($value) - { - $this->_isValid=TPropertyValue::ensureBoolean($value); - } - +
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+
}
diff --git a/framework/prado-cli.php b/framework/prado-cli.php index 9b9153c3..f9185e6b 100755 --- a/framework/prado-cli.php +++ b/framework/prado-cli.php @@ -43,6 +43,7 @@ PradoCommandLineInterpreter::getInstance()->addActionClass('PradoCommandLineCrea PradoCommandLineInterpreter::getInstance()->addActionClass('PradoCommandLinePhpShell'); PradoCommandLineInterpreter::getInstance()->addActionClass('PradoCommandLineUnitTest'); PradoCommandLineInterpreter::getInstance()->addActionClass('PradoCommandLineActiveRecordGen'); +PradoCommandLineInterpreter::getInstance()->addActionClass('PradoCommandLineConvertConfig'); //run it; PradoCommandLineInterpreter::getInstance()->run($_SERVER['argv']); @@ -730,6 +731,58 @@ EOD; } } +/** + * Convert prado 3.1 XML configuration to new prado 3.2 PHP array configuration + * + * @author Christophe Boulain <Christophe Boulain@gmail.com> + * @version $Id$ + * @since 3.2 + */ +class PradoCommandLineConvertConfig extends PradoCommandLineAction +{ + + protected $action = 'xmltophp'; + protected $parameters = array('xml'); + protected $optional = array('output'); + protected $description = 'Convert a prado xml configuration file (<xml>) to a php array. '; + + public function performAction($args) + { + $xml=realpath($args[1]); + if (!is_file($xml)) + { + echo "Unable to find {$args[1]} file.\n"; + return true; + } + $output=$args[2]; + if ($output===null) + $output=dirname($xml).DIRECTORY_SEPARATOR.basename($xml, 'xml')."php"; + if (!is_writable(realpath(dirname($output)))) + { + echo "Can't write new config file {$output}\n"; + return true; + } + $config=$this->parseXML($xml); + print_r($config); + + return true; + } + + /** + * Open and parse an xml config file. + * @param string $xml the filepath of xml file + * @return array + */ + protected function parseXML($xml) + { + $dom=new DOMDocument(); + $dom->load($xml); + print_r ($dom->childNodes); + return ; + } + +} + //run PHP shell if(class_exists('PHP_Shell_Commands', false)) { diff --git a/framework/pradolite.php b/framework/pradolite.php index 6d5b13fd..726a5343 100644 --- a/framework/pradolite.php +++ b/framework/pradolite.php @@ -1,7 +1,7 @@ <?php
/**
* File Name: pradolite.php
- * Last Update: 2009/05/29 18:09:00
+ * Last Update: 2009/05/11 08:48:33
* Generated By: buildscripts/phpbuilder/build.php
*
* This file is used in lieu of prado.php to boost PRADO application performance.
@@ -24,7 +24,7 @@ class PradoBase private static $_logger=null; public static function getVersion() { - return '3.1.6-dev'; + return '3.1.5a'; } public static function initErrorHandlers() { diff --git a/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page new file mode 100755 index 00000000..41390e52 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page @@ -0,0 +1,14 @@ +<com:TForm ID="form1"> + + <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:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.php b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.php new file mode 100755 index 00000000..816a899e --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.php @@ -0,0 +1,32 @@ +<?php +/** + * BActiveFileUploadTest.php + * + * @author Bradley Booms <Bradley.Booms@nsighttel.com> + * @version Creation Date: Aug 9, 2007 + */ + +/** + * BActiveFileUploadTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms <Bradley.Booms@nsighttel.com> + * @version Modified Date: Aug 9, 2007 + * + * Modifications: + */ +class TActiveFileUploadAutoPostBackTest extends TPage{ + public function onPreRender($param){ + parent::onPreRender($param); + $this->button1->Attributes->onclick = "{$this->uploader->getCallbackJavascript()}; return false;"; + } + + public function uploadComplete($sender, $param){ + $this->label1->setText($sender->getFileName()); + } +} +?>
\ No newline at end of file |