removed newlines in compiled templates after closing tags

This commit is contained in:
messju
2003-06-11 14:38:24 +00:00
parent b07a76da23
commit 42fbae3186
2 changed files with 10 additions and 9 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- removed newlines in compiled templates after closing tags (messju)
- added block-methods for registered objects (Bharat Mediratta, messju)
- ignore one char resource names like c:foo.tpl (Monte)
- added default_resource_type feature (Monte)

View File

@@ -348,14 +348,14 @@ class Smarty_Compiler extends Smarty {
}
$_plugins_params .= '))';
$_plugin_filepath = $this->_get_plugin_filepath('core', 'load_plugins');
$plugins_code = "<?php require_once('$_plugin_filepath');\nsmarty_core_load_plugins($_plugins_params, \$this); ?>\n";
$plugins_code = "<?php require_once('$_plugin_filepath');\nsmarty_core_load_plugins($_plugins_params, \$this); ?>";
$template_header .= $plugins_code;
$this->_plugin_info = array();
}
if ($this->_init_smarty_vars) {
$_plugin_filepath = $this->_get_plugin_filepath('core', 'assign_smarty_interface');
$template_header .= "<?php require_once('$_plugin_filepath');\nsmarty_core_assign_smarty_interface(null, \$this); ?>\n";
$template_header .= "<?php require_once('$_plugin_filepath');\nsmarty_core_assign_smarty_interface(null, \$this); ?>";
$this->_init_smarty_vars = false;
}
@@ -394,9 +394,9 @@ class Smarty_Compiler extends Smarty {
if (preg_match('!^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '$!', $tag_command)) {
$_return = $this->_parse_var_props($tag_command . $tag_modifier, $this->_parse_attrs($tag_args));
if(isset($_tag_attrs['assign'])) {
return "<?php \$this->assign('" . $this->_dequote($_tag_attrs['assign']) . "', $_return ); ?>\n";
return "<?php \$this->assign('" . $this->_dequote($_tag_attrs['assign']) . "', $_return ); ?>";
} else {
return "<?php echo $_return; ?>\n";
return "<?php echo $_return; ?>";
}
}
@@ -468,7 +468,7 @@ class Smarty_Compiler extends Smarty {
case 'literal':
list (,$literal_block) = each($this->_literal_blocks);
$this->_current_line_no += substr_count($literal_block, "\n");
return "<?php echo '".str_replace("'", "\'", str_replace("\\", "\\\\", $literal_block))."'; ?>\n";
return "<?php echo '".str_replace("'", "\'", str_replace("\\", "\\\\", $literal_block))."'; ?>";
case 'php':
if ($this->security && !$this->security_settings['PHP_TAGS']) {
@@ -678,7 +678,7 @@ class Smarty_Compiler extends Smarty {
$this->_parse_modifiers($return, $tag_modifier);
}
return '<?php echo ' . $return . " ; ?>\n";
return '<?php echo ' . $return . " ; ?>";
}
/**
@@ -770,7 +770,7 @@ class Smarty_Compiler extends Smarty {
$output = '';
}
return '<?php ' . $prefix . $output . $postfix . "?>\n";
return '<?php ' . $prefix . $output . $postfix . "?>";
}
/**
@@ -805,7 +805,7 @@ class Smarty_Compiler extends Smarty {
$_params = "array('args' => array(".implode(', ', (array)$arg_list)."))";
$_plugin_filepath = $this->_get_plugin_filepath('core', 'run_insert_handler');
return "<?php require_once('$_plugin_filepath');\necho smarty_core_run_insert_handler($_params, \$this); ?>\n";
return "<?php require_once('$_plugin_filepath');\necho smarty_core_run_insert_handler($_params, \$this); ?>";
}
/**
@@ -891,7 +891,7 @@ class Smarty_Compiler extends Smarty {
$_params = "array('smarty_file' => " . $attrs['file'] . ", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))";
$_plugin_filepath = $this->_get_plugin_filepath('core', 'smarty_include_php');
return "<?php require_once('$_plugin_filepath');\nsmarty_core_smarty_include_php($_params, \$this); ?>\n";
return "<?php require_once('$_plugin_filepath');\nsmarty_core_smarty_include_php($_params, \$this); ?>";
}