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: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_Adminhtml
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27: /**
28: * Adminhtml backup page content block
29: *
30: * @category Mage
31: * @package Mage_Adminhtml
32: * @author Magento Core Team <core@magentocommerce.com>
33: */
34: class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template
35: {
36: /**
37: * Block's template
38: *
39: * @var string
40: */
41: protected $_template = 'backup/list.phtml';
42:
43: protected function _prepareLayout()
44: {
45: parent::_prepareLayout();
46: $this->setChild('createButton',
47: $this->getLayout()->createBlock('adminhtml/widget_button')
48: ->setData(array(
49: 'label' => Mage::helper('backup')->__('Database Backup'),
50: 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_DB . "')",
51: 'class' => 'task'
52: ))
53: );
54: $this->setChild('createSnapshotButton',
55: $this->getLayout()->createBlock('adminhtml/widget_button')
56: ->setData(array(
57: 'label' => Mage::helper('backup')->__('System Backup'),
58: 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT . "')",
59: 'class' => ''
60: ))
61: );
62: $this->setChild('createMediaBackupButton',
63: $this->getLayout()->createBlock('adminhtml/widget_button')
64: ->setData(array(
65: 'label' => Mage::helper('backup')->__('Database and Media Backup'),
66: 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_MEDIA . "')",
67: 'class' => ''
68: ))
69: );
70: $this->setChild('backupsGrid',
71: $this->getLayout()->createBlock('adminhtml/backup_grid')
72: );
73:
74: $this->setChild('dialogs', $this->getLayout()->createBlock('adminhtml/backup_dialogs'));
75: }
76:
77: public function getCreateButtonHtml()
78: {
79: return $this->getChildHtml('createButton');
80: }
81:
82: /**
83: * Generate html code for "Create System Snapshot" button
84: *
85: * @return string
86: */
87: public function getCreateSnapshotButtonHtml()
88: {
89: return $this->getChildHtml('createSnapshotButton');
90: }
91:
92: /**
93: * Generate html code for "Create Media Backup" button
94: *
95: * @return string
96: */
97: public function getCreateMediaBackupButtonHtml()
98: {
99: return $this->getChildHtml('createMediaBackupButton');
100: }
101:
102: public function getGridHtml()
103: {
104: return $this->getChildHtml('backupsGrid');
105: }
106:
107: /**
108: * Generate html code for pop-up messages that will appear when user click on "Rollback" link
109: *
110: * @return string
111: */
112: public function getDialogsHtml()
113: {
114: return $this->getChildHtml('dialogs');
115: }
116: }
117: