You are here

private function MagicCSSTestCase::the_css_files in Magic 7.2

1 call to MagicCSSTestCase::the_css_files()
MagicCSSTestCase::testMagicCSSExcludes in ./magic.test
Test magic_assets_exclude().

File

./magic.test, line 37
A few tests to ensure the magic module is doing what it should be.

Class

MagicCSSTestCase
A quick test to ensure that we have the right CSS gets returned when we run our regex to selectively remove files.

Code

private function the_css_files($files = null) {

  // Will grab the active theme.
  $theme = drupal_get_path('theme', $GLOBALS['theme_key']);
  $css_files = array(
    'ctools' => array(
      'type' => 'file',
      'data' => 'sites/all/modules/contrib/ctools/css/ctools.css',
    ),
    'views' => array(
      'type' => 'file',
      'data' => 'sites/all/modules/contrib/views/css/views.css',
    ),
    'base' => array(
      'type' => 'file',
      'data' => 'modules/system/system.base.css',
    ),
    'menu' => array(
      'type' => 'file',
      'data' => 'modules/system/system.menus.css',
    ),
    'comment' => array(
      'type' => 'file',
      'data' => 'modules/comment/comment.css',
    ),
    'node' => array(
      'type' => 'file',
      'data' => 'modules/node/node.css',
    ),
    'theme' => array(
      'type' => 'file',
      'data' => $theme . '/css/style.css',
    ),
    'admin_menu' => array(
      'type' => 'file',
      'data' => 'sites/all/modules/contrib/admin_menu/admin_menu.css',
    ),
    'external' => array(
      'type' => 'external',
      'data' => '//external.file.com/folder/filename.css',
    ),
    'inline' => array(
      'type' => 'inline',
      'data' => 'body{color:blue;}',
    ),
  );
  $return = array();
  if ($files == null) {
    $files = array_keys($css_files);
  }
  foreach ($css_files as $name => $data) {
    if (in_array($name, $files)) {
      $return[] = $data;
    }
  }
  return $return;
}