Skip to content

Instantly share code, notes, and snippets.

@IvanChepurnyi
Last active August 29, 2015 14:19
Show Gist options
  • Save IvanChepurnyi/173f7fbe5bb31f47c0a4 to your computer and use it in GitHub Desktop.
Save IvanChepurnyi/173f7fbe5bb31f47c0a4 to your computer and use it in GitHub Desktop.
<remove /> strange behaviour, with core acl="" attribute for layout file.
<?php
// This code allows all calls to <remove /> being ignored
// if a block with acl attribute is valid for admin user.
// Shall I keep it in LayoutCompiler? IMO, this looks more like a bug, than a needed feature!
foreach ($ignoreNodes as $block) {
if ($block->getAttribute('ignore') !== null) {
continue;
}
$acl = (string)$attributes->acl;
if ($acl && Mage::getSingleton('admin/session')->isAllowed($acl)) {
continue;
}
if (!isset($block->attributes()->ignore)) {
$block->addAttribute('ignore', true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment