mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
Merge branch 'MDL-69898' of https://github.com/paulholden/moodle
This commit is contained in:
commit
f5e348ac3e
@ -23,7 +23,7 @@
|
||||
*/
|
||||
namespace core\event;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
use moodle_url;
|
||||
|
||||
/**
|
||||
* Event class for when an admin config log is created.
|
||||
@ -78,10 +78,12 @@ class config_log_created extends base {
|
||||
/**
|
||||
* Returns relevant URL.
|
||||
*
|
||||
* @return \moodle_url
|
||||
* @return moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/admin/index.php');
|
||||
return new moodle_url('/report/configlog/index.php', [
|
||||
'search' => $this->other['name'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,23 +26,30 @@
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('reportconfiglog', '', null, '', array('pagelayout'=>'report'));
|
||||
// Allow searching by setting when providing parameter directly.
|
||||
$search = optional_param('search', '', PARAM_TEXT);
|
||||
|
||||
admin_externalpage_setup('reportconfiglog', '', ['search' => $search], '', ['pagelayout' => 'report']);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('configlog', 'report_configlog'));
|
||||
|
||||
$mform = new \report_configlog\form\search();
|
||||
|
||||
/** @var cache_session $cache */
|
||||
$cache = cache::make_from_params(cache_store::MODE_SESSION, 'report_customlog', 'search');
|
||||
if ($cachedata = $cache->get('data')) {
|
||||
$mform->set_data($cachedata);
|
||||
|
||||
if (!empty($search)) {
|
||||
$searchdata = (object) ['setting' => $search];
|
||||
} else {
|
||||
$searchdata = $cache->get('data');
|
||||
}
|
||||
|
||||
$mform = new \report_configlog\form\search();
|
||||
$mform->set_data($searchdata);
|
||||
|
||||
$searchclauses = [];
|
||||
|
||||
// Check if we have a form submission, or a cached submission.
|
||||
$data = ($mform->is_submitted() ? $mform->get_data() : fullclone($cachedata));
|
||||
$data = ($mform->is_submitted() ? $mform->get_data() : fullclone($searchdata));
|
||||
if ($data instanceof stdClass) {
|
||||
if (!empty($data->value)) {
|
||||
$searchclauses[] = $data->value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user