class HelpService in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x src/HelpService.php \Drupal\bibcite\HelpService
Class HelpService.
@package Drupal\bibcite
Hierarchy
- class \Drupal\bibcite\HelpService implements HelpServiceInterface
Expanded class hierarchy of HelpService
1 string reference to 'HelpService'
1 service uses HelpService
File
- src/
HelpService.php, line 10
Namespace
Drupal\bibciteView source
class HelpService implements HelpServiceInterface {
/**
* {@inheritdoc}
*/
public function getHelpMarkup($links, $route, $module) {
$module_path = drupal_get_path('module', $module);
$lang = \Drupal::languageManager()
->getCurrentLanguage()
->getId();
$def = \Drupal::languageManager()
->getDefaultLanguage()
->getId();
$path = $module_path . '/help/' . $lang . '/' . $route . 'html';
if ($def === $lang || !file_exists($path)) {
$path = $module_path . '/help/default/' . $route . '.html';
}
if (file_exists($path)) {
$output = file_get_contents($path);
return sprintf($output, $links);
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HelpService:: |
public | function |
Get help text from file. Overrides HelpServiceInterface:: |