You are here

function contemplate_refresh_files in Content Templates (Contemplate) 5

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

Refresh the listing of template files for the current site

This gets refreshes the file listing whenever a ConTemplate admin screens 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 518
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_query("DELETE FROM {contemplate_files} WHERE site = '%s'", $conf);
  db_query("INSERT INTO {contemplate_files} (site, data) VALUES ('%s', '%s')", $conf, serialize($data));
}