Fix option to add field paths or rule paths to both module or plugin external forms.

This commit is contained in:
2022-02-04 19:21:10 +02:00
parent 2ce36117d4
commit 8219d5ed45
8 changed files with 292 additions and 237 deletions

View File

@ -28560,37 +28560,46 @@ function vdm_dkim() {
{
// default to the field set name
$label = $fieldset;
if (isset(
$module->fieldsets_label[$field_name . $fieldset]
))
if (isset($module->fieldsets_label[$field_name . $fieldset]))
{
$label = $module->fieldsets_label[$field_name
. $fieldset];
$label = $module->fieldsets_label[$field_name . $fieldset];
}
// add path to module rules and custom fields
if (isset($module->fieldsets_paths[$field_name . $fieldset])
&& $module->fieldsets_paths[$field_name . $fieldset]
== 2)
&& ($module->fieldsets_paths[$field_name . $fieldset] == 2
|| $module->fieldsets_paths[$field_name . $fieldset] == 3))
{
if ($module->target == 2)
{
$module->add_rule_path[$field_name . $fieldset][] =
'/administrator/modules/'
. $module->file_name . '/rules';
if (!isset($module->add_rule_path[$field_name . $fieldset]))
{
$module->add_rule_path[$field_name . $fieldset] =
'/administrator/modules/'
. $module->file_name . '/rules';
}
$module->add_field_path[$field_name . $fieldset][] =
'/administrator/modules/'
. $module->file_name . '/fields';
if (!isset($module->add_field_path[$field_name . $fieldset]))
{
$module->add_field_path[$field_name . $fieldset] =
'/administrator/modules/'
. $module->file_name . '/fields';
}
}
else
{
$module->add_rule_path[$field_name . $fieldset][] =
'/modules/' . $module->file_name
. '/rules';
if (!isset($module->add_rule_path[$field_name . $fieldset]))
{
$module->add_rule_path[$field_name . $fieldset] =
'/modules/' . $module->file_name
. '/rules';
}
$module->add_field_path[$field_name . $fieldset][] =
'/modules/' . $module->file_name
. '/fields';
if (!isset($module->add_field_path[$field_name . $fieldset]))
{
$module->add_field_path[$field_name . $fieldset] =
'/modules/' . $module->file_name
. '/fields';
}
}
}
// add path to module rules and custom fields
@ -28607,20 +28616,14 @@ function vdm_dkim() {
if (isset($module->add_rule_path[$field_name . $fieldset]))
{
foreach ($module->add_rule_path[$field_name . $fieldset] as $path)
{
$xml .= PHP_EOL . $this->_t(2)
. 'addrulepath="' . $path . '"';
}
$xml .= PHP_EOL . $this->_t(2)
. 'addrulepath="' . $module->add_rule_path[$field_name . $fieldset] . '"';
}
if (isset($module->add_field_path[$field_name . $fieldset]))
{
foreach ($module->add_field_path[$field_name . $fieldset] as $path)
{
$xml .= PHP_EOL . $this->_t(2)
. 'addfieldpath="' . $path . '"';
}
$xml .= PHP_EOL . $this->_t(2)
. 'addfieldpath="' . $module->add_field_path[$field_name . $fieldset] . '"';
}
$xml .= PHP_EOL . $this->_t(1) . '>';
@ -28950,28 +28953,30 @@ function vdm_dkim() {
{
// default to the field set name
$label = $fieldset;
if (isset(
$plugin->fieldsets_label[$field_name . $fieldset]
))
if (isset($plugin->fieldsets_label[$field_name . $fieldset]))
{
$label = $plugin->fieldsets_label[$field_name
. $fieldset];
$label = $plugin->fieldsets_label[$field_name . $fieldset];
}
// add path to plugin rules and custom fields
if (isset($plugin->fieldsets_paths[$field_name . $fieldset])
&& $plugin->fieldsets_paths[$field_name . $fieldset]
== 2)
&& ($plugin->fieldsets_paths[$field_name . $fieldset] == 2
|| $plugin->fieldsets_paths[$field_name . $fieldset] == 3))
{
$plugin->add_rule_path[$field_name . $fieldset][] =
'/plugins/' . strtolower($plugin->group
) . '/' . strtolower($plugin->code_name)
. '/rules';
if (!isset($plugin->add_rule_path[$field_name . $fieldset]))
{
$plugin->add_rule_path[$field_name . $fieldset] =
'/plugins/' . strtolower($plugin->group
) . '/' . strtolower($plugin->code_name)
. '/rules';
}
$plugin->add_field_path[$field_name . $fieldset][] =
'/plugins/' . strtolower($plugin->group
) . '/' . strtolower($plugin->code_name)
. '/fields';
if (!isset($plugin->add_field_path[$field_name . $fieldset]))
{
$plugin->add_field_path[$field_name . $fieldset] =
'/plugins/' . strtolower($plugin->group
) . '/' . strtolower($plugin->code_name)
. '/fields';
}
}
// add path to plugin rules and custom fields
if (isset($plugin->add_rule_path[$field_name . $fieldset])
@ -28986,20 +28991,14 @@ function vdm_dkim() {
if (isset($plugin->add_rule_path[$field_name . $fieldset]))
{
foreach ($plugin->add_rule_path[$field_name . $fieldset] as $path)
{
$xml .= PHP_EOL . $this->_t(2)
. 'addrulepath="' . $path . '"';
}
$xml .= PHP_EOL . $this->_t(2)
. 'addrulepath="' . $plugin->add_rule_path[$field_name . $fieldset] . '"';
}
if (isset($plugin->add_field_path[$field_name . $fieldset]))
{
foreach ($plugin->add_field_path[$field_name . $fieldset] as $path)
{
$xml .= PHP_EOL . $this->_t(2)
. 'addfieldpath="' . $path . '"';
}
$xml .= PHP_EOL . $this->_t(2)
. 'addfieldpath="' . $plugin->add_field_path[$field_name . $fieldset] . '"';
}
$xml .= PHP_EOL . $this->_t(1) . '>';