social_media.module in Social media share 8
Contains social_media.module..
File
social_media.moduleView source
<?php
/**
* @file
* Contains social_media.module..
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_theme().
*/
function social_media_theme($existing, $type, $theme, $path) {
return [
'social_media_links' => [
'variables' => [
'elements' => NULL,
],
'template' => 'social-media-links',
],
];
}
/**
* Implements hook_mail().
*/
function social_media_mail($key, &$message, $params) {
switch ($key) {
case 'forward_email':
$message['from'] = \Drupal::config('system.site')
->get('mail');
$message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes';
$message['subject'] = $params['subject'];
$message['body'][] = $params['message'];
break;
}
}
/**
* Implements hook_help().
*/
function social_media_help($route_name, RouteMatchInterface $route_match) {
if ($route_name != 'help.page.social_media') {
return '';
}
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The social media share module allows the user to share current page to different social media platforms. It is rendered as block, you can place it anywhere of your site.') . '</p>';
$output .= '<p>' . t('Module provides social media field type so that you can add it as field in entity and take all benefits from field API.') . '</p>';
$output .= '<p>' . t('It is flexible to share any page of the site whether it is node, term , panels, view pages so on.') . '</p>';
$output .= '<p>' . t('Analyse the <a href="https://git.drupalcode.org/project/social_media/blob/8.x-1.x/README.txt">Read more</a> to get more information about this module.') . '</p>';
return $output;
}
Functions
Name | Description |
---|---|
social_media_help | Implements hook_help(). |
social_media_mail | Implements hook_mail(). |
social_media_theme | Implements hook_theme(). |