You are here

sassy_bootstrap.module in Sassy 7.3

File

sassy_bootstrap/sassy_bootstrap.module
View source
<?php

/**
 * Implements hook_sassy_resolve_path_NAMESPACE().
 */
function sassy_bootstrap_sassy_resolve_path_bootstrap($filename, $syntax = 'scss') {
  $path = drupal_get_path('module', 'sassy_bootstrap') . '/bootstrap/lib/' . ($syn = '.scss');
  $filename = str_replace(array(
    '.scss',
    '.sass',
  ), '', trim($filename, ' /._'));
  switch ($filename) {
    case '*':
    case 'bootstrap':
      return $path . 'bootstrap' . $syn;
    case 'forms':
    case 'mixins':
    case 'patterns':
    case 'reset':
    case 'scaffolding':
    case 'tables':
    case 'variables':
      return $path . $filename . $sn;
  }
  $message = 'Sassy Bootstrap - unrecognised stylesheet "' . $filename . '" requested. ';
  $message .= 'Available files are: bootstrap, forms, mixins, patterns, reset, scaffolding, tables, variables.';
  drupal_set_message($message, 'error');
  return FALSE;
}

/**
 * Implements hook_library().
 */
function sassy_bootstrap_library() {
  $path = drupal_get_path('module', 'sassy_bootstrap');
  $return = array();
  $all = array();
  foreach (array(
    'alerts',
    'dropdown',
    'modal',
    'popover',
    'scrollspy',
    'tabs',
    'twipsy',
  ) as $lib) {
    $return['bootstrap-' . $lib] = array(
      'title' => 'Bootstrap ' . ucwords($lib),
      'website' => 'http://twitter.github.com/bootstrap/javascript.html#' . $lib,
      'version' => '1.3.0',
      'js' => array(
        $path . '/bootstrap/js/bootstrap-' . $lib . '.js',
      ),
      'css' => array(
        $path . '/bootstrap/lib/patterns.scss',
      ),
    );
    $all[] = $path . '/bootstrap/js/bootstrap-' . $lib . '.js';
  }
  $return['bootstrap'] = array(
    'title' => 'Bootstrap complete',
    'website' => 'http://twitter.github.com/bootstrap/',
    'version' => '1.3.0',
    'js' => $all,
    'css' => array(
      $path . '/boostrap/lib/bootstrap.scss',
    ),
  );
  return $return;
}