Commit 5e83075c authored by john_a's avatar john_a Committed by john_a
Browse files

Issue #2974058 by john_a, msankhala: hook_help should be in all modules and sub-modules

parent e54eecc3
<?php
/**
* @file
* marketing_cloud module that defines global settings for Marketing Cloud.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud address service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_address_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_address':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud assets service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_assets_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_assets':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud campaigns service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_campaigns_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_campaigns':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud contacts service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_contacts_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_contacts':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud data events service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_data_events_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_data_events':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud interaction service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_interaction_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_interaction':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud messages service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_messages_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_messages':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud platform service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_platform_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_platform':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud push service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_push_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_push':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
<?php
/**
* @file
* Module that defines the marketing cloud sms service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function marketing_cloud_sms_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.marketing_cloud_sms':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
drupal_set_message('To view this page correctly, please install and
enable the markdown module.');
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment