Skip to content

Commit

Permalink
Settings link in Plugins overview and Manage blocks (#412)
Browse files Browse the repository at this point in the history
* offering Settings link in Plugins overview and Manage blocks

* fix code checker

* adjust comments
  • Loading branch information
ferishili authored Jan 13, 2025
1 parent 0df4144 commit d5e91e4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lang/en/block_opencast.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@
$string['setdefaultseriessucceeded'] = 'The default series has been successfully changed.';
$string['setting_permanent'] = 'Is permanent';
$string['settings'] = 'Opencast Videos';
$string['settings_page'] = 'Settings';
$string['settings_page_url'] = '{$a} Settings';
$string['shared_settings'] = 'Shared settings';
$string['showvideos'] = 'Show videos';
$string['source'] = 'Source';
Expand Down
13 changes: 13 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1143,3 +1143,16 @@
}
}
$settings = null;

// In order to be able to offer "Settings" links in Plugins overview and Manage blocks,
// we need to use a specific setting category (admin_category) that has to be "blocksettingopencast",
// therefore we provide it as a hidden subcategory to block_opencast to minimize the changes.
$blocksettingscategory = new admin_category('blocksettingopencast', new lang_string('settings_page', 'block_opencast'), true);
$mainsettingurl = new moodle_url('/admin/category.php', ['category' => 'block_opencast']);
$settingexternalpage = new admin_externalpage(
'blocksettingopencast_externalpage',
get_string('settings_page_url', 'block_opencast', get_string('settings', 'block_opencast')),
$mainsettingurl
);
$blocksettingscategory->add('blocksettingopencast', $settingexternalpage);
$ADMIN->add('block_opencast', $blocksettingscategory);

0 comments on commit d5e91e4

Please sign in to comment.