From a88da7aa9e86759599e71cbfbd27f59b803daddd Mon Sep 17 00:00:00 2001 From: djarrancotleanu Date: Thu, 12 Mar 2026 15:26:30 +1000 Subject: [PATCH] Add CLI command reference admin/cli/cfg.php in replace_warning --- db_replace.php | 5 ++++- file_replace.php | 5 ++++- lang/en/tool_advancedreplace.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/db_replace.php b/db_replace.php index ddb98be..156bcaf 100644 --- a/db_replace.php +++ b/db_replace.php @@ -60,7 +60,10 @@ echo html_writer::div(get_string( 'replace_warning', 'tool_advancedreplace', - '$CFG->forced_plugin_settings[\'tool_advancedreplace\'][\'allowuireplace\'] = 1;' + (object)[ + 'file' => '$CFG->forced_plugin_settings[\'tool_advancedreplace\'][\'allowuireplace\'] = 1;', + 'command' => 'php admin/cli/cfg.php --component=tool_advancedreplace --name=allowuireplace --set=1' + ] ), 'alert alert-warning'); echo $OUTPUT->footer(); } else if ($data = $form->get_data()) { diff --git a/file_replace.php b/file_replace.php index 2f92207..8fdbd20 100644 --- a/file_replace.php +++ b/file_replace.php @@ -53,7 +53,10 @@ echo html_writer::div(get_string( 'replace_warning', 'tool_advancedreplace', - '$CFG->forced_plugin_settings[\'tool_advancedreplace\'][\'allowuireplace\'] = 1;' + (object)[ + 'file' => '$CFG->forced_plugin_settings[\'tool_advancedreplace\'][\'allowuireplace\'] = 1;', + 'command' => 'php admin/cli/cfg.php --component=tool_advancedreplace --name=allowuireplace --set=1' + ] ), 'alert alert-warning'); echo $OUTPUT->footer(); } else if ($data = $form->get_data()) { diff --git a/lang/en/tool_advancedreplace.php b/lang/en/tool_advancedreplace.php index 6c6b676..7807a64 100644 --- a/lang/en/tool_advancedreplace.php +++ b/lang/en/tool_advancedreplace.php @@ -111,7 +111,7 @@ $string['privacy:metadata:tool_advancedreplace_search:userid'] = 'User who created the db search'; $string['privacy:metadata:tool_advancedreplace_search:usermodified'] = 'User who modified the db search'; $string['replace'] = 'Replace'; -$string['replace_warning'] = 'Replace via UI not enabled, to enable please set {$a} in config.php'; +$string['replace_warning'] = 'Replace via UI not enabled. To enable, please set in config.php:
{$a->file}
or via CLI command:
{$a->command}'; $string['replacecheckdb'] = 'Are you sure you want to replace strings in the Database using the uploaded csv file?'; $string['replacecheckfiles'] = 'Are you sure you want to replace strings in Files using the uploaded csv file?'; $string['replacefilespageheader'] = 'Replace text stored in files';