Esempio n. 1
0
 public function testAddToParentGroup()
 {
     list($blocks, ) = $this->_createSampleBlocks(2);
     $this->_block->append($blocks[0], 'block1')->append($blocks[1], 'block2');
     $blocks[0]->addToParentGroup('group');
     $blocks[1]->addToParentGroup('group');
     $group = $this->_block->getChildGroup('group');
     $this->assertArrayHasKey('block1', $group);
     $this->assertArrayHasKey('block2', $group);
     $this->assertSame($group['block1'], $blocks[0], 'The same instance is expected.');
     $this->assertSame($group['block2'], $blocks[1], 'The same instance is expected.');
 }
 /**
  * @param Mage_Core_Block_Abstract $block
  * @return string
  */
 public function getActionHtml($block)
 {
     $html = '';
     $actions = $block->getChildGroup('actions');
     uasort($actions, array($this, 'compareBySortOrder'));
     foreach ($actions as $alias => $action) {
         /* @var $action Mana_Admin_Block_Action */
         $params = $action->getData();
         $this->copyParam($params, 'title', 'label');
         $action->setData($params);
         $html .= $block->getChildHtml($alias);
     }
     return $html;
 }