Creare_Optimisedcontacts - Version 0.1.0

Version Notes

Free release

Download this release

Release Info

Developer Magento Core Team
Extension Creare_Optimisedcontacts
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/local/Creare/Optimisedcontacts/Block/Index.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creare_Optimisedcontacts_Block_Index extends Mage_Core_Block_Template {
3
+
4
+ public function showOnContactPage() {
5
+
6
+ if (Mage::getStoreConfig('general/store_information/show_contacts_box') == 1) :
7
+ return true;
8
+ endif;
9
+
10
+ }
11
+
12
+ public function creareGetCompanyAddress() {
13
+
14
+ $html = '<p><strong>'.Mage::getStoreConfig('general/store_information/name').'</strong><br />';
15
+ $html .= nl2br(Mage::getStoreConfig('general/store_information/address')).'</p>';
16
+ return $html;
17
+
18
+ }
19
+
20
+ public function creareGetCompanyPhone() {
21
+
22
+ if (Mage::getStoreConfig('general/store_information/phone')) :
23
+
24
+ $html = '<p><strong>Telephone:</strong> ';
25
+ $html .= Mage::getStoreConfig('general/store_information/phone').'</p>';
26
+ return $html;
27
+
28
+ endif;
29
+
30
+ }
31
+
32
+ public function creareGetCompanyTwitter() {
33
+
34
+ if (Mage::getStoreConfig('general/store_information/twitter')) :
35
+
36
+ $html = '<p><strong>Twitter:</strong> ';
37
+ $html .= '<a href="http://twitter.com/'.Mage::getStoreConfig('general/store_information/twitter').'">@'.Mage::getStoreConfig('general/store_information/twitter').'</a></p>';
38
+ return $html;
39
+
40
+ endif;
41
+
42
+ }
43
+
44
+ public function creareGetCompanyEmail() {
45
+
46
+ if (Mage::getStoreConfig('general/store_information/email_address')) :
47
+
48
+ $html = '<p><strong>Email:</strong> ';
49
+ $html .= Mage::getStoreConfig('general/store_information/email_address').'</p>';
50
+ return $html;
51
+
52
+ endif;
53
+
54
+ }
55
+
56
+ public function creareGetCompanyFax() {
57
+
58
+ if (Mage::getStoreConfig('general/store_information/fax')) :
59
+
60
+ $html = '<p><strong>Fax:</strong> ';
61
+ $html .= Mage::getStoreConfig('general/store_information/fax').'</p>';
62
+ return $html;
63
+
64
+ endif;
65
+
66
+ }
67
+
68
+ }
app/code/local/Creare/Optimisedcontacts/Model/Adminhtml/System/Config/Source/Yesno.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creare_Optimisedcontacts_Model_Adminhtml_System_Config_Source_Yesno
3
+ {
4
+ public function yesNoArray()
5
+ {
6
+ $arr = array("Yes", "No");
7
+ return $arr;
8
+ }
9
+ }
app/code/local/Creare/Optimisedcontacts/controllers/IndexController.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ include_once "Mage/Contacts/controllers/IndexController.php";
3
+
4
+ class Creare_Optimisedcontacts_IndexController extends Mage_Contacts_IndexController
5
+ {
6
+
7
+ public function indexAction()
8
+ {
9
+ $this->loadLayout();
10
+ $this->getLayout()->getBlock('contactForm')
11
+ ->setFormAction( Mage::getUrl('*/*/post') );
12
+
13
+ $this->_initLayoutMessages('customer/session');
14
+ $this->_initLayoutMessages('catalog/session');
15
+
16
+ if (Mage::getStoreConfig('contacts/contacts_seo/contacts_title')) :
17
+ $this->getLayout()->getBlock('head')->setTitle(Mage::getStoreConfig('contacts/contacts_seo/contacts_title'));
18
+ endif;
19
+
20
+ if (Mage::getStoreConfig('contacts/contacts_seo/contacts_description')) :
21
+ $this->getLayout()->getBlock('head')->setDescription(Mage::getStoreConfig('contacts/contacts_seo/contacts_description'));
22
+ endif;
23
+
24
+ if (Mage::getStoreConfig('contacts/contacts_seo/contacts_keywords')) :
25
+ $this->getLayout()->getBlock('head')->setKeywords(Mage::getStoreConfig('contacts/contacts_seo/contacts_keywords'));
26
+ endif;
27
+
28
+ $this->renderLayout();
29
+ }
30
+
31
+ }
app/code/local/Creare/Optimisedcontacts/etc/config.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Creare_Optimisedcontacts>
5
+ <version>0.1.0</version>
6
+ </Creare_Optimisedcontacts>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <optimisedcontacts>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Creare_Optimisedcontacts</module>
14
+ <frontName>optimisedcontacts</frontName>
15
+ </args>
16
+ </optimisedcontacts>
17
+ <contacts>
18
+ <args>
19
+ <modules>
20
+ <Creare_Optimisedcontacts before="Mage_Contacts">Creare_Optimisedcontacts</Creare_Optimisedcontacts>
21
+ </modules>
22
+ </args>
23
+ </contacts>
24
+ </routers>
25
+ <layout>
26
+ <updates>
27
+ <optimisedcontacts>
28
+ <file>optimisedcontacts.xml</file>
29
+ </optimisedcontacts>
30
+ </updates>
31
+ </layout>
32
+ </frontend>
33
+ <global>
34
+ <blocks>
35
+ <optimisedcontacts>
36
+ <class>Creare_Optimisedcontacts_Block</class>
37
+ </optimisedcontacts>
38
+ </blocks>
39
+ </global>
40
+ </config>
app/code/local/Creare/Optimisedcontacts/etc/system.xml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections>
4
+ <general>
5
+ <groups>
6
+ <store_information translate="label">
7
+ <fields>
8
+ <fax translate="label">
9
+ <label>Fax Number</label>
10
+ <frontend_type>text</frontend_type>
11
+ <sort_order>49</sort_order>
12
+ <show_in_default>1</show_in_default>
13
+ <show_in_website>1</show_in_website>
14
+ <show_in_store>1</show_in_store>
15
+ </fax>
16
+ <twitter translate="label">
17
+ <label>Twitter Username</label>
18
+ <frontend_type>text</frontend_type>
19
+ <sort_order>50</sort_order>
20
+ <show_in_default>1</show_in_default>
21
+ <show_in_website>1</show_in_website>
22
+ <show_in_store>1</show_in_store>
23
+ </twitter>
24
+ <email_address translate="label">
25
+ <label>Display Email Address</label>
26
+ <frontend_type>text</frontend_type>
27
+ <sort_order>51</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ </email_address>
32
+ <show_contacts_box translate="label">
33
+ <label>Show Details on Contact Page</label>
34
+ <frontend_type>select</frontend_type>
35
+ <source_model>adminhtml/system_config_source_yesno</source_model>
36
+ <sort_order>52</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ </show_contacts_box>
41
+ </fields>
42
+ </store_information>
43
+ </groups>
44
+ </general>
45
+ <contacts>
46
+ <groups>
47
+ <contacts_seo translate="label">
48
+ <label>Contact Page SEO</label>
49
+ <frontend_type>text</frontend_type>
50
+ <sort_order>56</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ <fields>
55
+ <contacts_title translate="label">
56
+ <label>Contacts Page Title</label>
57
+ <frontend_type>text</frontend_type>
58
+ <sort_order>51</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </contacts_title>
63
+ <contacts_description translate="label">
64
+ <label>Contacts Meta Description</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>52</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>1</show_in_store>
70
+ </contacts_description>
71
+ <contacts_keywords translate="label">
72
+ <label>Contacts Meta Keywords</label>
73
+ <frontend_type>text</frontend_type>
74
+ <sort_order>53</sort_order>
75
+ <show_in_default>1</show_in_default>
76
+ <show_in_website>1</show_in_website>
77
+ <show_in_store>1</show_in_store>
78
+ </contacts_keywords>
79
+ </fields>
80
+ </contacts_seo>
81
+ </groups>
82
+ </contacts>
83
+ </sections>
84
+ </config>
app/design/frontend/default/default/layout/optimisedcontacts.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <contacts_index_index translate="label">
4
+ <reference name="content">
5
+ <block type="optimisedcontacts/index" name="optimisedcontacts_index" template="optimisedcontacts/index.phtml"/>
6
+ </reference>
7
+ <reference name="head">
8
+ <action method="addCss">
9
+ <stylesheet>css/Optimisedcontacts/style.css</stylesheet>
10
+ </action>
11
+ </reference>
12
+ </contacts_index_index>
13
+ </layout>
app/design/frontend/default/default/template/optimisedcontacts/index.phtml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php if ($this->showOnContactPage()) : ?>
2
+ <h3>Contact Details</h3>
3
+ <div class="contact_details">
4
+ <div class="contact_details_box contact_details_address"> <?php echo $this->creareGetCompanyAddress() ?> </div>
5
+ <div class="contact_details_box contact_details_phone"> <?php echo $this->creareGetCompanyPhone() ?> <?php echo $this->creareGetCompanyFax() ?> <?php echo $this->creareGetCompanyTwitter() ?> <?php echo $this->creareGetCompanyEmail() ?> </div>
6
+ </div>
7
+ <?php endif; ?>
app/etc/modules/Creare_Optimisedcontacts.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Creare_Optimisedcontacts>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <version>1.0</version>
8
+ </Creare_Optimisedcontacts>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Creare_Optimisedcontacts</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>An SEO-friendly contact form, with extra store data displayed.</summary>
10
+ <description>An SEO-friendly contact form, with extra store data displayed. The meta data and store details can all be defined by the user in the admin.</description>
11
+ <notes>Free release</notes>
12
+ <authors><author><name>Ecommerce Web Design</name><user>auto-converted</user><email>dev@e-commercewebdesign.co.uk</email></author></authors>
13
+ <date>2012-01-16</date>
14
+ <time>08:57:50</time>
15
+ <contents><target name="magelocal"><dir name="Creare"><dir name="Optimisedcontacts"><dir name="Block"><file name="Index.php" hash="cbb6ea27bdc7247910633098a2f70275"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Yesno.php" hash="df1c20e307f84dcde8bf03410239d4c9"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="a5330cc7011ba531808846ff2132188d"/></dir><dir name="etc"><file name="config.xml" hash="b290d76ea9866dc86dd31d41d3f22a94"/><file name="system.xml" hash="48a2e975d5dc693f8619cf5e63b49b87"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="optimisedcontacts.xml" hash="7a8e8d63ffade041db0ee015772f7c14"/></dir><dir name="template"><dir name="optimisedcontacts"><file name="index.phtml" hash="2c62478a656751c35931a6c8c1777735"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creare_Optimisedcontacts.xml" hash="1bce35d2d537d8d8990d0273a30627d2"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="Optimisedcontacts"><file name="style.css" hash="7496d1ad8b6823c9498b4001024c5e6f"/></dir></dir><dir name="images"><dir name="Optimisedcontacts"><file name="address.png" hash="d755c5d1def64f58e2ef09637d2f7a82"/><file name="phone.png" hash="0c8298910fbe3c2423f4f30f8ce5c983"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>
skin/frontend/default/default/css/Optimisedcontacts/style.css ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Creare Optimisedcontacts */
2
+
3
+ .contact_details {
4
+ width:99%;
5
+ overflow:hidden;
6
+ border:1px solid #e7e7e7;
7
+ padding:10px 0;
8
+ }
9
+
10
+ .contact_details_box {
11
+ width:40%;
12
+ float:left;
13
+ padding:0 0 0 30px;
14
+ margin: 0 0 0 10px;
15
+ background-position:top left;
16
+ background-repeat:no-repeat;
17
+ }
18
+
19
+ .contact_details_address {
20
+ background-image:url("../../images/Optimisedcontacts/address.png")
21
+ }
22
+
23
+ .contact_details_phone {
24
+ background-image:url("../../images/Optimisedcontacts/phone.png")
25
+ }
skin/frontend/default/default/images/Optimisedcontacts/address.png ADDED
Binary file
skin/frontend/default/default/images/Optimisedcontacts/phone.png ADDED
Binary file