summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls
diff options
context:
space:
mode:
authorxue <>2006-08-30 12:33:43 +0000
committerxue <>2006-08-30 12:33:43 +0000
commit1f560ccd8a9e21871dbedd548fc97f231131c771 (patch)
tree90d054108a0bce4668ca16d425655b22c99ed6d3 /framework/Web/UI/WebControls
parentf4482f9c17825b63242fee42252e097dd85f53c5 (diff)
merge from 3.0 branch till 1363.
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r--framework/Web/UI/WebControls/TDataTypeValidator.php2
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php14
-rw-r--r--framework/Web/UI/WebControls/THead.php19
3 files changed, 29 insertions, 6 deletions
diff --git a/framework/Web/UI/WebControls/TDataTypeValidator.php b/framework/Web/UI/WebControls/TDataTypeValidator.php
index 3e91ec15..ec39e8a3 100644
--- a/framework/Web/UI/WebControls/TDataTypeValidator.php
+++ b/framework/Web/UI/WebControls/TDataTypeValidator.php
@@ -91,7 +91,7 @@ class TDataTypeValidator extends TBaseValidator
{
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 0c3e0b9a..02361e54 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -317,14 +317,14 @@ class TDatePicker extends TTextBox
/**
* Returns the value to be validated.
* This methid is required by IValidatable interface.
- * @return integer the value of the property to be validated.
+ * @return integer the interger timestamp if valid, otherwise the original text.
*/
public function getValidationPropertyValue()
{
- if($this->getText() === '')
+ if(($text = $this->getText()) === '')
return '';
$date = $this->getTimeStamp();
- return $date == null ? '' : $date;
+ return $date == null ? $text : $date;
}
/**
@@ -422,7 +422,9 @@ class TDatePicker extends TTextBox
else
$year = $date['year'];
- $date = @mktime(0, 0, 0, $month, $day, $year);
+ $s = Prado::createComponent('System.Util.TDateTimeStamp');
+ $date = $s->getTimeStamp(0, 0, 0, $month, $day, $year);
+ //$date = @mktime(0, 0, 0, $month, $day, $year);
$pattern = $this->getDateFormat();
$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
@@ -509,7 +511,9 @@ class TDatePicker extends TTextBox
$writer->addAttribute('class', $class);
$writer->renderBeginTag('span');
- $date = @getdate($this->getTimeStampFromText());
+ $s = Prado::createComponent('System.Util.TDateTimeStamp');
+ $date = $s->getDate($this->getTimeStampFromText());
+ //$date = @getdate($this->getTimeStampFromText());
$this->renderCalendarSelections($writer, $date);
diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php
index 5c91002b..a803d484 100644
--- a/framework/Web/UI/WebControls/THead.php
+++ b/framework/Web/UI/WebControls/THead.php
@@ -113,6 +113,22 @@ class THead extends TControl
}
/**
+ * @return string the URL for the shortcut icon of the page. Defaults to ''.
+ */
+ public function getShortcutIcon()
+ {
+ return $this->getViewState('ShortcutIcon','');
+ }
+
+ /**
+ * @param string the URL for the shortcut icon of the page.
+ */
+ public function setShortcutIcon($url)
+ {
+ $this->setViewState('ShortcutIcon',$url,'');
+ }
+
+ /**
* @return TMetaTagCollection meta tag collection
*/
public function getMetaTags()
@@ -136,6 +152,9 @@ class THead extends TControl
$writer->write("<head>\n<title>".THttpUtility::htmlEncode($title)."</title>\n");
if(($baseUrl=$this->getBaseUrl())!=='')
$writer->write('<base href="'.$baseUrl."\" />\n");
+ if(($icon=$this->getShortcutIcon())!=='')
+ $writer->write('<link rel="shortcut icon" href="'.$icon."\" />\n");
+
if(($metaTags=$this->getMetaTags())!==null)
{
foreach($metaTags as $metaTag)