mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
WIP: Backup upload
This commit is contained in:
parent
40958ae69d
commit
c1337a4318
@ -13,10 +13,9 @@
|
|||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
// Load global vars
|
// Load global vars
|
||||||
// TESTING
|
// TESTING
|
||||||
/*
|
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
ini_set('display_startup_errors', 1);
|
ini_set('display_startup_errors', 1);
|
||||||
error_reporting(E_ALL); */
|
error_reporting(E_ALL);
|
||||||
$cipotes = false;
|
$cipotes = false;
|
||||||
// END
|
// END
|
||||||
global $config;
|
global $config;
|
||||||
@ -74,13 +73,13 @@ if (is_ajax()) {
|
|||||||
// Run.
|
// Run.
|
||||||
$manageBlock->run();
|
$manageBlock->run();
|
||||||
|
|
||||||
// List all Module Block
|
|
||||||
// Show the id_np selected
|
|
||||||
// Create new id_np
|
|
||||||
if ($id_np == 0) {
|
if ($id_np == 0) {
|
||||||
|
// Create new id_np
|
||||||
$manageBlock->moduleTemplateForm();
|
$manageBlock->moduleTemplateForm();
|
||||||
echo 'hola';
|
} else if ($id_np > 0) {
|
||||||
|
// Show the id_np selected
|
||||||
} else {
|
} else {
|
||||||
|
// List all Module Block
|
||||||
$manageBlock->moduleBlockList();
|
$manageBlock->moduleBlockList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,13 @@ class ManageBlock extends HTML
|
|||||||
*/
|
*/
|
||||||
private $resultModuleBlocksTable;
|
private $resultModuleBlocksTable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base URL for internal purposes
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $baseUrl;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -108,6 +115,9 @@ class ManageBlock extends HTML
|
|||||||
|
|
||||||
$this->ajaxController = $ajax_controller;
|
$this->ajaxController = $ajax_controller;
|
||||||
|
|
||||||
|
// Set baseUrl for use it in several locations in this class
|
||||||
|
$this->baseUrl = 'index.php?sec=gmodules&sec2=godmode/modules/manage_block_templates';
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +216,7 @@ class ManageBlock extends HTML
|
|||||||
foreach ($this->resultModuleBlocksTable as $row) {
|
foreach ($this->resultModuleBlocksTable as $row) {
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = html_print_checkbox_extended('delete_multiple[]', $row['id_np'], false, false, '', 'class="check_delete"', true);
|
$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_block_templates&id_np='.$row['id_np'].'">'.io_safe_output($row['name']).'</a>';
|
$data[1] = '<a href="'.$this->baseUrl.'&id_np='.$row['id_np'].'">'.io_safe_output($row['name']).'</a>';
|
||||||
$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(
|
||||||
@ -225,12 +235,14 @@ 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_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="'.$this->baseUrl.'&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'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV')]).'</a>';
|
$data[3] .= '<a href="'.$this->baseUrl.'&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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sé que los echo son basurientos, pero de momento, me valen para ir montando
|
||||||
|
// LOS QUITARÉ, PROMESA DE CORONAVIRUS
|
||||||
echo html_print_table($table, true);
|
echo html_print_table($table, true);
|
||||||
|
|
||||||
echo '<div style="float:right;" class="">';
|
echo '<div style="float:right;" class="">';
|
||||||
@ -239,7 +251,7 @@ class ManageBlock extends HTML
|
|||||||
[
|
[
|
||||||
'form' => [
|
'form' => [
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'action' => 'index.php?sec=gmodules&sec2=godmode/modules/manage_block_templates',
|
'action' => $this->baseUrl,
|
||||||
],
|
],
|
||||||
'inputs' => [
|
'inputs' => [
|
||||||
[
|
[
|
||||||
@ -260,4 +272,43 @@ class ManageBlock extends HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prints Form for template
|
||||||
|
*
|
||||||
|
* @param integer $id_np If not carried
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function moduleTemplateForm(int $id_np=0)
|
||||||
|
{
|
||||||
|
if ($id_np == 0) {
|
||||||
|
$formButtonName = 'crt';
|
||||||
|
$formButtonLabel = __('Create');
|
||||||
|
} else {
|
||||||
|
$formButtonName = 'upd';
|
||||||
|
$formButtonLabel = __('Update');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->printForm(
|
||||||
|
[
|
||||||
|
'form' => [
|
||||||
|
'method' => 'POST',
|
||||||
|
'action' => $this->baseUrl,
|
||||||
|
],
|
||||||
|
'inputs' => [
|
||||||
|
[
|
||||||
|
'class' => 'w100p',
|
||||||
|
'arguments' => [
|
||||||
|
'name' => $formButtonName,
|
||||||
|
'label' => $formButtonLabel,
|
||||||
|
'type' => 'submit',
|
||||||
|
'attributes' => 'class="sub next"',
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user