mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
WIP: Backup upload
This commit is contained in:
parent
4040d1a0e3
commit
40958ae69d
@ -12,6 +12,13 @@
|
|||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
// Load global vars
|
// Load global vars
|
||||||
|
// TESTING
|
||||||
|
/*
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
ini_set('display_startup_errors', 1);
|
||||||
|
error_reporting(E_ALL); */
|
||||||
|
$cipotes = false;
|
||||||
|
// END
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
check_login();
|
check_login();
|
||||||
@ -25,12 +32,8 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ini_set('display_errors', 1);
|
|
||||||
ini_set('display_startup_errors', 1);
|
|
||||||
error_reporting(E_ALL);
|
|
||||||
|
|
||||||
require_once $config['homedir'].'/include/class/ManageBlock.class.php';
|
require_once $config['homedir'].'/include/class/ManageBlock.class.php';
|
||||||
// $ajaxPage = ENTERPRISE_DIR.'/godmode/agentes/ManageBlock';
|
$ajaxPage = ENTERPRISE_DIR.'/godmode/agentes/ManageBlock';
|
||||||
// Control call flow.
|
// Control call flow.
|
||||||
try {
|
try {
|
||||||
// User access and validation is being processed on class constructor.
|
// User access and validation is being processed on class constructor.
|
||||||
@ -66,6 +69,18 @@ if (is_ajax()) {
|
|||||||
// Stop any execution.
|
// Stop any execution.
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
|
// Get all parameters
|
||||||
|
$id_np = get_parameter('id_np', '');
|
||||||
// Run.
|
// Run.
|
||||||
$manageBlock->run();
|
$manageBlock->run();
|
||||||
|
|
||||||
|
// List all Module Block
|
||||||
|
// Show the id_np selected
|
||||||
|
// Create new id_np
|
||||||
|
if ($id_np == 0) {
|
||||||
|
$manageBlock->moduleTemplateForm();
|
||||||
|
echo 'hola';
|
||||||
|
} else {
|
||||||
|
$manageBlock->moduleBlockList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Module Block feature.
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @package Pandora FMS
|
||||||
|
* @subpackage SNMP
|
||||||
|
* @version 0.0.1
|
||||||
|
* @license See below
|
||||||
|
*
|
||||||
|
* ______ ___ _______ _______ ________
|
||||||
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||||
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||||
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||||
|
*
|
||||||
|
* ============================================================================
|
||||||
|
* Copyright (c) 2005-2020 Artica Soluciones Tecnologicas
|
||||||
|
* Please see http://pandorafms.org for full contribution list
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation for version 2.
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
* ============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
// Pandora FMS - http://pandorafms.com
|
|
||||||
// ==================================================
|
|
||||||
// Copyright (c) 2005-2020 Artica Soluciones Tecnologicas
|
|
||||||
// Please see http://pandorafms.org for full contribution list
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License
|
|
||||||
// as published by the Free Software Foundation for version 2.
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
require_once $config['homedir'].'/include/class/HTML.class.php';
|
require_once $config['homedir'].'/include/class/HTML.class.php';
|
||||||
@ -140,8 +155,7 @@ class ManageBlock extends HTML
|
|||||||
|
|
||||||
ui_pagination($this->countNetworkTemplates, false, $this->offset);
|
ui_pagination($this->countNetworkTemplates, false, $this->offset);
|
||||||
|
|
||||||
echo $this->moduleBlockList();
|
// echo $this->moduleBlockList();
|
||||||
|
|
||||||
// $this->printForm(
|
// $this->printForm(
|
||||||
// [
|
// [
|
||||||
// 'form' => $form,
|
// 'form' => $form,
|
||||||
@ -154,7 +168,7 @@ class ManageBlock extends HTML
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Undocumented function
|
* Create
|
||||||
*
|
*
|
||||||
* @return html Formed table
|
* @return html Formed table
|
||||||
*/
|
*/
|
||||||
@ -189,14 +203,11 @@ class ManageBlock extends HTML
|
|||||||
|
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
|
|
||||||
hd($this->resultModuleBlocksTable);
|
|
||||||
|
|
||||||
foreach ($this->resultModuleBlocksTable as $row) {
|
foreach ($this->resultModuleBlocksTable as $row) {
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = $row['id_np'];
|
$data[0] = html_print_checkbox_extended('delete_multiple[]', $row['id_np'], false, false, '', 'class="check_delete"', true);
|
||||||
$data[1] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$row['id_np'].'">'.io_safe_output($row['name']).'</a>';
|
$data[1] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_block_templates&id_np='.$row['id_np'].'">'.io_safe_output($row['name']).'</a>';
|
||||||
$data[2] = 'description';
|
$data[2] = ui_print_truncate_text(io_safe_output($row['description']), 'description', true, true, true, '[…]');
|
||||||
// $data[2] = ui_print_truncate_text(io_safe_output($row['description']), 'description', true, true, true, '[…]');
|
|
||||||
$table->cellclass[][3] = 'action_buttons';
|
$table->cellclass[][3] = 'action_buttons';
|
||||||
$data[3] = html_print_input_image(
|
$data[3] = html_print_input_image(
|
||||||
'delete_profile',
|
'delete_profile',
|
||||||
@ -214,16 +225,38 @@ class ManageBlock extends HTML
|
|||||||
true,
|
true,
|
||||||
['title' => 'Export to CSV']
|
['title' => 'Export to CSV']
|
||||||
);
|
);
|
||||||
$data[3] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&delete_profile=1&delete_profile='.$row['id_np'].'" '.'onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
|
$data[3] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_block_templates'.'&delete_profile=1&delete_profile='.$row['id_np'].'" '.'onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
|
||||||
$data[3] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV')]).'</a>';
|
$data[3] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_block_templates'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV')]).'</a>';
|
||||||
|
|
||||||
array_push($table->data, $data);
|
array_push($table->data, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = '<div style="margin-top: 40px; text-align: center;"><span style="font-size: 1.9em; font-family: "lato-bolder", "Open Sans", sans-serif !important;">'.__('Summary').'</span></div>';
|
echo html_print_table($table, true);
|
||||||
$output .= html_print_table($table, true).'</div>';
|
|
||||||
|
|
||||||
return $output;
|
echo '<div style="float:right;" class="">';
|
||||||
|
|
||||||
|
$this->printForm(
|
||||||
|
[
|
||||||
|
'form' => [
|
||||||
|
'method' => 'POST',
|
||||||
|
'action' => 'index.php?sec=gmodules&sec2=godmode/modules/manage_block_templates',
|
||||||
|
],
|
||||||
|
'inputs' => [
|
||||||
|
[
|
||||||
|
'class' => 'w100p',
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'crt',
|
||||||
|
'label' => __('Create'),
|
||||||
|
'type' => 'submit',
|
||||||
|
'attributes' => 'class="sub next"',
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user