Skip to content

Commit

Permalink
Merge branch 'MDL-74596-master' of https://github.com/marinaglancy/mo…
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Jul 6, 2022
2 parents 6d99ad8 + b2565dd commit f739d61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/adminlib.php
Expand Up @@ -8785,6 +8785,7 @@ public function output_html($data, $query='') {
* page (e.g. admin/roles/allow.php, instead of admin/roles/manage.php, you can pass the alternate URL here.
* @param array $options Additional options that can be specified for page setup.
* pagelayout - This option can be used to set a specific pagelyaout, admin is default.
* nosearch - Do not display search bar
*/
function admin_externalpage_setup($section, $extrabutton = '', array $extraurlparams = null, $actualurl = '', array $options = array()) {
global $CFG, $PAGE, $USER, $SITE, $OUTPUT;
Expand Down Expand Up @@ -8881,7 +8882,7 @@ function admin_externalpage_setup($section, $extrabutton = '', array $extraurlpa
$PAGE->set_title("$SITE->shortname: " . implode(": ", $visiblepathtosection));
$PAGE->set_heading($SITE->fullname);

if ($hassiteconfig) {
if ($hassiteconfig && empty($options['nosearch'])) {
$PAGE->add_header_action($OUTPUT->render_from_template('core_admin/header_search_input', [
'action' => new moodle_url('/admin/search.php'),
'query' => $PAGE->url->get_param('query'),
Expand Down
1 change: 1 addition & 0 deletions lib/upgrade.txt
Expand Up @@ -30,6 +30,7 @@ information provided here is intended especially for developers.
attribute may encounter different behaviours between older Moodle versions (<v3.11.8, <v4.0.2) and the later ones. We recommend
plugin developers to not use this attribute for Moodle versions 4.0 and below in order to avoid this problem.
* Added $CFG->proxylogunsafe and proxyfixunsafe to detect code which doesn't honor the proxy config
* Function admin_externalpage_setup() now has additional option 'nosearch' allowing to remove Site administration search form.

=== 4.0 ===

Expand Down
2 changes: 1 addition & 1 deletion my/indexsys.php
Expand Up @@ -47,7 +47,7 @@
$PAGE->set_secondary_active_tab('appearance');
$PAGE->set_blocks_editing_capability('moodle/my:configsyspages');
$PAGE->set_url(new moodle_url('/my/indexsys.php'));
admin_externalpage_setup('mypage', '', null, '', array('pagelayout' => 'mydashboard'));
admin_externalpage_setup('mypage', '', null, '', ['pagelayout' => 'mydashboard', 'nosearch' => true]);
$PAGE->add_body_class('limitedwidth');
$PAGE->set_pagetype('my-index');
$PAGE->blocks->add_region('content');
Expand Down

0 comments on commit f739d61

Please sign in to comment.