65 lines
2.9 KiB
PHP
65 lines
2.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace MauticPlugin\PlanBundle\Service;
|
|
|
|
/**
|
|
* Pictograms an administrator can give to a description item type (Settings > Configuration > Plan
|
|
* Settings). They are icons of the Remix Icon set that Mautic ships ("ri-*" classes); each one was
|
|
* checked against Mautic 7's icon stylesheet.
|
|
*/
|
|
final class Pictograms
|
|
{
|
|
public const ICONS = [
|
|
// Ideas, goals, guidance
|
|
'ri-lightbulb-line', 'ri-focus-3-line', 'ri-compass-3-line', 'ri-route-line', 'ri-flag-line',
|
|
'ri-rocket-line', 'ri-trophy-line', 'ri-award-line', 'ri-medal-line', 'ri-star-line',
|
|
'ri-sparkling-line', 'ri-magic-line', 'ri-key-2-line',
|
|
// Creative, style, tone
|
|
'ri-palette-line', 'ri-brush-line', 'ri-quill-pen-line', 'ri-pencil-line', 'ri-emotion-line',
|
|
'ri-emotion-happy-line', 'ri-heart-line', 'ri-thumb-up-line', 'ri-image-line', 'ri-camera-line',
|
|
'ri-video-line', 'ri-mic-line', 'ri-music-line', 'ri-layout-line', 'ri-pages-line',
|
|
'ri-presentation-line', 'ri-slideshow-line',
|
|
// Messages, content
|
|
'ri-chat-quote-line', 'ri-chat-3-line', 'ri-volume-up-line', 'ri-megaphone-line', 'ri-mail-line',
|
|
'ri-newspaper-line', 'ri-article-line', 'ri-file-text-line', 'ri-file-list-3-line',
|
|
'ri-book-open-line', 'ri-bookmark-line', 'ri-links-line',
|
|
// People, market
|
|
'ri-team-line', 'ri-group-line', 'ri-user-line', 'ri-user-heart-line', 'ri-customer-service-2-line',
|
|
'ri-hand-heart-line', 'ri-building-line', 'ri-briefcase-line', 'ri-store-2-line',
|
|
'ri-shopping-cart-line', 'ri-price-tag-3-line', 'ri-gift-line', 'ri-truck-line',
|
|
'ri-global-line', 'ri-earth-line', 'ri-map-pin-line',
|
|
// Figures, time
|
|
'ri-money-euro-circle-line', 'ri-wallet-3-line', 'ri-bar-chart-line', 'ri-pie-chart-line',
|
|
'ri-line-chart-line', 'ri-calendar-line', 'ri-time-line', 'ri-timer-line',
|
|
// Rules, status, structure
|
|
'ri-information-line', 'ri-question-line', 'ri-error-warning-line', 'ri-shield-check-line',
|
|
'ri-scales-3-line', 'ri-lock-line', 'ri-checkbox-circle-line', 'ri-list-check', 'ri-search-line',
|
|
'ri-eye-line', 'ri-tools-line', 'ri-settings-3-line', 'ri-stack-line', 'ri-node-tree', 'ri-leaf-line',
|
|
];
|
|
|
|
public static function isValid(?string $icon): bool
|
|
{
|
|
return null !== $icon && in_array($icon, self::ICONS, true);
|
|
}
|
|
|
|
/**
|
|
* Dropdown choices: readable name => icon class, e.g. "Lightbulb" => "ri-lightbulb-line".
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public static function getChoices(): array
|
|
{
|
|
$choices = [];
|
|
foreach (self::ICONS as $icon) {
|
|
$name = preg_replace(['/^ri-/', '/-line$/'], '', $icon);
|
|
$name = ucfirst(str_replace('-', ' ', (string) $name));
|
|
|
|
$choices[$name] = $icon;
|
|
}
|
|
|
|
return $choices;
|
|
}
|
|
}
|