diff options
author | godzilla80@gmx.net <> | 2010-02-14 01:22:57 +0000 |
---|---|---|
committer | godzilla80@gmx.net <> | 2010-02-14 01:22:57 +0000 |
commit | 94e94e0a8566f23d16658a04c55b0bbfdd6689aa (patch) | |
tree | 72ffad82c279080dd9320d45dda26d64ffb4626f /framework/Web/UI | |
parent | 966fd66f217911d079c4bd6a87b09f4a0c5c4736 (diff) |
Merge Branches & Trunk
/trunk:r2680,2692,2707-2736
/branches/3.1:r2682-2686,2694-2702,2705,2738-2762
Diffstat (limited to 'framework/Web/UI')
-rwxr-xr-x | framework/Web/UI/ActiveControls/TDropContainer.php | 7 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 3 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TBoundColumn.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TCheckBoxList.php | 99 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TDataGridColumn.php | 6 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TJavascriptLogger.php | 6 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TRegularExpressionValidator.php | 4 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TTabPanel.php | 1 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TTextBox.php | 14 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TValidationSummary.php | 17 |
10 files changed, 111 insertions, 48 deletions
diff --git a/framework/Web/UI/ActiveControls/TDropContainer.php b/framework/Web/UI/ActiveControls/TDropContainer.php index 8f7792f3..9c2e1dd5 100755 --- a/framework/Web/UI/ActiveControls/TDropContainer.php +++ b/framework/Web/UI/ActiveControls/TDropContainer.php @@ -62,6 +62,13 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan return $this->getAdapter()->getBaseActiveControl(); } + /** + * @return TCallbackClientSide client side request options. + */ + public function getClientSide() + { + return $this->getAdapter()->getBaseActiveControl()->getClientSide(); + } /** * Gets the Css class name that this container can accept. diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index 6daae4d0..0c71f46d 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -167,6 +167,7 @@ abstract class TBaseValidator extends TLabel implements IValidator $options['ControlCssClass'] = $this->getControlCssClass();
$options['ControlType'] = $this->getClientControlClass($control);
+ $options['Enabled'] = $this->getEnabled(true);
//get date format from date picker target control
if($control instanceof TDatePicker)
@@ -241,7 +242,7 @@ abstract class TBaseValidator extends TLabel implements IValidator $scripts->registerPradoScript('validator');
$scripts->registerEndScript($scriptKey, "new Prado.ValidationManager({$options});");
}
- if($this->getEnableClientScript() & $this->getEnabled(true))
+ if($this->getEnableClientScript())
$this->registerClientScriptValidator();
}
diff --git a/framework/Web/UI/WebControls/TBoundColumn.php b/framework/Web/UI/WebControls/TBoundColumn.php index 0f48d6e7..fdcde9b2 100644 --- a/framework/Web/UI/WebControls/TBoundColumn.php +++ b/framework/Web/UI/WebControls/TBoundColumn.php @@ -4,7 +4,7 @@ *
* @author 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
diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php index 742dd18b..c7c9fc98 100644 --- a/framework/Web/UI/WebControls/TCheckBoxList.php +++ b/framework/Web/UI/WebControls/TCheckBoxList.php @@ -4,7 +4,7 @@ *
* @author 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
@@ -53,7 +53,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont private $_isEnabled;
private $_changedEventRaised=false;
private $_dataChanged=false;
- private $_isValid=true; + private $_isValid=true;
/**
* Constructor.
@@ -254,6 +254,31 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont {
return false;
}
+
+ /**
+ * @param boolean whether the control is to be enabled.
+ */
+ public function setEnabled($value)
+ {
+ parent::setEnabled($value);
+ $value = !TPropertyValue::ensureBoolean($value);
+ // 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) &&
+ $this->getPage()->getIsCallBack() &&
+ $this->getActiveControl()->canUpdateClientSide())
+ {
+ $items = $this->getItems();
+ $cs = $this->getPage()->getCallbackClient();
+ $baseClientID = $this->getClientID().'_c';
+ foreach($items as $index=>$item)
+ {
+ $cs->setAttribute($baseClientID.$index, 'disabled', $value);
+ }
+ }
+ }
/**
* Returns a style used for rendering items.
@@ -359,16 +384,16 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont $page->registerRequiresPostData($this->_repeatedControl);
}
}
- - /** - * 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; - } +
+ /**
+ * 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.
@@ -379,11 +404,11 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont {
if($this->getItemCount()>0)
{
- if ($needSpan=$this->getSpanNeeded()) - { - $writer->addAttribute('id', $this->getClientId()); - $writer->renderBeginTag('span'); - } + if ($needSpan=$this->getSpanNeeded())
+ {
+ $writer->addAttribute('id', $this->getClientId());
+ $writer->renderBeginTag('span');
+ }
$this->_isEnabled=$this->getEnabled(true);
$repeatInfo=$this->getRepeatInfo();
$accessKey=$this->getAccessKey();
@@ -395,8 +420,8 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont $this->setTabIndex(0);
$repeatInfo->renderRepeater($writer,$this);
$this->setAccessKey($accessKey);
- $this->setTabIndex($tabIndex); - if ($needSpan) + $this->setTabIndex($tabIndex);
+ if ($needSpan)
$writer->renderEndTag();
}
//checkbox skipped the client control script in addAttributesToRender
@@ -429,23 +454,23 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont return $this->getSelectedValue();
}
- /** - * 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);
+ }
+
/**
* Gets the name of the javascript class responsible for performing postback for this control.
* This method overrides the parent implementation.
@@ -468,7 +493,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont $options['ListName'] = $this->getUniqueID();
$options['ItemCount'] = $this->getItemCount();
return $options;
- } + }
}
diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php index 577c0068..ed53dc88 100644 --- a/framework/Web/UI/WebControls/TDataGridColumn.php +++ b/framework/Web/UI/WebControls/TDataGridColumn.php @@ -4,7 +4,7 @@ *
* @author 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
@@ -418,6 +418,7 @@ abstract class TDataGridColumn extends TApplicationComponent if(($classPath=$this->getHeaderRenderer())!=='')
{
$control=Prado::createComponent($classPath);
+ $cell->getControls()->add($control);
if($control instanceof IDataRenderer)
{
if($control instanceof IItemDataRenderer)
@@ -428,7 +429,6 @@ abstract class TDataGridColumn extends TApplicationComponent }
$control->setData($text);
}
- $cell->getControls()->add($control);
}
else if($this->getAllowSorting())
{
@@ -489,6 +489,7 @@ abstract class TDataGridColumn extends TApplicationComponent if(($classPath=$this->getFooterRenderer())!=='')
{
$control=Prado::createComponent($classPath);
+ $cell->getControls()->add($control);
if($control instanceof IDataRenderer)
{
if($control instanceof IItemDataRenderer)
@@ -499,7 +500,6 @@ abstract class TDataGridColumn extends TApplicationComponent }
$control->setData($text);
}
- $cell->getControls()->add($control);
}
else if($text!=='')
$cell->setText($text);
diff --git a/framework/Web/UI/WebControls/TJavascriptLogger.php b/framework/Web/UI/WebControls/TJavascriptLogger.php index 6d49f801..778b6728 100644 --- a/framework/Web/UI/WebControls/TJavascriptLogger.php +++ b/framework/Web/UI/WebControls/TJavascriptLogger.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.Web.UI.WebControls
@@ -23,7 +23,7 @@ *
* To see the logger and console, press ALT-D (or CTRL-D on OS X).
* More information on the logger can be found at
- * http://gleepglop.com/javascripts/logger/
+ * http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @version $Id$
@@ -84,7 +84,7 @@ class TJavascriptLogger extends TWebControl public function renderContents($writer)
{
$code = strtoupper($this->getToggleKey());
- $info = '(<a href="http://gleepglop.com/javascripts/logger/" target="_blank">more info</a>).';
+ $info = '(<a href="http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/" target="_blank">more info</a>).';
$link = '<a href="javascript:if(logConsole)logConsole.toggle()">toggle the javascript log console.</a>';
$usage = 'Press ALT-'.$code.' (Or CTRL-'.$code.' on OS X) to';
$writer->write("{$usage} {$link} {$info}");
diff --git a/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/framework/Web/UI/WebControls/TRegularExpressionValidator.php index be861e45..6855c6de 100644 --- a/framework/Web/UI/WebControls/TRegularExpressionValidator.php +++ b/framework/Web/UI/WebControls/TRegularExpressionValidator.php @@ -4,7 +4,7 @@ *
* @author 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
@@ -86,7 +86,7 @@ class TRegularExpressionValidator extends TBaseValidator {
if(($value=$this->getValidationValue($this->getValidationTarget()))==='')
return true;
- if(($expression=$this->getRegularExpression())!=='')
+ if(($expression=addcslashes($this->getRegularExpression(),"/"))!=='')
{
$mods = $this->getPatternModifiers();
return preg_match("/^$expression\$/{$mods}",$value);
diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php index 961d0797..5deced79 100644 --- a/framework/Web/UI/WebControls/TTabPanel.php +++ b/framework/Web/UI/WebControls/TTabPanel.php @@ -413,6 +413,7 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler $cs->registerEndScript("prado:$id", $code);
$cs->registerHiddenField($id.'_1',$this->getActiveViewIndex());
$page->registerRequiresPostData($this);
+ $page->registerRequiresPostData($id."_1");
}
/**
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index 4e6a66e9..8ab548a3 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -245,7 +245,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable }
/** - * Returns true if this control validated successfully. + * Returns true if this control validated successfully. * Defaults to true. * @return bool wether this control validated successfully. */ @@ -299,6 +299,18 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable }
/**
+ * Renders an additional line-break after the opening tag when it
+ * is in MultiLine text mode.
+ * @param THtmlWriter the writer used for the rendering purpose^M
+ */
+ public function renderBeginTag($writer)
+ {
+ parent::renderBeginTag($writer);
+ if($this->getTextMode()==='MultiLine')
+ $writer->write("\n");
+ }
+
+ /**
* @return TTextBoxAutoCompleteType the AutoComplete type of the textbox
*/
public function getAutoCompleteType()
diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php index ab066f78..4ed2eebe 100644 --- a/framework/Web/UI/WebControls/TValidationSummary.php +++ b/framework/Web/UI/WebControls/TValidationSummary.php @@ -149,6 +149,22 @@ class TValidationSummary extends TWebControl }
/**
+ * @return boolean whether scroll summary into viewport or not. Defaults to true.
+ */
+ public function getScrollToSummary()
+ {
+ return $this->getViewState('ScrollToSummary',true);
+ }
+
+ /**
+ * @param boolean whether scroll summary into viewport or not.
+ */
+ public function setScrollToSummary($value)
+ {
+ $this->setViewState('ScrollToSummary',TPropertyValue::ensureBoolean($value),true);
+ }
+
+ /**
* @return boolean whether the validation summary should be anchored. Defaults to false.
*/
public function getShowAnchor()
@@ -254,6 +270,7 @@ class TValidationSummary extends TWebControl if(!$this->getShowSummary())
$options['ShowSummary']=false;
+ $options['ScrollToSummary']=$this->getScrollToSummary();
$options['HeaderText']=$this->getHeaderText();
$options['DisplayMode']=$this->getDisplayMode();
|