summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorChristophe.Boulain <>2010-02-15 09:20:35 +0000
committerChristophe.Boulain <>2010-02-15 09:20:35 +0000
commitd860219f366a8fbe63b03d26c69525d4e6bd4f3a (patch)
tree6520a9a0a70a941d122de10d8f5ae9e3883a0ac6 /framework/Web
parent94e94e0a8566f23d16658a04c55b0bbfdd6689aa (diff)
Merge from r2765 (and some others) 3.1
Added TActiveTableRow QST page Corrected an uninitialized array in TScaffoldBase
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js2
-rw-r--r--framework/Web/Services/TPageService.php24
-rw-r--r--framework/Web/UI/ActiveControls/TInPlaceTextBox.php2
-rw-r--r--framework/Web/UI/TPage.php13
-rw-r--r--framework/Web/UI/WebControls/TFileUpload.php43
5 files changed, 61 insertions, 23 deletions
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 &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 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);
+ }
+
}