summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/TTemplateManager.php6
-rw-r--r--framework/Web/UI/TThemeManager.php10
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php19
3 files changed, 24 insertions, 11 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index caa1dcbc..c13b5a9d 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -680,7 +680,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
if($matchStart>$textStart)
{
$value=substr($input,$textStart,$matchStart-$textStart);
- if(strrpos($prop,'template')===strlen($prop)-8)
+ if(substr($prop,-8,8)==='template')
$value=$this->parseTemplateProperty($value,$textStart);
else
$value=$this->parseAttribute($value);
@@ -701,7 +701,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
}
else if(strpos($str,'<!--')===0) // comments
{
- if(strrpos($str,'--!>')===strlen($str)-4) // template comments
+ if(substr($str,-4,4)==='--!>') // template comments
{
if($expectPropEnd)
throw new TConfigurationException('template_comments_forbidden');
@@ -799,7 +799,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
if(isset($attributes[$name]))
throw new TConfigurationException('template_property_duplicated',$name);
$value=$match[2][0];
- if(strrpos($name,'template')===strlen($name)-8)
+ if(substr($name,-8,8)==='template')
{
if($value[0]==='\'' || $value[0]==='"')
$attributes[$name]=$this->parseTemplateProperty(substr($value,1,strlen($value)-2),$match[2][1]+1);
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php
index 66bfa8be..245f8049 100644
--- a/framework/Web/UI/TThemeManager.php
+++ b/framework/Web/UI/TThemeManager.php
@@ -10,6 +10,8 @@
* @package System.Web.UI
*/
+Prado::using('System.Web.Services.TPageService');
+
/**
* TThemeManager class
*
@@ -63,7 +65,11 @@ class TThemeManager extends TModule
public function init($config)
{
$this->_initialized=true;
- $this->getService()->setThemeManager($this);
+ $service=$this->getService();
+ if($service instanceof TPageService)
+ $service->setThemeManager($this);
+ else
+ throw new TConfigurationException('thememanager_service_unavailable');
}
/**
@@ -105,7 +111,7 @@ class TThemeManager extends TModule
{
$this->_basePath=dirname($this->getRequest()->getApplicationFilePath()).'/'.self::DEFAULT_BASEPATH;
if(($basePath=realpath($this->_basePath))===false || !is_dir($basePath))
- throw new TConfigurationException('thememanager_basepath_invalid',$this->_basePath);
+ throw new TConfigurationException('thememanager_basepath_invalid2',$this->_basePath);
$this->_basePath=$basePath;
}
return $this->_basePath;
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index f811edaf..fead5344 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -954,9 +954,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
{
foreach($columns as $column)
$column->initialize();
- if($allowPaging)
- $this->_topPager=$this->createPager();
- $this->_header=$this->createItemInternal(-1,-1,self::IT_HEADER,true,null,$columns);
+
$selectedIndex=$this->getSelectedItemIndex();
$editIndex=$this->getEditItemIndex();
foreach($data as $key=>$row)
@@ -965,6 +963,12 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$keys->add($this->getDataFieldValue($row,$keyField));
else
$keys->add($key);
+ if($index===0)
+ {
+ if($allowPaging)
+ $this->_topPager=$this->createPager();
+ $this->_header=$this->createItemInternal(-1,-1,self::IT_HEADER,true,null,$columns);
+ }
if($index===$editIndex)
$itemType=self::IT_EDITITEM;
else if($index===$selectedIndex)
@@ -977,9 +981,12 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$index++;
$dsIndex++;
}
- $this->_footer=$this->createItemInternal(-1,-1,self::IT_FOOTER,true,null,$columns);
- if($allowPaging)
- $this->_bottomPager=$this->createPager();
+ if($index>0)
+ {
+ $this->_footer=$this->createItemInternal(-1,-1,self::IT_FOOTER,true,null,$columns);
+ if($allowPaging)
+ $this->_bottomPager=$this->createPager();
+ }
}
$this->setViewState('ItemCount',$index,0);
if(!$dsIndex && $this->_emptyTemplate!==null)