libraries.theme.inc 968 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @file
  4. * Provides theme and preprocess functions for Libraries API.
  5. */
  6. /**
  7. * Prepare variables for theming a table with a title.
  8. *
  9. * @param array $variables
  10. * An array of theme variables, passed by reference.
  11. */
  12. function template_preprocess_libraries_table_with_title(&$variables) {
  13. drupal_add_css(drupal_get_path('module', 'libraries') . '/css/libraries.admin.css');
  14. $variables['attributes'] += array('class' => array());
  15. $variables['attributes']['class'][] = 'libraries-table';
  16. }
  17. /**
  18. * Returns HTML for a table with a title.
  19. *
  20. * @param array $variables
  21. * An array theme variables.
  22. *
  23. * @return string
  24. * The HTML output for this table with a title.
  25. */
  26. function theme_libraries_table_with_title(array $variables) {
  27. $output = '';
  28. $output .= '<h2>' . $variables['title'] . '</h2>';
  29. $output .= '<div class="description">' . $variables['description'] . '</div>';
  30. $output .= theme_table($variables);
  31. return $output;
  32. }