diff options
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/Services/TPageService.php | 13 | ||||
-rw-r--r-- | framework/Web/UI/TControl.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TTextHighlighter.php | 11 |
3 files changed, 21 insertions, 5 deletions
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 65549159..b07527c6 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -464,6 +464,19 @@ class TPageService extends TService {
return $this->getRequest()->constructUrl($this->_id,$pagePath,$getParams,$encodeAmpersand);
}
+
+ /**
+ * Publishes a private asset and returns its URL.
+ * This method will publish a private asset (file or directory)
+ * and returns 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 either absolute or relative to the directory containing the current running script.
+ * @return string URL to the asset path.
+ */
+ public function getAsset($path)
+ {
+ return $this->getAssetManager()->publishFilePath($path);
+ }
}
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index d6e1889d..382e3811 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -262,7 +262,7 @@ class TControl extends TComponent {
$class=new ReflectionClass(get_class($this));
$assetPath=dirname($class->getFileName()).'/'.$assetPath;
- return $this->getService()->getAssetManager()->publishFilePath($assetPath);
+ return $this->getService()->getAsset($assetPath);
}
/**
diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php index 800d5246..56ae406e 100644 --- a/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/framework/Web/UI/WebControls/TTextHighlighter.php @@ -13,7 +13,7 @@ /**
* Using GeSHi and TTextWriter classes
*/
-Prado::using('System.Web.UI.WebControls.Highlighter.geshi');
+Prado::using('System.3rdParty.geshi.geshi');
Prado::using('System.IO.TTextWriter');
/**
@@ -52,11 +52,13 @@ class TTextHighlighter extends TWebControl /**
* @param string language whose syntax is to be used for highlighting.
- * Valid values include 'php','prado','css','html','javascript','xml'.
+ * Valid values are those file names (without suffix) that are contained
+ * in '3rdParty/geshi/geshi' (e.g. 'php','prado','css','html','javascript',
+ * 'xml'.)
*/
public function setLanguage($value)
{
- $this->setViewState('Language', TPropertyValue::ensureEnum($value,'php','prado','css','html','javascript','xml'), 'php');
+ $this->setViewState('Language', $value, 'php');
}
/**
@@ -120,7 +122,8 @@ class TTextHighlighter extends TWebControl $cssKey='prado:TTextHighlighter';
if(!$cs->isStyleSheetFileRegistered($cssKey))
{
- $styleSheet = $this->getAsset('Highlighter/code_highlight.css');
+ $cssFile=Prado::getPathOfNamespace('System.3rdParty.geshi.highlight','.css');
+ $styleSheet = $this->getService()->getAsset($cssFile);
$cs->registerStyleSheetFile($cssKey, $styleSheet);
}
}
|