1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
<?php
namespace TotalPoll\Admin\Log; ! defined( 'ABSPATH' ) && exit();
use TotalPollVendors\TotalCore\Admin\Pages\Page as TotalCoreAdminPage;
/** * Class Page * @package TotalPoll\Admin\Log */ class Page extends TotalCoreAdminPage { /** * Page assets. */ public function assets() { /** * @asset-script totalpoll-admin-log */ wp_enqueue_script( 'totalpoll-admin-log' ); /** * @asset-style totalpoll-admin-log */ wp_enqueue_style( 'totalpoll-admin-log' );
// Some variables for frontend controller wp_localize_script( 'totalpoll-admin-log', 'TotalPollLog', [ 'pollId' => $this->request->query( 'poll' ) ] ); }
/** * Page content. */ public function render() { /** * Filters the list of columns in log browser. * * @param array $columns Array of columns. * * @return array * @since 4.0.0 */ $columns = apply_filters( 'totalpoll/filters/admin/log/columns', [ 'status' => [ 'label' => __( 'Status', 'totalpoll' ), 'default' => true, ], 'action' => [ 'label' => __( 'Action', 'totalpoll' ), 'default' => true, ], 'date' => [ 'label' => __( 'Date', 'totalpoll' ), 'default' => true, ], 'ip' => [ 'label' => __( 'IP', 'totalpoll' ), 'default' => true, ], 'browser' => [ 'label' => __( 'Browser', 'totalpoll' ), 'default' => true, ], 'poll' => [ 'label' => __( 'Poll', 'totalpoll' ), 'default' => true, ], 'user_name' => [ 'label' => __( 'User name', 'totalpoll' ), 'default' => false, ], 'user_id' => [ 'label' => __( 'User ID', 'totalpoll' ), 'default' => false, ], 'user_login' => [ 'label' => __( 'User login', 'totalpoll' ), 'default' => true, ], 'user_email' => [ 'label' => __( 'User email', 'totalpoll' ), 'default' => false, ], 'details' => [ 'label' => __( 'Details', 'totalpoll' ), 'default' => false, 'compact' => true ], ] ); /** * * Filters the list of available formats that can be used for export. * * @param array $formats Array of formats [id => label]. * * @return array * @since 4.0.0 */ $formats = apply_filters( 'totalpoll/filters/admin/log/formats', [ 'html' => __( 'HTML', 'totalpoll' ), 'csv' => __( 'CSV', 'totalpoll' ), 'json' => __( 'JSON', 'totalpoll' ), ] );
include __DIR__ . '/views/index.php'; } }
|