Permalink
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...
1 parent c096042 commit f723bd3df5f85816cfe3fee2bae2bb2f0a9532bf @danpoltawski danpoltawski committed Mar 15, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 admin/blocks.php
View
@@ -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>';

0 comments on commit f723bd3

Please sign in to comment.