You are here

function sassy_foundation_sassy_resolve_path_foundation in Sassy 7.3

Same name and namespace in other branches
  1. 7.2 extensions/foundation/sassy_foundation.module \sassy_foundation_sassy_resolve_path_foundation()

Implements hook_sassy_resolve_path_NAMESPACE().

File

sassy_foundation/sassy_foundation.module, line 6

Code

function sassy_foundation_sassy_resolve_path_foundation($filename, $syntax = 'scss') {
  $path = drupal_get_path('module', 'sassy_foundation') . '/foundation/stylesheets/';
  $syn = '.css';
  $filename = str_replace(array(
    '.scss',
    '.sass',
    '.css',
  ), '', trim($filename, ' /._'));
  if ($filename == '*') {
    $filename == 'foundation';
  }
  $available = array(
    'foundation',
    'app',
    'forms',
    'globals',
    'grid',
    'ie',
    'mobile',
    'orbit',
    'reveal',
    'typography',
    'ui',
  );
  if (in_array($filename, $available)) {
    return $path . $filename . $syn;
  }
  $message = 'Sassy Foundation - unrecognised stylesheet "' . $filename . '" requested. ';
  $message .= 'Available files are: ' . implode(', ', $available);
  drupal_set_message($message, 'error');
  return FALSE;
}