-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcontroller.php
65 lines (50 loc) · 1.7 KB
/
controller.php
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
<?php
/**
*
* @author Krios Mane - FABteam
* @version 0.10.0
* @license https://opensource.org/licenses/GPL-3.0
*
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Plugin_fab_system_logs extends FAB_Controller {
function __construct()
{
parent::__construct();
if(!$this->input->is_cli_request()){ //avoid this form command line
}
}
public function index()
{
$this->load->library('smart');
$this->load->helper(array('form', 'fabtotum_helper', 'plugin_helper'));
//load plugin translation
loadPluginTranslation('fab_system_logs', 'fab_system_logs');
$data = array();
$widgetOptions = array(
'sortable' => false, 'fullscreenbutton' => true, 'refreshbutton' => false, 'togglebutton' => false,
'deletebutton' => false, 'editbutton' => false, 'colorbutton' => false, 'collapsed' => false
);
$widgeFooterButtons = '';
$widget = $this->smart->create_widget($widgetOptions);
$widget->id = 'main-widget-system-logs';
$widget->header = array('icon' => 'fa-files-o', "title" => "<h2>".dgettext("fab_system_logs", "System logs")."</h2>");
$widget->body = array('content' => $this->load->view(plugin_url('main_widget'), $data, true ), 'class'=>'');
$this->addJsInLine($this->load->view(plugin_url('js'), $data, true));
$this->content = $widget->print_html(true);
$this->view();
}
/**
*
*/
public function download()
{
$this->load->helper('plugin_helper');
$this->load->helper('download');
$this->load->config('fabtotum');
$archive = $this->config->item('temp_path').'archive.tar.gz';
startPluginBashScript('compress_log_files.sh', $archive, false, true);
force_download($archive, null);
}
}
?>