More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / modules / dblog / dblog.admin.inc
1 <?php
2
3 /**
4  * @file
5  * Administrative page callbacks for the Database Logging module.
6  */
7
8 use Drupal\Core\Logger\RfcLogLevel;
9
10 /**
11  * Creates a list of database log administration filters that can be applied.
12  *
13  * @return array
14  *   Associative array of filters. The top-level keys are used as the form
15  *   element names for the filters, and the values are arrays with the following
16  *   elements:
17  *   - title: Title of the filter.
18  *   - where: The filter condition.
19  *   - options: Array of options for the select list for the filter.
20  */
21 function dblog_filters() {
22   $filters = [];
23
24   foreach (_dblog_get_message_types() as $type) {
25     $types[$type] = t($type);
26   }
27
28   if (!empty($types)) {
29     $filters['type'] = [
30       'title' => t('Type'),
31       'where' => "w.type = ?",
32       'options' => $types,
33     ];
34   }
35
36   $filters['severity'] = [
37     'title' => t('Severity'),
38     'where' => 'w.severity = ?',
39     'options' => RfcLogLevel::getLevels(),
40   ];
41
42   return $filters;
43 }