summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2006-08-05 21:34:30 +0000
committerxue <>2006-08-05 21:34:30 +0000
commitb7f95ce37ae577e95a81e64aa2aaf3e2e698109d (patch)
tree85c6b9961ebbd4c9283fbd9b841703f9e4c47307 /framework
parent550ba06593b467b643862d41a00ca2dd12ee704b (diff)
merge from 3.0 branch till 1329.
Diffstat (limited to 'framework')
-rw-r--r--framework/Exceptions/messages.txt3
-rw-r--r--framework/I18N/TGlobalization.php27
-rw-r--r--framework/I18N/core/Gettext/MO.php1
-rw-r--r--framework/I18N/core/Gettext/PO.php1
-rw-r--r--framework/I18N/core/MessageSource_XLIFF.php7
-rw-r--r--framework/I18N/core/MessageSource_gettext.php6
-rw-r--r--framework/IO/TTarFileExtractor.php2
-rw-r--r--framework/PradoBase.php2
-rw-r--r--framework/TApplication.php3
-rw-r--r--framework/Util/TSimpleDateFormatter.php5
-rw-r--r--framework/Web/Javascripts/js/validator.js9
-rw-r--r--framework/Web/Javascripts/prado/validation3.js14
-rw-r--r--framework/Web/TAssetManager.php3
-rw-r--r--framework/Web/UI/TClientScriptManager.php34
-rw-r--r--framework/Web/UI/TPage.php21
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php4
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php1
-rw-r--r--framework/Web/UI/WebControls/TDataList.php2
-rw-r--r--framework/Web/UI/WebControls/TDataTypeValidator.php3
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php3
-rw-r--r--framework/Web/UI/WebControls/TOutputCache.php2
-rw-r--r--framework/Web/UI/WebControls/TPanelStyle.php2
-rw-r--r--framework/Web/UI/WebControls/TStyle.php33
-rw-r--r--framework/Web/UI/WebControls/TStyleSheet.php18
-rw-r--r--framework/Web/UI/WebControls/TWizard.php10
-rwxr-xr-xframework/prado-cli.php4
26 files changed, 179 insertions, 41 deletions
diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt
index 630f7b50..39d304be 100644
--- a/framework/Exceptions/messages.txt
+++ b/framework/Exceptions/messages.txt
@@ -323,7 +323,8 @@ databoundcontrol_datamember_invalid = databoundcontrol_datamember_invalid
clientscript_invalid_file_position = Invalid file position '{1}' for TClientScript control '{0}', must be 'Head', 'Here' or 'Begin'.
tdatepicker_autopostback_unsupported = '{0}' does not support AutoPostBack.
-
+globalization_cache_path_failed = Unable to create translation message cache path '{0}'. Make sure the parent directory exists and is writable by the Web process.
+globalization_source_path_failed = Unable to create translation message path '{0}'. Make sure the parent directory exists and is writable by the Web process.
callback_not_support_no_priority_state_update = Callback request does not support unprioritized pagestate update.
callback_invalid_callback_options = '{1}' is not a valid TCallbackOptions control for Callback control '{0}'.
callback_invalid_clientside_options = Callback ClientSide property must be either a string that is the ID of a TCallbackOptions control or an instance of TCallbackClientSideOptions.=======
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index aa545d21..1ea7ce2b 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -168,12 +168,33 @@ class TGlobalization extends TModule
{
if($config['type'] == 'XLIFF' || $config['type'] == 'gettext')
{
- $config['source'] = Prado::getPathOfNamespace($config['source']);
- if($config['source']===null || !is_dir($config['source']))
- throw new TException("invalid source dir '{$config['source']}'");
+ if($config['source'])
+ {
+ $config['source'] = Prado::getPathOfNamespace($config['source']);
+ if(!is_dir($config['source']))
+ {
+ if(@mkdir($config['source'])===false)
+ throw new TConfigurationException('globalization_source_path_failed',
+ $config['source']);
+ chmod($config['source'], 0777); //make it deletable
+ }
+ }
+ else
+ {
+ throw new TConfigurationException("invalid source dir '{$config['source']}'");
+ }
}
if($config['cache'])
+ {
$config['cache'] = $this->getApplication()->getRunTimePath().'/i18n';
+ if(!is_dir($config['cache']))
+ {
+ if(@mkdir($config['cache'])===false)
+ throw new TConfigurationException('globalization_cache_path_failed',
+ $config['cache']);
+ chmod($config['cache'], 0777); //make it deletable
+ }
+ }
$this->_translation = $config;
}
diff --git a/framework/I18N/core/Gettext/MO.php b/framework/I18N/core/Gettext/MO.php
index 5ee0057f..9f2d5799 100644
--- a/framework/I18N/core/Gettext/MO.php
+++ b/framework/I18N/core/Gettext/MO.php
@@ -349,6 +349,7 @@ class TGettext_MO extends TGettext
// done
@flock($this->_handle, LOCK_UN);
@fclose($this->_handle);
+ chmod($file,0777);
return true;
}
}
diff --git a/framework/I18N/core/Gettext/PO.php b/framework/I18N/core/Gettext/PO.php
index 015747a0..3a5fda04 100644
--- a/framework/I18N/core/Gettext/PO.php
+++ b/framework/I18N/core/Gettext/PO.php
@@ -154,6 +154,7 @@ class TGettext_PO extends TGettext
//done
@flock($fh, LOCK_UN);
@fclose($fh);
+ chmod($file,0777);
return true;
}
}
diff --git a/framework/I18N/core/MessageSource_XLIFF.php b/framework/I18N/core/MessageSource_XLIFF.php
index 2194ca41..7f2f27c5 100644
--- a/framework/I18N/core/MessageSource_XLIFF.php
+++ b/framework/I18N/core/MessageSource_XLIFF.php
@@ -473,10 +473,15 @@ class MessageSource_XLIFF extends MessageSource
$variant = array_shift($variants);
$file = $this->getSource($variant);
$dir = dirname($file);
- if(!is_dir($dir)) @mkdir($dir);
+ if(!is_dir($dir))
+ {
+ @mkdir($dir);
+ @chmod($dir,0777);
+ }
if(!is_dir($dir))
throw new TException("Unable to create directory $dir");
file_put_contents($file, $this->getTemplate($catalogue));
+ chmod($file, 0777);
return array($variant, $file);
}
diff --git a/framework/I18N/core/MessageSource_gettext.php b/framework/I18N/core/MessageSource_gettext.php
index 78fa5259..c92577d4 100644
--- a/framework/I18N/core/MessageSource_gettext.php
+++ b/framework/I18N/core/MessageSource_gettext.php
@@ -431,7 +431,11 @@ class MessageSource_gettext extends MessageSource
$po_file = $this->getPOFile($mo_file);
$dir = dirname($mo_file);
- if(!is_dir($dir)) @mkdir($dir);
+ if(!is_dir($dir))
+ {
+ @mkdir($dir);
+ @chmod($dir,0777);
+ }
if(!is_dir($dir))
throw new TException("Unable to create directory $dir");
diff --git a/framework/IO/TTarFileExtractor.php b/framework/IO/TTarFileExtractor.php
index 9f61026d..1bd245ca 100644
--- a/framework/IO/TTarFileExtractor.php
+++ b/framework/IO/TTarFileExtractor.php
@@ -460,6 +460,7 @@ class TTarFileExtractor
.$v_header['filename'].'}');
return false;
}
+ chmod($v_header['filename'], 0777);
}
} else {
if (($v_dest_file = @fopen($v_header['filename'], "wb")) == 0) {
@@ -549,6 +550,7 @@ class TTarFileExtractor
$this->_error("Unable to create directory '$p_dir'");
return false;
}
+ chmod($p_dir,0777);
return true;
}
diff --git a/framework/PradoBase.php b/framework/PradoBase.php
index 50e4ac82..4685ce83 100644
--- a/framework/PradoBase.php
+++ b/framework/PradoBase.php
@@ -516,7 +516,7 @@ class PradoBase
*/
public static function varDump($var,$depth=10,$highlight=false)
{
- require_once(PRADO_DIR.'/Util/TVarDumper.php');
+ Prado::using('System.Util.TVarDumper');
return TVarDumper::dump($var,$depth,$highlight);
}
diff --git a/framework/TApplication.php b/framework/TApplication.php
index ef2fd1a1..68064072 100644
--- a/framework/TApplication.php
+++ b/framework/TApplication.php
@@ -310,8 +310,11 @@ class TApplication extends TComponent
$subdir=basename($this->_configFile);
$this->_runtimePath.='/'.$subdir;
if(!is_dir($this->_runtimePath))
+ {
if(@mkdir($this->_runtimePath)===false)
throw new TConfigurationException('application_runtimepath_failed',$this->_runtimePath);
+ chmod($this->_runtimePath, 0777); //make it deletable
+ }
}
}
else
diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php
index 971225b5..03ae7b7d 100644
--- a/framework/Util/TSimpleDateFormatter.php
+++ b/framework/Util/TSimpleDateFormatter.php
@@ -185,7 +185,10 @@ class TSimpleDateFormatter
*/
public function isValidDate($value)
{
- return !is_null($this->parse($value, false));
+ if(is_null($value))
+ return false;
+ else
+ return !is_null($this->parse($value, false));
}
/**
diff --git a/framework/Web/Javascripts/js/validator.js b/framework/Web/Javascripts/js/validator.js
index 5e896aa1..711c996e 100644
--- a/framework/Web/Javascripts/js/validator.js
+++ b/framework/Web/Javascripts/js/validator.js
@@ -97,7 +97,8 @@ control.addClassName(CssClass);}},hide:function()
{this.isValid=true;this.updateControl();this.visible=false;},validate:function(invoker)
{if(typeof(this.options.OnValidate)=="function")
this.options.OnValidate(this,invoker);if(this.enabled)
-this.isValid=this.evaluateIsValid();if(this.isValid)
+this.isValid=this.evaluateIsValid();else
+this.isValid=true;if(this.isValid)
{if(typeof(this.options.OnSuccess)=="function")
{this.visible=true;this.message.style.visibility="visible";this.updateControlCssClass(this.control,this.isValid);this.options.OnSuccess(this,invoker);}
else
@@ -126,7 +127,11 @@ return value;},getValidationValue:function(control)
control=this.control
switch(this.options.ControlType)
{case'TDatePicker':if(control.type=="text")
-return this.trim($F(control));else
+{value=this.trim($F(control));if(this.options.DateFormat)
+{date=value.toDate(this.options.DateFormat);return date==null?'':date;}
+else
+return value;}
+else
{this.observeDatePickerChanges();return Prado.WebUI.TDatePicker.getDropDownDate(control).getTime();}
case'THtmlArea':if(typeof tinyMCE!="undefined")
tinyMCE.triggerSave();return this.trim($F(control));case'TRadioButton':if(this.options.GroupName)
diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js
index 1dba23da..7df6efeb 100644
--- a/framework/Web/Javascripts/prado/validation3.js
+++ b/framework/Web/Javascripts/prado/validation3.js
@@ -661,6 +661,8 @@ Prado.WebUI.TBaseValidator.prototype =
if(this.enabled)
this.isValid = this.evaluateIsValid();
+ else
+ this.isValid = true;
if(this.isValid)
{
@@ -776,7 +778,17 @@ Prado.WebUI.TBaseValidator.prototype =
{
case 'TDatePicker':
if(control.type == "text")
- return this.trim($F(control));
+ {
+ value = this.trim($F(control));
+
+ if(this.options.DateFormat)
+ {
+ date = value.toDate(this.options.DateFormat);
+ return date == null ? '' : date;
+ }
+ else
+ return value;
+ }
else
{
this.observeDatePickerChanges();
diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php
index f9fe156f..f6384a08 100644
--- a/framework/Web/TAssetManager.php
+++ b/framework/Web/TAssetManager.php
@@ -199,7 +199,10 @@ class TAssetManager extends TModule
protected function copyFile($src,$dst)
{
if(!is_dir($dst))
+ {
@mkdir($dst);
+ @chmod($dst, 0777);
+ }
$dstFile=$dst.'/'.basename($src);
if(@filemtime($dstFile)<@filemtime($src))
{
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 540ea01e..d1f3f457 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -145,7 +145,7 @@ class TClientScriptManager extends TApplicationComponent
}
}
- /**
+ /**
* Renders the <script> tag that will load the javascript library files.
* @param THtmlWriter writer that renders the <script> tag.
*/
@@ -163,7 +163,7 @@ class TClientScriptManager extends TApplicationComponent
}
}
- /**
+ /**
* Returns javascript statement that create a new callback request object.
* @param ICallbackEventHandler callback response handler
* @param array additional callback options
@@ -244,8 +244,11 @@ class TClientScriptManager extends TApplicationComponent
*/
public function registerFocusControl($target)
{
- $this->registerPradoScriptInternal('prado');
- $this->_endScripts['prado:focus']='Prado.Focus.setFocus("'.TJavaScript::quoteString($target).'");';
+ $this->registerPradoScriptInternal('effects');
+ if($target instanceof TControl)
+ $target=$target->getClientID();
+ $id = TJavaScript::quoteString($target);
+ $this->_endScripts['prado:focus'] = 'new Effect.ScrollTo("'.$id.'"); Prado.Element.focus("'.$id.'");';
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerFocusControl',$params);
@@ -268,10 +271,14 @@ class TClientScriptManager extends TApplicationComponent
* Registers a CSS file to be rendered in the page head
* @param string a unique key identifying the file
* @param string URL to the CSS file
+ * @param string media type of the CSS (such as 'print', 'screen', etc.). Defaults to empty, meaning the CSS applies to all media types.
*/
- public function registerStyleSheetFile($key,$url)
+ public function registerStyleSheetFile($key,$url,$media='')
{
- $this->_styleSheetFiles[$key]=$url;
+ if($media==='')
+ $this->_styleSheetFiles[$key]=$url;
+ else
+ $this->_styleSheetFiles[$key]=array($url,$media);
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerStyleSheetFile',$params);
@@ -282,7 +289,7 @@ class TClientScriptManager extends TApplicationComponent
* @param string a unique key identifying the CSS block
* @param string CSS block
*/
- public function registerStyleSheet($key,$css)
+ public function registerStyleSheet($key,$css,$media='')
{
$this->_styleSheets[$key]=$css;
@@ -431,7 +438,7 @@ class TClientScriptManager extends TApplicationComponent
{
return isset($this->_endScripts[$key]);
}
-
+
/**
* @return boolean true if any end scripts are registered.
*/
@@ -439,7 +446,7 @@ class TClientScriptManager extends TApplicationComponent
{
return count($this->_endScripts) > 0;
}
-
+
/**
* @return boolean true if any begin scripts are registered.
*/
@@ -464,7 +471,12 @@ class TClientScriptManager extends TApplicationComponent
{
$str='';
foreach($this->_styleSheetFiles as $url)
- $str.="<link rel=\"stylesheet\" type=\"text/css\" href=\"".THttpUtility::htmlEncode($url)."\" />\n";
+ {
+ if(is_array($url))
+ $str.="<link rel=\"stylesheet\" type=\"text/css\" media=\"{$url[1]}\" href=\"".THttpUtility::htmlEncode($url[0])."\" />\n";
+ else
+ $str.="<link rel=\"stylesheet\" type=\"text/css\" href=\"".THttpUtility::htmlEncode($url)."\" />\n";
+ }
$writer->write($str);
}
@@ -620,4 +632,4 @@ abstract class TClientSideOptions extends TComponent
}
}
-?> \ No newline at end of file
+?>
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php
index 22aee89f..60586fab 100644
--- a/framework/Web/UI/TPage.php
+++ b/framework/Web/UI/TPage.php
@@ -637,20 +637,37 @@ class TPage extends TTemplateControl
if($this->_theme instanceof ITheme)
{
foreach($this->_theme->getStyleSheetFiles() as $url)
- $cs->registerStyleSheetFile($url,$url);
+ $cs->registerStyleSheetFile($url,$url,$this->getCssMediaType($url));
foreach($this->_theme->getJavaScriptFiles() as $url)
$cs->registerHeadScriptFile($url,$url);
}
if($this->_styleSheet instanceof ITheme)
{
foreach($this->_styleSheet->getStyleSheetFiles() as $url)
- $cs->registerStyleSheetFile($url,$url);
+ $cs->registerStyleSheetFile($url,$url,$this->getCssMediaType($url));
foreach($this->_styleSheet->getJavaScriptFiles() as $url)
$cs->registerHeadScriptFile($url,$url);
}
}
/**
+ * Determines the media type of the CSS file.
+ * The media type is determined according to the following file name pattern:
+ * xxx.media-type.extension
+ * For example, 'mystyle.print.css' means its media type is 'print'.
+ * @param string CSS URL
+ * @return string media type of the CSS file
+ */
+ private function getCssMediaType($url)
+ {
+ $segs=explode('.',basename($url));
+ if(isset($segs[2]))
+ return $segs[count($segs)-2];
+ else
+ return '';
+ }
+
+ /**
* Raises OnSaveStateComplete event.
* This method is invoked right after {@link onSaveState OnSaveState} stage.
* You may override this method to provide additional logic after page state is saved.
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index 6660184e..ff026b49 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -167,6 +167,10 @@ abstract class TBaseValidator extends TLabel implements IValidator
$options['ControlCssClass'] = $this->getControlCssClass();
$options['ControlType'] = $this->getClientControlClass($control);
+
+ //get date format from date picker target control
+ if($control instanceof TDatePicker)
+ $options['DateFormat'] = $control->getDateFormat();
if(!is_null($this->_clientSide))
$options = array_merge($options,$this->_clientSide->getOptions()->toArray());
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 2687ac35..e27f6ead 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -278,6 +278,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$style=new TTableStyle;
$style->setGridLines('Both');
$style->setCellSpacing(0);
+ $style->setBorderCollapse(true);
return $style;
}
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index 42c47f86..22bec07e 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -1357,7 +1357,7 @@ class TDataListItem extends TWebControl implements INamingContainer
/**
* Creates a style object for the control.
- * This method creates a {@link TTableStyle} to be used by checkbox list.
+ * This method creates a {@link TTableItemStyle} to be used by a datalist item.
* @return TStyle control style to be used
*/
protected function createStyle()
diff --git a/framework/Web/UI/WebControls/TDataTypeValidator.php b/framework/Web/UI/WebControls/TDataTypeValidator.php
index bd7569fc..3e91ec15 100644
--- a/framework/Web/UI/WebControls/TDataTypeValidator.php
+++ b/framework/Web/UI/WebControls/TDataTypeValidator.php
@@ -89,6 +89,9 @@ class TDataTypeValidator extends TBaseValidator
*/
protected function evaluateDataTypeCheck($value)
{
+ if($value=='')
+ return true;
+
switch($this->getDataType())
{
case 'Integer':
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 42cb305e..001c7c46 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -296,7 +296,8 @@ class TDatePicker extends TTextBox
{
if($this->getText() === '')
return '';
- return $this->getTimeStamp();
+ $date = $this->getTimeStamp();
+ return $date == null ? '' : $date;
}
/**
diff --git a/framework/Web/UI/WebControls/TOutputCache.php b/framework/Web/UI/WebControls/TOutputCache.php
index 20c04f7c..ff07a6db 100644
--- a/framework/Web/UI/WebControls/TOutputCache.php
+++ b/framework/Web/UI/WebControls/TOutputCache.php
@@ -37,7 +37,7 @@
* to respond to the {@link onCheckDependency OnCheckDependency} event and set
* the event parameter's {@link TOutputCacheCheckDependencyEventParameter::getIsValid IsValid}
* property to indicate whether the cached data remains valid or not.
- * One can also extend TOutputCache and override its {@link getCacheDependency CacheDependency}
+ * One can also extend TOutputCache and override its {@link getCacheDependency}
* function. While the former is easier to use, the latter offers more extensibility.
*
* The content fetched from cache may be variated with respect to
diff --git a/framework/Web/UI/WebControls/TPanelStyle.php b/framework/Web/UI/WebControls/TPanelStyle.php
index 02f366b8..dc20806e 100644
--- a/framework/Web/UI/WebControls/TPanelStyle.php
+++ b/framework/Web/UI/WebControls/TPanelStyle.php
@@ -171,7 +171,7 @@ class TPanelStyle extends TStyle
/**
* Sets the style attributes to default values.
* This method overrides the parent implementation by
- * resetting additional TTableStyle specific attributes.
+ * resetting additional TPanelStyle specific attributes.
*/
public function reset()
{
diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php
index 597229ea..d4cb6154 100644
--- a/framework/Web/UI/WebControls/TStyle.php
+++ b/framework/Web/UI/WebControls/TStyle.php
@@ -403,6 +403,10 @@ class TTableStyle extends TStyle
* @var string grid line setting of the table
*/
private $_gridLines=null;
+ /**
+ * @var boolean whether the table border should be collapsed
+ */
+ private $_borderCollapse=null;
/**
* Sets the style attributes to default values.
@@ -416,6 +420,7 @@ class TTableStyle extends TStyle
$this->_cellPadding=null;
$this->_cellSpacing=null;
$this->_gridLines=null;
+ $this->_borderCollapse=null;
}
/**
@@ -439,6 +444,8 @@ class TTableStyle extends TStyle
$this->_cellSpacing=$style->_cellSpacing;
if($style->_gridLines!==null)
$this->_gridLines=$style->_gridLines;
+ if($style->_borderCollapse!==null)
+ $this->_borderCollapse=$style->_borderCollapse;
}
}
@@ -463,6 +470,8 @@ class TTableStyle extends TStyle
$this->_cellSpacing=$style->_cellSpacing;
if($this->_gridLines===null && $style->_gridLines!==null)
$this->_gridLines=$style->_gridLines;
+ if($this->_borderCollapse===null && $style->_borderCollapse!==null)
+ $this->_borderCollapse=$style->_borderCollapse;
}
}
@@ -484,11 +493,10 @@ class TTableStyle extends TStyle
$writer->addAttribute('cellpadding',"$cellPadding");
if(($cellSpacing=$this->getCellSpacing())>=0)
- {
$writer->addAttribute('cellspacing',"$cellSpacing");
- if($this->getCellSpacing()===0)
- $writer->addStyleAttribute('border-collapse','collapse');
- }
+
+ if($this->getBorderCollapse())
+ $writer->addStyleAttribute('border-collapse','collapse');
switch($this->getGridLines())
{
@@ -588,6 +596,23 @@ class TTableStyle extends TStyle
{
$this->_gridLines=TPropertyValue::ensureEnum($value,array('None', 'Horizontal', 'Vertical', 'Both'));
}
+
+
+ /**
+ * @return boolean whether the table borders should be collapsed. Defaults to false.
+ */
+ public function getBorderCollapse()
+ {
+ return $this->_borderCollapse===null?false:$this->_borderCollapse;
+ }
+
+ /**
+ * @param boolean whether the table borders should be collapsed.
+ */
+ public function setBorderCollapse($value)
+ {
+ $this->_borderCollapse=TPropertyValue::ensureBoolean($value);
+ }
}
/**
diff --git a/framework/Web/UI/WebControls/TStyleSheet.php b/framework/Web/UI/WebControls/TStyleSheet.php
index 5925645c..3e172697 100644
--- a/framework/Web/UI/WebControls/TStyleSheet.php
+++ b/framework/Web/UI/WebControls/TStyleSheet.php
@@ -46,6 +46,22 @@ class TStyleSheet extends TControl
}
/**
+ * @return string media type of the CSS (such as 'print', 'screen', etc.). Defaults to empty, meaning the CSS applies to all media types.
+ */
+ public function getMediaType()
+ {
+ return $this->getViewState('MediaType','');
+ }
+
+ /**
+ * @param string media type of the CSS (such as 'print', 'screen', etc.). If empty, it means the CSS applies to all media types.
+ */
+ public function setMediaType($value)
+ {
+ $this->setViewState('MediaType',$value,'');
+ }
+
+ /**
* Registers the stylesheet file and content to be rendered.
* This method overrides the parent implementation and is invoked right before rendering.
* @param mixed event parameter
@@ -53,7 +69,7 @@ class TStyleSheet extends TControl
public function onPreRender($param)
{
if(($url=$this->getStyleSheetUrl())!=='')
- $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url);
+ $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url,$this->getMediaType());
}
/**
diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php
index fa0fd92a..684ef5dc 100644
--- a/framework/Web/UI/WebControls/TWizard.php
+++ b/framework/Web/UI/WebControls/TWizard.php
@@ -715,9 +715,11 @@ class TWizard extends TWebControl implements INamingContainer
}
/**
+ * Returns the multiview that holds the wizard steps.
+ * This method should only be used by control developers.
* @return TMultiView the multiview holding wizard steps
*/
- protected function getMultiView()
+ public function getMultiView()
{
if($this->_multiView===null)
{
@@ -740,7 +742,6 @@ class TWizard extends TWebControl implements INamingContainer
if(($wizard=$step->getWizard())!==null)
$wizard->getWizardSteps()->remove($step);
$step->setWizard($this);
- $this->getMultiView()->getViews()->add($step);
$this->wizardStepsChanged();
}
@@ -752,7 +753,6 @@ class TWizard extends TWebControl implements INamingContainer
*/
public function removedWizardStep($step)
{
- $this->getMultiView()->getViews()->remove($step);
$step->setWizard(null);
$this->wizardStepsChanged();
}
@@ -1262,7 +1262,7 @@ class TWizard extends TWebControl implements INamingContainer
if($this->_sideBarDataList!==null)
{
$this->_sideBarDataList->setDataSource($this->getWizardSteps());
- $this->_sideBarDataList->setSelectedIndex($this->getActiveStepIndex());
+ $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex());
$this->_sideBarDataList->dataBind();
}
}
@@ -1816,6 +1816,7 @@ class TWizardStepCollection extends TList
if($item instanceof TWizardStep)
{
parent::insertAt($index,$item);
+ $this->_wizard->getMultiView()->getViews()->insertAt($index,$item);
$this->_wizard->addedWizardStep($item);
}
else
@@ -1830,6 +1831,7 @@ class TWizardStepCollection extends TList
public function removeAt($index)
{
$step=parent::removeAt($index);
+ $this->_wizard->getMultiView()->getViews()->remove($step);
$this->_wizard->removedWizardStep($step);
return $step;
}
diff --git a/framework/prado-cli.php b/framework/prado-cli.php
index 1a0e5498..36739ad2 100755
--- a/framework/prado-cli.php
+++ b/framework/prado-cli.php
@@ -65,10 +65,6 @@ function create_new_prado_project($dir)
create_directory($runtimePath,0777);
create_directory($pagesPath,0755);
- create_directory($tests,0755);
- create_directory($unit_tests,0755);
- create_directory($functional_tests,0755);
-
create_file($indexFile, render_index_file());
create_file($htaccessFile, render_htaccess_file());
create_file($defaultPageFile, render_default_page());