features_ui.module 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * @file
  4. * Allows site administrators to modify configuration.
  5. */
  6. use Drupal\Core\Routing\RouteMatchInterface;
  7. /**
  8. * Implements hook_help().
  9. */
  10. function features_ui_help($route_name, RouteMatchInterface $route_match) {
  11. switch ($route_name) {
  12. case 'features.assignment':
  13. $output = '';
  14. $output .= '<p>' . t('Bundles are used to collect together groups of features. A bundle provides a shared <a href=":namespace">namespace</a> for all features included in it, which prevents conflicts and helps distinguish your features from those produced for other purposes. Common uses of bundles include:', array(':namespace' => 'http://en.wikipedia.org/wiki/Namespace'));
  15. $output .= '<ul>';
  16. $output .= '<li>' . t('Custom features for use on a particular site.') . '</li>';
  17. $output .= '<li>' . t('The features of a given <a href=":distributions">distribution</a>.', array(':distributions' => 'https://www.drupal.org/documentation/build/distributions')) . '</li>';
  18. $output .= '</ul></p>';
  19. $output .= '<p>' . t('Use the form below to manage bundles. Each bundle comes with a set of assignment methods. By configuring and ordering the assignment methods, you can set the defaults for what does and doesn\'t get packaged into features for your bundle. Use the <em>Bundle</em> select to choose which bundle to edit, or chose <em>--New--</em> to create a new bundle. The <em>Default</em> bundle does not include a namespace and cannot be deleted.') . '</p>';
  20. return $output;
  21. case 'features.export':
  22. $output = '';
  23. $output .= '<p>' . t('Export packages of configuration into modules.') . '</p>';
  24. return $output;
  25. }
  26. }
  27. /**
  28. * Implements hook_theme().
  29. */
  30. function features_ui_theme() {
  31. return array(
  32. 'features_listing' => array(
  33. 'render element' => 'form',
  34. 'file' => 'features_ui.admin.inc',
  35. 'function' => 'theme_features_listing',
  36. ),
  37. 'features_assignment_configure_form' => array(
  38. 'render element' => 'form',
  39. 'file' => 'features_ui.admin.inc',
  40. 'function' => 'theme_assignment_form',
  41. ),
  42. 'features_items' => array(
  43. 'variables' => array(
  44. 'items' => array(),
  45. ),
  46. 'file' => 'features_ui.admin.inc',
  47. 'function' => 'theme_features_items',
  48. ),
  49. );
  50. }