-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EWPP-3102: Allow 2 new icons to be used in field_oe_icon of paragraphs.
- Loading branch information
1 parent
53d13d1
commit 8636481
Showing
3 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
modules/oe_theme_helper/src/EventSubscriber/IconOptionsEventSubscriber.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Drupal\oe_theme_helper\EventSubscriber; | ||
|
||
use Drupal\Core\StringTranslation\StringTranslationTrait; | ||
use Drupal\oe_paragraphs\Event\IconOptionsEvent; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
|
||
/** | ||
* Provides a list of allowed icons. | ||
*/ | ||
class IconOptionsEventSubscriber implements EventSubscriberInterface { | ||
|
||
use StringTranslationTrait; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public static function getSubscribedEvents() { | ||
return [ | ||
IconOptionsEvent::class => 'getIconOptions', | ||
]; | ||
} | ||
|
||
/** | ||
* Gets the icon options. | ||
* | ||
* @param \Drupal\oe_paragraphs\Event\IconOptionsEvent $event | ||
* Allowed format event object. | ||
*/ | ||
public function getIconOptions(IconOptionsEvent $event): void { | ||
$event->setIconOptions([ | ||
'arrow-down' => $this->t('Arrow down'), | ||
'external' => $this->t('External'), | ||
'arrow-up' => $this->t('Arrow up'), | ||
'audio' => $this->t('Audio'), | ||
'book' => $this->t('Book'), | ||
'breadcrumb' => $this->t('Breadcrumb'), | ||
'brochure' => $this->t('Brochure'), | ||
'budget' => $this->t('Budget'), | ||
'calendar' => $this->t('Calendar'), | ||
'camera' => $this->t('Camera'), | ||
'check' => $this->t('Check'), | ||
'close' => $this->t('Close'), | ||
'close-dark' => $this->t('Close dark'), | ||
'copy' => $this->t('Copy'), | ||
'data' => $this->t('Data'), | ||
'digital' => $this->t('Digital'), | ||
'down' => $this->t('Down'), | ||
'download' => $this->t('Download'), | ||
'edit' => $this->t('Edit'), | ||
'energy' => $this->t('Energy'), | ||
'error' => $this->t('Error'), | ||
'euro' => $this->t('Euro'), | ||
'facebook' => $this->t('Facebook'), | ||
'faq' => $this->t('Faq'), | ||
'feedback' => $this->t('Feedback'), | ||
'file' => $this->t('File'), | ||
'generic-lang' => $this->t('Generic language'), | ||
'global' => $this->t('Global'), | ||
'googleplus' => $this->t('Google Plus (deprecated)'), | ||
'growth' => $this->t('Growth'), | ||
'image' => $this->t('Image'), | ||
'in' => $this->t('In'), | ||
'info' => $this->t('Info'), | ||
'infographic' => $this->t('Infographic'), | ||
'language' => $this->t('Language'), | ||
'left' => $this->t('Left'), | ||
'linkedin' => $this->t('LinkedIn'), | ||
'livestreaming' => $this->t('Live streaming'), | ||
'location' => $this->t('Location'), | ||
'log-in' => $this->t('Log in'), | ||
'logged-in' => $this->t('Logged in'), | ||
'multiple-files' => $this->t('Multiple files'), | ||
'organigram' => $this->t('Organigram'), | ||
'package' => $this->t('Package'), | ||
'presentation' => $this->t('Presentation'), | ||
'regulation' => $this->t('Regulation'), | ||
'right' => $this->t('Right'), | ||
'rss' => $this->t('RSS'), | ||
'search' => $this->t('Search'), | ||
'share' => $this->t('Share'), | ||
'slides' => $this->t('Slides (deprecated)'), | ||
'spinner' => $this->t('Spinner'), | ||
'spreadsheet' => $this->t('Spreadsheet'), | ||
'success' => $this->t('Success'), | ||
'tag-close' => $this->t('Tag close'), | ||
'twitter' => $this->t('Twitter'), | ||
'up' => $this->t('Up'), | ||
'video' => $this->t('Video'), | ||
'warning' => $this->t('Warning'), | ||
]); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters