Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

blocks admin MDL-26827- allow blocks settings to be an admin external…

…page

This borrows from Tim's technique for qtypes in 1650a33
  • Loading branch information...
commit f723bd3df5f85816cfe3fee2bae2bb2f0a9532bf 1 parent c096042
@danpoltawski danpoltawski authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 admin/blocks.php
View
6 admin/blocks.php
@@ -147,7 +147,11 @@
$settings = ''; // By default, no configuration
if ($blockobject and $blockobject->has_config()) {
- if (file_exists($CFG->dirroot.'/blocks/'.$block->name.'/settings.php')) {
+ $blocksettings = admin_get_root()->locate('blocksetting' . $block->name);
+
+ if ($blocksettings instanceof admin_externalpage) {
+ $settings = '<a href="' . $blocksettings->url . '">' . get_string('settings') . '</a>';
+ } else if ($blocksettings instanceof admin_settingpage) {
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
} else {
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
Please sign in to comment.
Something went wrong with that request. Please try again.