Skip to content

Commit bad96df

Browse files
committed
fix: add campi personalizzati
1 parent 72c5fde commit bad96df

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

modules/custom_fields/actions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
break;
4141

4242
case 'add':
43-
$plugin = post('plugin_id') ?: null;
44-
$module = $plugin ? null : post('module_id');
43+
$plugin = post('plugin_id_add') ?: null;
44+
$module = $plugin ? null : post('module_id_add');
4545

4646
$dbo->insert('zz_fields', [
4747
'id_module' => $module,
4848
'id_plugin' => $plugin,
49-
'name' => post('name'),
50-
'content' => $_POST['content'],
49+
'name' => post('name_add'),
50+
'content' => $_POST['content_add'],
5151
'html_name' => secure_random_string(8),
5252
]);
5353
$id_record = $dbo->lastInsertedID();

modules/custom_fields/add.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525

2626
<div class="row">
2727
<div class="col-md-6">
28-
{[ "type": "select", "label": "<?php echo tr('Modulo'); ?>", "name": "module_id", "values": "query=SELECT `zz_modules`.`id`, `title` as text FROM `zz_modules` LEFT JOIN `zz_modules_lang` ON (`zz_modules`.`id` = `zz_modules_lang`.`id_record` AND `zz_modules_lang`.`id_lang` = <?php echo prepare(Models\Locale::getDefault()->id); ?>) WHERE `enabled` = 1" ]}
28+
{[ "type": "select", "label": "<?php echo tr('Modulo'); ?>", "name": "module_id_add", "values": "query=SELECT `zz_modules`.`id`, `title` as text FROM `zz_modules` LEFT JOIN `zz_modules_lang` ON (`zz_modules`.`id` = `zz_modules_lang`.`id_record` AND `zz_modules_lang`.`id_lang` = <?php echo prepare(Models\Locale::getDefault()->id); ?>) WHERE `enabled` = 1" ]}
2929
</div>
3030

3131
<div class="col-md-6">
32-
{[ "type": "select", "label": "<?php echo tr('Plugin'); ?>", "name": "plugin_id", "values": "query=SELECT `zz_plugins`.`id`, `title` as text FROM `zz_plugins` LEFT JOIN `zz_plugins_lang` ON (`zz_plugins`.`id` = `zz_plugins_lang`.`id_record` AND `zz_plugins_lang`.`id_lang` = <?php echo prepare(Models\Locale::getDefault()->id); ?>) WHERE `enabled` = 1" ]}
32+
{[ "type": "select", "label": "<?php echo tr('Plugin'); ?>", "name": "plugin_id_add", "values": "query=SELECT `zz_plugins`.`id`, `title` as text FROM `zz_plugins` LEFT JOIN `zz_plugins_lang` ON (`zz_plugins`.`id` = `zz_plugins_lang`.`id_record` AND `zz_plugins_lang`.`id_lang` = <?php echo prepare(Models\Locale::getDefault()->id); ?>) WHERE `enabled` = 1" ]}
3333
</div>
3434
</div>
3535

3636
<div class="row">
3737
<div class="col-md-12">
38-
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "name", "required": 1 ]}
38+
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "name_add", "required": 1 ]}
3939
</div>
4040
</div>
4141

@@ -45,7 +45,7 @@
4545
echo input([
4646
'type' => 'textarea',
4747
'label' => tr('Codice'),
48-
'name' => 'content',
48+
'name' => 'content_add',
4949
'required' => 1,
5050
'value' => '{[ "type": "text", "label": "|label|", "name": "|name|", "value": "|value|" ]}',
5151
]);

0 commit comments

Comments
 (0)