NEW Can see the favicon file into setup of properties of a website

This commit is contained in:
Laurent Destailleur
2023-09-06 18:35:40 +02:00
parent 20162a6d11
commit 94758009dd
2 changed files with 11 additions and 1 deletions

View File

@@ -56,6 +56,8 @@ if (!defined('NOREQUIREAJAX')) {
// Note that only directory logo is free to access without login.
$needlogin = 1;
if (isset($_GET["modulepart"])) {
// Some value of modulepart can be used to get resources that are public so no login are required.
// For logo of company
if ($_GET["modulepart"] == 'mycompany' && preg_match('/^\/?logos\//', $_GET['file'])) {
$needlogin = 0;
@@ -64,10 +66,11 @@ if (isset($_GET["modulepart"])) {
if ($_GET["modulepart"] == 'barcode') {
$needlogin = 0;
}
// Some value of modulepart can be used to get resources that are public so no login are required.
// Medias files
if ($_GET["modulepart"] == 'medias') {
$needlogin = 0;
}
// User photo
if ($_GET["modulepart"] == 'userphotopublic') {
$needlogin = 0;
}

View File

@@ -3731,6 +3731,13 @@ if ($action == 'editcss') {
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
}
print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>';
$uploadfolder = $conf->website->dir_output.'/'.$websitekey;
if (dol_is_file($uploadfolder.'/favicon.png')) {
print '<div class="inline-block valignmiddle marginrightonly">';
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=website&file='.$websitekey.'/favicon.png">';
print '</div>';
}
print '</tr></td>';
// CSS file