ajaxcallback - Version 0.1.1

Version Notes

first stable

Download this release

Release Info

Developer bxN5
Extension ajaxcallback
Version 0.1.1
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.1

app/design/frontend/base/default/layout/callback.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+
6
+ <action method="addCss">
7
+ <stylesheet>css/modal.css</stylesheet>
8
+ </action>
9
+ </reference>
10
+ </default>
11
+ <callback_index_index>
12
+ <reference name="root">
13
+ <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
14
+ </reference>
15
+ <reference name="left">
16
+ <block type="callback/left" name="callback_left" template="callback/left.phtml"/>
17
+ </reference>
18
+ <reference name="content">
19
+ <block type="callback/index" name="callback_index" template="callback/index.phtml"/>
20
+ </reference>
21
+ </callback_index_index>
22
+ </layout>
23
+
app/design/frontend/base/default/template/callback/index.phtml ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <section class="modal--show" id="modal-text" tabindex="-1"
2
+ role="dialog" aria-labelledby="modal-label" aria-hidden="true">
3
+
4
+ <div class="modal-inner">
5
+ <header id="modal-label"><?php print Mage::getStoreConfig('contacts/callback/header');?></header>
6
+ <div class="modal-content">
7
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
8
+
9
+ <form action="<?php print Mage::getUrl('callback/index/callbacksend');?>" id="contactForm" method="post">
10
+ <div class="fieldset">
11
+ <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
12
+ <ul class="form-list">
13
+ <li class="fields">
14
+ <div class="field">
15
+ <label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
16
+ <div class="input-box">
17
+ <input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
18
+ </div>
19
+ </div>
20
+ <div class="field">
21
+ <label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
22
+ <div class="input-box">
23
+ <input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
24
+ </div>
25
+ </div>
26
+ </li>
27
+ <li>
28
+ <label for="telephone" class="required"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
29
+ <div class="input-box">
30
+ <input name="phone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="required-entry input-text" type="text" />
31
+ </div>
32
+ </li>
33
+ <li class="wide">
34
+ <label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment') ?></label>
35
+ <div class="input-box">
36
+ <textarea name="message" id="comment" title="<?php echo Mage::helper('contacts')->__('Comment') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
37
+ </div>
38
+ </li>
39
+ </ul>
40
+ </div>
41
+ <div class="buttons-set">
42
+ <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
43
+ <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
44
+ <button type="submit" onclick="contactForm.submit(this); return false;" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
45
+ </div>
46
+ <div class="result"></div>
47
+ </form>
48
+ <script type="text/javascript">
49
+ //<![CDATA[
50
+ var contactForm = new VarienForm('contactForm', true);
51
+ contactForm.submit = function(button, url) {
52
+ if (this.validator.validate()) {
53
+ var form = this.form;
54
+ var oldUrl = form.action;
55
+ if (url) { form.action = url; }
56
+ var e = null;
57
+ try {
58
+ //this.form.submit();
59
+ //loggin(this.form.action,this.form.serialize(),this.form.method);
60
+
61
+ new Ajax.Request(this.form.action,{
62
+ method:'POST',
63
+ parameters:this.form.serialize(),
64
+ requestHeaders: {Accept: 'application/json'},
65
+ onSuccess:function(transport){
66
+ var response=transport.responseText.evalJSON(true);
67
+ if (response.status == 0) {
68
+ $$(".fieldset").first().insert({ after: response.message });
69
+ $("contactForm").disable();
70
+ }
71
+ else {
72
+ alert(response.message)
73
+ }
74
+
75
+ }.bind(this)
76
+ });
77
+
78
+
79
+ } catch (e) {
80
+ }
81
+ this.form.action = oldUrl;
82
+ if (e) { throw e; }
83
+
84
+
85
+ }
86
+ }.bind(contactForm);
87
+
88
+ //]]>
89
+ </script>
90
+
91
+ </div>
92
+ <footer></footer>
93
+ </div>
94
+
95
+ <a href="#!" class="modal-close" title="Close this modal" data-close="Close"
96
+ data-dismiss="modal">?</a>
97
+ </section>
98
+
99
+ <a href="#modal-text"><?php print Mage::getStoreConfig('contacts/callback/link');?></a>
100
+
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ajaxcallback</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>callback/contact AJAX form </description>
11
  <notes>first stable</notes>
12
  <authors><author><name>bxN5</name><user>bxN5</user><email>bxN5@ua.fm</email></author></authors>
13
- <date>2016-04-11</date>
14
- <time>16:05:06</time>
15
- <contents><target name="magelocal"><dir name="Psychose"><dir name="CallBack"><dir name="Block"><dir name="Adminhtml"><dir name="Callback"><dir name="Edit"><file name="Form.php" hash="cca24d365fa9ce1fce3f98dd43345523"/><dir name="Tab"><file name="Form.php" hash="45d337fc9fad132ccdeda030fd6d07c3"/></dir><file name="Tabs.php" hash="8d2cedf3936eed31673a47a92e056ff2"/></dir><file name="Edit.php" hash="5ce4d9e3894d63f09f45bfe341f28c26"/><file name="Grid.php" hash="b24900ee000f2e7756e40bd9f9afda31"/></dir><file name="Callback.php" hash="796b1aac77e89c97d1a8d609d59b0103"/></dir><file name="Callbackwidget.php" hash="537a1f0caec0adae2691dbb4bb58d6ad"/><file name="Index.php" hash="162180386c5359ee139f1cb9fd3d9305"/><file name="Left.php" hash="4b6da6de579326d109bc753c8f7b11ba"/></dir><dir name="Helper"><file name="Data.php" hash="2b61362c44c21a465cd2e2a505595168"/></dir><dir name="Model"><file name="Callback.php" hash="7e0c2f1ae29b41f73c173d08e43715a1"/><dir name="Mysql4"><dir name="Callback"><file name="Collection.php" hash="7824dd1220b4a5d4a92f0f9ea9cb1eb4"/></dir><file name="Callback.php" hash="ede8d79f70d1e73a82e9a7c6358554b3"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CallbackkController.php" hash="26e7ef73eb3e674196746570f34732a1"/></dir><file name="IndexController.php" hash="66b90d6bb6d8f2602bc075d92f7c62c3"/></dir><dir name="etc"><file name="config.xml" hash="81aea128d85a606f9d11ffe0ab47e79c"/><file name="system.xml" hash="93b5eae2c851057e639b5e41f5845beb"/><file name="widget.xml" hash="fe40456c46faba699f1fee15c8040a40"/></dir><dir name="sql"><dir name="callback_setup"><file name="mysql4-install-0.1.0.php" hash="0cb830d79f5f1df8b1773e03bf872f17"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="modal.css" hash="418c5831e0770d1b91500e11c00e3917"/></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Psychose_CallBack.xml" hash="515049e34ff7961721b42eb60e405e62"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ajaxcallback</name>
4
+ <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
10
  <description>callback/contact AJAX form </description>
11
  <notes>first stable</notes>
12
  <authors><author><name>bxN5</name><user>bxN5</user><email>bxN5@ua.fm</email></author></authors>
13
+ <date>2016-04-12</date>
14
+ <time>07:38:20</time>
15
+ <contents><target name="magelocal"><dir name="Psychose"><dir name="CallBack"><dir name="Block"><dir name="Adminhtml"><dir name="Callback"><dir name="Edit"><file name="Form.php" hash="cca24d365fa9ce1fce3f98dd43345523"/><dir name="Tab"><file name="Form.php" hash="45d337fc9fad132ccdeda030fd6d07c3"/></dir><file name="Tabs.php" hash="8d2cedf3936eed31673a47a92e056ff2"/></dir><file name="Edit.php" hash="5ce4d9e3894d63f09f45bfe341f28c26"/><file name="Grid.php" hash="b24900ee000f2e7756e40bd9f9afda31"/></dir><file name="Callback.php" hash="796b1aac77e89c97d1a8d609d59b0103"/></dir><file name="Callbackwidget.php" hash="537a1f0caec0adae2691dbb4bb58d6ad"/><file name="Index.php" hash="162180386c5359ee139f1cb9fd3d9305"/><file name="Left.php" hash="4b6da6de579326d109bc753c8f7b11ba"/></dir><dir name="Helper"><file name="Data.php" hash="2b61362c44c21a465cd2e2a505595168"/></dir><dir name="Model"><file name="Callback.php" hash="7e0c2f1ae29b41f73c173d08e43715a1"/><dir name="Mysql4"><dir name="Callback"><file name="Collection.php" hash="7824dd1220b4a5d4a92f0f9ea9cb1eb4"/></dir><file name="Callback.php" hash="ede8d79f70d1e73a82e9a7c6358554b3"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CallbackkController.php" hash="26e7ef73eb3e674196746570f34732a1"/></dir><file name="IndexController.php" hash="66b90d6bb6d8f2602bc075d92f7c62c3"/></dir><dir name="etc"><file name="config.xml" hash="81aea128d85a606f9d11ffe0ab47e79c"/><file name="system.xml" hash="93b5eae2c851057e639b5e41f5845beb"/><file name="widget.xml" hash="fe40456c46faba699f1fee15c8040a40"/></dir><dir name="sql"><dir name="callback_setup"><file name="mysql4-install-0.1.0.php" hash="0cb830d79f5f1df8b1773e03bf872f17"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="modal.css" hash="418c5831e0770d1b91500e11c00e3917"/></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Psychose_CallBack.xml" hash="515049e34ff7961721b42eb60e405e62"/></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="callback"><file name="index.phtml" hash="d6101d03e4329187decb520504ef36b8"/></dir></dir><dir name="layout"><file name="callback.xml" hash="a9f0f0844d67b1a17301821f6490e6df"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
18
  </package>