Refine survey list layout and backend active toggle
This commit is contained in:
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Mummert\SurveyBundle\EventListener;
|
||||
|
||||
use Contao\Backend;
|
||||
use Contao\Config;
|
||||
use Contao\CoreBundle\Routing\ContentUrlGenerator;
|
||||
use Contao\CoreBundle\Framework\ContaoFramework;
|
||||
@@ -105,21 +104,6 @@ final class SurveyDcaListener
|
||||
);
|
||||
}
|
||||
|
||||
public function generateToggleActiveButton(array $row, ?string $href, string $label, string $title, ?string $icon, string $attributes): string
|
||||
{
|
||||
$isActive = '1' === (string) ($row['isActive'] ?? '');
|
||||
$icon = $isActive ? 'visible.svg' : 'invisible.svg';
|
||||
$title = $isActive ? 'Umfrage vorübergehend deaktivieren' : 'Umfrage wieder aktivieren';
|
||||
|
||||
return sprintf(
|
||||
'<a href="%s" title="%s"%s>%s</a>',
|
||||
htmlspecialchars(Backend::addToUrl(($href ?? '').'&id='.(int) ($row['id'] ?? 0)), ENT_QUOTES),
|
||||
htmlspecialchars($title, ENT_QUOTES),
|
||||
$attributes,
|
||||
Image::getHtml($icon, $label)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user