1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * @category Phoenix
16: * @package Phoenix_Moneybookers
17: * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
18: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19: */
20: class Phoenix_Moneybookers_Block_Jsinit extends Mage_Adminhtml_Block_Template
21: {
22: /**
23: * Include JS in head if section is moneybookers
24: */
25: protected function _prepareLayout()
26: {
27: $section = $this->getAction()->getRequest()->getParam('section', false);
28: if ($section == 'moneybookers') {
29: $this->getLayout()
30: ->getBlock('head')
31: ->addJs('mage/adminhtml/moneybookers.js');
32: }
33: parent::_prepareLayout();
34: }
35:
36: /**
37: * Print init JS script into body
38: * @return string
39: */
40: protected function _toHtml()
41: {
42: $section = $this->getAction()->getRequest()->getParam('section', false);
43: if ($section == 'moneybookers') {
44: return parent::_toHtml();
45: } else {
46: return '';
47: }
48: }
49: }
50: