Mindstretch_Installer - Version 2.0.0

Version Notes

This release comes with the feature of installing packages from magento channel or different channel

Download this release

Release Info

Developer Magento Core Team
Extension Mindstretch_Installer
Version 2.0.0
Comparing to
See all releases


Version 2.0.0

app/code/local/Mindstretch/Installer/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mindstretch_Installer_Helper_Data extends Mage_Core_Helper_Abstract {
4
+
5
+ }
6
+
app/code/local/Mindstretch/Installer/controllers/Adminhtml/FormController.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ set_include_path(
4
+ BP . DIRECTORY_SEPARATOR . 'downloader' . PATH_SEPARATOR .
5
+ get_include_path()
6
+ );
7
+
8
+ include_once "Maged/Pear.php";
9
+
10
+ class Mindstretch_Installer_Adminhtml_FormController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+ public function indexAction()
13
+ {
14
+ $this->loadLayout();
15
+ $this->renderLayout();
16
+ }
17
+
18
+ public function installAction()
19
+ {
20
+ $this->_doAction('install');
21
+ }
22
+
23
+ public function upgradeAction()
24
+ {
25
+ $this->_doAction('upgrade');
26
+ }
27
+
28
+ public function reinstallAction()
29
+ {
30
+ $this->_doAction('install', array('force' => 1));
31
+ }
32
+
33
+ private function _doAction($command, $options = array())
34
+ {
35
+ $post = $this->getRequest()->getPost();
36
+ $pear = Maged_Pear::getInstance();
37
+ try
38
+ {
39
+ $pkg = '';
40
+
41
+ if (is_uploaded_file($_FILES['file_local']['tmp_name']))
42
+ {
43
+ $pkg = $_FILES['file_local']['tmp_name'];
44
+ }
45
+ elseif (isset($post['file_remote']))
46
+ {
47
+ $pkg = $post['file_remote'];
48
+ }
49
+
50
+ if (!$pkg) Mage::throwException($this->__('No file selected.'));
51
+
52
+ $pear->runHtmlConsole(array(
53
+ 'command' => $command,
54
+ 'options' => $options,
55
+ 'params' => array($pkg),
56
+ ));
57
+ }
58
+ catch (Exception $e)
59
+ {
60
+ $pear->runHtmlConsole($e->getMessage());
61
+ echo '<script type="text/javascript">top.onFailure();</script>';
62
+ }
63
+ }
64
+ }
app/code/local/Mindstretch/Installer/etc/config.xml ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mindstretch_Installer>
5
+ <version>1.0.0</version>
6
+ </Mindstretch_Installer>
7
+ </modules>
8
+
9
+ <global>
10
+ <models>
11
+ <installer>
12
+ <class>Mindstretch_Installer_Model</class>
13
+ <resourceModel>installer_mysql4</resourceModel>
14
+ </installer>
15
+ <sintax_mysql4>
16
+ <class>Mindstretch_Installer_Model_Mysql4</class>
17
+ </sintax_mysql4>
18
+ </models>
19
+ <blocks>
20
+ <installer>
21
+ <class>Mindstretch_Installer_Block</class>
22
+ </installer>
23
+ </blocks>
24
+ <helpers>
25
+ <installer>
26
+ <class>Mindstretch_Installer_Helper</class>
27
+ </installer>
28
+ </helpers>
29
+ </global>
30
+
31
+ <admin>
32
+ <routers>
33
+ <installer>
34
+ <use>admin</use>
35
+ <args>
36
+ <module>Mindstretch_Installer</module>
37
+ <frontName>installer</frontName>
38
+ </args>
39
+ </installer>
40
+ </routers>
41
+ </admin>
42
+
43
+ <adminhtml>
44
+
45
+ <menu>
46
+ <system>
47
+ <children>
48
+ <extensions translate="title">
49
+ <title>Magento Connect</title>
50
+ <children>
51
+ <local translate="title">
52
+ <title>Magento Connect Manager</title>
53
+ <sort_order>0</sort_order>
54
+ </local>
55
+ <custom translate="title">
56
+ <title>Package Extensions</title>
57
+ <sort_order>5</sort_order>
58
+ </custom>
59
+ <installer_adminform translate="title" module="installer">
60
+ <title>Mindstretch Installer</title>
61
+ <action>installer/adminhtml_form</action>
62
+ <sort_order>6</sort_order>
63
+ </installer_adminform>
64
+ </children>
65
+ </extensions>
66
+ </children>
67
+ </system>
68
+ </menu>
69
+
70
+ <acl>
71
+ <resources>
72
+ <admin>
73
+ <children>
74
+ <system>
75
+ <children>
76
+ <installer_adminform>
77
+ <title>Mindstretch Installer</title>
78
+ </installer_adminform>
79
+ </children>
80
+ </system>
81
+ </children>
82
+ </admin>
83
+ </resources>
84
+ </acl>
85
+
86
+ <layout>
87
+ <updates>
88
+ <installer>
89
+ <file>installer.xml</file>
90
+ </installer>
91
+ </updates>
92
+ </layout>
93
+
94
+ <translate>
95
+ <modules>
96
+ <installer>
97
+ <files>
98
+ <Mindstretch>Mindstretch_Installer.csv</Mindstretch>
99
+ </files>
100
+ </installer>
101
+ </modules>
102
+ </translate>
103
+ </adminhtml>
104
+ </config>
app/design/adminhtml/default/default/layout/installer.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <installer_adminhtml_form_index>
4
+ <update handle="installer_form_index"/>
5
+ <reference name="content">
6
+ <block type="adminhtml/template" name="form" template="installer/form.phtml"/>
7
+ </reference>
8
+ </installer_adminhtml_form_index>
9
+ </layout>
app/design/adminhtml/default/default/template/installer/form.phtml ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="content-header">
2
+ <table cellspacing="0" class="grid-header">
3
+ <tr>
4
+ <td><h3><?php echo $this->__('Mindstretch Installer'); ?></h3></td>
5
+ <td class="a-right">
6
+ <button onclick="doUpgrade();" class="scalable" type="button"><span><?php echo $this->__('Upgrade')?></span></button>
7
+ <button onclick="doReinstall();" class="scalable save" type="button"><span><?php echo $this->__('Reinstall')?></span></button>
8
+ <button onclick="doInstall();" class="scalable add" type="button"><span><?php echo $this->__('Install')?></span></button>
9
+ </td>
10
+ </tr>
11
+ </table>
12
+ </div>
13
+ <div class="entry-edit">
14
+ <form id="installer_form" target="pear_iframe" name="installer_form" enctype="multipart/form-data" method="post">
15
+ <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
16
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Paste extension key to install:')?></h4>
17
+ <div>
18
+ <div class="entry-edit">
19
+ <div class="entry-edit-head">
20
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Install information')?></h4>
21
+ <div class="form-buttons"></div>
22
+ </div>
23
+ <div class="fieldset">
24
+ <div class="hor-scroll">
25
+ <table cellspacing="0" class="form-list">
26
+ <!--<tr>
27
+ <td class="label"><label for="file_local"><?php echo $this->__('Local File')?></label></td>
28
+ <td class="value"><input type="file" name="file_local" id="file_local"></td>
29
+ </tr>-->
30
+ <tr>
31
+ <td class="label">&nbsp;</td>
32
+ <div class="box">
33
+ <br/>
34
+ <p class="grand-total">Mindstretch Installer<br/><b></b></p>
35
+ <p><?php echo $this->__('Welcome to the Mindstretch Installer. With this module you can simplify the installation of your MagAddons.com modules.<br>If you have any questions please visit the links below to get access to our Customer Support.')?></p>
36
+ - <a href="http://www.magaddons.com/wiki" target="_blank"><strong>MagAddons.com Wiki</strong></a> <font size=1>(opens in new window)</font><br/>
37
+ - <a href="http://www.mindstretch.nl/supportrequest" target="_blank"><strong>MagAddons.com Support</strong></a> <font size=1>(opens in new window)</font><br/>
38
+ <br/>
39
+ <p class="grand-total"><?php echo $this->__('How to start using the Mindstretch Installer?')?><br/><b></b></p>
40
+ <p><?php echo $this->__('- Paste the extension key in the field below and press the install button.<br>- Check the output frame for useful information and refresh the page to see changes.')?></p>
41
+ <br>
42
+ </div>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><label for="file_remote"><?php echo $this->__('Extension Key')?></label></td>
46
+ <td class="value"><input type="text" class=" input-text" value="" name="file_remote" id="file_remote"></td>
47
+ </tr>
48
+ <tr>
49
+ <td class="label">&nbsp;</td>
50
+ <td class="value"><div class="notification-global" style="background-position:7px 5px; border:1px solid #EEE2BE; padding:5px 7px 5px 27px;"><?php echo $this->__('Before installing the extension is recommended to disable caching system.')?></div></td>
51
+ </tr>
52
+ </table>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </form>
58
+
59
+ <div id="pear_iframe_container" style="display:none;">
60
+ <input id="pear_iframe_scroll" type="checkbox" checked="checked"/> <label for="pear_iframe_scroll"><?php echo $this->__('Auto-scroll console contents')?></label><br/>
61
+ <iframe id="pear_iframe" name="pear_iframe" src="" style="width:100%; height:300px;" frameborder="no"></iframe>
62
+ </div>
63
+
64
+ <a name="pear_iframe_result"></a>
65
+ <div id="pear_iframe_success" style="display:none">
66
+ <ul class="msgs">
67
+ <li><?php echo $this->__('Procedure completed. Please check the output frame for useful information and refresh the page to see changes.')?></li>
68
+ </ul>
69
+ <button onclick="window.location.assign('<?php echo $this->getUrl('*/*/index')?>')"><?php echo $this->__('Refresh')?></button>
70
+ </div>
71
+ <div id="pear_iframe_failure" style="display:none">
72
+ <ul class="msgs">
73
+ <li><?php echo $this->__('Please check the output frame for errors and refresh the page to retry changes.')?></li>
74
+ </ul>
75
+ <button onclick="window.location.assign('<?php echo $this->getUrl('*/*/index')?>')"><?php echo $this->__('Refresh')?></button>
76
+ </div>
77
+ </div>
78
+ <script type="text/javascript">
79
+ //<![CDATA[
80
+ var installerForm = new varienForm('installer_form');
81
+
82
+ function disableInputs(flag)
83
+ {
84
+ top.$$('input, select, button').each(function(el){
85
+ if (el.id!='pear_iframe_scroll') el.disabled = flag;
86
+ });
87
+ if (flag)
88
+ {
89
+ window.onbeforeunload = confirmExit;
90
+ }
91
+ else
92
+ {
93
+ window.onbeforeunload = null;
94
+ }
95
+ }
96
+
97
+ function confirmExit()
98
+ {
99
+ return "<?php echo $this->__('There are PEAR processes running.\nIf you will close the window or navigate away from the page, installation will be interrupted.')?>";
100
+ }
101
+
102
+ function doAction()
103
+ {
104
+ top.$('pear_iframe_success').style.display = 'none';
105
+ top.$('pear_iframe_failure').style.display = 'none';
106
+ top.$('pear_iframe_container').style.display = '';
107
+ top.location.href = '#pear_iframe';
108
+ installerForm.submit();
109
+ return true;
110
+ }
111
+
112
+ function doInstall()
113
+ {
114
+ top.$('installer_form').action = '<?php echo $this->getUrl('*/*/install')?>';
115
+ return doAction();
116
+ }
117
+
118
+ function doUpgrade()
119
+ {
120
+ top.$('installer_form').action = '<?php echo $this->getUrl('*/*/upgrade')?>';
121
+ return doAction();
122
+ }
123
+
124
+ function doReinstall()
125
+ {
126
+ top.$('installer_form').action = '<?php echo $this->getUrl('*/*/reinstall')?>';
127
+ return doAction();
128
+ }
129
+
130
+ function onSuccess()
131
+ {
132
+ var div = top.$('pear_iframe_success');
133
+ if (div)
134
+ {
135
+ top.location.href = top.location.href.replace(/#.*$/, '')+'#pear_iframe_result';
136
+ div.style.display = '';
137
+ }
138
+ }
139
+
140
+ function onFailure()
141
+ {
142
+ var div = top.$('pear_iframe_failure');
143
+ if (div)
144
+ {
145
+ top.location.href = top.location.href.replace(/#.*$/, '')+'#pear_iframe_result';
146
+ div.style.display = '';
147
+ }
148
+ }
149
+ //]]>
150
+ </script>
app/etc/modules/Mindstretch_Installer.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mindstretch_Installer>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Mindstretch_Installer>
8
+ </modules>
9
+ </config>
app/locale/en_US/Mindstretch_Installer.csv ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Install","Install"
2
+ "Reinstall","Reinstall"
3
+ "Upgrade","Upgrade"
4
+ "Paste extension key to install:","Paste extension key to install:"
5
+ "Refresh","Refresh"
6
+ "Extension Key","Extension Key"
7
+ "Install information","Install information"
8
+ "Before installing the extension is recommended to disable caching system.","Before installing the extension is recommended to disable caching system."
9
+ "Procedure completed. Please check the output frame for useful information and refresh the page to see changes.","Procedure completed. Please check the output frame for useful information and refresh the page to see changes."
10
+ "How to start using the Mindstretch Installer?","How to start using the Mindstretch Installer?"
11
+ "- Paste the extension key in the field below and press the install button.<br>- Check the output frame for useful information and refresh the page to see changes.","- Paste the extension key in the field below and press the install button.<br>- Check the output frame for useful information and refresh the page to see changes."
12
+ "Welcome to the Mindstretch Installer. With this module you can simplify the installation of your MagAddons.com modules.<br>If you have any questions please visit the links below to get access to our Customer Support.","Welcome to the Mindstretch Installer. With this module you can simplify the installation of your MagAddons.com modules.<br>If you have any questions please visit the links below to get access to our Customer Support."
app/locale/nl_NL/Mindstretch_Installer.csv ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Install","Installeren"
2
+ "Reinstall","Herinstalleren"
3
+ "Upgrade","Upgraden"
4
+ "Paste extension key to install:","Plak een installatiekey om te installeren:"
5
+ "Refresh","Vernieuwen"
6
+ "Extension Key","Installatiekey"
7
+ "Install information","Installatie-informatie"
8
+ "Before installing the extension is recommended to disable caching system.","Het wordt aanbevolen om de cache management uit te zetten voorafgaand aan installatie."
9
+ "Procedure completed. Please check the output frame for useful information and refresh the page to see changes.","Procedure afgerond. Controleer de aanvullende informatie en vernieuw de pagina indien nodig."
10
+ "How to start using the Mindstretch Installer?","Hoe gebruik te maken van de Mindstretch Installer?"
11
+ "- Paste the extension key in the field below and press the install button.<br>- Check the output frame for useful information and refresh the page to see changes.","- Plak de installatiekey in het veld en druk op de installatie knop.<br>- Controleer de aanvullende informatie en vernieuw de pagina indien nodig."
12
+ "Welcome to the Mindstretch Installer. With this module you can simplify the installation of your MagAddons.com modules.<br>If you have any questions please visit the links below to get access to our Customer Support.","Welkom bij de Mindstretch installatietool. Vereenvoudig de installatie van uw MagAddons.com modules.<br>Indien u vragen of opmerkingen heeft, bezoek onderstaande links of neem contact op met onze Customer Support."
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Mindstretch_Installer</name>
4
+ <version>2.0.0</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>Installs extensions</summary>
10
+ <description>Installs extensions</description>
11
+ <notes>This release comes with the feature of installing packages from magento channel or different channel</notes>
12
+ <authors><author><name>Dirk-Jan Timmer</name><user>auto-converted</user><email>dirk-jan.timmer@mindstretch.nl</email></author></authors>
13
+ <date>2011-01-28</date>
14
+ <time>01:05:05</time>
15
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="installer.xml" hash="fba54f0d1d3f681dcd196d48c226d8b5"/></dir><dir name="template"><dir name="installer"><file name="form.phtml" hash="bf0abddab728fba5d925978d3375bf39"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mindstretch_Installer.csv" hash="8e98974bd123a8404db70ddc0a289195"/></dir><dir name="nl_NL"><file name="Mindstretch_Installer.csv" hash="c85448dc640c8a9905de13b8d3258bdb"/></dir></target><target name="magelocal"><dir name="Mindstretch"><dir name="Installer"><dir name="controllers"><dir name="Adminhtml"><file name="FormController.php" hash="78f2bd9efc22968fd5d9e3ac46dddccb"/></dir></dir><dir name="etc"><file name="config.xml" hash="4729dab88106d2570f671970989cf585"/></dir><dir name="Helper"><file name="Data.php" hash="5c302c40a1a4eaf1a694f38da77ffc07"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mindstretch_Installer.xml" hash="ea0a2c4aca01f12294cb21b32416de3c"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>