You are here

function contemplate_refresh_files in Content Templates (Contemplate) 7

Same name and namespace in other branches
  1. 5 contemplate.module \contemplate_refresh_files()
  2. 6 contemplate.module \contemplate_refresh_files()

Refresh the listing of template files for the current site

This refreshes the file listing whenever a ConTemplate admin screen is called

2 calls to contemplate_refresh_files()
contemplate_admin in ./contemplate.module
Admin page... list out the node types
contemplate_edit_type in ./contemplate.module

File

./contemplate.module, line 621
Create templates to customize teaser and body content.

Code

function contemplate_refresh_files() {
  $data = drupal_system_listing('/\\.tpl\\.php$/', 'contemplates', 'name', 0);
  $conf = conf_path();
  db_delete('contemplate_files')
    ->condition('site', $conf)
    ->execute();
  if (!empty($data)) {
    $fields = array(
      'site' => $conf,
      'data' => serialize($data),
    );
    db_insert('contemplate_files')
      ->fields($fields)
      ->execute();
  }
}