You are here

function _invoice_get_templates in Invoice 7

Same name and namespace in other branches
  1. 6 invoice_helpers.inc \_invoice_get_templates()

Helper function to get the available template names

5 calls to _invoice_get_templates()
invoice_form in ./invoice_form.inc
Implements hook_form()
invoice_settings_form in ./invoice_form.inc
Invoice settings form
invoice_settings_form_submit in ./invoice.module
Submit function for the settings form
_invoice_api_check_allowed_templates in ./invoice_api.inc
Checks if the authenticated username has access to the defined template name
_invoice_get_variable in ./invoice_helpers.inc
Helper function to get template variables

File

./invoice_helpers.inc, line 509
Invoice module

Code

function _invoice_get_templates() {
  $templates = array(
    'default',
  );
  $files = file_scan_directory(dirname(__FILE__) . '/templates', '/\\.inc$/i');
  foreach ($files as $file) {
    if (!empty($file->name) && $file->name != 'default') {
      $templates[] = check_plain($file->name);
    }
  }
  return $templates;
}