You are here

class Micon in Micon 8

Same name in this branch
  1. 8 src/TwigExtension/Micon.php \Drupal\micon\TwigExtension\Micon
  2. 8 src/Element/Micon.php \Drupal\micon\Element\Micon
  3. 8 src/Entity/Micon.php \Drupal\micon\Entity\Micon
  4. 8 src/Plugin/SocialMediaLinks/Iconset/Micon.php \Drupal\micon\Plugin\SocialMediaLinks\Iconset\Micon
Same name and namespace in other branches
  1. 2.x src/Plugin/SocialMediaLinks/Iconset/Micon.php \Drupal\micon\Plugin\SocialMediaLinks\Iconset\Micon

Provides 'elegantthemes' iconset.

Plugin annotation


@Iconset(
  id = "micon",
  publisher = "JaceRider",
  publisherUrl = "https://github.com/jacerider/micon",
  name = "Micon",
)

Hierarchy

Expanded class hierarchy of Micon

8 string references to 'Micon'
micon.info.yml in ./micon.info.yml
micon.info.yml
micon.links.menu.yml in ./micon.links.menu.yml
micon.links.menu.yml
micon_content_type.info.yml in micon_content_type/micon_content_type.info.yml
micon_content_type/micon_content_type.info.yml
micon_link.info.yml in micon_link/micon_link.info.yml
micon_link/micon_link.info.yml
micon_local_task.info.yml in micon_local_task/micon_local_task.info.yml
micon_local_task/micon_local_task.info.yml

... See full list

File

src/Plugin/SocialMediaLinks/Iconset/Micon.php, line 18

Namespace

Drupal\micon\Plugin\SocialMediaLinks\Iconset
View source
class Micon extends IconsetBase implements IconsetInterface {

  /**
   * {@inheritdoc}
   */
  public function setPath($iconset_id) {
    $this->path = 'library';
  }

  /**
   * {@inheritdoc}
   */
  public function getStyle() {
    return array(
      'normal' => 'normal',
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getIconElement($platform, $style) {
    $icon_name = $platform
      ->getIconName();
    switch ($icon_name) {
      case 'vimeo':
        $icon_name = $icon_name . '-square';
        break;
      case 'googleplus':
        $icon_name = 'google-plus';
        break;
      case 'email':
        $icon_name = 'envelope';
        break;
    }
    $icon = array(
      '#theme' => 'micon',
      '#icon' => 'fa-' . $icon_name,
    );
    return $icon;
  }

  /**
   * {@inheritdoc}
   */
  public function getIconPath($icon_name, $style) {
    return NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
IconsetBase::$finder protected property
IconsetBase::$path protected property
IconsetBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
IconsetBase::explodeStyle public static function Explode the styles.
IconsetBase::getDownloadUrl public function Return the url to download the iconset. Overrides IconsetInterface::getDownloadUrl
IconsetBase::getLibrary public function Get the library. 1
IconsetBase::getName public function Return the name of the iconset. Overrides IconsetInterface::getName
IconsetBase::getPath public function Get the path to the iconset.
IconsetBase::getPublisher public function Return the name of the publisher. Overrides IconsetInterface::getPublisher
IconsetBase::getPublisherUrl public function Return the url of the publisher. Overrides IconsetInterface::getPublisherUrl
IconsetBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase::__construct
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
Micon::getIconElement public function Get the iconset element. Overrides IconsetBase::getIconElement
Micon::getIconPath public function Return the path of an icon for the given platform (iconName) and style. Overrides IconsetInterface::getIconPath
Micon::getStyle public function Return the available styles. Overrides IconsetInterface::getStyle
Micon::setPath public function Set the path for the given iconset. Overrides IconsetBase::setPath
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.