You are here

function biblio_citeproc_install_default_styles in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/CiteProc/biblio_citeproc.install \biblio_citeproc_install_default_styles()
  2. 7 modules/CiteProc/biblio_citeproc.install \biblio_citeproc_install_default_styles()
1 call to biblio_citeproc_install_default_styles()
biblio_citeproc_install in modules/CiteProc/biblio_citeproc.install

File

modules/CiteProc/biblio_citeproc.install, line 87

Code

function biblio_citeproc_install_default_styles() {
  $record = array();
  $dir = drupal_get_path('module', 'biblio_citeproc') . '/style';
  $files = file_scan_directory($dir, '/..*.csl$/');
  $query = db_insert('biblio_citeproc_styles')
    ->fields(array(
    'id',
    'title',
    'filename',
    'summary',
    'csl',
    'sha1',
  ));
  foreach ($files as $file) {
    $csl = file_get_contents($file->uri);
    $name = basename($file->filename);
    biblio_citeproc_install_style($name, $csl);
  }
}