summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/TComponent.php73
-rw-r--r--framework/Web/UI/TClientScriptManager.php4
-rw-r--r--framework/Web/UI/TControlAdapter.php2
-rw-r--r--framework/Web/UI/THtmlWriter.php4
-rw-r--r--framework/Web/UI/TPageStatePersister.php2
5 files changed, 6 insertions, 79 deletions
diff --git a/framework/TComponent.php b/framework/TComponent.php
index 8a7f5f84..7443168d 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -412,79 +412,6 @@ class TComponent
throw new TInvalidOperationException('component_statements_invalid',get_class($this),$statements,$e->getMessage());
}
}
-
- /**
- * @return TApplication current application instance
- */
- public function getApplication()
- {
- return Prado::getApplication();
- }
-
- /**
- * @return IService the current service
- */
- public function getService()
- {
- return Prado::getApplication()->getService();
- }
-
- /**
- * @return THttpRequest the current user request
- */
- public function getRequest()
- {
- return Prado::getApplication()->getRequest();
- }
-
- /**
- * @return THttpResponse the response
- */
- public function getResponse()
- {
- return Prado::getApplication()->getResponse();
- }
-
- /**
- * @return THttpSession user session
- */
- public function getSession()
- {
- return Prado::getApplication()->getSession();
- }
-
- /**
- * @return IUser user
- */
- public function getUser()
- {
- return Prado::getApplication()->getUser();
- }
-
- /**
- * Publishes a private asset and gets its URL.
- * This method will publish a private asset (file or directory)
- * and gets the URL to the asset. Note, if the asset refers to
- * a directory, all contents under that directory will be published.
- * @param string path of the asset that is relative to the directory containing the control class file.
- * @return string URL to the asset path.
- */
- public function publishAsset($assetPath)
- {
- $class=new ReflectionClass(get_class($this));
- $fullPath=dirname($class->getFileName()).'/'.$assetPath;
- return $this->publishFilePath($fullPath);
- }
-
- /**
- * Publishes a file or directory and returns its URL.
- * @param string absolute path of the file or directory to be published
- * @return string URL to the published file or directory
- */
- public function publishFilePath($fullPath)
- {
- return $this->getApplication()->getAssetManager()->publishFilePath($fullPath);
- }
}
/**
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 1ea4175d..39c23b99 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -20,7 +20,7 @@ Prado::using('System.Web.Javascripts.*');
* @package System.Web.UI
* @since 3.0
*/
-class TClientScriptManager extends TComponent
+class TClientScriptManager extends TApplicationComponent
{
const SCRIPT_DIR='Web/Javascripts/js';
//const POSTBACK_FUNC='Prado.doPostBack';
@@ -123,7 +123,7 @@ class TClientScriptManager extends TComponent
//create the client script url
$url = $this->publishClientScriptCompressorAsset();
$url .= '?js='.implode(',', $scripts);
- if(Prado::getApplication()->getMode() == TApplication::STATE_DEBUG)
+ if($this->getApplication()->getMode() == TApplication::STATE_DEBUG)
$url .= '&__nocache';
$this->registerScriptFile('prado:gzipscripts', $url);
}
diff --git a/framework/Web/UI/TControlAdapter.php b/framework/Web/UI/TControlAdapter.php
index f0663966..732cf470 100644
--- a/framework/Web/UI/TControlAdapter.php
+++ b/framework/Web/UI/TControlAdapter.php
@@ -21,7 +21,7 @@
* @package System.Web.UI
* @since 3.0
*/
-class TControlAdapter extends TComponent
+class TControlAdapter extends TApplicationComponent
{
/**
* @var TControl the control to which the adapter is attached
diff --git a/framework/Web/UI/THtmlWriter.php b/framework/Web/UI/THtmlWriter.php
index dc867b77..2f1f8c1a 100644
--- a/framework/Web/UI/THtmlWriter.php
+++ b/framework/Web/UI/THtmlWriter.php
@@ -16,13 +16,13 @@
// implment encoding (for text and url)
/**
* THtmlWriter class
- *
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
* @package System.Web.UI
* @since 3.0
*/
-class THtmlWriter extends TComponent implements ITextWriter
+class THtmlWriter extends TApplicationComponent implements ITextWriter
{
const TAG_INLINE=0;
const TAG_NONCLOSING=1;
diff --git a/framework/Web/UI/TPageStatePersister.php b/framework/Web/UI/TPageStatePersister.php
index 49321ff5..b16d9f7d 100644
--- a/framework/Web/UI/TPageStatePersister.php
+++ b/framework/Web/UI/TPageStatePersister.php
@@ -28,7 +28,7 @@
* @package System.Web.UI
* @since 3.0
*/
-class TPageStatePersister extends TComponent implements IPageStatePersister
+class TPageStatePersister extends TApplicationComponent implements IPageStatePersister
{
private $_page;