summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-05-21 18:14:36 +0000
committerctrlaltca@gmail.com <>2011-05-21 18:14:36 +0000
commit0892b27e326f14bd3f6229b55077ef5f9d5280b4 (patch)
tree24039ec47ba8977bf14ba435c058e758e901f185 /framework/Web/UI/WebControls
parent6f00b28a1d9c7409c956a83866eac48a9493e83c (diff)
branch/3.1: merged bugfixes from trunk/ up to current
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php4
-rw-r--r--framework/Web/UI/WebControls/THtmlArea.php102
-rw-r--r--framework/Web/UI/WebControls/TOutputCache.php8
-rw-r--r--framework/Web/UI/WebControls/TSafeHtml.php6
-rw-r--r--framework/Web/UI/WebControls/TTabPanel.php17
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php40
-rw-r--r--framework/Web/UI/WebControls/TTextProcessor.php6
-rw-r--r--framework/Web/UI/WebControls/TWizard.php6
-rw-r--r--framework/Web/UI/WebControls/TXmlTransform.php6
9 files changed, 134 insertions, 61 deletions
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index c81d8bc1..1bac5a1c 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -803,7 +803,9 @@ class TDatePicker extends TTextBox
$writer->addAttribute('class', $this->getCssClass().' TDatePickerImageButton');
if(!$this->getEnabled(true))
$writer->addAttribute('disabled', 'disabled');
- $writer->renderBeginTag('img');
+ $writer->addAttribute('type', 'image');
+ $writer->addAttribute('onclick', 'return false;');
+ $writer->renderBeginTag('input');
$writer->renderEndTag();
}
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php
index 8d55c074..efdea8a3 100644
--- a/framework/Web/UI/WebControls/THtmlArea.php
+++ b/framework/Web/UI/WebControls/THtmlArea.php
@@ -83,71 +83,127 @@ class THtmlArea extends TTextBox
*/
private static $_langs = array(
'ar' => 'ar',
+ 'az' => 'az',
+ 'be' => 'be',
+ 'bg' => 'bg',
+ 'bn' => 'bn',
+ 'br' => 'br',
+ 'bs' => 'bs',
'ca' => 'ca',
+ 'ch' => 'ch',
+ 'cn' => 'cn',
'cs' => 'cs',
- 'cy' => 'cy', //available since 3.0.7
+ 'cy' => 'cy',
'da' => 'da',
'de' => 'de',
+ 'dv' => 'dv',
'el' => 'el',
'en' => 'en',
+ 'eo' => 'eo',
'es' => 'es',
+ 'et' => 'et',
+ 'eu' => 'eu',
'fa' => 'fa',
'fi' => 'fi',
'fr' => 'fr',
- 'fr_CA' => 'fr_ca',
+ 'gl' => 'gl',
+ 'gu' => 'gu',
'he' => 'he',
+ 'hi' => 'hi',
+ 'hr' => 'hr',
'hu' => 'hu',
+ 'hy' => 'hy',
+ 'ia' => 'ia',
+ 'id' => 'id',
'is' => 'is',
'it' => 'it',
- 'ja' => 'ja_utf-8',
+ 'ja' => 'ja',
+ 'ka' => 'ka',
+ 'kl' => 'kl',
+ 'km' => 'km',
'ko' => 'ko',
+ 'lb' => 'lb',
+ 'lt' => 'lt',
+ 'lv' => 'lv',
+ 'mk' => 'mk',
+ 'ml' => 'ml',
+ 'mn' => 'mn',
+ 'ms' => 'ms',
+ 'my' => 'my',
'nb' => 'nb',
'nl' => 'nl',
'nn' => 'nn',
+ 'no' => 'no',
'pl' => 'pl',
+ 'ps' => 'ps',
'pt' => 'pt',
- 'pt_BR' => 'pt_br',
'ro' => 'ro',
'ru' => 'ru',
+ 'sc' => 'sc',
+ 'se' => 'se',
'si' => 'si',
'sk' => 'sk',
+ 'sl' => 'sl',
'sq' => 'sq',
'sr' => 'sr',
- 'sv' => 'sv_utf8',
+ 'sv' => 'sv',
+ 'ta' => 'ta',
+ 'te' => 'te',
'th' => 'th',
+ 'tn' => 'tn',
'tr' => 'tr',
+ 'tt' => 'tt',
+ 'tw' => 'tw',
+ 'uk' => 'vi',
+ 'ur' => 'vi',
'vi' => 'vi',
- 'zh' => 'zh_cn_utf8',
- 'zh_CN' => 'zh_cn_utf8',
- //'zh_HK' => 'zh_tw_utf8', removed from 3.0.7
- 'zh_TW' => 'zh_tw_utf8'
+ 'zh_CN' => 'zh-cn',
+ 'zh_TW' => 'zh-tw',
+ 'zh' => 'zh',
+ 'zu' => 'zu',
);
/**
* @var array list of default plugins to load, override using getAvailablePlugins();
*/
private static $_plugins = array(
- 'style',
- 'layer',
- 'table',
- 'save',
'advhr',
-// 'advimage',
-// 'advlink',
+ 'advimage',
+ 'advlink',
+ 'advlist',
+ 'autolink',
+ 'autoresize',
+ 'autosave',
+ 'bbcode',
+ 'contextmenu',
+ 'directionality',
'emotions',
+ 'example',
+ 'fullpage',
+ 'fullscreen',
'iespell',
+ 'inlinepopups',
'insertdatetime',
- 'preview',
+ 'layer',
+ 'legacyoutput',
+ 'lists',
'media',
- 'searchreplace',
- 'print',
- 'contextmenu',
- 'paste',
- 'directionality',
- 'fullscreen',
+ 'nonbreaking',
'noneditable',
+ 'pagebreak',
+ 'paste',
+ 'preview',
+ 'print',
+ 'save',
+ 'searchreplace',
+ 'spellchecker',
+ 'style',
+ 'tabfocus',
+ 'table',
+ 'template',
'visualchars',
- 'nonbreaking',
+ 'wordc',
+ 'wordcount',
'xhtmlxtras'
);
diff --git a/framework/Web/UI/WebControls/TOutputCache.php b/framework/Web/UI/WebControls/TOutputCache.php
index c0747a11..294519da 100644
--- a/framework/Web/UI/WebControls/TOutputCache.php
+++ b/framework/Web/UI/WebControls/TOutputCache.php
@@ -478,14 +478,14 @@ class TOutputCache extends TControl implements INamingContainer
$writer->write($this->_contents);
else if($this->_cacheAvailable)
{
- $textWriter=new TTextWriter;
-
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+
$stack=$this->getPage()->getCachingStack();
$stack->push($this);
- parent::render(new THtmlWriter($textWriter));
+ parent::render($htmlWriter);
$stack->pop();
- $content=$textWriter->flush();
+ $content=$htmlWriter->flush();
$data=array($content,$this->_state,$this->_actions,time());
$this->_cache->set($this->getCacheKey(),$data,$this->getDuration(),$this->getCacheDependency());
$writer->write($content);
diff --git a/framework/Web/UI/WebControls/TSafeHtml.php b/framework/Web/UI/WebControls/TSafeHtml.php
index d6829f8b..dba513c5 100644
--- a/framework/Web/UI/WebControls/TSafeHtml.php
+++ b/framework/Web/UI/WebControls/TSafeHtml.php
@@ -45,9 +45,9 @@ class TSafeHtml extends TControl
*/
public function render($writer)
{
- $textWriter=new TTextWriter;
- parent::render(new THtmlWriter($textWriter));
- $writer->write($this->parseSafeHtml($textWriter->flush()));
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+ parent::render($htmlWriter);
+ $writer->write($this->parseSafeHtml($htmlWriter->flush()));
}
/**
diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php
index 63710e56..e17008ba 100644
--- a/framework/Web/UI/WebControls/TTabPanel.php
+++ b/framework/Web/UI/WebControls/TTabPanel.php
@@ -412,7 +412,11 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler
$cs->registerPradoScript('tabpanel');
$code="new $className($options);";
$cs->registerEndScript("prado:$id", $code);
- $cs->registerHiddenField($id.'_1',$this->getActiveViewIndex());
+ // ensure an item is always active and visible
+ $index = $this->getActiveViewIndex();
+ if(!$this->getViews()->itemAt($index)->Visible)
+ $index=0;
+ $cs->registerHiddenField($id.'_1', $index);
$page->registerRequiresPostData($this);
$page->registerRequiresPostData($id."_1");
}
@@ -435,13 +439,16 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler
$options['ID']=$this->getClientID();
$options['ActiveCssClass']=$this->getActiveTabCssClass();
$options['NormalCssClass']=$this->getTabCssClass();
- $viewIDs=array();
+ $views='';
foreach($this->getViews() as $view)
{
- if($view->getVisible())
- $viewIDs[]=$view->getClientID();
+ if($views!='')
+ $views.=', ';
+ $views.= '"'.$view->getClientID().'":'.($view->getVisible() ? '1': '0' );
}
- $options['Views']='[\''.implode('\',\'',$viewIDs).'\']';
+
+ $options['Views']='{'.$views.='}';
+ $viewIDs=array();
return $options;
}
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php
index 8ab548a3..46e7f551 100644
--- a/framework/Web/UI/WebControls/TTextBox.php
+++ b/framework/Web/UI/WebControls/TTextBox.php
@@ -122,25 +122,6 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
$writer->addAttribute('type','text');
if(($text=$this->getText())!=='')
$writer->addAttribute('value',$text);
- if(($act=$this->getAutoCompleteType())!=='None')
- {
- if($act==='Disabled')
- $writer->addAttribute('autocomplete','off');
- else if($act==='Search')
- $writer->addAttribute('vcard_name','search');
- else if($act==='HomeCountryRegion')
- $writer->addAttribute('vcard_name','HomeCountry');
- else if($act==='BusinessCountryRegion')
- $writer->addAttribute('vcard_name','BusinessCountry');
- else
- {
- if(strpos($act,'Business')===0)
- $act='Business'.'.'.substr($act,8);
- else if(strpos($act,'Home')===0)
- $act='Home'.'.'.substr($act,4);
- $writer->addAttribute('vcard_name','vCard.'.$act);
- }
- }
}
else
{
@@ -148,6 +129,27 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
$writer->addAttribute('value',$text);
$writer->addAttribute('type','password');
}
+
+ if(($act=$this->getAutoCompleteType())!=='None')
+ {
+ if($act==='Disabled')
+ $writer->addAttribute('autocomplete','off');
+ else if($act==='Search')
+ $writer->addAttribute('vcard_name','search');
+ else if($act==='HomeCountryRegion')
+ $writer->addAttribute('vcard_name','HomeCountry');
+ else if($act==='BusinessCountryRegion')
+ $writer->addAttribute('vcard_name','BusinessCountry');
+ else
+ {
+ if(strpos($act,'Business')===0)
+ $act='Business'.'.'.substr($act,8);
+ else if(strpos($act,'Home')===0)
+ $act='Home'.'.'.substr($act,4);
+ $writer->addAttribute('vcard_name','vCard.'.$act);
+ }
+ }
+
if(($cols=$this->getColumns())>0)
$writer->addAttribute('size',"$cols");
if(($maxLength=$this->getMaxLength())>0)
diff --git a/framework/Web/UI/WebControls/TTextProcessor.php b/framework/Web/UI/WebControls/TTextProcessor.php
index 26dab754..3d900054 100644
--- a/framework/Web/UI/WebControls/TTextProcessor.php
+++ b/framework/Web/UI/WebControls/TTextProcessor.php
@@ -75,9 +75,9 @@ abstract class TTextProcessor extends TWebControl
{
if(($text=$this->getText())==='' && $this->getHasControls())
{
- $textWriter=new TTextWriter;
- parent::renderContents(new THtmlWriter($textWriter));
- $text=$textWriter->flush();
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+ parent::renderContents($htmlWriter);
+ $text=$htmlWriter->flush();
}
if($text!=='')
$writer->write($this->processText($text));
diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php
index 774096f7..a9268b2b 100644
--- a/framework/Web/UI/WebControls/TWizard.php
+++ b/framework/Web/UI/WebControls/TWizard.php
@@ -954,6 +954,8 @@ class TWizard extends TWebControl implements INamingContainer
if($buttonStyle!==null)
$style->mergeWith($buttonStyle);
$style->apply($button);
+ if($activeStepType===TWizardStepType::Start)
+ $this->getPage()->getClientScript()->registerDefaultButton($this, $button);
}
// apply styles to finish navigation buttons
@@ -977,6 +979,8 @@ class TWizard extends TWebControl implements INamingContainer
if($buttonStyle!==null)
$style->mergeWith($buttonStyle);
$style->apply($button);
+ if($activeStepType===TWizardStepType::Finish)
+ $this->getPage()->getClientScript()->registerDefaultButton($this, $button);
}
// apply styles to step navigation buttons
@@ -1000,6 +1004,8 @@ class TWizard extends TWebControl implements INamingContainer
if($buttonStyle!==null)
$style->mergeWith($buttonStyle);
$style->apply($button);
+ if($activeStepType===TWizardStepType::Step)
+ $this->getPage()->getClientScript()->registerDefaultButton($this, $button);
}
}
diff --git a/framework/Web/UI/WebControls/TXmlTransform.php b/framework/Web/UI/WebControls/TXmlTransform.php
index 991aed39..c1a372e1 100644
--- a/framework/Web/UI/WebControls/TXmlTransform.php
+++ b/framework/Web/UI/WebControls/TXmlTransform.php
@@ -168,10 +168,10 @@ class TXmlTransform extends TControl {
*/
public function render($writer) {
if(($document=$this->getSourceXmlDocument()) === null) {
- $textWriter = new TTextWriter();
- parent::render(new THtmlWriter($textWriter));
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+ parent::render($htmlWriter);
$document = new DOMDocument();
- $document->loadXML($textWriter->flush());
+ $document->loadXML($htmlWriter->flush());
}
$stylesheet = $this->getTransformXmlDocument();