You are here

better_module_dependencies.theme.inc in Better Module Dependencies 7

The theme Controlling output for modules list.

File

better_module_dependencies.theme.inc
View source
<?php

/**
 * @file
 * The theme Controlling output for modules list.
 */

/**
 * Returns HTML for the modules list.
 *
 * @param array $variables
 *   An associative array containing:
 *   - modules: An array of the depending modules.
 *
 * @return array
 *   Summary Array.
 */
function theme_better_module_dependencies_add_selectors(array $variables) {
  foreach ($variables['module']['#required_by'] as $key => $module) {
    $variables['module']['#required_by'][$key] = '<span class="better-module-dependencies-selector">' . $module . '</span>';
  }
  foreach ($variables['module']['#requires'] as $key => $module) {
    if (strpos($module, 'class="admin-missing"')) {
      $path = 'http://drupal.org/project/' . $key;
      $args = array(
        'attributes' => array(
          'class' => array(
            'better-module-dependencies-link',
          ),
          'target' => '_blank',
        ),
        'html' => TRUE,
      );
      $link = l($module, $path, $args);
      $variables['module']['#requires'][$key] = $link;
    }
    else {
      $variables['module']['#requires'][$key] = '<span class="better-module-dependencies-selector">' . $module . '</span>';
    }
  }
  $variables['module']['name']['#markup'] = '<span class="better-module-dependencies-name">' . $variables['module']['name']['#markup'] . '</span>';
  return $variables['module'];
}

Functions

Namesort descending Description
theme_better_module_dependencies_add_selectors Returns HTML for the modules list.