Merge branch 'feature/MDL-56830' of https://github.com/fwsl/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 13 Dec 2016 11:00:46 +0000 (12:00 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 13 Dec 2016 11:00:46 +0000 (12:00 +0100)
admin/blocks.php
lib/blocklib.php

index b31da9e..f3faf4d 100644 (file)
@@ -37,6 +37,7 @@
             print_error('blockdoesnotexist', 'error');
         }
         $DB->set_field('block', 'visible', '0', array('id'=>$block->id));      // Hide block
+        add_to_config_log('block_visibility', $block->visible, '0', $block->name);
         core_plugin_manager::reset_caches();
         admin_get_root(true, false);  // settings not required - only pages
     }
@@ -46,6 +47,7 @@
             print_error('blockdoesnotexist', 'error');
         }
         $DB->set_field('block', 'visible', '1', array('id'=>$block->id));      // Show block
+        add_to_config_log('block_visibility', $block->visible, '1', $block->name);
         core_plugin_manager::reset_caches();
         admin_get_root(true, false);  // settings not required - only pages
     }
index e3a3868..b8b2821 100644 (file)
@@ -420,6 +420,7 @@ class block_manager {
         if (!in_array($block->name, $undeletableblocktypes)) {
             $undeletableblocktypes[] = $block->name;
             set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
+            add_to_config_log('block_protect', "0", "1", $block->name);
         }
     }
 
@@ -445,6 +446,7 @@ class block_manager {
         if (in_array($block->name, $undeletableblocktypes)) {
             $undeletableblocktypes = array_diff($undeletableblocktypes, array($block->name));
             set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
+            add_to_config_log('block_protect', "1", "0", $block->name);
         }
 
     }