diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/THttpResponse.php | 7 | ||||
-rw-r--r-- | framework/Web/THttpUtility.php | 4 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/THtmlArea.php | 9 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TJavascriptLogger.php | 11 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TTableRow.php | 3 |
5 files changed, 24 insertions, 10 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index 18be9fec..29258259 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -238,15 +238,14 @@ class THttpResponse extends TModule implements ITextWriter if($mimeType===null)
{
+ $mimeType='text/plain';
if(function_exists('mime_content_type'))
$mimeType=mime_content_type($fileName);
- else
+ else if(($ext=strrchr($fileName,'.'))!==false)
{
- $ext=array_pop(explode('.',$fileName));
+ $ext=substr($ext,1);
if(isset($defaultMimeTypes[$ext]))
$mimeType=$defaultMimeTypes[$ext];
- else
- $mimeType='text/plain';
}
}
$fn=basename($fileName);
diff --git a/framework/Web/THttpUtility.php b/framework/Web/THttpUtility.php index 4cd869b4..3bb78f0f 100644 --- a/framework/Web/THttpUtility.php +++ b/framework/Web/THttpUtility.php @@ -20,8 +20,8 @@ */
class THttpUtility
{
- private static $_encodeTable=array('<'=>'<','>'=>'>','"'=>'"e;');
- private static $_decodeTable=array('<'=>'<','>'=>'>','"e;'=>'"');
+ private static $_encodeTable=array('<'=>'<','>'=>'>','"'=>'"');
+ private static $_decodeTable=array('<'=>'<','>'=>'>','"'=>'"');
/**
* HTML-encodes a string.
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php index 7ad2d06f..038c7368 100644 --- a/framework/Web/UI/WebControls/THtmlArea.php +++ b/framework/Web/UI/WebControls/THtmlArea.php @@ -11,6 +11,11 @@ */
/**
+ * Includes TTextBox class
+ */
+Prado::using('System.Web.UI.WebControls.TTextBox');
+
+/**
* THtmlArea class
*
* THtmlArea wraps the visual editting functionalities provided by the
@@ -73,7 +78,8 @@ */
class THtmlArea extends TTextBox
{
- protected $langs = array(
+ // Qiang: need to clean up the following (too inefficient)
+ private $langs = array(
'da' => array('da'),
'fa' => array('fa'),
'hu' => array('hu'),
@@ -310,6 +316,7 @@ class THtmlArea extends TTextBox if(count($variants) == 0)
$variants[] = empty($culture) ? 'en' : strtolower($culture);
+ // TODO: triple loops???
foreach($this->langs as $js => $langs)
{
foreach($variants as $variant)
diff --git a/framework/Web/UI/WebControls/TJavascriptLogger.php b/framework/Web/UI/WebControls/TJavascriptLogger.php index 3196d3b6..0296a276 100644 --- a/framework/Web/UI/WebControls/TJavascriptLogger.php +++ b/framework/Web/UI/WebControls/TJavascriptLogger.php @@ -41,17 +41,24 @@ class TJavascriptLogger extends TWebControl }
/**
+ * Registers the required logger javascript.
+ * @param TEventParameter event parameter
+ */
+ public function onPreRender($param)
+ {
+ $this->getPage()->getClientScript()->registerPradoScript('logger');
+ }
+
+ /**
* Register the required javascript libraries and
* display some general usage information.
* @param THtmlWriter the writer used for the rendering purpose
*/
public function renderContents($writer)
{
- $this->getPage()->getClientScript()->registerPradoScript('logger');
$info = '(<a href="http://gleepglop.com/javascripts/logger/" target="_blank">more info</a>).';
$usage = 'Press ALT-D (Or CTRL-D on OS X) to toggle the javascript log console';
$writer->write("{$usage} {$info}");
- parent::renderContents($writer);
}
}
diff --git a/framework/Web/UI/WebControls/TTableRow.php b/framework/Web/UI/WebControls/TTableRow.php index 04a1555d..6a3f196a 100644 --- a/framework/Web/UI/WebControls/TTableRow.php +++ b/framework/Web/UI/WebControls/TTableRow.php @@ -11,9 +11,10 @@ */
/**
- * Includes TTableCell class
+ * Includes TTableCell and TTableHeaderCell classes
*/
Prado::using('System.Web.UI.WebControls.TTableCell');
+Prado::using('System.Web.UI.WebControls.TTableHeaderCell');
/**
* TTableRow class.
|