[imc-sf-coders] CVS update of
sf-active/sf-active/shared/classes/smarty (3 files)
Bart M
pseudopunk at codecoop.org
Wed Dec 28 04:09:07 PST 2005
Date: Wednesday, December 28, 2005 @ 13:09:07
Author: pseudopunk
Path: /cvsroot/sf-active/sf-active/sf-active/shared/classes/smarty
Modified: function.get_local_link.php function.set_lang_ext_include.php
function.set_lang_include.php
we had occurences of // in urls, fixed these
Index: sf-active/sf-active/shared/classes/smarty/function.get_local_link.php
diff -u sf-active/sf-active/shared/classes/smarty/function.get_local_link.php:1.2 sf-active/sf-active/shared/classes/smarty/function.get_local_link.php:1.3
--- sf-active/sf-active/shared/classes/smarty/function.get_local_link.php:1.2 Sun Jun 19 12:12:49 2005
+++ sf-active/sf-active/shared/classes/smarty/function.get_local_link.php Wed Dec 28 13:09:07 2005
@@ -14,7 +14,12 @@
*/
function smarty_function_get_local_link ($params, &$smarty) {
$rules = $smarty->get_template_vars('p_rule');
- return SF_ROOT_URL.'/'.$rules['langpath'].$params["path"];
+ if(strlen($rules['langpath'] > 0 )) {
+ $langpath = '/'.$rules['langpath'];
+ }else{
+ $langpath = $rules['langpath'] ;
+ }
+ return SF_ROOT_URL.$langpath.$params["path"];
}
?>
Index: sf-active/sf-active/shared/classes/smarty/function.set_lang_ext_include.php
diff -u sf-active/sf-active/shared/classes/smarty/function.set_lang_ext_include.php:1.2 sf-active/sf-active/shared/classes/smarty/function.set_lang_ext_include.php:1.3
--- sf-active/sf-active/shared/classes/smarty/function.set_lang_ext_include.php:1.2 Sun Jun 19 12:12:49 2005
+++ sf-active/sf-active/shared/classes/smarty/function.set_lang_ext_include.php Wed Dec 28 13:09:07 2005
@@ -8,7 +8,8 @@
*/
function smarty_function_set_lang_ext_include($args, &$smarty){
$lang = $smarty->_tpl_vars['p_rule']['langpath'];
+ if($lang) $lang .= '.';
eregi("([a-z0-9/\._-]+)\.([a-z0-9]+)$", $args['file'], $regs);
- return '<? include("'.$args['path'].'/'.$regs[1].'.'.$lang.'.'.$regs[2].'");?>';
+ return '<? include("'.$args['path'].'/'.$regs[1].'.'.$lang.$regs[2].'");?>';
}
?>
Index: sf-active/sf-active/shared/classes/smarty/function.set_lang_include.php
diff -u sf-active/sf-active/shared/classes/smarty/function.set_lang_include.php:1.2 sf-active/sf-active/shared/classes/smarty/function.set_lang_include.php:1.3
--- sf-active/sf-active/shared/classes/smarty/function.set_lang_include.php:1.2 Sun Jun 19 12:12:49 2005
+++ sf-active/sf-active/shared/classes/smarty/function.set_lang_include.php Wed Dec 28 13:09:07 2005
@@ -6,6 +6,8 @@
* @subpackage functions
*/
function smarty_function_set_lang_include($args, &$smarty){
- return '<? include("'.$args['path'].'/'.$smarty->_tpl_vars[p_rule][langpath].'/'.$args['file'].'") ; ?>';
+ if(strlen($smarty->_tpl_vars['p_rule']['langpath']) > 0) { $langpath = $smarty->_tpl_vars['p_rule']['langpath'].'/'; }
+ else { $langpath = '' ; }
+ return '<? include("'.$args['path'].'/'.$langpath.$args['file'].'") ; ?>';
}
?>
More information about the imc-sf-coders
mailing list