From: <sy...@us...> - 2003-09-30 13:05:06
|
Update of /cvsroot/tikiwiki/tiki/lib/wiki-plugins In directory sc8-pr-cvs1:/tmp/cvs-serv17990/lib/wiki-plugins Modified Files: wikiplugin_module.php Log Message: quick fix+optimisation Index: wikiplugin_module.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/wiki-plugins/wikiplugin_module.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- wikiplugin_module.php 8 Sep 2003 14:52:23 -0000 1.12 +++ wikiplugin_module.php 30 Sep 2003 13:05:01 -0000 1.13 @@ -18,12 +18,12 @@ like the trackerId in the above example. */ function wikiplugin_module_help() { - return tra("Displays a module inlined in page").":<br />~np~{MODULE(module=>,align=>left|center|right,max)>)}{MODULE}~/np~"; + return tra("Displays a module inlined in page").":<br />~np~{MODULE(module=>,align=>left|center|right,max=>,np=>0|1,args...)}{MODULE}~/np~"; } function wikiplugin_module($data, $params) { global $tikilib, $cache_time, $smarty, $dbTiki, $feature_directory, $ranklib, $feature_trackers, $tikidomain, $user, - $feature_tasks, $feature_user_bookmarks, $tiki_p_tasks, $tiki_p_create_bookmarks, $imagegallib; + $feature_tasks, $feature_user_bookmarks, $tiki_p_tasks, $tiki_p_create_bookmarks, $imagegallib, $language; $out = ''; extract ($params); @@ -63,7 +63,7 @@ $args = ''; } - $cachefile = 'modules/cache/' . $tikidomain . 'mod-' . $module . '.tpl.cache'; + $cachefile = 'modules/cache/' . $tikidomain . 'mod-' . $module . '.tpl.'.$language.'.cache'; $phpfile = 'modules/mod-' . $module . '.php'; $template = 'modules/mod-' . $module . '.tpl'; $nocache = 'templates/modules/mod-' . $module . '.tpl.nocache'; @@ -89,11 +89,12 @@ $out = $smarty->fetch('modules/user_module.tpl'); } } - $smarty->clear_assign('no_module_controls'); - - $fp = fopen($cachefile, "w+"); - fwrite($fp, $data, strlen($data)); - fclose ($fp); + $smarty->clear_assign('no_module_controls'); + if (!file_exists($nocache)) { + $fp = fopen($cachefile, "w+"); + fwrite($fp, $data, strlen($data)); + fclose ($fp); + } } else { $fp = fopen($cachefile, "r"); |