From 265b7e85766ba403ca0a8b58648dd091e483cf38 Mon Sep 17 00:00:00 2001 From: wei <> Date: Mon, 30 Jan 2006 22:31:58 +0000 Subject: Adding THtmlArea. --- framework/Web/UI/TAssetManager.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/TAssetManager.php') diff --git a/framework/Web/UI/TAssetManager.php b/framework/Web/UI/TAssetManager.php index 94b1bc55..cd25a74c 100644 --- a/framework/Web/UI/TAssetManager.php +++ b/framework/Web/UI/TAssetManager.php @@ -131,6 +131,23 @@ class TAssetManager extends TModule $this->_baseUrl=$value; } + public function getPublishedUrl($path) + { + if(($fullpath=realpath($path))!==false) + { + $dir=$this->hash(dirname($fullpath)); + $file=$this->_basePath.'/'.$dir.'/'.basename($fullpath); + if(is_file($file) || is_dir($file)) + return $this->_baseUrl.'/'.$dir.'/'.basename($fullpath); + } + return null; + } + + public function isPublished($path) + { + return $this->getPublishedUrl($path) !== null; + } + /** * Publishes a file or a directory (recursively). * This method will copy the content in a directory (recursively) to @@ -181,7 +198,7 @@ class TAssetManager extends TModule * @param string string to be hashed. * @return string hashed string. */ - private function hash($dir) + protected function hash($dir) { return sprintf('%x',crc32($dir)); } -- cgit v1.2.3