summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--demos/quickstart/protected/controls/TopicList.tpl1
-rw-r--r--framework/Web/Javascripts/js/clientscripts.php38
-rw-r--r--framework/Web/UI/TClientScriptManager.php2
4 files changed, 26 insertions, 16 deletions
diff --git a/HISTORY b/HISTORY
index 3557fb92..7c111a19 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2,6 +2,7 @@ Version 3.0.1 June 1, 2006
==========================
BUG: Ticket#44 - THtmlArea (tiny_mce) not working on some systems (Qiang)
BUG: Ticket#167 - TSecurityManager issues warning when trying to encrypt/decrypt strings (Qiang)
+BUG: Ticket#179 - CGI incompatibility causing clientscripts.php failure (Qiang)
ENH: Ticket#150 - TDataGrid and TDataList now render table section tags (Qiang)
ENH: Ticket#152 - constituent parts of TWizard are exposed (Qiang)
ENH: added sanity check to calling event handlers (Qiang)
diff --git a/demos/quickstart/protected/controls/TopicList.tpl b/demos/quickstart/protected/controls/TopicList.tpl
index 5ffc7098..f26b75a6 100644
--- a/demos/quickstart/protected/controls/TopicList.tpl
+++ b/demos/quickstart/protected/controls/TopicList.tpl
@@ -64,6 +64,7 @@
<div class="topic">
<div>Avanced Topics</div>
<ul>
+ <li><a href="?page=Advanced.Collections">Collections</a></li>
<li><a href="?page=Advanced.Auth">Authentication and Authorization</a></li>
<li><a href="?page=Advanced.Security">Security</a></li>
<li><a href="?page=Advanced.Scripts">Client-side Scripting</a></li>
diff --git a/framework/Web/Javascripts/js/clientscripts.php b/framework/Web/Javascripts/js/clientscripts.php
index 1fb14003..3ac3b062 100644
--- a/framework/Web/Javascripts/js/clientscripts.php
+++ b/framework/Web/Javascripts/js/clientscripts.php
@@ -1,15 +1,15 @@
<?php
/**
- * This file compresses the javascript files using GZip
+ * This file compresses the javascript files using GZip
*
* Todo:
* - Add local file cache for the GZip:ed version.
*/
-if(is_int(strpos($_SERVER['REQUEST_URI'], '__nocache')))
- $expiresOffset = -10000; //no cache
-else
- $expiresOffset = 3600 * 24 * 10; // 10 days util client cache expires
+$debugMode=(isset($_GET['mode']) && $_GET['mode']==='debug');
+
+// if debug mode, js is not cached; otherwise cached for 10 days.
+$expiresOffset = $debugMode ? -10000 : 3600 * 24 * 10; //no cache
//allowed libraries
$library = array('prado', 'effects', 'ajax', 'validator', 'logger', 'datepicker', 'rico', 'colorpicker');
@@ -18,7 +18,7 @@ $param = isset($_GET['js']) ? $_GET['js'] : '';
//check for proper matching parameters, otherwise exit;
if(preg_match('/(\w)+(,\w+)*/', $param)) $js = explode(',', $param); else exit();
-foreach($js as $lib) if(!in_array($lib, $library)) exit();
+foreach($js as $lib) if(!in_array($lib, $library)) exit();
// Only gzip the contents if clients and server support it
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
@@ -27,8 +27,8 @@ else
$encodings = array();
// Check for gzip header or northon internet securities
-if ((in_array('gzip', $encodings) || isset($_SERVER['---------------']))
- && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')
+if ((in_array('gzip', $encodings) || isset($_SERVER['---------------']))
+ && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')
&& ini_get('output_handler') != 'ob_gzhandler')
ob_start("ob_gzhandler");
@@ -38,16 +38,24 @@ header('Content-type: text/javascript; charset: UTF-8');
header('Vary: Accept-Encoding'); // Handle proxies
header('Expires: ' . @gmdate('D, d M Y H:i:s', @time() + $expiresOffset) . ' GMT');
-foreach($js as $lib)
+if ($debugMode)
{
- $file = realpath($lib.'.js');
- if(is_file($file))
- echo file_get_contents($file);
- else //log missings files to console logger
+ foreach($js as $lib)
{
- echo 'setTimeout(function(){ if(Logger) Logger.error("Missing file", "'.$lib.'.js"); }, 1000);';
- error_log("Unable to find asset file {$lib}.js");
+ $file = realpath($lib.'.js');
+ if(is_file($file))
+ echo file_get_contents($file);
+ else //log missings files to console logger
+ {
+ echo 'setTimeout(function(){ if(Logger) Logger.error("Missing file", "'.$lib.'.js"); }, 1000);';
+ error_log("Unable to find asset file {$lib}.js");
+ }
}
}
+else
+{
+ foreach($js as $lib)
+ echo file_get_contents($lib.'.js');
+}
?> \ No newline at end of file
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 8962f270..752b61ea 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -150,7 +150,7 @@ class TClientScriptManager extends TApplicationComponent
$scriptLoader=$basePath.'/'.self::SCRIPT_LOADER;
$url=$this->publishFilePath($scriptLoader).'?js='.trim($files,',');
if($this->getApplication()->getMode()===TApplication::STATE_DEBUG)
- $url.='&amp;__nocache';
+ $url.='&amp;mode=debug';
$writer->write(TJavaScript::renderScriptFile($url));
}
}