From 682f7ef6933f4ad485baedddf7a30367d003d7bf Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 25 Jan 2007 05:49:22 +0000 Subject: Fixed #502 --- .gitattributes | 3 ++ HISTORY | 4 ++ buildscripts/texbuilder/Page2Tex.php | 5 +- framework/I18N/core/CultureInfo.php | 5 +- framework/Web/UI/WebControls/TStyle.php | 62 +++++++++++++++++++++- framework/Web/UI/WebControls/TWebControl.php | 16 ++++++ .../protected/pages/DisplayStyleTest.page | 22 ++++++++ .../protected/pages/DisplayStyleTest.php | 26 +++++++++ .../validators/tests/DatePickerTestCase.php | 1 + tests/simple_unit/I18N/CultureInfoTest.php | 13 +++++ 10 files changed, 152 insertions(+), 5 deletions(-) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.php create mode 100644 tests/simple_unit/I18N/CultureInfoTest.php diff --git a/.gitattributes b/.gitattributes index 5c2dc5e1..ca1df998 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2117,6 +2117,8 @@ tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.php -text tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page -text tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.php -text +tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page -text +tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.php -text tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page -text tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.php -text tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page -text @@ -2411,6 +2413,7 @@ tests/simple_unit/ActiveRecord/records/DepartmentRecord.php -text tests/simple_unit/ActiveRecord/records/SimpleUser.php -text tests/simple_unit/ActiveRecord/records/SqliteUsers.php -text tests/simple_unit/ActiveRecord/records/UserRecord.php -text +tests/simple_unit/I18N/CultureInfoTest.php -text tests/simple_unit/Soap/ContactManager.php -text tests/simple_unit/Soap/SoapTestCase.php -text tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php -text diff --git a/HISTORY b/HISTORY index 8c7dfdf9..840e0fd8 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,10 @@ Version 3.1.0 beta to be released ================================= ENH: Added PRADO_CHMOD constant so that users can specify the permission of PRADO-created directories (Qiang) +ENH: Ticket#519 - Update TActiveRecord implementation (Wei) +ENH: Add Display property to TWebControl (Wei) +BUG: Ticket#517 - Quickstart I18N sample: conflicting module ID (Wei) +BUG: Ticket#521 - comment tag on TActiveButton stop callback (Wei) Version 3.1.0 alpha January 15, 2007 ==================================== diff --git a/buildscripts/texbuilder/Page2Tex.php b/buildscripts/texbuilder/Page2Tex.php index 2374647c..7ee4a171 100644 --- a/buildscripts/texbuilder/Page2Tex.php +++ b/buildscripts/texbuilder/Page2Tex.php @@ -211,6 +211,7 @@ class Page2Tex array($this, 'tabular'), $html); $html = preg_replace('//', '', $html); + $html = preg_replace('/
/', array($this, 'add_p'), $content);
@@ -322,7 +323,7 @@ class Page2Tex
return $matches[0];
}
else
- {
+ {
$changes = str_replace('"source"', '"source block-content" id="code-'.$id.'"', $matches[0]);
return $changes;
}
diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php
index bcf2f245..404c81fe 100644
--- a/framework/I18N/core/CultureInfo.php
+++ b/framework/I18N/core/CultureInfo.php
@@ -414,7 +414,7 @@ class CultureInfo
* Gets the culture name in English.
* Returns array('Language','Country');
* 'Country' is omitted if the culture is neutral.
- * @return array array with language and country as elements.
+ * @return string language (country), it may locale code string if english name does not exist.
*/
function getEnglishName()
{
@@ -423,6 +423,9 @@ class CultureInfo
$culture = $this->getInvariantCulture();
$language = $culture->findInfo("Languages/{$lang}");
+ if(count($language) == 0)
+ return $this->culture;
+
$region = $culture->findInfo("Countries/{$reg}");
if($region)
return $language[0].' ('.$region[0].')';
diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php
index cc383766..73ff4adf 100644
--- a/framework/Web/UI/WebControls/TStyle.php
+++ b/framework/Web/UI/WebControls/TStyle.php
@@ -43,6 +43,10 @@ class TStyle extends TComponent
* @var string CSS style string (those not represented by specific fields of TStyle)
*/
private $_customStyle=null;
+ /**
+ * @var string display style
+ */
+ private $_displayStyle='Fixed';
/**
* Constructor.
@@ -173,7 +177,7 @@ class TStyle extends TComponent
$this->_font=new TFont;
return $this->_font;
}
-
+
/**
* @return boolean true if font is set.
*/
@@ -182,6 +186,37 @@ class TStyle extends TComponent
return $this->_font !== null;
}
+ /**
+ * @param TDisplayStyle control display style, default is TDisplayStyle::Fixed
+ */
+ public function setDisplayStyle($value)
+ {
+ $this->_displayStyle = TPropertyValue::ensureEnum($value, 'TDisplayStyle');
+ switch($this->_displayStyle)
+ {
+ case TDisplayStyle::None:
+ $this->_fields['display'] = 'none';
+ break;
+ case TDisplayStyle::Dynamic:
+ $this->_fields['display'] = ''; //remove the display property
+ break;
+ case TDisplayStyle::Fixed:
+ $this->_fields['visibility'] = 'visible';
+ break;
+ case TDisplayStyle::Hidden:
+ $this->_fields['visibility'] = 'hidden';
+ break;
+ }
+ }
+
+ /**
+ * @return TDisplayStyle display style
+ */
+ public function getDisplayStyle()
+ {
+ return $this->_displayStyle;
+ }
+
/**
* @return string the foreground color of the control
*/
@@ -362,7 +397,7 @@ class TStyle extends TComponent
if($this->_class!==null)
$writer->addAttribute('class',$this->_class);
}
-
+
/**
* @return array list of style fields.
*/
@@ -372,6 +407,29 @@ class TStyle extends TComponent
}
}
+/**
+ * TDisplayStyle defines the enumerable type for the possible styles
+ * that a web control can display.
+ *
+ * The following enumerable values are defined:
+ * - None: the control is not displayed and not included in the layout.
+ * - Dynamic: the control is displayed and included in the layout, the layout flow is dependent on the control (equivalent to display:'' in css).
+ * - Fixed: Similar to Dynamic with CSS "visibility" set "shown".
+ * - Hidden: the control is not displayed and is included in the layout.
+ *
+ * @author Wei Zhuo Display Style Test
+
+