Advertisement
Guest User

Untitled

a guest
May 24th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. // This code allows all calls to <remove /> being ignored
  3. // if a block with acl attribute is valid for admin user.
  4. // Shall I keep it in LayoutCompiler? IMO, this looks more like a bug, than a needed feature!
  5. foreach ($ignoreNodes as $block) {
  6. if ($block->getAttribute('ignore') !== null) {
  7. continue;
  8. }
  9. $acl = (string)$attributes->acl;
  10. if ($acl && Mage::getSingleton('admin/session')->isAllowed($acl)) {
  11. continue;
  12. }
  13. if (!isset($block->attributes()->ignore)) {
  14. $block->addAttribute('ignore', true);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement