[pLog-svn] r5734 - in plog/trunk: class/template install locale/admin
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Thu Jul 26 16:51:27 EDT 2007
Author: oscar
Date: 2007-07-26 16:51:27 -0400 (Thu, 26 Jul 2007)
New Revision: 5734
Modified:
plog/trunk/class/template/template.class.php
plog/trunk/install/defaultconfig.properties.php
plog/trunk/locale/admin/locale_en_UK.php
Log:
Added support for smarty's 'trimwhitespace' filter, which will remove unnecessary blank spaces from output. In my brief empirical tests, this has reduced the size of some pages up to 40% but your mileage may vary. Unless very much concerned about performance (all content will be post-processed after rendered with a few regular expressions), this should be left enabled.
Modified: plog/trunk/class/template/template.class.php
===================================================================
--- plog/trunk/class/template/template.class.php 2007-07-26 20:37:28 UTC (rev 5733)
+++ plog/trunk/class/template/template.class.php 2007-07-26 20:51:27 UTC (rev 5734)
@@ -93,6 +93,9 @@
// register dynamic block for every template instance
$this->register_block('dynamic', 'smarty_block_dynamic', false);
+
+ if( $config->getValue( 'trim_whitespace_output' ))
+ $this->load_filter( 'output', 'trimwhitespace' );
}
/**
Modified: plog/trunk/install/defaultconfig.properties.php
===================================================================
--- plog/trunk/install/defaultconfig.properties.php 2007-07-26 20:37:28 UTC (rev 5733)
+++ plog/trunk/install/defaultconfig.properties.php 2007-07-26 20:51:27 UTC (rev 5734)
@@ -130,4 +130,5 @@
$Inserts['allow_javascript_blocks_in_posts'] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('allow_javascript_blocks_in_posts','0', 1);";
$Inserts['location_data_enabled'] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('location_data_enabled','0', 1);";
$Inserts['google_maps_api_key'] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('google_maps_api_key','', 3);";
+$Inserts['trim_whitespace_output'] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('trim_whitespace_output','1', 1);";
?>
Modified: plog/trunk/locale/admin/locale_en_UK.php
===================================================================
--- plog/trunk/locale/admin/locale_en_UK.php 2007-07-26 20:37:28 UTC (rev 5733)
+++ plog/trunk/locale/admin/locale_en_UK.php 2007-07-26 20:51:27 UTC (rev 5734)
@@ -1273,4 +1273,6 @@
$messages['newResourceAlbum'] = 'Add New Album';
$messages['newResource'] = 'Upload File';
$messages['select_all'] = 'Select all';
+
+$messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
?>
\ No newline at end of file
More information about the pLog-svn
mailing list