Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\dblog\Controller;
|
Chris@0
|
4
|
Chris@0
|
5 use Drupal\Component\Utility\Html;
|
Chris@0
|
6 use Drupal\Component\Utility\Unicode;
|
Chris@0
|
7 use Drupal\Component\Utility\Xss;
|
Chris@18
|
8 use Drupal\Component\Utility\UrlHelper;
|
Chris@0
|
9 use Drupal\Core\Controller\ControllerBase;
|
Chris@0
|
10 use Drupal\Core\Database\Connection;
|
Chris@0
|
11 use Drupal\Core\Datetime\DateFormatterInterface;
|
Chris@0
|
12 use Drupal\Core\Extension\ModuleHandlerInterface;
|
Chris@0
|
13 use Drupal\Core\Form\FormBuilderInterface;
|
Chris@0
|
14 use Drupal\Core\Logger\RfcLogLevel;
|
Chris@0
|
15 use Drupal\Core\Url;
|
Chris@0
|
16 use Drupal\user\Entity\User;
|
Chris@0
|
17 use Symfony\Component\DependencyInjection\ContainerInterface;
|
Chris@18
|
18 use Drupal\Core\Link;
|
Chris@0
|
19
|
Chris@0
|
20 /**
|
Chris@0
|
21 * Returns responses for dblog routes.
|
Chris@0
|
22 */
|
Chris@0
|
23 class DbLogController extends ControllerBase {
|
Chris@0
|
24
|
Chris@0
|
25 /**
|
Chris@0
|
26 * The database service.
|
Chris@0
|
27 *
|
Chris@0
|
28 * @var \Drupal\Core\Database\Connection
|
Chris@0
|
29 */
|
Chris@0
|
30 protected $database;
|
Chris@0
|
31
|
Chris@0
|
32 /**
|
Chris@0
|
33 * The module handler service.
|
Chris@0
|
34 *
|
Chris@0
|
35 * @var \Drupal\Core\Extension\ModuleHandlerInterface
|
Chris@0
|
36 */
|
Chris@0
|
37 protected $moduleHandler;
|
Chris@0
|
38
|
Chris@0
|
39 /**
|
Chris@0
|
40 * The date formatter service.
|
Chris@0
|
41 *
|
Chris@0
|
42 * @var \Drupal\Core\Datetime\DateFormatterInterface
|
Chris@0
|
43 */
|
Chris@0
|
44 protected $dateFormatter;
|
Chris@0
|
45
|
Chris@0
|
46 /**
|
Chris@0
|
47 * The form builder service.
|
Chris@0
|
48 *
|
Chris@0
|
49 * @var \Drupal\Core\Form\FormBuilderInterface
|
Chris@0
|
50 */
|
Chris@0
|
51 protected $formBuilder;
|
Chris@0
|
52
|
Chris@0
|
53 /**
|
Chris@0
|
54 * The user storage.
|
Chris@0
|
55 *
|
Chris@0
|
56 * @var \Drupal\user\UserStorageInterface
|
Chris@0
|
57 */
|
Chris@0
|
58 protected $userStorage;
|
Chris@0
|
59
|
Chris@0
|
60 /**
|
Chris@0
|
61 * {@inheritdoc}
|
Chris@0
|
62 */
|
Chris@0
|
63 public static function create(ContainerInterface $container) {
|
Chris@0
|
64 return new static(
|
Chris@0
|
65 $container->get('database'),
|
Chris@0
|
66 $container->get('module_handler'),
|
Chris@0
|
67 $container->get('date.formatter'),
|
Chris@0
|
68 $container->get('form_builder')
|
Chris@0
|
69 );
|
Chris@0
|
70 }
|
Chris@0
|
71
|
Chris@0
|
72 /**
|
Chris@0
|
73 * Constructs a DbLogController object.
|
Chris@0
|
74 *
|
Chris@0
|
75 * @param \Drupal\Core\Database\Connection $database
|
Chris@0
|
76 * A database connection.
|
Chris@0
|
77 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
|
Chris@0
|
78 * A module handler.
|
Chris@0
|
79 * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
|
Chris@0
|
80 * The date formatter service.
|
Chris@0
|
81 * @param \Drupal\Core\Form\FormBuilderInterface $form_builder
|
Chris@0
|
82 * The form builder service.
|
Chris@0
|
83 */
|
Chris@0
|
84 public function __construct(Connection $database, ModuleHandlerInterface $module_handler, DateFormatterInterface $date_formatter, FormBuilderInterface $form_builder) {
|
Chris@0
|
85 $this->database = $database;
|
Chris@0
|
86 $this->moduleHandler = $module_handler;
|
Chris@0
|
87 $this->dateFormatter = $date_formatter;
|
Chris@0
|
88 $this->formBuilder = $form_builder;
|
Chris@18
|
89 $this->userStorage = $this->entityTypeManager()->getStorage('user');
|
Chris@0
|
90 }
|
Chris@0
|
91
|
Chris@0
|
92 /**
|
Chris@0
|
93 * Gets an array of log level classes.
|
Chris@0
|
94 *
|
Chris@0
|
95 * @return array
|
Chris@0
|
96 * An array of log level classes.
|
Chris@0
|
97 */
|
Chris@0
|
98 public static function getLogLevelClassMap() {
|
Chris@0
|
99 return [
|
Chris@0
|
100 RfcLogLevel::DEBUG => 'dblog-debug',
|
Chris@0
|
101 RfcLogLevel::INFO => 'dblog-info',
|
Chris@0
|
102 RfcLogLevel::NOTICE => 'dblog-notice',
|
Chris@0
|
103 RfcLogLevel::WARNING => 'dblog-warning',
|
Chris@0
|
104 RfcLogLevel::ERROR => 'dblog-error',
|
Chris@0
|
105 RfcLogLevel::CRITICAL => 'dblog-critical',
|
Chris@0
|
106 RfcLogLevel::ALERT => 'dblog-alert',
|
Chris@0
|
107 RfcLogLevel::EMERGENCY => 'dblog-emergency',
|
Chris@0
|
108 ];
|
Chris@0
|
109 }
|
Chris@0
|
110
|
Chris@0
|
111 /**
|
Chris@0
|
112 * Displays a listing of database log messages.
|
Chris@0
|
113 *
|
Chris@0
|
114 * Messages are truncated at 56 chars.
|
Chris@0
|
115 * Full-length messages can be viewed on the message details page.
|
Chris@0
|
116 *
|
Chris@0
|
117 * @return array
|
Chris@16
|
118 * A render array as expected by
|
Chris@16
|
119 * \Drupal\Core\Render\RendererInterface::render().
|
Chris@0
|
120 *
|
Chris@0
|
121 * @see Drupal\dblog\Form\DblogClearLogConfirmForm
|
Chris@0
|
122 * @see Drupal\dblog\Controller\DbLogController::eventDetails()
|
Chris@0
|
123 */
|
Chris@0
|
124 public function overview() {
|
Chris@0
|
125
|
Chris@0
|
126 $filter = $this->buildFilterQuery();
|
Chris@0
|
127 $rows = [];
|
Chris@0
|
128
|
Chris@0
|
129 $classes = static::getLogLevelClassMap();
|
Chris@0
|
130
|
Chris@0
|
131 $this->moduleHandler->loadInclude('dblog', 'admin.inc');
|
Chris@0
|
132
|
Chris@0
|
133 $build['dblog_filter_form'] = $this->formBuilder->getForm('Drupal\dblog\Form\DblogFilterForm');
|
Chris@0
|
134
|
Chris@0
|
135 $header = [
|
Chris@0
|
136 // Icon column.
|
Chris@0
|
137 '',
|
Chris@0
|
138 [
|
Chris@0
|
139 'data' => $this->t('Type'),
|
Chris@0
|
140 'field' => 'w.type',
|
Chris@0
|
141 'class' => [RESPONSIVE_PRIORITY_MEDIUM],
|
Chris@0
|
142 ],
|
Chris@0
|
143 [
|
Chris@0
|
144 'data' => $this->t('Date'),
|
Chris@0
|
145 'field' => 'w.wid',
|
Chris@0
|
146 'sort' => 'desc',
|
Chris@0
|
147 'class' => [RESPONSIVE_PRIORITY_LOW],
|
Chris@0
|
148 ],
|
Chris@0
|
149 $this->t('Message'),
|
Chris@0
|
150 [
|
Chris@0
|
151 'data' => $this->t('User'),
|
Chris@0
|
152 'field' => 'ufd.name',
|
Chris@0
|
153 'class' => [RESPONSIVE_PRIORITY_MEDIUM],
|
Chris@0
|
154 ],
|
Chris@0
|
155 [
|
Chris@0
|
156 'data' => $this->t('Operations'),
|
Chris@0
|
157 'class' => [RESPONSIVE_PRIORITY_LOW],
|
Chris@0
|
158 ],
|
Chris@0
|
159 ];
|
Chris@0
|
160
|
Chris@0
|
161 $query = $this->database->select('watchdog', 'w')
|
Chris@0
|
162 ->extend('\Drupal\Core\Database\Query\PagerSelectExtender')
|
Chris@0
|
163 ->extend('\Drupal\Core\Database\Query\TableSortExtender');
|
Chris@0
|
164 $query->fields('w', [
|
Chris@0
|
165 'wid',
|
Chris@0
|
166 'uid',
|
Chris@0
|
167 'severity',
|
Chris@0
|
168 'type',
|
Chris@0
|
169 'timestamp',
|
Chris@0
|
170 'message',
|
Chris@0
|
171 'variables',
|
Chris@0
|
172 'link',
|
Chris@0
|
173 ]);
|
Chris@0
|
174 $query->leftJoin('users_field_data', 'ufd', 'w.uid = ufd.uid');
|
Chris@0
|
175
|
Chris@0
|
176 if (!empty($filter['where'])) {
|
Chris@0
|
177 $query->where($filter['where'], $filter['args']);
|
Chris@0
|
178 }
|
Chris@0
|
179 $result = $query
|
Chris@0
|
180 ->limit(50)
|
Chris@0
|
181 ->orderByHeader($header)
|
Chris@0
|
182 ->execute();
|
Chris@0
|
183
|
Chris@0
|
184 foreach ($result as $dblog) {
|
Chris@0
|
185 $message = $this->formatMessage($dblog);
|
Chris@0
|
186 if ($message && isset($dblog->wid)) {
|
Chris@0
|
187 $title = Unicode::truncate(Html::decodeEntities(strip_tags($message)), 256, TRUE, TRUE);
|
Chris@0
|
188 $log_text = Unicode::truncate($title, 56, TRUE, TRUE);
|
Chris@0
|
189 // The link generator will escape any unsafe HTML entities in the final
|
Chris@0
|
190 // text.
|
Chris@0
|
191 $message = $this->l($log_text, new Url('dblog.event', ['event_id' => $dblog->wid], [
|
Chris@0
|
192 'attributes' => [
|
Chris@0
|
193 // Provide a title for the link for useful hover hints. The
|
Chris@0
|
194 // Attribute object will escape any unsafe HTML entities in the
|
Chris@0
|
195 // final text.
|
Chris@0
|
196 'title' => $title,
|
Chris@0
|
197 ],
|
Chris@0
|
198 ]));
|
Chris@0
|
199 }
|
Chris@0
|
200 $username = [
|
Chris@0
|
201 '#theme' => 'username',
|
Chris@0
|
202 '#account' => $this->userStorage->load($dblog->uid),
|
Chris@0
|
203 ];
|
Chris@0
|
204 $rows[] = [
|
Chris@0
|
205 'data' => [
|
Chris@0
|
206 // Cells.
|
Chris@0
|
207 ['class' => ['icon']],
|
Chris@0
|
208 $this->t($dblog->type),
|
Chris@0
|
209 $this->dateFormatter->format($dblog->timestamp, 'short'),
|
Chris@0
|
210 $message,
|
Chris@0
|
211 ['data' => $username],
|
Chris@0
|
212 ['data' => ['#markup' => $dblog->link]],
|
Chris@0
|
213 ],
|
Chris@0
|
214 // Attributes for table row.
|
Chris@0
|
215 'class' => [Html::getClass('dblog-' . $dblog->type), $classes[$dblog->severity]],
|
Chris@0
|
216 ];
|
Chris@0
|
217 }
|
Chris@0
|
218
|
Chris@0
|
219 $build['dblog_table'] = [
|
Chris@0
|
220 '#type' => 'table',
|
Chris@0
|
221 '#header' => $header,
|
Chris@0
|
222 '#rows' => $rows,
|
Chris@0
|
223 '#attributes' => ['id' => 'admin-dblog', 'class' => ['admin-dblog']],
|
Chris@0
|
224 '#empty' => $this->t('No log messages available.'),
|
Chris@0
|
225 '#attached' => [
|
Chris@0
|
226 'library' => ['dblog/drupal.dblog'],
|
Chris@0
|
227 ],
|
Chris@0
|
228 ];
|
Chris@0
|
229 $build['dblog_pager'] = ['#type' => 'pager'];
|
Chris@0
|
230
|
Chris@0
|
231 return $build;
|
Chris@0
|
232
|
Chris@0
|
233 }
|
Chris@0
|
234
|
Chris@0
|
235 /**
|
Chris@0
|
236 * Displays details about a specific database log message.
|
Chris@0
|
237 *
|
Chris@0
|
238 * @param int $event_id
|
Chris@0
|
239 * Unique ID of the database log message.
|
Chris@0
|
240 *
|
Chris@0
|
241 * @return array
|
Chris@0
|
242 * If the ID is located in the Database Logging table, a build array in the
|
Chris@16
|
243 * format expected by \Drupal\Core\Render\RendererInterface::render().
|
Chris@0
|
244 */
|
Chris@0
|
245 public function eventDetails($event_id) {
|
Chris@0
|
246 $build = [];
|
Chris@0
|
247 if ($dblog = $this->database->query('SELECT w.*, u.uid FROM {watchdog} w LEFT JOIN {users} u ON u.uid = w.uid WHERE w.wid = :id', [':id' => $event_id])->fetchObject()) {
|
Chris@0
|
248 $severity = RfcLogLevel::getLevels();
|
Chris@0
|
249 $message = $this->formatMessage($dblog);
|
Chris@0
|
250 $username = [
|
Chris@0
|
251 '#theme' => 'username',
|
Chris@0
|
252 '#account' => $dblog->uid ? $this->userStorage->load($dblog->uid) : User::getAnonymousUser(),
|
Chris@0
|
253 ];
|
Chris@0
|
254 $rows = [
|
Chris@0
|
255 [
|
Chris@0
|
256 ['data' => $this->t('Type'), 'header' => TRUE],
|
Chris@0
|
257 $this->t($dblog->type),
|
Chris@0
|
258 ],
|
Chris@0
|
259 [
|
Chris@0
|
260 ['data' => $this->t('Date'), 'header' => TRUE],
|
Chris@0
|
261 $this->dateFormatter->format($dblog->timestamp, 'long'),
|
Chris@0
|
262 ],
|
Chris@0
|
263 [
|
Chris@0
|
264 ['data' => $this->t('User'), 'header' => TRUE],
|
Chris@0
|
265 ['data' => $username],
|
Chris@0
|
266 ],
|
Chris@0
|
267 [
|
Chris@0
|
268 ['data' => $this->t('Location'), 'header' => TRUE],
|
Chris@18
|
269 $this->createLink($dblog->location),
|
Chris@0
|
270 ],
|
Chris@0
|
271 [
|
Chris@0
|
272 ['data' => $this->t('Referrer'), 'header' => TRUE],
|
Chris@18
|
273 $this->createLink($dblog->referer),
|
Chris@0
|
274 ],
|
Chris@0
|
275 [
|
Chris@0
|
276 ['data' => $this->t('Message'), 'header' => TRUE],
|
Chris@0
|
277 $message,
|
Chris@0
|
278 ],
|
Chris@0
|
279 [
|
Chris@0
|
280 ['data' => $this->t('Severity'), 'header' => TRUE],
|
Chris@0
|
281 $severity[$dblog->severity],
|
Chris@0
|
282 ],
|
Chris@0
|
283 [
|
Chris@0
|
284 ['data' => $this->t('Hostname'), 'header' => TRUE],
|
Chris@0
|
285 $dblog->hostname,
|
Chris@0
|
286 ],
|
Chris@0
|
287 [
|
Chris@0
|
288 ['data' => $this->t('Operations'), 'header' => TRUE],
|
Chris@0
|
289 ['data' => ['#markup' => $dblog->link]],
|
Chris@0
|
290 ],
|
Chris@0
|
291 ];
|
Chris@0
|
292 $build['dblog_table'] = [
|
Chris@0
|
293 '#type' => 'table',
|
Chris@0
|
294 '#rows' => $rows,
|
Chris@0
|
295 '#attributes' => ['class' => ['dblog-event']],
|
Chris@0
|
296 '#attached' => [
|
Chris@0
|
297 'library' => ['dblog/drupal.dblog'],
|
Chris@0
|
298 ],
|
Chris@0
|
299 ];
|
Chris@0
|
300 }
|
Chris@0
|
301
|
Chris@0
|
302 return $build;
|
Chris@0
|
303 }
|
Chris@0
|
304
|
Chris@0
|
305 /**
|
Chris@0
|
306 * Builds a query for database log administration filters based on session.
|
Chris@0
|
307 *
|
Chris@0
|
308 * @return array|null
|
Chris@0
|
309 * An associative array with keys 'where' and 'args' or NULL if there were
|
Chris@0
|
310 * no filters set.
|
Chris@0
|
311 */
|
Chris@0
|
312 protected function buildFilterQuery() {
|
Chris@0
|
313 if (empty($_SESSION['dblog_overview_filter'])) {
|
Chris@0
|
314 return;
|
Chris@0
|
315 }
|
Chris@0
|
316
|
Chris@0
|
317 $this->moduleHandler->loadInclude('dblog', 'admin.inc');
|
Chris@0
|
318
|
Chris@0
|
319 $filters = dblog_filters();
|
Chris@0
|
320
|
Chris@0
|
321 // Build query.
|
Chris@0
|
322 $where = $args = [];
|
Chris@0
|
323 foreach ($_SESSION['dblog_overview_filter'] as $key => $filter) {
|
Chris@0
|
324 $filter_where = [];
|
Chris@0
|
325 foreach ($filter as $value) {
|
Chris@0
|
326 $filter_where[] = $filters[$key]['where'];
|
Chris@0
|
327 $args[] = $value;
|
Chris@0
|
328 }
|
Chris@0
|
329 if (!empty($filter_where)) {
|
Chris@0
|
330 $where[] = '(' . implode(' OR ', $filter_where) . ')';
|
Chris@0
|
331 }
|
Chris@0
|
332 }
|
Chris@0
|
333 $where = !empty($where) ? implode(' AND ', $where) : '';
|
Chris@0
|
334
|
Chris@0
|
335 return [
|
Chris@0
|
336 'where' => $where,
|
Chris@0
|
337 'args' => $args,
|
Chris@0
|
338 ];
|
Chris@0
|
339 }
|
Chris@0
|
340
|
Chris@0
|
341 /**
|
Chris@0
|
342 * Formats a database log message.
|
Chris@0
|
343 *
|
Chris@0
|
344 * @param object $row
|
Chris@0
|
345 * The record from the watchdog table. The object properties are: wid, uid,
|
Chris@0
|
346 * severity, type, timestamp, message, variables, link, name.
|
Chris@0
|
347 *
|
Chris@0
|
348 * @return string|\Drupal\Core\StringTranslation\TranslatableMarkup|false
|
Chris@0
|
349 * The formatted log message or FALSE if the message or variables properties
|
Chris@0
|
350 * are not set.
|
Chris@0
|
351 */
|
Chris@0
|
352 public function formatMessage($row) {
|
Chris@0
|
353 // Check for required properties.
|
Chris@0
|
354 if (isset($row->message, $row->variables)) {
|
Chris@0
|
355 $variables = @unserialize($row->variables);
|
Chris@0
|
356 // Messages without variables or user specified text.
|
Chris@0
|
357 if ($variables === NULL) {
|
Chris@0
|
358 $message = Xss::filterAdmin($row->message);
|
Chris@0
|
359 }
|
Chris@0
|
360 elseif (!is_array($variables)) {
|
Chris@0
|
361 $message = $this->t('Log data is corrupted and cannot be unserialized: @message', ['@message' => Xss::filterAdmin($row->message)]);
|
Chris@0
|
362 }
|
Chris@0
|
363 // Message to translate with injected variables.
|
Chris@0
|
364 else {
|
Chris@0
|
365 $message = $this->t(Xss::filterAdmin($row->message), $variables);
|
Chris@0
|
366 }
|
Chris@0
|
367 }
|
Chris@0
|
368 else {
|
Chris@0
|
369 $message = FALSE;
|
Chris@0
|
370 }
|
Chris@0
|
371 return $message;
|
Chris@0
|
372 }
|
Chris@0
|
373
|
Chris@0
|
374 /**
|
Chris@18
|
375 * Creates a Link object if the provided URI is valid.
|
Chris@18
|
376 *
|
Chris@18
|
377 * @param string|null $uri
|
Chris@18
|
378 * The uri string to convert into link if valid.
|
Chris@18
|
379 *
|
Chris@18
|
380 * @return \Drupal\Core\Link|string|null
|
Chris@18
|
381 * Return a Link object if the uri can be converted as a link. In case of
|
Chris@18
|
382 * empty uri or invalid, fallback to the provided $uri.
|
Chris@18
|
383 */
|
Chris@18
|
384 protected function createLink($uri) {
|
Chris@18
|
385 if (UrlHelper::isValid($uri, TRUE)) {
|
Chris@18
|
386 return new Link($uri, Url::fromUri($uri));
|
Chris@18
|
387 }
|
Chris@18
|
388 return $uri;
|
Chris@18
|
389 }
|
Chris@18
|
390
|
Chris@18
|
391 /**
|
Chris@0
|
392 * Shows the most frequent log messages of a given event type.
|
Chris@0
|
393 *
|
Chris@0
|
394 * Messages are not truncated on this page because events detailed herein do
|
Chris@0
|
395 * not have links to a detailed view.
|
Chris@0
|
396 *
|
Chris@0
|
397 * @param string $type
|
Chris@0
|
398 * Type of database log events to display (e.g., 'search').
|
Chris@0
|
399 *
|
Chris@0
|
400 * @return array
|
Chris@16
|
401 * A build array in the format expected by
|
Chris@16
|
402 * \Drupal\Core\Render\RendererInterface::render().
|
Chris@0
|
403 */
|
Chris@0
|
404 public function topLogMessages($type) {
|
Chris@0
|
405 $header = [
|
Chris@0
|
406 ['data' => $this->t('Count'), 'field' => 'count', 'sort' => 'desc'],
|
Chris@0
|
407 ['data' => $this->t('Message'), 'field' => 'message'],
|
Chris@0
|
408 ];
|
Chris@0
|
409
|
Chris@0
|
410 $count_query = $this->database->select('watchdog');
|
Chris@0
|
411 $count_query->addExpression('COUNT(DISTINCT(message))');
|
Chris@0
|
412 $count_query->condition('type', $type);
|
Chris@0
|
413
|
Chris@0
|
414 $query = $this->database->select('watchdog', 'w')
|
Chris@0
|
415 ->extend('\Drupal\Core\Database\Query\PagerSelectExtender')
|
Chris@0
|
416 ->extend('\Drupal\Core\Database\Query\TableSortExtender');
|
Chris@0
|
417 $query->addExpression('COUNT(wid)', 'count');
|
Chris@0
|
418 $query = $query
|
Chris@0
|
419 ->fields('w', ['message', 'variables'])
|
Chris@0
|
420 ->condition('w.type', $type)
|
Chris@0
|
421 ->groupBy('message')
|
Chris@0
|
422 ->groupBy('variables')
|
Chris@0
|
423 ->limit(30)
|
Chris@0
|
424 ->orderByHeader($header);
|
Chris@0
|
425 $query->setCountQuery($count_query);
|
Chris@0
|
426 $result = $query->execute();
|
Chris@0
|
427
|
Chris@0
|
428 $rows = [];
|
Chris@0
|
429 foreach ($result as $dblog) {
|
Chris@0
|
430 if ($message = $this->formatMessage($dblog)) {
|
Chris@0
|
431 $rows[] = [$dblog->count, $message];
|
Chris@0
|
432 }
|
Chris@0
|
433 }
|
Chris@0
|
434
|
Chris@17
|
435 $build['dblog_top_table'] = [
|
Chris@0
|
436 '#type' => 'table',
|
Chris@0
|
437 '#header' => $header,
|
Chris@0
|
438 '#rows' => $rows,
|
Chris@0
|
439 '#empty' => $this->t('No log messages available.'),
|
Chris@0
|
440 '#attached' => [
|
Chris@0
|
441 'library' => ['dblog/drupal.dblog'],
|
Chris@0
|
442 ],
|
Chris@0
|
443 ];
|
Chris@0
|
444 $build['dblog_top_pager'] = ['#type' => 'pager'];
|
Chris@0
|
445
|
Chris@0
|
446 return $build;
|
Chris@0
|
447 }
|
Chris@0
|
448
|
Chris@0
|
449 }
|