Enahnce web site templates
This commit is contained in:
parent
6549bcaf77
commit
fe40875aa9
@ -592,7 +592,7 @@ function showWebsiteTemplates(Website $website)
|
|||||||
|
|
||||||
print '<tr><td colspan="'.$colspan.'">';
|
print '<tr><td colspan="'.$colspan.'">';
|
||||||
|
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td><div class="center">';
|
print '<table class="nobordernopadding centpercent"><tr><td><div class="center">';
|
||||||
|
|
||||||
if (count($dirthemes)) {
|
if (count($dirthemes)) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -603,8 +603,7 @@ function showWebsiteTemplates(Website $website)
|
|||||||
$handle = opendir($dirtheme);
|
$handle = opendir($dirtheme);
|
||||||
if (is_resource($handle)) {
|
if (is_resource($handle)) {
|
||||||
while (($subdir = readdir($handle)) !== false) {
|
while (($subdir = readdir($handle)) !== false) {
|
||||||
if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.'
|
if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && preg_match('/\.zip$/i', $subdir)) {
|
||||||
&& substr($subdir, 0, 3) <> 'CVS' && preg_match('/\.zip$/i', $subdir)) {
|
|
||||||
$subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir);
|
$subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir);
|
||||||
|
|
||||||
// Disable not stable themes (dir ends with _exp or _dev)
|
// Disable not stable themes (dir ends with _exp or _dev)
|
||||||
@ -617,6 +616,7 @@ function showWebsiteTemplates(Website $website)
|
|||||||
|
|
||||||
print '<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">';
|
print '<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">';
|
||||||
|
|
||||||
|
$templatedir = $dirtheme."/".$subdir;
|
||||||
$file = $dirtheme."/".$subdirwithoutzip.".jpg";
|
$file = $dirtheme."/".$subdirwithoutzip.".jpg";
|
||||||
$url = DOL_URL_ROOT.'/viewimage.php?modulepart=doctemplateswebsite&file='.$subdirwithoutzip.".jpg";
|
$url = DOL_URL_ROOT.'/viewimage.php?modulepart=doctemplateswebsite&file='.$subdirwithoutzip.".jpg";
|
||||||
|
|
||||||
@ -635,14 +635,16 @@ function showWebsiteTemplates(Website $website)
|
|||||||
if (!empty($urladvanced)) {
|
if (!empty($urladvanced)) {
|
||||||
$ret .= '<a class="'.$urladvanced['css'].'" target="'.$urladvanced['target'].'" mime="'.$urladvanced['mime'].'" href="'.$urladvanced['url'].'">';
|
$ret .= '<a class="'.$urladvanced['css'].'" target="'.$urladvanced['target'].'" mime="'.$urladvanced['mime'].'" href="'.$urladvanced['url'].'">';
|
||||||
} else {
|
} else {
|
||||||
$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
|
$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.urlencode($modulepart).'&entity='.((int) $entity).'&file='.urlencode($originalfile).'&cache='.((int) $cache).'">';
|
||||||
}
|
}
|
||||||
print $ret;
|
print $ret;
|
||||||
print '<img class="img-skinthumb shadow" src="'.$url.'" border="0" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">';
|
print '<img class="img-skinthumb shadow" src="'.$url.'" border="0" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">';
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $subdir.' ('.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).')';
|
print $subdir;
|
||||||
|
print '<br>';
|
||||||
|
print '<span class="opacitymedium">'.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).' - '.dol_print_date(dol_filemtime($templatedir), 'dayhour', 'tzuserrel').'</span>';
|
||||||
print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&token='.newToken().'&website='.urlencode($website->ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").'</a>';
|
print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&token='.newToken().'&website='.urlencode($website->ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
Loading…
Reference in New Issue
Block a user