function _css3pie_create_css3pie_js in css3pie 6
Same name and namespace in other branches
- 7.2 css3pie.module \_css3pie_create_css3pie_js()
helper function creates a real js file within files directory using new drupal streamwrapper;
Parameters
<type> $js - the js markup:
Return value
<type>
1 call to _css3pie_create_css3pie_js()
- _css3pie_build_css3pie_js in ./
css3pie.module - helper function get all selectors and generates content for js file
File
- ./
css3pie.module, line 205 - 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_create_css3pie_js($js = NULL) {
if (!$js) {
drupal_set_message(t('No js content given.'), 'error');
return FALSE;
}
$css3pie_js_path = file_create_path('css3pie');
// create css3pie directory and check if successfull...
if (!file_check_directory($css3pie_js_path, FILE_CREATE_DIRECTORY)) {
drupal_set_message(t('Unable to create CSS3PIE cache directory. Check the permissions on your files directory.'), 'error');
return;
}
// save css data to our real css file...
$filename = $css3pie_js_path . '/css3pie.js';
$filename = file_save_data($js, $filename, FILE_EXISTS_REPLACE);
// clear the js cache
drupal_clear_js_cache();
return $filename;
}