data
8 years ago
export
8 years ago
import
8 years ago
logs
8 years ago
views
8 years ago
class-settings-api.php
8 years ago
class-settings-data.php
8 years ago
class-settings-export.php
8 years ago
class-settings-import.php
8 years ago
class-settings-logs.php
8 years ago
class-settings-system-info.php
8 years ago
class-settings-logs.php
108 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Give Settings Page/Tab |
| 4 | * |
| 5 | * @package Give |
| 6 | * @subpackage Classes/Give_Settings_Logs |
| 7 | * @copyright Copyright (c) 2016, WordImpress |
| 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | * @since 1.8 |
| 10 | */ |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; // Exit if accessed directly |
| 14 | } |
| 15 | |
| 16 | if ( ! class_exists( 'Give_Settings_Logs' ) ) : |
| 17 | |
| 18 | /** |
| 19 | * Give_Settings_Logs. |
| 20 | * |
| 21 | * @sine 1.8 |
| 22 | */ |
| 23 | class Give_Settings_Logs extends Give_Settings_Page { |
| 24 | /** |
| 25 | * Flag to check if enable saving option for setting page or not |
| 26 | * |
| 27 | * @since 1.8.17 |
| 28 | * @var bool |
| 29 | */ |
| 30 | protected $enable_save = false; |
| 31 | |
| 32 | /** |
| 33 | * Constructor. |
| 34 | */ |
| 35 | public function __construct() { |
| 36 | $this->id = 'logs'; |
| 37 | $this->label = __( 'Logs', 'give' ); |
| 38 | |
| 39 | $this->default_tab = 'sales'; |
| 40 | |
| 41 | parent::__construct(); |
| 42 | |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Get settings array. |
| 47 | * |
| 48 | * @since 1.8 |
| 49 | * @return array |
| 50 | */ |
| 51 | public function get_settings() { |
| 52 | // Get settings. |
| 53 | $settings = apply_filters( 'give_settings_logs', array( |
| 54 | array( |
| 55 | 'id' => 'give_tools_logs', |
| 56 | 'type' => 'title', |
| 57 | 'table_html' => false, |
| 58 | ), |
| 59 | array( |
| 60 | 'id' => 'logs', |
| 61 | 'name' => __( 'Log', 'give' ), |
| 62 | 'type' => 'logs', |
| 63 | |
| 64 | ), |
| 65 | array( |
| 66 | 'id' => 'give_tools_logs', |
| 67 | 'type' => 'sectionend', |
| 68 | 'table_html' => false, |
| 69 | ), |
| 70 | ) ); |
| 71 | |
| 72 | /** |
| 73 | * Filter the settings. |
| 74 | * |
| 75 | * @since 1.8 |
| 76 | * |
| 77 | * @param array $settings |
| 78 | */ |
| 79 | $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
| 80 | |
| 81 | // Output. |
| 82 | return $settings; |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Get sections. |
| 87 | * |
| 88 | * @since 1.8 |
| 89 | * @return array |
| 90 | */ |
| 91 | public function get_sections() { |
| 92 | $sections = array( |
| 93 | 'sales' => __( 'Donations', 'give' ), |
| 94 | 'gateway_errors' => __( 'Payment Errors', 'give' ), |
| 95 | 'api_requests' => __( 'API Requests', 'give' ), |
| 96 | 'updates' => __( 'Updates', 'give' ), |
| 97 | ); |
| 98 | |
| 99 | $sections = apply_filters( 'give_log_views', $sections ); |
| 100 | |
| 101 | return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | endif; |
| 106 | |
| 107 | return new Give_Settings_Logs(); |
| 108 |