mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
fixes #2054 avoid exceeding box limits for album directory name
This commit is contained in:
@@ -83,6 +83,22 @@ SELECT galleries_url
|
||||
return $row['galleries_url'];
|
||||
}
|
||||
|
||||
function get_min_local_dir($local_dir)
|
||||
{
|
||||
$full_dir = explode('/', $local_dir);
|
||||
if (count($full_dir) <= 3)
|
||||
{
|
||||
return $local_dir;
|
||||
}
|
||||
else
|
||||
{
|
||||
$start = $full_dir[0] . '/' . $full_dir[1];
|
||||
$end = end($full_dir);
|
||||
$concat = $start . '/…/' . $end;
|
||||
return $concat;
|
||||
}
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Check Access and exit when user status is not ok |
|
||||
// +-----------------------------------------------------------------------+
|
||||
@@ -315,11 +331,14 @@ $template->assign(array(
|
||||
if (!$category['is_virtual'])
|
||||
{
|
||||
$category['cat_full_dir'] = get_complete_dir($_GET['cat_id']);
|
||||
$category_full_dir = preg_replace('/\/$/', '', $category['cat_full_dir']);
|
||||
$template->assign(
|
||||
array(
|
||||
'CAT_FULL_DIR' => preg_replace('/\/$/', '', $category['cat_full_dir'])
|
||||
'CAT_FULL_DIR' => $category_full_dir
|
||||
)
|
||||
);
|
||||
$template->assign('CAT_DIR_NAME', basename($category_full_dir));
|
||||
$template->assign('CAT_MIN_DIR', get_min_local_dir($category_full_dir));
|
||||
|
||||
if ($conf['enable_synchronization'])
|
||||
{
|
||||
|
||||
@@ -104,7 +104,8 @@ str_root = '{'Root'|@translate}';
|
||||
{if isset($U_SYNC) }
|
||||
<div class="cat-modify-info-card">
|
||||
<span class="cat-modify-info-title">{'Directory'}</span>
|
||||
<span class="cat-modify-info-content">{$CAT_FULL_DIR}</span>
|
||||
<span class="cat-modify-info-content directory" title="{$CAT_DIR_NAME}">{$CAT_DIR_NAME}</span>
|
||||
<span class="cat-modify-info-subcontent directory" title="{$CAT_FULL_DIR}">{$CAT_MIN_DIR}</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -274,4 +275,13 @@ str_root = '{'Root'|@translate}';
|
||||
.warnings {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.directory {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.cat-modify-infos .cat-modify-info-content.directory::first-letter {
|
||||
text-transform: none;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user