You are here

function _css3pie_build_css3pie_css in css3pie 6

Same name and namespace in other branches
  1. 7.2 css3pie.module \_css3pie_build_css3pie_css()

helper function get all selectors and generates content for css file

Parameters

<type> $css:

Return value

<type> path to new created file

1 call to _css3pie_build_css3pie_css()
_css3pie_build_css3pie_functionality in ./css3pie.module
helper function to build the module functionality

File

./css3pie.module, line 109
css3pie.module a very simple Drupal module to implement the css3pie.com javascript to your drupal and make the css selectors configurable over ui. This module creates a real css file on drupal files folder and add them via drupal_add_css.

Code

function _css3pie_build_css3pie_css() {
  $output = '';

  // invoke hook_css3pie in all modules to get the selectors
  $css3pie_selectors = module_invoke_all('css3pie');
  if ($css3pie_selectors) {
    $show_namespaces_as_comments = variable_get('css3pie_css_comment', TRUE);
    $cnt_namespaces = count($css3pie_selectors);
    $i = 0;
    foreach ($css3pie_selectors as $namespace => $selectors) {
      $i++;
      if ($show_namespaces_as_comments) {
        $output .= '/* ' . $namespace . ' */' . "\n";
      }
      $output .= implode(', ', $selectors);
      if ($i < $cnt_namespaces) {
        $output .= ',' . "\n";
      }
    }
    $output .= "\n" . '{' . "\n" . '  behavior: url(' . base_path() . _css3pie_get_css3pie_library() . ');' . "\n" . '}';
  }
  return _css3pie_create_css3pie_css($output);
}