diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 07f46e26d6..5e7b53da2a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -10545,18 +10545,54 @@ parameters: count: 1 path: src/Profiling.php + - + message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:checkboxCheck\(\) expects string, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/BoolPropertyItem.php + + - + message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/HiddenPropertyItem.php + + - + message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/NumberPropertyItem.php + - message: '#^Loose comparison via "\=\=" is not allowed\.$#' identifier: equal.notAllowed count: 1 path: src/Properties/Options/Items/RadioPropertyItem.php + - + message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/RadioPropertyItem.php + - message: '#^Loose comparison via "\=\=" is not allowed\.$#' identifier: equal.notAllowed count: 1 path: src/Properties/Options/Items/SelectPropertyItem.php + - + message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/SelectPropertyItem.php + + - + message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/TextPropertyItem.php + - message: '#^Loose comparison via "\=\=" is not allowed\.$#' identifier: equal.notAllowed diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 0ff2d14756..de6670db5d 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -5596,6 +5596,9 @@ getName()]]> getName()]]> + + + settings[$pluginType->value][$opt])]]> @@ -7186,48 +7189,60 @@ + + getName()]]> + getForce()]]> getForce()]]> getName()]]> getName()]]> getName()]]> - getName()]]> - + getName()]]> + + getName()]]> - + getName()]]> + + getName()]]> getName()]]> getName()]]> - + getName()]]> + + getName()]]> getName()]]> getName()]]> - + getName()]]> + + getName()]]> getName()]]> getName()]]> - + getName()]]> + + getName()]]> getName()]]> getName()]]> diff --git a/src/Plugins.php b/src/Plugins.php index af60173f21..a084f9b3ca 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -322,7 +322,7 @@ class Plugins $ret .= '
    • getName() !== null) { - $ret .= ' id="ul_' . $pluginName . '_' . $subgroupHeader->getName() . '">'; + $ret .= ' id="ul_' . $subgroupHeader->getName() . '">'; } else { $ret .= '>'; } diff --git a/src/Plugins/Export/ExportCodegen.php b/src/Plugins/Export/ExportCodegen.php index 46c23ea3a6..a8d3e20263 100644 --- a/src/Plugins/Export/ExportCodegen.php +++ b/src/Plugins/Export/ExportCodegen.php @@ -65,10 +65,10 @@ class ExportCodegen extends ExportPlugin // general options main group $generalOptions = new OptionsPropertyMainGroup('codegen_general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('codegen_structure_or_data'); $generalOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - 'format', + 'codegen_format', __('Format:'), ); $leaf->setValues(self::CODEGEN_FORMATS); diff --git a/src/Plugins/Export/ExportCsv.php b/src/Plugins/Export/ExportCsv.php index 4ec6467964..0b682d9845 100644 --- a/src/Plugins/Export/ExportCsv.php +++ b/src/Plugins/Export/ExportCsv.php @@ -65,41 +65,41 @@ class ExportCsv extends ExportPlugin $generalOptions = new OptionsPropertyMainGroup('csv_general_opts'); // create leaf items and add them to the group $leaf = new TextPropertyItem( - 'separator', + 'csv_separator', __('Columns separated with:'), ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'enclosed', + 'csv_enclosed', __('Columns enclosed with:'), ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'escaped', + 'csv_escaped', __('Columns escaped with:'), ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'terminated', + 'csv_terminated', __('Lines terminated with:'), ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'null', + 'csv_null', __('Replace NULL with:'), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'removeCRLF', + 'csv_removeCRLF', __('Remove carriage return/line feed characters within columns'), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'columns', + 'csv_columns', __('Put columns names in the first row'), ); $generalOptions->addProperty($leaf); - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('csv_structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); diff --git a/src/Plugins/Export/ExportExcel.php b/src/Plugins/Export/ExportExcel.php index d9441dcd38..9aa9c3985e 100644 --- a/src/Plugins/Export/ExportExcel.php +++ b/src/Plugins/Export/ExportExcel.php @@ -66,22 +66,22 @@ class ExportExcel extends ExportPlugin $generalOptions = new OptionsPropertyMainGroup('excel_general_opts'); // create primary items and add them to the group $leaf = new TextPropertyItem( - 'null', + 'excel_null', __('Replace NULL with:'), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'removeCRLF', + 'excel_removeCRLF', __('Remove carriage return/line feed characters within columns'), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'columns', + 'excel_columns', __('Put columns names in the first row'), ); $generalOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - 'edition', + 'excel_edition', __('Excel edition:'), ); $leaf->setValues( @@ -92,7 +92,7 @@ class ExportExcel extends ExportPlugin ], ); $generalOptions->addProperty($leaf); - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('excel_structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); diff --git a/src/Plugins/Export/ExportHtmlword.php b/src/Plugins/Export/ExportHtmlword.php index 9b5fc0246b..bef28cf758 100644 --- a/src/Plugins/Export/ExportHtmlword.php +++ b/src/Plugins/Export/ExportHtmlword.php @@ -68,7 +68,7 @@ class ExportHtmlword extends ExportPlugin __('Dump table'), ); // create primary items and add them to the group - $leaf = new RadioPropertyItem('structure_or_data'); + $leaf = new RadioPropertyItem('htmlword_structure_or_data'); $leaf->setValues( ['structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')], ); @@ -84,12 +84,12 @@ class ExportHtmlword extends ExportPlugin $dataOptions->setForce('structure'); // create primary items and add them to the group $leaf = new TextPropertyItem( - 'null', + 'htmlword_null', __('Replace NULL with:'), ); $dataOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'columns', + 'htmlword_columns', __('Put columns names in the first row'), ); $dataOptions->addProperty($leaf); diff --git a/src/Plugins/Export/ExportJson.php b/src/Plugins/Export/ExportJson.php index 9e3920b319..29e39690f2 100644 --- a/src/Plugins/Export/ExportJson.php +++ b/src/Plugins/Export/ExportJson.php @@ -80,17 +80,17 @@ class ExportJson extends ExportPlugin // general options main group $generalOptions = new OptionsPropertyMainGroup('json_general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('json_structure_or_data'); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'pretty_print', + 'json_pretty_print', __('Output pretty-printed JSON (Use human-readable formatting)'), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'unicode', + 'json_unicode', __('Output unicode characters unescaped'), ); $generalOptions->addProperty($leaf); diff --git a/src/Plugins/Export/ExportLatex.php b/src/Plugins/Export/ExportLatex.php index 9ef4ea8cd5..14bd08df47 100644 --- a/src/Plugins/Export/ExportLatex.php +++ b/src/Plugins/Export/ExportLatex.php @@ -97,7 +97,7 @@ class ExportLatex extends ExportPlugin $generalOptions = new OptionsPropertyMainGroup('latex_general_opts'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - 'caption', + 'latex_caption', __('Include table caption'), ); $generalOptions->addProperty($leaf); @@ -110,7 +110,7 @@ class ExportLatex extends ExportPlugin __('Dump table'), ); // create primary items and add them to the group - $leaf = new RadioPropertyItem('structure_or_data'); + $leaf = new RadioPropertyItem('latex_structure_or_data'); $leaf->setValues( ['structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')], ); @@ -127,19 +127,19 @@ class ExportLatex extends ExportPlugin $structureOptions->setForce('data'); // create primary items and add them to the group $leaf = new TextPropertyItem( - 'structure_caption', + 'latex_structure_caption', __('Table caption:'), ); $leaf->setDoc('faq6-27'); $structureOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'structure_continued_caption', + 'latex_structure_continued_caption', __('Table caption (continued):'), ); $leaf->setDoc('faq6-27'); $structureOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'structure_label', + 'latex_structure_label', __('Label key:'), ); $leaf->setDoc('faq6-27'); @@ -147,20 +147,20 @@ class ExportLatex extends ExportPlugin $relationParameters = $this->relation->getRelationParameters(); if ($relationParameters->relationFeature !== null) { $leaf = new BoolPropertyItem( - 'relation', + 'latex_relation', __('Display foreign key relationships'), ); $structureOptions->addProperty($leaf); } $leaf = new BoolPropertyItem( - 'comments', + 'latex_comments', __('Display comments'), ); $structureOptions->addProperty($leaf); if ($relationParameters->browserTransformationFeature !== null) { $leaf = new BoolPropertyItem( - 'mime', + 'latex_mime', __('Display media types'), ); $structureOptions->addProperty($leaf); @@ -178,30 +178,30 @@ class ExportLatex extends ExportPlugin $dataOptions->setForce('structure'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - 'columns', + 'latex_columns', __('Put columns names in the first row:'), ); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'data_caption', + 'latex_data_caption', __('Table caption:'), ); $leaf->setDoc('faq6-27'); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'data_continued_caption', + 'latex_data_continued_caption', __('Table caption (continued):'), ); $leaf->setDoc('faq6-27'); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'data_label', + 'latex_data_label', __('Label key:'), ); $leaf->setDoc('faq6-27'); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'null', + 'latex_null', __('Replace NULL with:'), ); $dataOptions->addProperty($leaf); diff --git a/src/Plugins/Export/ExportMediawiki.php b/src/Plugins/Export/ExportMediawiki.php index 53b3c8ad6c..6aaeb76183 100644 --- a/src/Plugins/Export/ExportMediawiki.php +++ b/src/Plugins/Export/ExportMediawiki.php @@ -65,7 +65,7 @@ class ExportMediawiki extends ExportPlugin 'mediawiki_dump_table', __('Dump table'), ); - $leaf = new RadioPropertyItem('structure_or_data'); + $leaf = new RadioPropertyItem('mediawiki_structure_or_data'); $leaf->setValues( ['structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')], ); @@ -74,14 +74,14 @@ class ExportMediawiki extends ExportPlugin // export table name $leaf = new BoolPropertyItem( - 'caption', + 'mediawiki_caption', __('Export table names'), ); $generalOptions->addProperty($leaf); // export table headers $leaf = new BoolPropertyItem( - 'headers', + 'mediawiki_headers', __('Export table headers'), ); $generalOptions->addProperty($leaf); diff --git a/src/Plugins/Export/ExportOds.php b/src/Plugins/Export/ExportOds.php index d33f5f75f3..8f644af356 100644 --- a/src/Plugins/Export/ExportOds.php +++ b/src/Plugins/Export/ExportOds.php @@ -62,16 +62,16 @@ class ExportOds extends ExportPlugin $generalOptions = new OptionsPropertyMainGroup('ods_general_opts'); // create primary items and add them to the group $leaf = new TextPropertyItem( - 'null', + 'ods_null', __('Replace NULL with:'), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'columns', + 'ods_columns', __('Put columns names in the first row'), ); $generalOptions->addProperty($leaf); - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('ods_structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); diff --git a/src/Plugins/Export/ExportOdt.php b/src/Plugins/Export/ExportOdt.php index 2588cb87a8..0993f874a5 100644 --- a/src/Plugins/Export/ExportOdt.php +++ b/src/Plugins/Export/ExportOdt.php @@ -75,7 +75,7 @@ class ExportOdt extends ExportPlugin __('Dump table'), ); // create primary items and add them to the group - $leaf = new RadioPropertyItem('structure_or_data'); + $leaf = new RadioPropertyItem('odt_structure_or_data'); $leaf->setValues( ['structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')], ); @@ -94,20 +94,20 @@ class ExportOdt extends ExportPlugin // create primary items and add them to the group if ($relationParameters->relationFeature !== null) { $leaf = new BoolPropertyItem( - 'relation', + 'odt_relation', __('Display foreign key relationships'), ); $structureOptions->addProperty($leaf); } $leaf = new BoolPropertyItem( - 'comments', + 'odt_comments', __('Display comments'), ); $structureOptions->addProperty($leaf); if ($relationParameters->browserTransformationFeature !== null) { $leaf = new BoolPropertyItem( - 'mime', + 'odt_mime', __('Display media types'), ); $structureOptions->addProperty($leaf); @@ -125,12 +125,12 @@ class ExportOdt extends ExportPlugin $dataOptions->setForce('structure'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - 'columns', + 'odt_columns', __('Put columns names in the first row'), ); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'null', + 'odt_null', __('Replace NULL with:'), ); $dataOptions->addProperty($leaf); diff --git a/src/Plugins/Export/ExportPdf.php b/src/Plugins/Export/ExportPdf.php index 254f6857aa..80b9f8f484 100644 --- a/src/Plugins/Export/ExportPdf.php +++ b/src/Plugins/Export/ExportPdf.php @@ -63,7 +63,7 @@ class ExportPdf extends ExportPlugin $generalOptions = new OptionsPropertyMainGroup('pdf_general_opts'); // create primary items and add them to the group $leaf = new TextPropertyItem( - 'report_title', + 'pdf_report_title', __('Report title:'), ); $generalOptions->addProperty($leaf); @@ -75,7 +75,7 @@ class ExportPdf extends ExportPlugin 'pdf_dump_what', __('Dump table'), ); - $leaf = new RadioPropertyItem('structure_or_data'); + $leaf = new RadioPropertyItem('pdf_structure_or_data'); $leaf->setValues( ['structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')], ); diff --git a/src/Plugins/Export/ExportPhparray.php b/src/Plugins/Export/ExportPhparray.php index 7b6f402b1f..2004f14e21 100644 --- a/src/Plugins/Export/ExportPhparray.php +++ b/src/Plugins/Export/ExportPhparray.php @@ -54,7 +54,7 @@ class ExportPhparray extends ExportPlugin // general options main group $generalOptions = new OptionsPropertyMainGroup('phparray_general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('phparray_structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); diff --git a/src/Plugins/Export/ExportSql.php b/src/Plugins/Export/ExportSql.php index e395d89c44..7d03552b82 100644 --- a/src/Plugins/Export/ExportSql.php +++ b/src/Plugins/Export/ExportSql.php @@ -179,7 +179,7 @@ class ExportSql extends ExportPlugin // comments $subgroup = new OptionsPropertySubgroup('sql_include_comments'); $leaf = new BoolPropertyItem( - 'include_comments', + 'sql_include_comments', __( 'Display comments (includes info such as export timestamp, PHP version, and server version)', ), @@ -187,12 +187,12 @@ class ExportSql extends ExportPlugin $subgroup->setSubgroupHeader($leaf); $leaf = new TextPropertyItem( - 'header_comment', + 'sql_header_comment', __('Additional custom header comment (\n splits lines):'), ); $subgroup->addProperty($leaf); $leaf = new BoolPropertyItem( - 'dates', + 'sql_dates', __( 'Include a timestamp of when databases were created, last updated, and last checked', ), @@ -201,7 +201,7 @@ class ExportSql extends ExportPlugin $relationParameters = $this->relation->getRelationParameters(); if ($relationParameters->relationFeature !== null) { $leaf = new BoolPropertyItem( - 'relation', + 'sql_relation', __('Display foreign key relationships'), ); $subgroup->addProperty($leaf); @@ -209,7 +209,7 @@ class ExportSql extends ExportPlugin if ($relationParameters->browserTransformationFeature !== null) { $leaf = new BoolPropertyItem( - 'mime', + 'sql_mime', __('Display media types'), ); $subgroup->addProperty($leaf); @@ -219,7 +219,7 @@ class ExportSql extends ExportPlugin // enclose in a transaction $leaf = new BoolPropertyItem( - 'use_transaction', + 'sql_use_transaction', __('Enclose export in a transaction'), ); $leaf->setDoc( @@ -229,7 +229,7 @@ class ExportSql extends ExportPlugin // disable foreign key checks $leaf = new BoolPropertyItem( - 'disable_fk', + 'sql_disable_fk', __('Disable foreign key checks'), ); $leaf->setDoc( @@ -239,14 +239,14 @@ class ExportSql extends ExportPlugin // export views as tables $leaf = new BoolPropertyItem( - 'views_as_tables', + 'sql_views_as_tables', __('Export views as tables'), ); $generalOptions->addProperty($leaf); // export metadata $leaf = new BoolPropertyItem( - 'metadata', + 'sql_metadata', __('Export metadata'), ); $generalOptions->addProperty($leaf); @@ -262,7 +262,7 @@ class ExportSql extends ExportPlugin 'sql_dump_table', __('Dump table'), ); - $leaf = new RadioPropertyItem('structure_or_data'); + $leaf = new RadioPropertyItem('sql_structure_or_data'); $leaf->setValues( ['structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')], ); @@ -283,7 +283,7 @@ class ExportSql extends ExportPlugin // begin SQL Statements $subgroup = new OptionsPropertySubgroup(); $leaf = new MessageOnlyPropertyItem( - 'add_statements', + 'sql_add_statements', __('Add statements:'), ); $subgroup->setSubgroupHeader($leaf); @@ -291,7 +291,7 @@ class ExportSql extends ExportPlugin // server export options if (ExportPlugin::$exportType === ExportType::Server) { $leaf = new BoolPropertyItem( - 'drop_database', + 'sql_drop_database', sprintf(__('Add %s statement'), 'DROP DATABASE IF EXISTS'), ); $subgroup->addProperty($leaf); @@ -300,7 +300,7 @@ class ExportSql extends ExportPlugin if (ExportPlugin::$exportType === ExportType::Database) { $createClause = 'CREATE DATABASE / USE'; $leaf = new BoolPropertyItem( - 'create_database', + 'sql_create_database', sprintf(__('Add %s statement'), $createClause), ); $subgroup->addProperty($leaf); @@ -317,7 +317,7 @@ class ExportSql extends ExportPlugin $dropClause .= ' / TRIGGER'; $leaf = new BoolPropertyItem( - 'drop_table', + 'sql_drop_table', sprintf(__('Add %s statement'), $dropClause), ); $subgroup->addProperty($leaf); @@ -326,13 +326,13 @@ class ExportSql extends ExportPlugin // Add table structure option $leaf = new BoolPropertyItem( - 'create_table', + 'sql_create_table', sprintf(__('Add %s statement'), 'CREATE TABLE'), ); $subgroupCreateTable->setSubgroupHeader($leaf); $leaf = new BoolPropertyItem( - 'if_not_exists', + 'sql_if_not_exists', 'IF NOT EXISTS ' . __( '(less efficient as indexes will be generated during table creation)', ), @@ -340,7 +340,7 @@ class ExportSql extends ExportPlugin $subgroupCreateTable->addProperty($leaf); $leaf = new BoolPropertyItem( - 'auto_increment', + 'sql_auto_increment', sprintf(__('%s value'), 'AUTO_INCREMENT'), ); $subgroupCreateTable->addProperty($leaf); @@ -350,26 +350,26 @@ class ExportSql extends ExportPlugin // Add view option $subgroupCreateView = new OptionsPropertySubgroup(); $leaf = new BoolPropertyItem( - 'create_view', + 'sql_create_view', sprintf(__('Add %s statement'), 'CREATE VIEW'), ); $subgroupCreateView->setSubgroupHeader($leaf); $leaf = new BoolPropertyItem( - 'simple_view_export', + 'sql_simple_view_export', /* l10n: Allow simplifying exported view syntax to only "CREATE VIEW" */ __('Use simple view export'), ); $subgroupCreateView->addProperty($leaf); $leaf = new BoolPropertyItem( - 'view_current_user', + 'sql_view_current_user', __('Exclude definition of current user'), ); $subgroupCreateView->addProperty($leaf); $leaf = new BoolPropertyItem( - 'or_replace_view', + 'sql_or_replace_view', sprintf(__('%s view'), 'OR REPLACE'), ); $subgroupCreateView->addProperty($leaf); @@ -377,7 +377,7 @@ class ExportSql extends ExportPlugin $subgroup->addProperty($subgroupCreateView); $leaf = new BoolPropertyItem( - 'procedure_function', + 'sql_procedure_function', sprintf( __('Add %s statement'), 'CREATE PROCEDURE / FUNCTION / EVENT', @@ -387,7 +387,7 @@ class ExportSql extends ExportPlugin // Add triggers option $leaf = new BoolPropertyItem( - 'create_trigger', + 'sql_create_trigger', sprintf(__('Add %s statement'), 'CREATE TRIGGER'), ); $subgroup->addProperty($leaf); @@ -395,7 +395,7 @@ class ExportSql extends ExportPlugin $structureOptions->addProperty($subgroup); $leaf = new BoolPropertyItem( - 'backquotes', + 'sql_backquotes', __( 'Enclose table and column names with backquotes ' . '(Protects column and table names formed with' @@ -416,7 +416,7 @@ class ExportSql extends ExportPlugin ); $dataOptions->setForce('structure'); $leaf = new BoolPropertyItem( - 'truncate', + 'sql_truncate', __('Truncate table before insert'), ); $dataOptions->addProperty($leaf); @@ -424,13 +424,13 @@ class ExportSql extends ExportPlugin // begin SQL Statements $subgroup = new OptionsPropertySubgroup(); $leaf = new MessageOnlyPropertyItem( - 'insert_alternatives', + 'sql_insert_alternatives', __('Instead of INSERT statements, use:'), ); $subgroup->setSubgroupHeader($leaf); $leaf = new BoolPropertyItem( - 'delayed', + 'sql_delayed', __('INSERT DELAYED statements'), ); $leaf->setDoc( @@ -439,7 +439,7 @@ class ExportSql extends ExportPlugin $subgroup->addProperty($leaf); $leaf = new BoolPropertyItem( - 'ignore', + 'sql_ignore', __('INSERT IGNORE statements'), ); $leaf->setDoc( @@ -450,7 +450,7 @@ class ExportSql extends ExportPlugin // Function to use when dumping dat $leaf = new SelectPropertyItem( - 'type', + 'sql_type', __('Function to use when dumping data:'), ); $leaf->setValues( @@ -466,7 +466,7 @@ class ExportSql extends ExportPlugin ); $subgroup->setSubgroupHeader($leaf); $leaf = new RadioPropertyItem( - 'insert_syntax', + 'sql_insert_syntax', __('INSERT IGNORE statements'), ); $leaf->setValues( @@ -497,14 +497,14 @@ class ExportSql extends ExportPlugin // Max length of query $leaf = new NumberPropertyItem( - 'max_query_size', + 'sql_max_query_size', __('Maximal length of created query'), ); $dataOptions->addProperty($leaf); // Dump binary columns in hexadecimal $leaf = new BoolPropertyItem( - 'hex_for_binary', + 'sql_hex_for_binary', __( 'Dump binary columns in hexadecimal notation (for example, "abc" becomes 0x616263)', ), @@ -513,7 +513,7 @@ class ExportSql extends ExportPlugin // Dump time in UTC $leaf = new BoolPropertyItem( - 'utc_time', + 'sql_utc_time', __( 'Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns' . ' to be dumped and reloaded between servers in different' @@ -2566,7 +2566,7 @@ class ExportSql extends ExportPlugin } $leaf = new SelectPropertyItem( - 'compatibility', + 'sql_compatibility', __( 'Database system or older MySQL server to maximize output compatibility with:', ), diff --git a/src/Plugins/Export/ExportTexytext.php b/src/Plugins/Export/ExportTexytext.php index e9f02052f8..15721650c1 100644 --- a/src/Plugins/Export/ExportTexytext.php +++ b/src/Plugins/Export/ExportTexytext.php @@ -67,7 +67,7 @@ class ExportTexytext extends ExportPlugin __('Dump table'), ); // create primary items and add them to the group - $leaf = new RadioPropertyItem('structure_or_data'); + $leaf = new RadioPropertyItem('texytext_structure_or_data'); $leaf->setValues( ['structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')], ); @@ -83,12 +83,12 @@ class ExportTexytext extends ExportPlugin $dataOptions->setForce('structure'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - 'columns', + 'texytext_columns', __('Put columns names in the first row'), ); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'null', + 'texytext_null', __('Replace NULL with:'), ); $dataOptions->addProperty($leaf); diff --git a/src/Plugins/Export/ExportToon.php b/src/Plugins/Export/ExportToon.php index 70ffb47e7e..2afdd601a7 100644 --- a/src/Plugins/Export/ExportToon.php +++ b/src/Plugins/Export/ExportToon.php @@ -58,17 +58,17 @@ class ExportToon extends ExportPlugin $generalOptions = new OptionsPropertyMainGroup('toon_general_opts'); // create leaf items and add them to the group $leaf = new TextPropertyItem( - 'separator', + 'toon_separator', __('Columns separated with:'), ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'indent', + 'toon_indent', __('Indentation:'), ); $generalOptions->addProperty($leaf); // create primary items and add them to the group - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('toon_structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); diff --git a/src/Plugins/Export/ExportXml.php b/src/Plugins/Export/ExportXml.php index 1a6b0c1ebf..745362d0df 100644 --- a/src/Plugins/Export/ExportXml.php +++ b/src/Plugins/Export/ExportXml.php @@ -76,7 +76,7 @@ class ExportXml extends ExportPlugin // general options main group $generalOptions = new OptionsPropertyMainGroup('xml_general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('xml_structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); @@ -89,32 +89,32 @@ class ExportXml extends ExportPlugin // create primary items and add them to the group $leaf = new BoolPropertyItem( - 'export_events', + 'xml_export_events', __('Events'), ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - 'export_functions', + 'xml_export_functions', __('Functions'), ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - 'export_procedures', + 'xml_export_procedures', __('Procedures'), ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - 'export_tables', + 'xml_export_tables', __('Tables'), ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - 'export_triggers', + 'xml_export_triggers', __('Triggers'), ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - 'export_views', + 'xml_export_views', __('Views'), ); $structure->addProperty($leaf); @@ -127,7 +127,7 @@ class ExportXml extends ExportPlugin ); // create primary items and add them to the group $leaf = new BoolPropertyItem( - 'export_contents', + 'xml_export_contents', __('Export contents'), ); $data->addProperty($leaf); diff --git a/src/Plugins/Export/ExportYaml.php b/src/Plugins/Export/ExportYaml.php index 52e040f39b..32b6dfd095 100644 --- a/src/Plugins/Export/ExportYaml.php +++ b/src/Plugins/Export/ExportYaml.php @@ -53,7 +53,7 @@ class ExportYaml extends ExportPlugin // general options main group $generalOptions = new OptionsPropertyMainGroup('yaml_general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem('structure_or_data'); + $leaf = new HiddenPropertyItem('yaml_structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); diff --git a/src/Plugins/Import/AbstractImportCsv.php b/src/Plugins/Import/AbstractImportCsv.php index e6922e0c11..8f4c7eb81e 100644 --- a/src/Plugins/Import/AbstractImportCsv.php +++ b/src/Plugins/Import/AbstractImportCsv.php @@ -25,34 +25,34 @@ abstract class AbstractImportCsv extends ImportPlugin // create common items and add them to the group $leaf = new BoolPropertyItem( - 'replace', + $this->getName() . '_replace', __( 'Update data when duplicate keys found on import (add ON DUPLICATE KEY UPDATE)', ), ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'terminated', + $this->getName() . '_terminated', __('Columns separated with:'), ); $leaf->setSize(2); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'enclosed', + $this->getName() . '_enclosed', __('Columns enclosed with:'), ); $leaf->setSize(2); $leaf->setLen(2); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'escaped', + $this->getName() . '_escaped', __('Columns escaped with:'), ); $leaf->setSize(2); $leaf->setLen(2); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - 'new_line', + $this->getName() . '_new_line', __('Lines terminated with:'), ); $leaf->setSize(2); diff --git a/src/Plugins/Import/ImportCsv.php b/src/Plugins/Import/ImportCsv.php index 0676c515f2..5575d7d645 100644 --- a/src/Plugins/Import/ImportCsv.php +++ b/src/Plugins/Import/ImportCsv.php @@ -88,7 +88,7 @@ class ImportCsv extends AbstractImportCsv if (ImportSettings::$importType !== 'table') { $leaf = new TextPropertyItem( - 'new_tbl_name', + 'csv_new_tbl_name', __( 'Name of the new table (optional):', ), @@ -97,7 +97,7 @@ class ImportCsv extends AbstractImportCsv if (ImportSettings::$importType === 'server') { $leaf = new TextPropertyItem( - 'new_db_name', + 'csv_new_db_name', __( 'Name of the new database (optional):', ), @@ -106,7 +106,7 @@ class ImportCsv extends AbstractImportCsv } $leaf = new NumberPropertyItem( - 'partial_import', + 'csv_partial_import', __( 'Import these many number of rows (optional):', ), @@ -114,7 +114,7 @@ class ImportCsv extends AbstractImportCsv $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'col_names', + 'csv_col_names', __( 'The first line of the file contains the table column names' . ' (if this is unchecked, the first line will become part' @@ -124,7 +124,7 @@ class ImportCsv extends AbstractImportCsv $generalOptions->addProperty($leaf); } else { $leaf = new NumberPropertyItem( - 'partial_import', + 'csv_partial_import', __( 'Import these many number of rows (optional):', ), @@ -140,14 +140,14 @@ class ImportCsv extends AbstractImportCsv ), ); $leaf = new TextPropertyItem( - 'columns', + 'csv_columns', __('Column names:') . ' ' . Generator::showHint($hint->getMessage()), ); $generalOptions->addProperty($leaf); } $leaf = new BoolPropertyItem( - 'ignore', + 'csv_ignore', __('Do not abort on INSERT error'), ); $generalOptions->addProperty($leaf); diff --git a/src/Plugins/Import/ImportLdi.php b/src/Plugins/Import/ImportLdi.php index 56290f3d25..5e8ab4f27a 100644 --- a/src/Plugins/Import/ImportLdi.php +++ b/src/Plugins/Import/ImportLdi.php @@ -67,19 +67,19 @@ class ImportLdi extends AbstractImportCsv $generalOptions = $this->getGeneralOptions(); $leaf = new TextPropertyItem( - 'columns', + 'ldi_columns', __('Column names: '), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'ignore', + 'ldi_ignore', __('Do not abort on INSERT error'), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'local_option', + 'ldi_local_option', __('Use LOCAL keyword'), ); $generalOptions->addProperty($leaf); diff --git a/src/Plugins/Import/ImportOds.php b/src/Plugins/Import/ImportOds.php index 7ac84202d9..dac1e244bc 100644 --- a/src/Plugins/Import/ImportOds.php +++ b/src/Plugins/Import/ImportOds.php @@ -68,7 +68,7 @@ class ImportOds extends ImportPlugin $generalOptions = new OptionsPropertyMainGroup('ods_general_opts'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - 'col_names', + 'ods_col_names', __( 'The first line of the file contains the table column names' . ' (if this is unchecked, the first line will become part' @@ -77,19 +77,19 @@ class ImportOds extends ImportPlugin ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'empty_rows', + 'ods_empty_rows', __('Do not import empty rows'), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'recognize_percentages', + 'ods_recognize_percentages', __( 'Import percentages as proper decimals (ex. 12.00% to .12)', ), ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'recognize_currency', + 'ods_recognize_currency', __('Import currencies (ex. $5.00 to 5.00)'), ); $generalOptions->addProperty($leaf); diff --git a/src/Plugins/Import/ImportSql.php b/src/Plugins/Import/ImportSql.php index d1e8a24026..c96159e78e 100644 --- a/src/Plugins/Import/ImportSql.php +++ b/src/Plugins/Import/ImportSql.php @@ -58,7 +58,7 @@ class ImportSql extends ImportPlugin $generalOptions = new OptionsPropertyMainGroup('sql_general_opts'); // create primary items and add them to the group $leaf = new SelectPropertyItem( - 'compatibility', + 'sql_compatibility', __('SQL compatibility mode:'), ); $leaf->setValues($values); @@ -67,7 +67,7 @@ class ImportSql extends ImportPlugin ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'no_auto_value_on_zero', + 'sql_no_auto_value_on_zero', __('Do not use AUTO_INCREMENT for zero values'), ); $leaf->setDoc( diff --git a/src/Plugins/Schema/SchemaDia.php b/src/Plugins/Schema/SchemaDia.php index 6aae0a394b..abaf160879 100644 --- a/src/Plugins/Schema/SchemaDia.php +++ b/src/Plugins/Schema/SchemaDia.php @@ -51,7 +51,7 @@ class SchemaDia extends SchemaPlugin $this->addCommonOptions($specificOptions); $leaf = new SelectPropertyItem( - 'orientation', + 'dia_orientation', __('Orientation'), ); $leaf->setValues( @@ -60,7 +60,7 @@ class SchemaDia extends SchemaPlugin $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - 'paper', + 'dia_paper', __('Paper size'), ); $leaf->setValues($this->getPaperSizeArray()); diff --git a/src/Plugins/Schema/SchemaEps.php b/src/Plugins/Schema/SchemaEps.php index 7e4bd177d0..b5e973ca1b 100644 --- a/src/Plugins/Schema/SchemaEps.php +++ b/src/Plugins/Schema/SchemaEps.php @@ -53,13 +53,13 @@ class SchemaEps extends SchemaPlugin // create leaf items and add them to the group $leaf = new BoolPropertyItem( - 'all_tables_same_width', + 'eps_all_tables_same_width', __('Same width for all tables'), ); $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - 'orientation', + 'eps_orientation', __('Orientation'), ); $leaf->setValues( diff --git a/src/Plugins/Schema/SchemaPdf.php b/src/Plugins/Schema/SchemaPdf.php index 0676c6fa3d..7c839dcb19 100644 --- a/src/Plugins/Schema/SchemaPdf.php +++ b/src/Plugins/Schema/SchemaPdf.php @@ -55,13 +55,13 @@ class SchemaPdf extends SchemaPlugin // create leaf items and add them to the group $leaf = new BoolPropertyItem( - 'all_tables_same_width', + 'pdf_all_tables_same_width', __('Same width for all tables'), ); $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - 'orientation', + 'pdf_orientation', __('Orientation'), ); $leaf->setValues( @@ -70,26 +70,26 @@ class SchemaPdf extends SchemaPlugin $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - 'paper', + 'pdf_paper', __('Paper size'), ); $leaf->setValues($this->getPaperSizeArray()); $specificOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'show_grid', + 'pdf_show_grid', __('Show grid'), ); $specificOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - 'with_doc', + 'pdf_with_doc', __('Data dictionary'), ); $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - 'table_order', + 'pdf_table_order', __('Order of the tables'), ); $leaf->setValues( diff --git a/src/Plugins/Schema/SchemaSvg.php b/src/Plugins/Schema/SchemaSvg.php index f220e94f61..785bfea231 100644 --- a/src/Plugins/Schema/SchemaSvg.php +++ b/src/Plugins/Schema/SchemaSvg.php @@ -52,7 +52,7 @@ class SchemaSvg extends SchemaPlugin // create leaf items and add them to the group $leaf = new BoolPropertyItem( - 'all_tables_same_width', + 'svg_all_tables_same_width', __('Same width for all tables'), ); $specificOptions->addProperty($leaf); diff --git a/src/Plugins/SchemaPlugin.php b/src/Plugins/SchemaPlugin.php index 377582e481..5d22483df4 100644 --- a/src/Plugins/SchemaPlugin.php +++ b/src/Plugins/SchemaPlugin.php @@ -68,9 +68,9 @@ abstract class SchemaPlugin implements Plugin */ protected function addCommonOptions(OptionsPropertyMainGroup $propertyGroup): void { - $leaf = new BoolPropertyItem('show_color', __('Show color')); + $leaf = new BoolPropertyItem($this->getName() . '_show_color', __('Show color')); $propertyGroup->addProperty($leaf); - $leaf = new BoolPropertyItem('show_keys', __('Only show keys')); + $leaf = new BoolPropertyItem($this->getName() . '_show_keys', __('Only show keys')); $propertyGroup->addProperty($leaf); } diff --git a/src/Properties/Options/Items/BoolPropertyItem.php b/src/Properties/Options/Items/BoolPropertyItem.php index f78f8c37ad..a39492cfa4 100644 --- a/src/Properties/Options/Items/BoolPropertyItem.php +++ b/src/Properties/Options/Items/BoolPropertyItem.php @@ -19,12 +19,12 @@ class BoolPropertyItem extends OptionsPropertyOneItem $ret = '
    • '; $ret .= '
      '; $ret .= 'getName() . '"' + . ' value="y" id="checkbox_' . $this->getName() . '"' . ' ' . Plugins::checkboxCheck( $pluginType, - $pluginName . '_' . $this->getName(), + $this->getName(), ); if ($this->getForce() !== null) { @@ -38,7 +38,7 @@ class BoolPropertyItem extends OptionsPropertyOneItem } $ret .= '>'; - $ret .= '
      '; $ret .= Plugins::getDocumentationLinkHtml($this); diff --git a/src/Properties/Options/Items/HiddenPropertyItem.php b/src/Properties/Options/Items/HiddenPropertyItem.php index 2e3ff779b7..7cd302acd2 100644 --- a/src/Properties/Options/Items/HiddenPropertyItem.php +++ b/src/Properties/Options/Items/HiddenPropertyItem.php @@ -18,11 +18,11 @@ class HiddenPropertyItem extends OptionsPropertyOneItem { public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { - return '
    • '; } diff --git a/src/Properties/Options/Items/NumberPropertyItem.php b/src/Properties/Options/Items/NumberPropertyItem.php index 04c697b7a7..35cb1b1732 100644 --- a/src/Properties/Options/Items/NumberPropertyItem.php +++ b/src/Properties/Options/Items/NumberPropertyItem.php @@ -19,15 +19,15 @@ class NumberPropertyItem extends OptionsPropertyOneItem public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { $ret = '
    • '; - $ret .= '
    • '; foreach ($this->getValues() as $key => $val) { - $ret .= '
      getName() . '_' . $key . '">' + . $this->getName() . '_' . $key . '">' . $plugin->getTranslatedText($val) . '
      '; } diff --git a/src/Properties/Options/Items/SelectPropertyItem.php b/src/Properties/Options/Items/SelectPropertyItem.php index ba5e68017d..e3c20441f7 100644 --- a/src/Properties/Options/Items/SelectPropertyItem.php +++ b/src/Properties/Options/Items/SelectPropertyItem.php @@ -19,13 +19,13 @@ class SelectPropertyItem extends OptionsPropertyOneItem public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { $ret = '
    • '; - $ret .= '