adm_program/modules/photos/photos.php
File photos.php
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
***********************************************************************************************
* Show a list of all photo albums
*
Avoid deeply nested control flow statements. Open
Open
if (strlen($albumDescription) > 200) {
// read first 200 chars of text, then search for last space and cut the text there. After that add a "more" link
$textPrev = substr($albumDescription, 0, 200);
$maxPosPrev = strrpos($textPrev, ' ');
$albumDescription = substr($textPrev, 0, $maxPosPrev) .
Avoid deeply nested control flow statements. Open
Open
if ((bool)$childPhotoAlbum->getValue('pho_locked') === false) {
$htmlLock = '<li><a class="dropdown-item admidio-album-lock" href="javascript:void(0)" data-id="' . $childPhotoAlbum->getValue('pho_uuid') . '" data-mode="lock">
<i class="bi bi-lock" data-bs-toggle="tooltip"></i> ' . $gL10n->get('SYS_LOCK_ALBUM') . '</a>
</li>';
}