From c331ccfff81d5cfb28df83a2ec77c7815ef4c455 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Apr 2011 17:15:18 +0000 Subject: [PATCH] Wrapper for images support a parameter cache=1 to increase speed for some pages. --- htdocs/includes/menus/standard/auguria.lib.php | 2 +- htdocs/includes/menus/standard/eldy.lib.php | 2 +- htdocs/lib/security.lib.php | 4 ++-- htdocs/theme/auguria/fckeditor/fckconfig.js | 14 +++++++------- htdocs/theme/eldy/fckeditor/fckconfig.js | 14 +++++++------- htdocs/user/passwordforgotten.php | 10 +++++----- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/includes/menus/standard/auguria.lib.php b/htdocs/includes/menus/standard/auguria.lib.php index 3bec0b37344..6fba37729b8 100644 --- a/htdocs/includes/menus/standard/auguria.lib.php +++ b/htdocs/includes/menus/standard/auguria.lib.php @@ -197,7 +197,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after) $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini); + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini); print "\n".''."\n"; print '
'."\n"; print '
'."\n"; diff --git a/htdocs/includes/menus/standard/eldy.lib.php b/htdocs/includes/menus/standard/eldy.lib.php index fc71c559e0a..3b50280d963 100644 --- a/htdocs/includes/menus/standard/eldy.lib.php +++ b/htdocs/includes/menus/standard/eldy.lib.php @@ -589,7 +589,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini); + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini); print "\n".''."\n"; print '
'."\n"; print '
'."\n"; diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php index 31014563833..e2a4c6940f2 100644 --- a/htdocs/lib/security.lib.php +++ b/htdocs/lib/security.lib.php @@ -190,11 +190,11 @@ function dol_loginfunction($langs,$conf,$mysoc) if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small); + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small); } elseif (! empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode($mysoc->logo); + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode($mysoc->logo); $width=128; } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) diff --git a/htdocs/theme/auguria/fckeditor/fckconfig.js b/htdocs/theme/auguria/fckeditor/fckconfig.js index ce6a87fafb1..a03f87158eb 100644 --- a/htdocs/theme/auguria/fckeditor/fckconfig.js +++ b/htdocs/theme/auguria/fckeditor/fckconfig.js @@ -101,9 +101,9 @@ FCKConfig.ToolbarLocation = 'In' ; /* Ne pas mettre le lien sur objets internes (Image,Smiley) sur le type mailing */ FCKConfig.ToolbarSets["dolibarr_mailings"] = [ ['FitWindow','Source'], - ['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'], + ['Cut','Copy','Paste','-','SpellCheck'], ['Undo','Redo','-','Find','Replace'], - ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'], + ['Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','-','TextColor','BGColor','RemoveFormat'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'], @@ -112,9 +112,9 @@ FCKConfig.ToolbarSets["dolibarr_mailings"] = [ FCKConfig.ToolbarSets["dolibarr_notes"] = [ ['FitWindow','Source'], - ['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'], + ['Cut','Copy','Paste','-','SpellCheck'], ['Undo','Redo','-','Find','Replace'], - ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'], + ['Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','-','TextColor','BGColor','RemoveFormat'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Link','Unlink','Image','Table','Rule','SpecialChar'], @@ -123,13 +123,13 @@ FCKConfig.ToolbarSets["dolibarr_notes"] = [ FCKConfig.ToolbarSets["dolibarr_details"] = [ ['FitWindow','Source'], - ['Cut','Copy','Paste','-','Preview'], + ['Cut','Copy','Paste'], ['Undo','Redo'], - ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'], + ['Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','-','TextColor','RemoveFormat'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['SpecialChar'], - ['FontName','FontSize'] + ['FontSize'] ] ; FCKConfig.ToolbarSets["Default"] = [ diff --git a/htdocs/theme/eldy/fckeditor/fckconfig.js b/htdocs/theme/eldy/fckeditor/fckconfig.js index ce6a87fafb1..d64e9e87ec5 100644 --- a/htdocs/theme/eldy/fckeditor/fckconfig.js +++ b/htdocs/theme/eldy/fckeditor/fckconfig.js @@ -101,9 +101,9 @@ FCKConfig.ToolbarLocation = 'In' ; /* Ne pas mettre le lien sur objets internes (Image,Smiley) sur le type mailing */ FCKConfig.ToolbarSets["dolibarr_mailings"] = [ ['FitWindow','Source'], - ['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'], + ['Cut','Copy','Paste','-','SpellCheck'], ['Undo','Redo','-','Find','Replace'], - ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'], + ['Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','-','TextColor','RemoveFormat'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'], @@ -112,9 +112,9 @@ FCKConfig.ToolbarSets["dolibarr_mailings"] = [ FCKConfig.ToolbarSets["dolibarr_notes"] = [ ['FitWindow','Source'], - ['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'], + ['Cut','Copy','Paste','-','SpellCheck'], ['Undo','Redo','-','Find','Replace'], - ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'], + ['Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','-','TextColor','RemoveFormat'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Link','Unlink','Image','Table','Rule','SpecialChar'], @@ -123,13 +123,13 @@ FCKConfig.ToolbarSets["dolibarr_notes"] = [ FCKConfig.ToolbarSets["dolibarr_details"] = [ ['FitWindow','Source'], - ['Cut','Copy','Paste','-','Preview'], + ['Cut','Copy','Paste'], ['Undo','Redo'], - ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'], + ['Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','-','TextColor','RemoveFormat'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['SpecialChar'], - ['FontName','FontSize'] + ['FontSize'] ] ; FCKConfig.ToolbarSets["Default"] = [ diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index ac6ed3edefa..99c78effc19 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -194,11 +194,11 @@ $urllogo=DOL_URL_ROOT.'/theme/login_logo.png'; if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small); + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small); } elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode($mysoc->logo); + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode($mysoc->logo); $width=128; } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) @@ -213,7 +213,7 @@ if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY) && ! $disabled) $rowspan++; $lastuser=''; $lastentity = GETPOST('entity'); - + if (! empty($conf->global->MAIN_MULTICOMPANY_COOKIE)) { $prefix=dol_getprefix(); @@ -221,9 +221,9 @@ if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY) && ! $disabled) if (isset($_COOKIE[$entityCookieName])) { include_once(DOL_DOCUMENT_ROOT . "/core/class/cookie.class.php"); - + $cryptkey = (! empty($conf->file->cookie_cryptkey) ? $conf->file->cookie_cryptkey : '' ); - + $entityCookie = new DolCookie($cryptkey); $cookieValue = $entityCookie->_getCookie($entityCookieName); list($lastuser, $lastentity) = explode('|', $cookieValue);