Fooman_Common - Version 1.1.15

Version Notes

1.1.15 release

Download this release

Release Info

Developer Kristof Ringleff
Extension Fooman_Common
Version 1.1.15
Comparing to
See all releases


Version 1.1.15

app/code/community/Fooman/Common/Block/Adminhtml/Extensioninfo.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fooman Common
4
+ *
5
+ * @package Fooman_Common
6
+ * @author Kristof Ringleff <kristof@fooman.co.nz>
7
+ * @copyright Copyright (c) 2012 Fooman Limited (http://www.fooman.co.nz)
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ class Fooman_Common_Block_Adminhtml_Extensioninfo extends Mage_Adminhtml_Block_System_Config_Form_Field
14
+ {
15
+ protected $_hasSelftest = false;
16
+ protected $_idString = '';
17
+ protected $_moduleName = '';
18
+
19
+ /**
20
+ * return the selftest button if a selftest is supported for this extension
21
+ *
22
+ * @param Varien_Data_Form_Element_Abstract $element
23
+ *
24
+ * @return string
25
+ */
26
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
27
+ {
28
+ $this->setTemplate('fooman/common/selftester.phtml');
29
+ $this->setShowSelftestButton(false);
30
+ if ($this->_hasSelftest) {
31
+ if (Mage::getModel($this->_idString . '/selftester')) {
32
+ $this->setShowSelftestButton(true);
33
+ $this->setSelftestButtonUrl(
34
+ Mage::helper('adminhtml')->getUrl(
35
+ 'adminhtml/selftester',
36
+ array(
37
+ 'module' => $this->_idString,
38
+ 'moduleName' => $this->_moduleName
39
+ )
40
+ )
41
+ );
42
+ $element->setReadonly(true, true);
43
+ }
44
+ }
45
+ $this->setConfigVersion((string)Mage::getConfig()->getModuleConfig($this->_moduleName)->version);
46
+
47
+ return $this->_toHtml();
48
+ }
49
+ }
app/code/community/Fooman/Common/Helper/Data.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @author Kristof Ringleff
5
+ * @package Fooman_Common
6
+ * @copyright Copyright (c) 2009 Fooman Limited (http://www.fooman.co.nz)
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ class Fooman_Common_Helper_Data extends Mage_Core_Helper_Abstract
13
+ {
14
+ /**
15
+ * Helper function to create a hash from a base64 Fooman serial number
16
+ *
17
+ * @param $serial
18
+ *
19
+ * @return string
20
+ */
21
+ public function convertSerialToId($serial)
22
+ {
23
+ return hash('sha256', str_replace(array("\r\n", "\n", "\r", " ", PHP_EOL), '', $serial));
24
+ }
25
+
26
+ /**
27
+ * return css file path to include for overlay window css - version dependent
28
+ *
29
+ * @return string
30
+ */
31
+ public function getOverlayFileName()
32
+ {
33
+ if (file_exists($this->_getNewOverlayFileLocation())) {
34
+ return 'lib/prototype/windows/themes/magento.css';
35
+ } else {
36
+ return 'prototype/windows/themes/magento.css';
37
+ }
38
+ }
39
+
40
+ /**
41
+ * return css file type to include for overlay window css - version dependent
42
+ *
43
+ * @return string
44
+ */
45
+ public function getOverlayFileType()
46
+ {
47
+ if (file_exists($this->_getNewOverlayFileLocation())) {
48
+ return 'skin_css';
49
+ } else {
50
+ return 'js_css';
51
+ }
52
+ }
53
+
54
+ /**
55
+ * path of new magento.css file
56
+ *
57
+ * @return string
58
+ */
59
+ protected function _getNewOverlayFileLocation()
60
+ {
61
+ return BP . DS . 'skin' . DS . 'adminhtml' . DS . 'default' . DS . 'default'
62
+ . DS . 'lib' . DS . 'prototype' . DS . 'windows' . DS . 'themes' . DS . 'magento.css';
63
+ }
64
+ }
app/code/community/Fooman/Common/LICENSE.txt ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Open Software License ("OSL") v. 3.0
3
+
4
+ This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
5
+
6
+ Licensed under the Open Software License version 3.0
7
+
8
+ 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
9
+
10
+ 1. to reproduce the Original Work in copies, either alone or as part of a collective work;
11
+
12
+ 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
13
+
14
+ 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
15
+
16
+ 4. to perform the Original Work publicly; and
17
+
18
+ 5. to display the Original Work publicly.
19
+
20
+ 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
21
+
22
+ 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
23
+
24
+ 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
25
+
26
+ 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
27
+
28
+ 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
29
+
30
+ 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
31
+
32
+ 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
33
+
34
+ 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
35
+
36
+ 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
37
+
38
+ 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
39
+
40
+ 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
41
+
42
+ 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
43
+
44
+ 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
45
+
46
+ 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
47
+
48
+ 16. Modification of This License. This License is Copyright � 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
app/code/community/Fooman/Common/Model/Selftester.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fooman Common
4
+ *
5
+ * @package Fooman_Common
6
+ * @author Kristof Ringleff <kristof@fooman.co.nz>
7
+ * @copyright Copyright (c) 2012 Fooman Limited (http://www.fooman.co.nz)
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ class Fooman_Common_Model_Selftester extends Fooman_Common_Model_Selftester_Abstract
14
+ {
15
+ public $messages = array();
16
+ public $errorOccurred = false;
17
+ protected $_fix = false;
18
+
19
+ /**
20
+ * Start the selftest
21
+ *
22
+ * @return $this
23
+ */
24
+ public function main ()
25
+ {
26
+ $this->messages[] = 'Starting ' . get_class($this);
27
+ $failed = false;
28
+ try {
29
+ if (!$this->selfCheckLocation()) {
30
+ $failed = true;
31
+ }
32
+ if (Mage::app()->getRequest()->getParam('fix') == 'true') {
33
+ $this->_fix = true;
34
+ }
35
+ if (!$this->checkFileLocations()) {
36
+ $failed = true;
37
+ }
38
+ if (!$this->magentoRewrites()) {
39
+ $failed = true;
40
+ }
41
+ if (!$this->dbCheck()) {
42
+ $failed = true;
43
+ }
44
+ if (!$this->hasSettings()) {
45
+ $failed = true;
46
+ }
47
+ if (!$failed) {
48
+ $this->messages[] = 'Result: success';
49
+ } else {
50
+ $this->messages[] = 'Result: failure';
51
+ $this->errorOccurred = true;
52
+ }
53
+ } catch (Exception $e) {
54
+ $this->errorOccurred = true;
55
+ $this->messages[] = $e->getMessage();
56
+ }
57
+ $this->messages[] = 'Self-test finished';
58
+ return $this;
59
+ }
60
+
61
+ /**
62
+ * preliminary tests if the selftest can find a Magento instance
63
+ *
64
+ * @return bool
65
+ * @throws Exception
66
+ */
67
+ public function selfCheckLocation()
68
+ {
69
+ if (file_exists('app' . DIRECTORY_SEPARATOR . 'Mage.php')) {
70
+ require_once 'app' . DIRECTORY_SEPARATOR . 'Mage.php';
71
+ Mage::app();
72
+ $this->messages[] = "Default store loaded";
73
+ $this->_getVersions();
74
+ } else {
75
+ $this->messages[] = 'Can\'t instantiate Magento. Is the file uploaded to your root Magento folder?';
76
+ throw new Exception();
77
+ }
78
+ return true;
79
+ }
80
+
81
+ /**
82
+ * return fix boolean flag
83
+ *
84
+ * @return bool
85
+ */
86
+ public function shouldFix()
87
+ {
88
+ return $this->_fix;
89
+ }
90
+
91
+ /**
92
+ * test if all expected files exist and can be read/opened
93
+ *
94
+ * @return bool
95
+ */
96
+ public function checkFileLocations()
97
+ {
98
+ $returnVal = true;
99
+ $this->messages[] = "Checking file locations";
100
+ foreach ($this->_getFiles() as $currentRow) {
101
+
102
+ if (empty($currentRow)) {
103
+ continue;
104
+ }
105
+ try {
106
+ if (!file_exists($currentRow)) {
107
+ throw new Exception('File ' . $currentRow . ' does not exist');
108
+ }
109
+ if (!is_readable($currentRow)) {
110
+ throw new Exception(
111
+ 'Can\'t read file ' . $currentRow . ' - please check file permissions and file owner.'
112
+ );
113
+ }
114
+
115
+ $handleExtFile = fopen($currentRow, "r");
116
+ if (!$handleExtFile) {
117
+ throw new Exception(
118
+ 'Can\'t read file contents ' . $currentRow
119
+ . ' - please check if the file got corrupted in the upload process.'
120
+ );
121
+ }
122
+ fclose($handleExtFile);
123
+ } catch (Exception $e) {
124
+ $this->messages[] = $e->getMessage();
125
+ $returnVal = false;
126
+ }
127
+ }
128
+ return $returnVal;
129
+ }
130
+
131
+ /**
132
+ * check that rewrites return expected classes
133
+ *
134
+ * @return bool
135
+ */
136
+ public function magentoRewrites ()
137
+ {
138
+ $returnVal = true;
139
+ $this->messages[] = "Checking rewrites";
140
+
141
+ foreach ($this->_getRewrites() as $currentRow) {
142
+
143
+ if (empty($currentRow) || !$currentRow) {
144
+ continue;
145
+ }
146
+ try {
147
+ $this->_testRewriteRow($currentRow);
148
+ } catch (Exception $e) {
149
+ $this->messages[] = $e->getMessage();
150
+ $returnVal = false;
151
+ }
152
+ }
153
+ return $returnVal;
154
+ }
155
+
156
+ /**
157
+ * check the database for expected tables, columns and attributes
158
+ *
159
+ * @return bool
160
+ */
161
+ public function dbCheck()
162
+ {
163
+ //we don't use getModel since the common extension might not yet be installed correctly
164
+ $dbCheckModel = new Fooman_Common_Model_Selftester_Db();
165
+ return $dbCheckModel->dbCheck($this);
166
+ }
167
+
168
+ /**
169
+ * retrieve current database info relevant for debugging
170
+ *
171
+ * @return bool
172
+ */
173
+ public function hasSettings()
174
+ {
175
+ foreach ($this->_getSettings() as $table => $tableValues) {
176
+
177
+ $this->messages[] = $table;
178
+ foreach ($tableValues as $setting) {
179
+ $msg = array();
180
+ foreach ($setting as $key => $value) {
181
+ $msg[] = $key . ': ' . $value;
182
+ }
183
+ $this->messages[] = implode(' | ', $msg);
184
+ }
185
+
186
+ }
187
+ return true;
188
+ }
189
+
190
+ }
app/code/community/Fooman/Common/Model/Selftester/Abstract.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fooman Common
4
+ *
5
+ * @package Fooman_Common
6
+ * @author Kristof Ringleff <kristof@fooman.co.nz>
7
+ * @copyright Copyright (c) 2012 Fooman Limited (http://www.fooman.co.nz)
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ class Fooman_Common_Model_Selftester_Abstract extends Mage_Core_Model_Abstract
14
+ {
15
+
16
+ /**
17
+ * Helper to test for rewrites
18
+ *
19
+ * @param array $currentRow The rewrite info
20
+ *
21
+ * @throws Exception
22
+ *
23
+ * @return void
24
+ */
25
+ protected function _testRewriteRow(array $currentRow)
26
+ {
27
+ switch ($currentRow[0]) {
28
+ case 'resource-model':
29
+ $model = Mage::getResourceModel($currentRow[1]);
30
+ if (get_class($model) != $currentRow[2]) {
31
+ throw new Exception(
32
+ 'Trying to load class ' . $currentRow[2] . 'returns ' . get_class($model)
33
+ . '. Please refresh your Magento configuration cache and check
34
+ if you have any conflicting extensions installed.'
35
+ );
36
+ }
37
+ break;
38
+
39
+ case 'model':
40
+ $model = Mage::getModel($currentRow[1]);
41
+ if (!($model instanceof $currentRow[2])) {
42
+ throw new Exception(
43
+ 'Trying to load class ' . $currentRow[2] . ' returns ' . get_class($model)
44
+ . '. Please refresh your Magento configuration cache and check
45
+ if you have any conflicting extensions installed.'
46
+ );
47
+ }
48
+ if (get_class($model) != $currentRow[2]) {
49
+ $this->messages[] =
50
+ 'Trying to load class ' . $currentRow[2] . ' returns correct instance but unexpected class '
51
+ . get_class($model). '. This can be a likely cause of issues and will need to be investigated
52
+ on a case by case basis if the other extension cannot be uninstalled.';
53
+ }
54
+ break;
55
+ case 'block':
56
+ $block = Mage::app()->getLayout()->createBlock($currentRow[1]);
57
+ if (!($block instanceof $currentRow[2])) {
58
+ throw new Exception(
59
+ 'Trying to load block ' . $currentRow[2] . ' returns ' . get_class($block)
60
+ . '. Please refresh your Magento configuration cache and check
61
+ if you have any conflicting extensions installed.'
62
+ );
63
+ }
64
+ if (get_class($block) != $currentRow[2]) {
65
+ $this->messages[] =
66
+ 'Trying to load block ' . $currentRow[2] . ' returns correct instance but unexpected class '
67
+ . get_class($block). '. This can be a likely cause of issues and will need to be investigated
68
+ on a case by case basis if the other extension cannot be uninstalled.';
69
+ }
70
+ break;
71
+ }
72
+ }
73
+
74
+ /**
75
+ * add Mage version to messages
76
+ *
77
+ * @return void
78
+ */
79
+ public function _getVersions()
80
+ {
81
+ $this->messages[] = "Magento version: " . Mage::getVersion();
82
+ }
83
+
84
+ /**
85
+ * stub for retrieval of database fields
86
+ *
87
+ * @return array
88
+ */
89
+ public function _getDbFields()
90
+ {
91
+ return array();
92
+ }
93
+
94
+ /**
95
+ * stub for retrieval of rewrite information
96
+ *
97
+ * @return array
98
+ */
99
+ public function _getRewrites ()
100
+ {
101
+ return array();
102
+ }
103
+
104
+ /**
105
+ * stub for list of files
106
+ *
107
+ * @return array
108
+ */
109
+ public function _getFiles ()
110
+ {
111
+ return array();
112
+ }
113
+
114
+ /**
115
+ * stub for db settings
116
+ *
117
+ * @return array
118
+ */
119
+ public function _getSettings()
120
+ {
121
+ return array();
122
+ }
123
+
124
+ }
app/code/community/Fooman/Common/Model/Selftester/Db.php ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fooman Common
4
+ *
5
+ * @package Fooman_Common
6
+ * @author Kristof Ringleff <kristof@fooman.co.nz>
7
+ * @copyright Copyright (c) 2012 Fooman Limited (http://www.fooman.co.nz)
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ class Fooman_Common_Model_Selftester_Db extends Mage_Core_Model_Abstract
14
+ {
15
+ public $messages = array();
16
+ public $errorOccurred = false;
17
+ protected $_dbOkay = true;
18
+
19
+
20
+ /**
21
+ * check the database for expected tables, columns and attributes
22
+ *
23
+ * @param Fooman_Common_Model_Selftester $selftester
24
+ *
25
+ * @return bool
26
+ */
27
+ public function dbCheck (Fooman_Common_Model_Selftester $selftester)
28
+ {
29
+ $localError = false;
30
+ $selftester->messages[] = "Checking database";
31
+ $installer = new Mage_Sales_Model_Mysql4_Setup('sales_setup');
32
+ $installer->startSetup();
33
+
34
+ foreach ($selftester->_getDbFields() as $field) {
35
+ switch ($field[0]) {
36
+ case 'eav':
37
+ $localError = $this->_dbCheckEav($selftester, $field, $installer, $localError);
38
+ break;
39
+ case 'sql-column':
40
+ $localError = $this->_dbCheckSqlColumn($selftester, $field, $installer, $localError);
41
+ break;
42
+ case 'table':
43
+ $localError = $this->_dbCheckSqlTable($selftester, $field, $installer, $localError);
44
+ break;
45
+ case 'constraint':
46
+ $localError = $this->_dbCheckConstraint($selftester, $field, $installer, $localError);
47
+ break;
48
+ case 'row-data':
49
+ $localError = $this->_dbCheckDbRow($selftester, $field, $installer, $localError);
50
+ break;
51
+ }
52
+ }
53
+ $installer->endSetup();
54
+ if (empty($localError)) {
55
+ return true;
56
+ } else {
57
+ if ($this->_dbOkay == false) {
58
+ $selftester->messages[]
59
+ = "<p>The selftest has found some problems with your database install.
60
+ You can attempt to fix this by clicking this <a href=\""
61
+ . htmlentities(Mage::app()->getRequest()->getServer('PHP_SELF', ''))
62
+ . "?fix=true\">link</a>.</p><p style=\"color:red;\"><em>A DATABASE BACKUP IS strongly
63
+ RECOMMENDED BEFORE ATTEMPTING THIS!</em></p>";
64
+ }
65
+ return false;
66
+ }
67
+ }
68
+
69
+ /**
70
+ * check the DB for an expected EAV attribute
71
+ *
72
+ * @param Fooman_Common_Model_Selftester $selftester
73
+ * @param $field
74
+ * @param $installer
75
+ * @param $localError
76
+ *
77
+ * @return bool
78
+ */
79
+ protected function _dbCheckEav(Fooman_Common_Model_Selftester $selftester, $field, $installer, $localError)
80
+ {
81
+ try {
82
+ $attribute = Mage::getModel('eav/entity_attribute')->loadByCode($field[1], $field[2]);
83
+ if (!$attribute->getId() > 0) {
84
+ $localError = true;
85
+ throw new Exception('eav attribute ' . $field[2] . ' is not installed');
86
+ }
87
+ $selftester->messages[] = "[OK] eav attribute " . $field[2]." with id ".$attribute->getId()."";
88
+ } catch (Exception $e) {
89
+ if ($selftester->shouldFix()) {
90
+ $selftester->messages[] = "Attempting fix for eav attribute " . $field[2]."";
91
+ try {
92
+ $installer->addAttribute($field[1], $field[2], $field[3]);
93
+ $selftester->messages[] = "[FIX OK] eav attribute " . $field[2]." fixed";
94
+ } catch (Exception $e) {
95
+ $selftester->messages[] = "[FAILED] fixing eav attribute " . $field[2]."";
96
+ $this->_dbOkay = false;
97
+ $selftester->messages[] = $e->getMessage();
98
+ $localError = true;
99
+ }
100
+ } else {
101
+ $selftester->messages[] = "[FAILED] eav attribute " . $field[2] . "";
102
+ $this->_dbOkay = false;
103
+ $selftester->messages[] = "[ERR] ".$e->getMessage();
104
+ $localError = true;
105
+ }
106
+ }
107
+ return $localError;
108
+ }
109
+
110
+
111
+ /**
112
+ * check the DB for an expected table column
113
+ *
114
+ * @param Fooman_Common_Model_Selftester $selftester
115
+ * @param $field
116
+ * @param $installer
117
+ * @param $localError
118
+ *
119
+ * @return bool
120
+ */
121
+ protected function _dbCheckSqlColumn(Fooman_Common_Model_Selftester $selftester, $field, $installer, $localError)
122
+ {
123
+ try {
124
+ if (!$installer->getConnection()->tableColumnExists($installer->getTable($field[1]), $field[2])) {
125
+ throw new Exception(
126
+ sprintf('Did not find column %s in table %s', $field[2], $installer->getTable($field[1]))
127
+ );
128
+ }
129
+ $selftester->messages[] = "[OK] column " . $field[2]."";
130
+ } catch (Exception $e) {
131
+ if ($selftester->shouldFix()) {
132
+ $selftester->messages[] = "Attempting fix for column " . $field[2]."";
133
+ try {
134
+ $installer->getConnection()->addColumn(
135
+ $installer->getTable($field[1]),
136
+ $field[2],
137
+ $field[3]
138
+ );
139
+ $selftester->messages[] = "[FIX OK] column " . $field[2]." fixed";
140
+ } catch (Exception $e) {
141
+ $selftester->messages[] = "[FAILED] fixing column " . $field[2]."";
142
+ $this->_dbOkay = false;
143
+ $selftester->messages[] = $e->getMessage();
144
+ $localError = true;
145
+ }
146
+ } else {
147
+ $selftester->messages[] = "[FAILED] column " . $field[2]."";
148
+ $this->_dbOkay = false;
149
+ $selftester->messages[] = "[ERR] ".$e->getMessage();
150
+ $localError = true;
151
+ }
152
+ }
153
+ return $localError;
154
+
155
+ }
156
+
157
+ /**
158
+ * check the DB for an expected table
159
+ *
160
+ * @param Fooman_Common_Model_Selftester $selftester
161
+ * @param $fields
162
+ * @param $installer
163
+ * @param $localError
164
+ *
165
+ * @return bool
166
+ */
167
+ protected function _dbCheckSqlTable(Fooman_Common_Model_Selftester $selftester, $fields, $installer, $localError)
168
+ {
169
+ try {
170
+ $tables = $installer->getConnection()->listTables();
171
+
172
+ if (!(array_search($installer->getTable($fields[1]), $tables))) {
173
+ throw new Exception(
174
+ sprintf('Did not find table %s', $installer->getTable($fields[1]))
175
+ );
176
+ }
177
+ $selftester->messages[] = "[OK] Table " . $fields[1]."";
178
+ } catch (Exception $e) {
179
+ if ($selftester->shouldFix()) {
180
+ $selftester->messages[] = "Attempting fix for table " . $fields[1]."";
181
+
182
+ $keys = array();
183
+ $columns = array();
184
+
185
+ foreach ($fields[2] as $item) {
186
+ switch ($item[0]) {
187
+ case 'sql-column':
188
+ $columns[] = '`'.$item[1].'` '.$item[2];
189
+ break;
190
+ case 'key':
191
+ $keys[] = $item[1] .' (`'.$item[2].'`)';
192
+ break;
193
+ }
194
+ }
195
+ $tableDetails = implode(",", array_merge($columns, $keys));
196
+ $sql ="CREATE TABLE `{$installer->getTable( $fields[1])}` ("
197
+ .$tableDetails.") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
198
+ try {
199
+ $installer->run($sql);
200
+ $selftester->messages[] = "[FIX OK] table " . $fields[1]." fixed";
201
+ } catch (Exception $e) {
202
+ $selftester->messages[] = "[FAILED] fixing table " . $fields[1]."";
203
+ $this->_dbOkay = false;
204
+ $selftester->messages[] = $e->getMessage();
205
+ $localError = true;
206
+ }
207
+ } else {
208
+ $selftester->messages[] = "[FAILED] table " . $fields[1]."";
209
+ $this->_dbOkay = false;
210
+ $selftester->messages[] = "[ERR] ".$e->getMessage();
211
+ $localError = true;
212
+ }
213
+ }
214
+ return $localError;
215
+
216
+ }
217
+
218
+ /**
219
+ * check the DB for an expected constraint
220
+ *
221
+ * @param Fooman_Common_Model_Selftester $selftester
222
+ * @param $fields
223
+ * @param $installer
224
+ * @param $localError
225
+ *
226
+ * @return bool
227
+ */
228
+ protected function _dbCheckConstraint(Fooman_Common_Model_Selftester $selftester, $fields, $installer, $localError)
229
+ {
230
+ try {
231
+ $constraints = $installer->getConnection()->getKeyList($installer->getTable($fields[2]));
232
+ if (!(isset($constraints[$installer->getTable($fields[1])]))) {
233
+ throw new Exception(
234
+ sprintf('Did not find constraint %s', $installer->getTable($fields[1]))
235
+ );
236
+ }
237
+ $selftester->messages[] = "[OK] Constraint " . $fields[1]."";
238
+ } catch (Exception $e) {
239
+ if ($selftester->shouldFix()) {
240
+ $selftester->messages[] = "Attempting fix for constraint " . $fields[1]."";
241
+ try {
242
+ $installer->getConnection()->addConstraint(
243
+ $fields[1],
244
+ $installer->getTable($fields[2]), $fields[3],
245
+ $installer->getTable($fields[4]), $fields[5],
246
+ $fields[6], $fields[7], $fields[8]
247
+ );
248
+ $selftester->messages[] = "[FIX OK] constraint " . $fields[1]." fixed";
249
+ } catch (Exception $e) {
250
+ $selftester->messages[] = "[FAILED] fixing constraint " . $fields[1]."";
251
+ $this->_dbOkay = false;
252
+ $selftester->messages[] = $e->getMessage();
253
+ $localError = true;
254
+ }
255
+ } else {
256
+ $selftester->messages[] = "[FAILED] constraint " . $fields[1]."";
257
+ $this->_dbOkay = false;
258
+ $selftester->messages[] = "[ERR] ".$e->getMessage();
259
+ $localError = true;
260
+ }
261
+ }
262
+ return $localError;
263
+ }
264
+
265
+ /**
266
+ * check the DB for expected content
267
+ *
268
+ * @param Fooman_Common_Model_Selftester $selftester
269
+ * @param $fields
270
+ * @param $installer
271
+ * @param $localError
272
+ *
273
+ * @return bool
274
+ */
275
+ protected function _dbCheckDbRow(Fooman_Common_Model_Selftester $selftester, $fields, $installer, $localError)
276
+ {
277
+ try {
278
+ $where = array();
279
+ foreach ($fields[2] as $key => $value) {
280
+ $where[] = "`" . $key . "`='" . $value . "'";
281
+ }
282
+ $sql ="SELECT * FROM `{$installer->getTable( $fields[1])}` WHERE ".implode(' AND ', $where).";";
283
+
284
+ $result = $installer->getConnection()->fetchOne($sql);
285
+ if (!$result) {
286
+ throw new Exception(
287
+ sprintf('Did not find content in %s', $installer->getTable($fields[1]))
288
+ );
289
+ }
290
+
291
+ $selftester->messages[] = "[OK] Content " . $fields[1]."";
292
+ } catch (Exception $e) {
293
+ if ($selftester->shouldFix()) {
294
+ $selftester->messages[] = "Attempting fix for content in " . $fields[1]."";
295
+ try {
296
+ $installer->getConnection()->insert(
297
+ $installer->getTable($fields[1]),
298
+ $fields[2]
299
+ );
300
+ $selftester->messages[] = "[FIX OK] content in " . $fields[1]." fixed";
301
+ } catch (Exception $e) {
302
+ $selftester->messages[] = "[FAILED] fixing content in " . $fields[1]."";
303
+ $this->_dbOkay = false;
304
+ $selftester->messages[] = $e->getMessage();
305
+ $localError = true;
306
+ }
307
+ } else {
308
+ $selftester->messages[] = "[FAILED] content in " . $fields[1]."";
309
+ $this->_dbOkay = false;
310
+ $selftester->messages[] = "[ERR] ".$e->getMessage();
311
+ $localError = true;
312
+ }
313
+ }
314
+ return $localError;
315
+ }
316
+ }
app/code/community/Fooman/Common/controllers/Adminhtml/SelftesterController.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fooman Common
4
+ *
5
+ * @package Fooman_Common
6
+ * @author Kristof Ringleff <kristof@fooman.co.nz>
7
+ * @copyright Copyright (c) 2012 Fooman Limited (http://www.fooman.co.nz)
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ class Fooman_Common_Adminhtml_SelftesterController extends Mage_Adminhtml_Controller_Action
14
+ {
15
+
16
+ /**
17
+ * Here we actually run the process of selftesting. All messages are returned to the session
18
+ *
19
+ * @return void
20
+ */
21
+ public function indexAction()
22
+ {
23
+
24
+ $module = $this->getRequest()->getParam('module');
25
+ $selftester = Mage::getModel($module . '/selftester')->main();
26
+ //Here we get db version of the given module code
27
+ if (Mage::getModel('core/mysql4_resource')->getDbVersion($module . '_setup')) {
28
+ $dbVersion = Mage::getModel('core/mysql4_resource')->getDbVersion($module . '_setup');
29
+ } else {
30
+ $dbVersion = 'Not Available';
31
+ }
32
+
33
+ //Here we get data version of the given module code
34
+ if (Mage::getModel('core/mysql4_resource')->getDataVersion($module . '_setup')) {
35
+ $dataVersion = Mage::getModel('core/mysql4_resource')->getDataVersion($module . '_setup');
36
+ } else {
37
+ $dataVersion = 'Not Available';
38
+ }
39
+ //Here we get configuration version of the given module name
40
+ $moduleName = $this->getRequest()->getParam('moduleName');
41
+ $configVersion = (string)Mage::getConfig()->getModuleConfig($moduleName)->version;
42
+ $selftester->messages = array_merge(
43
+ array(
44
+ 'Config Version: ' . $configVersion,
45
+ 'DB Version: ' . $dbVersion,
46
+ 'Data Version: ' . $dataVersion,
47
+ ), $selftester->messages
48
+ );
49
+
50
+ if (!$selftester->errorOccurred) {
51
+ Mage::getSingleton('core/session')->addSuccess(implode("<br/>", $selftester->messages));
52
+ } else {
53
+ Mage::getSingleton('core/session')->addError(implode("<br/>", $selftester->messages));
54
+ }
55
+ //Here we load appropriate layout. In our case its popup
56
+ $layout = $this->getLayout();
57
+ $layout->getUpdate()->load('selftest_popup');
58
+ $layout->generateXml();
59
+ $layout->generateBlocks();
60
+ $output = $layout->getOutput();
61
+
62
+ $this->getResponse()->setBody($output);
63
+ //Here we clear all the messages of the current session, because otherwise we will get a number
64
+ //of duplicates from the previous page loads.
65
+ Mage::getSingleton('core/session')->getMesssages(true);
66
+ }
67
+ }
app/code/community/Fooman/Common/etc/config.xml ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /*
4
+ * @author Kristof Ringleff
5
+ * @package Fooman_Common
6
+ * @copyright Copyright (c) 2009 Fooman Limited (http://www.fooman.co.nz)
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Fooman_Common>
12
+ <version>1.1.15</version>
13
+ </Fooman_Common>
14
+ </modules>
15
+ <global>
16
+ <blocks>
17
+ <foomancommon>
18
+ <class>Fooman_Common_Block</class>
19
+ </foomancommon>
20
+ </blocks>
21
+ <models>
22
+ <foomancommon>
23
+ <class>Fooman_Common_Model</class>
24
+ </foomancommon>
25
+ </models>
26
+ <helpers>
27
+ <foomancommon>
28
+ <class>Fooman_Common_Helper</class>
29
+ </foomancommon>
30
+ </helpers>
31
+ </global>
32
+ <admin>
33
+ <routers>
34
+ <adminhtml>
35
+ <args>
36
+ <modules>
37
+ <foomancommon after="Mage_Adminhtml">Fooman_Common_Adminhtml</foomancommon>
38
+ </modules>
39
+ </args>
40
+ </adminhtml>
41
+ </routers>
42
+ </admin>
43
+ <adminhtml>
44
+ <layout>
45
+ <updates>
46
+ <foomancommon>
47
+ <file>fooman_common.xml</file>
48
+ </foomancommon>
49
+ </updates>
50
+ </layout>
51
+ <acl>
52
+ <resources>
53
+ <admin>
54
+ <children>
55
+ <foomancommon translate="title" module="foomancommon">
56
+ <title>Fooman Selftests</title>
57
+ <sort_order>-100</sort_order>
58
+ </foomancommon>
59
+ <system>
60
+ <children>
61
+ <config>
62
+ <children>
63
+ <foomancommon translate="title" module="foomancommon">
64
+ <title>Fooman</title>
65
+ <sort_order>50</sort_order>
66
+ </foomancommon>
67
+ </children>
68
+ </config>
69
+ </children>
70
+ </system>
71
+ </children>
72
+ </admin>
73
+ </resources>
74
+ </acl>
75
+ </adminhtml>
76
+ </config>
app/code/community/Fooman/Common/etc/system.xml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <fooman translate="label" module="foomancommon">
5
+ <label>Fooman Extensions</label>
6
+ <sort_order>500</sort_order>
7
+ </fooman>
8
+ </tabs>
9
+ <sections>
10
+ <foomancommon>
11
+ <label>Support</label>
12
+ <tab>fooman</tab>
13
+ <show_in_default>1</show_in_default>
14
+ <show_in_website>1</show_in_website>
15
+ <show_in_store>1</show_in_store>
16
+ <sort_order>100</sort_order>
17
+ <groups>
18
+ <!--<notifications translate="label" module="foomancommon">
19
+ <label>Update Notifications</label>
20
+ <comment>To receive notifications please make sure that your Magento cron.php is set up. Please refer to the Magento documentation on how to do this.</comment>
21
+ <sort_order>100</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>0</show_in_store>
25
+ </notifications>-->
26
+ <extensions translate="label" module="foomancommon">
27
+ <label>Extensions Installed</label>
28
+ <comment>Here you can find a list of all Fooman extensions currently installed on your system.</comment>
29
+ <sort_order>101</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>0</show_in_store>
33
+ </extensions>
34
+ </groups>
35
+ </foomancommon>
36
+ </sections>
37
+ </config>
app/code/community/Fooman/Common/modman ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ ../../../../../app/code/community/Fooman/Common/ /app/code/community/Fooman/Common/
2
+ ../../../../../app/design/adminhtml/default/default/layout/fooman_common.xml /app/design/adminhtml/default/default/layout/fooman_common.xml
3
+ ../../../../../app/design/adminhtml/default/default/template/fooman/common/ /app/design/adminhtml/default/default/template/fooman/common/
4
+ ../../../../../app/etc/modules/Fooman_Common.xml /app/etc/modules/Fooman_Common.xml
5
+ ../../../../../app/locale/en_US/Fooman_Common.csv /app/locale/en_US/Fooman_Common.csv
app/design/adminhtml/default/default/layout/fooman_common.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
6
+ <action method="addItem">
7
+ <type helper="foomancommon/data/getOverlayFileType"/>
8
+ <name helper="foomancommon/data/getOverlayFileName"/>
9
+ </action>
10
+ </reference>
11
+ </default>
12
+ <selftest_popup>
13
+ <update handle="popup"/>
14
+ <remove name="footer"/>
15
+ </selftest_popup>
16
+ </layout>
app/design/adminhtml/default/default/template/fooman/common/selftester.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <strong>Config Version: </strong><?php echo $this->getConfigVersion(); ?><br/>
2
+ <?php if ($this->getShowSelftestButton()): ?>
3
+ <br/>
4
+ <button class="button" title="<?php echo $this->__('Run Selftest'); ?>"
5
+ onclick="showModal('<?php echo $this->getSelftestButtonUrl(); ?>')" type="button"><?php echo $this->__(
6
+ 'Run Selftest'
7
+ ); ?> </button>
8
+ <script type="text/javascript">
9
+ // <![CDATA[
10
+ function showModal(url) {
11
+ winModal = new Window({
12
+ className: 'magento',
13
+ title: 'Selftest',
14
+ url: url,
15
+ width: 820,
16
+ height: 475,
17
+ minimizable: false,
18
+ maximizable: false,
19
+ showEffectOptions: {duration: 0.4},
20
+ hideEffectOptions: {duration: 0.4}
21
+ });
22
+ winModal.setZIndex(100);
23
+ winModal.showCenter(true);
24
+ }
25
+ // ]]>
26
+ </script>
27
+ <?php endif;?>
28
+ &nbsp;
app/etc/modules/Fooman_Common.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Fooman_Common>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Fooman_Common>
8
+ </modules>
9
+ </config>
app/locale/en_US/Fooman_Common.csv ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ "Fooman Selftests","Fooman Selftests"
2
+ "Fooman Extensions","Fooman Extensions"
3
+ "Support","Support"
4
+ "Extensions Installed","Extensions Installed"
5
+ "Here you can find a list of all Fooman extensions currently installed on your system.","Here you can find a list of all Fooman extensions currently installed on your system."
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Fooman_Common</name>
4
+ <version>1.1.15</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Provides common functionality across Fooman extensions.</summary>
10
+ <description>add Fooman section to back-end, provide base selftest</description>
11
+ <notes>1.1.15 release</notes>
12
+ <authors><author><name>Kristof Ringleff</name><user>FOOMAN</user><email>kristof@fooman.co.nz</email></author><author><name>Kristof Ringleff</name><user>FOOMAN</user><email>kristof@fooman.co.nz</email></author></authors>
13
+ <date>2014-06-19</date>
14
+ <time>22:50:30</time>
15
+ <contents><target name="magecommunity"><dir name="Fooman"><dir name="Common"><dir name="Block"><dir name="Adminhtml"><file name="Extensioninfo.php" hash="48a6de0af77c57b5c1a4f62a7b8c717c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="27625b371977689df6ff51cbe80c236d"/></dir><file name="LICENSE.txt" hash="34410d4f566fdc33f094525a2d9865fa"/><dir name="Model"><dir name="Selftester"><file name="Abstract.php" hash="b6cf37236718450bdfd7d2d7c0b106f5"/><file name="Db.php" hash="5f5a01cc1f642640c37b86feccbee961"/></dir><file name="Selftester.php" hash="3cd38b42062004004b50052d2b2efa60"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SelftesterController.php" hash="67963c4d09fa95b389e8de4742f317dd"/></dir></dir><dir name="etc"><file name="config.xml" hash="28c85d634bdb4c87e9dfc7de4a19d4f7"/><file name="system.xml" hash="062afadb28b77803a0cf5fbdb472f23b"/></dir><file name="modman" hash="aa860cf2bae93db339b48ffc27d10955"/></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Fooman_Common.xml" hash="2555b2dd668865790df287b5cca61e35"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="fooman_common.xml" hash="a7e4ac18fcfcac0080b1aef960fe9c94"/></dir><dir name="template"><dir name="fooman"><dir name="common"><file name="selftester.phtml" hash="12c4225cfb71490f2b297f50650d1185"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Fooman_Common.csv" hash="d15584a4da95d0a802e048a99a844723"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>