$t('D3'), 'value' => '', 'severity' => REQUIREMENT_OK, ); // Return a list of all the files that exist. foreach ($files as $file) { $requirements['d3']['value'] .= $file->filename . ' '; } // Report has passed. $requirements['d3']['value'] .= $t('found under !path', array('!path' => $path)); } else { // If there are no javascript files, then there was a problem // installing the library. $requirements['d3'] = array( 'title' => $t('D3'), 'value' => $t('The d3 library has not been installed properly. Check your folder !path and ensure your d3.[version].js file is located inside that folder, and not in a subfolder.', array('!path' => $path)), 'severity' => REQUIREMENT_ERROR, ); } return $requirements; } else { // If there is no library at all, chances are they have not downloaded // and tried installing D3 yet. $requirements['d3'] = array( 'title' => $t('D3'), 'value' => $t('D3 library was not found. !download the library and place all javascript files in a folder entitled "d3" located in your default libraries folder. E.g. If you download version 3 minified, it would be located in path/to/libraries/d3/d3.v3.min.js.', array('!download' => l($t('Download'), 'http://d3js.org/')) ), 'severity' => REQUIREMENT_ERROR, ); return $requirements; } } /** * Implements hook_uninstall(). */ function d3_uninstall() { variable_del('d3_graphapi_default_library'); }