neklo_facebookpage - Version 1.0.1

Version Notes

* Locale fix

Download this release

Release Info

Developer NEKLO
Extension neklo_facebookpage
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0 to 1.0.1

Files changed (44) hide show
  1. app/code/community/Neklo/Core/Block/System/Abstract.php +0 -62
  2. app/code/community/Neklo/Core/Block/System/Contact.php +7 -156
  3. app/code/community/Neklo/Core/Block/System/Contact/Header.php +17 -0
  4. app/code/community/Neklo/Core/Block/System/Contact/Send.php +20 -0
  5. app/code/community/Neklo/Core/Block/System/Contact/Send/Button.php +35 -0
  6. app/code/community/Neklo/Core/Block/System/Extension.php +16 -0
  7. app/code/community/Neklo/Core/Block/System/Extension/List.php +104 -0
  8. app/code/community/Neklo/Core/Block/System/Extensions.php +0 -66
  9. app/code/community/Neklo/Core/Block/System/Newsletter.php +0 -9
  10. app/code/community/Neklo/Core/Block/System/Newsletter/Subscribe.php +19 -19
  11. app/code/community/Neklo/Core/Block/System/Newsletter/Subscribe/Button.php +34 -34
  12. app/code/community/Neklo/Core/Helper/Config.php +16 -0
  13. app/code/community/Neklo/Core/Helper/Data.php +9 -1
  14. app/code/community/Neklo/Core/Helper/Extension.php +104 -0
  15. app/code/community/Neklo/Core/Model/Feed.php +91 -33
  16. app/code/community/Neklo/Core/Model/Feed/Extension.php +48 -0
  17. app/code/community/Neklo/Core/Model/Observer.php +41 -5
  18. app/code/community/Neklo/Core/Model/Source/Reason.php +28 -0
  19. app/code/community/Neklo/Core/Model/Source/Subscription/Type.php +45 -0
  20. app/code/community/Neklo/Core/Model/System/Config/Backend/Empty.php +9 -0
  21. app/code/community/Neklo/Core/controllers/Adminhtml/Neklo/Core/ContactController.php +11 -14
  22. app/code/community/Neklo/Core/controllers/Adminhtml/Neklo/Core/NewsletterController.php +1 -1
  23. app/code/community/Neklo/Core/etc/config.xml +19 -11
  24. app/code/community/Neklo/Core/etc/system.xml +98 -11
  25. app/code/community/Neklo/FacebookPage/Block/Sdk.php +28 -19
  26. app/code/community/Neklo/FacebookPage/Block/Widget/Page.php +139 -139
  27. app/code/community/Neklo/FacebookPage/Helper/Config.php +18 -18
  28. app/code/community/Neklo/FacebookPage/Model/Source/Tabs.php +41 -41
  29. app/code/community/Neklo/FacebookPage/etc/config.xml +49 -49
  30. app/code/community/Neklo/FacebookPage/etc/system.xml +34 -34
  31. app/code/community/Neklo/FacebookPage/etc/widget.xml +115 -115
  32. app/design/adminhtml/default/default/layout/neklo/core.xml +10 -0
  33. app/design/adminhtml/default/default/template/neklo/core/system/contact/button.phtml +190 -0
  34. app/design/adminhtml/default/default/template/neklo/core/system/contact/header.phtml +2 -0
  35. app/design/adminhtml/default/default/template/neklo/core/system/extension/list.phtml +25 -0
  36. app/design/adminhtml/default/default/template/neklo/core/system/subscribe/button.phtml +180 -161
  37. app/design/frontend/base/default/template/neklo/facebookpage/sdk.phtml +12 -12
  38. app/etc/modules/Neklo_FacebookPage.xml +3 -3
  39. package.xml +1 -17
  40. skin/adminhtml/default/default/neklo/core/css/style.css +52 -0
  41. skin/adminhtml/default/default/neklo/core/images/ok.gif +0 -0
  42. skin/adminhtml/default/default/neklo/core/images/update.gif +0 -0
  43. skin/frontend/base/default/css/neklo/facebookpage/styles.css +13 -13
  44. skin/frontend/base/default/images/neklo/facebookpage/{facebook-loader.gif → facebook-loader.GIF} +0 -0
app/code/community/Neklo/Core/Block/System/Abstract.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
-
3
- class Neklo_Core_Block_System_Abstract extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
4
- {
5
- protected $_modules;
6
- protected $_fieldRenderer;
7
-
8
- protected function _getFieldRenderer()
9
- {
10
- if (empty($this->_fieldRenderer)) {
11
- $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
12
- }
13
- return $this->_fieldRenderer;
14
- }
15
-
16
- protected function _getFooterHtml($element)
17
- {
18
- $html = parent::_getFooterHtml($element);
19
- $html .= Mage::helper('adminhtml/js')->getScript(
20
- "
21
- $$('td.form-buttons')[0].update('');
22
- $('{$element->getHtmlId()}' + '-head').setStyle('background: none;');
23
- $('{$element->getHtmlId()}' + '-head').writeAttribute('onclick', 'return false;');
24
- $('{$element->getHtmlId()}').show();
25
- "
26
- );
27
- return $html;
28
- }
29
-
30
- protected function _getModules()
31
- {
32
- if (is_null($this->modules)) {
33
- $array = (array)Mage::getConfig()->getNode('modules')->children();
34
- ksort($array);
35
- $modules = array();
36
- $cache = array();
37
- foreach ($array as $code => $item) {
38
- $name = explode('_', $code, 2);
39
-
40
- if (!$item->is('active', 'true')
41
- || !isset($name)
42
- || $name[0] != 'Neklo'
43
- || $code == 'Neklo_Core'
44
- ) {
45
- continue;
46
- }
47
-
48
- $modules[] = $code;
49
- $config = Mage::getConfig()->getNode('modules/' . $code);
50
- $version = explode('.', $config->version);
51
- $version = (intval($version[0]) - 1) << 12 | intval($version[1]) << 6 | intval($version[2]) << 0;
52
- $cache[] = dechex(intval($config->build)) . 't' . dechex(intval($config->build) - hexdec($config->encoding)) . 't' . substr(md5(strtolower($code)), 0, 2) . $version;
53
- }
54
- $cache = implode('n', $cache);
55
- $param = 'htt' . 'p:/' . '/st' . 'ore' . '.ne' . 'klo' . '.co' . 'm/' . 'cache/' . $cache;
56
- $param = str_replace('<domain>' . '</domain>', '/', $param) . '/';
57
- $this->getRequest()->setPost('neklo_' . 'cache', $param);
58
- $this->modules = $modules;
59
- }
60
- return $this->modules;
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Neklo/Core/Block/System/Contact.php CHANGED
@@ -1,165 +1,16 @@
1
  <?php
2
 
3
- class Neklo_Core_Block_System_Contact extends Neklo_Core_Block_System_Abstract
4
  {
5
- public function render(Varien_Data_Form_Element_Abstract $element)
6
  {
7
- $fields = array(
8
- array(
9
- 'type' => 'text',
10
- 'name' => 'name',
11
- 'label' => $this->__('Contact Name'),
12
- 'class' => 'required-entry',
13
- ),
14
- array(
15
- 'type' => 'text',
16
- 'name' => 'email',
17
- 'label' => $this->__('Contact Email'),
18
- 'class' => 'required-entry validate-email',
19
- ),
20
- array(
21
- 'type' => 'text',
22
- 'name' => 'subject',
23
- 'label' => $this->__('Subject'),
24
- 'class' => 'required-entry'),
25
- array(
26
- 'type' => 'select',
27
- 'name' => 'reason',
28
- 'label' => $this->__('Reason'),
29
- 'values' => $this->_getReasons(),
30
- 'class' => 'required-entry',
31
- 'onchange' => 'NekloContact.toggleReason()',
32
- ),
33
- array(
34
- 'type' => 'text',
35
- 'name' => 'other_reason',
36
- 'label' => $this->__('Other Reason'),
37
- 'class' => 'required-entry',
38
- 'onchange' => 'NekloContact.toggleReason()',
39
- ),
40
- array(
41
- 'type' => 'textarea',
42
- 'name' => 'message',
43
- 'label' => $this->__('Message'),
44
- 'class' => 'required-entry',
45
- ),
46
- array(
47
- 'type' => 'label',
48
- 'name' => 'send',
49
- 'after_element_html' => '<div class="right"><button type="button" class="scalable save" onclick="NekloContact.submit()">' . $this->__('Send') . '</button></div><div class="notice" id="ajax-response"></div>',
50
- ),
51
- );
52
- if (!$element->getForm()) {
53
- return '';
54
- }
55
- $html = $this->_getHeaderHtml($element);
56
- foreach ($fields as $field) {
57
- $html .= $this->_getFieldHtml($element, $field);
58
- }
59
- $html .= $this->_getFooterHtml($element);
60
- return $html;
61
  }
62
 
63
- protected function _getReasons()
64
  {
65
- $modules = $this->_getModules();
66
-
67
- $reasons[] = array(
68
- 'label' => $this->__('Please select'),
69
- 'value' => ''
70
- );
71
- $reasons[] = array(
72
- 'label' => $this->__('Magento Related Support (paid)'),
73
- 'value' => 'Magento v' . Mage::getVersion()
74
- );
75
- $reasons[] = array(
76
- 'label' => $this->__('Request New Extension Development (paid)'),
77
- 'value' => 'New Extension'
78
- );
79
- foreach ($modules as $code) {
80
- $moduleConfig = Mage::getConfig()->getNode('modules/' . $code);
81
- $reasons[] = array(
82
- 'label' => $this->__('%s Support (%s)', ($moduleConfig->extension_name ? $moduleConfig->extension_name : $code) . ' v' . $moduleConfig->version, ($moduleConfig->free ? $this->__('paid') : $this->__('free'))),
83
- 'value' => $code . ' ' . $moduleConfig->version,
84
- );
85
- }
86
- $reasons[] = array(
87
- 'label' => $this->__('Other Reason'),
88
- 'value' => 'other',
89
- );
90
- return $reasons;
91
- }
92
-
93
- protected function _getFooterHtml($element)
94
- {
95
- $ajaxUrl = $this->getUrl('adminhtml/neklo_core_contact');
96
- $html = parent::_getFooterHtml($element);
97
- $html = '<h4>' . $this->__('Contact Neklo Support Team or visit <a href="%s" target="_blank">%s</a> for additional information', 'http://store.neklo.com/', 'store.neklo.com') . '</h4>' . $html;
98
-
99
- $html .= Mage::helper('adminhtml/js')->getScript(
100
- '
101
- var NekloContact = {
102
- toggleReason: function() {
103
- if ($("reason").getValue() != "other"){
104
- $("other_reason").up(1).hide();
105
- $("other_reason").disable();
106
- } else {
107
- $("other_reason").enable();
108
- $("other_reason").up(1).show();
109
- }
110
- },
111
- submit: function() {
112
- if (supportForm.validator.validate()){
113
- new Ajax.Request(
114
- "' . $ajaxUrl . '",
115
- {
116
- method: "post",
117
- parameters: Form.serialize($("' . $element->getHtmlId() . '")),
118
- onSuccess:function(transport){
119
- if (transport && transport.responseText){
120
- try {
121
- response = eval("(" + transport.responseText + ")");
122
- } catch (e) {
123
- response = {};
124
- }
125
- }
126
-
127
- if ((typeof response.message) == "string") {
128
- $("ajax-response").update(response.message);
129
- } else {
130
- $("ajax-response").update(response.message.join("<br/>"));
131
- }
132
-
133
- if (response.error==0) {
134
- $("subject").value = "";
135
- $("other_reason").value = "";
136
- $("message").value = "";
137
- $("reason").selectedIndex = 0;
138
- }
139
-
140
- new PeriodicalExecuter(function(pe){ $("ajax-response").update(""); pe.stop(); }, 20);
141
- }
142
- }
143
- );
144
- }
145
- }
146
- };
147
-
148
- NekloContact.toggleReason();
149
- supportForm = new varienForm($(' . $element->getHtmlId() . '));
150
- '
151
- );
152
- return $html;
153
- }
154
-
155
- protected function _getFieldHtml($fieldset, $field)
156
- {
157
- $type = $field['type'];
158
- unset($field['type']);
159
- $field = $fieldset
160
- ->addField($field['name'], $type, $field)
161
- ->setRenderer($this->_getFieldRenderer())
162
- ;
163
- return $field->toHtml();
164
  }
165
  }
1
  <?php
2
 
3
+ class Neklo_Core_Block_System_Contact extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
4
  {
5
+ protected function _getHeaderHtml($element)
6
  {
7
+ return parent::_getHeaderHtml($element) . $this->_getAfterHeaderHtml();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  }
9
 
10
+ protected function _getAfterHeaderHtml()
11
  {
12
+ $subscribeButton = $this->getLayout()->createBlock('neklo_core/system_contact_header', 'neklo_core_contact_header');
13
+ $subscribeButton->setTemplate('neklo/core/system/contact/header.phtml');
14
+ return $subscribeButton->toHtml();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  }
app/code/community/Neklo/Core/Block/System/Contact/Header.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Block_System_Contact_Header extends Mage_Adminhtml_Block_Template
4
+ {
5
+ const STORE_URL = 'http://store.neklo.com/';
6
+ const STORE_LABEL = 'store.neklo.com';
7
+
8
+ public function getStoreUrl()
9
+ {
10
+ return self::STORE_URL;
11
+ }
12
+
13
+ public function getStoreLabel()
14
+ {
15
+ return self::STORE_LABEL;
16
+ }
17
+ }
app/code/community/Neklo/Core/Block/System/Contact/Send.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Block_System_Contact_Send extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ public function render(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ $element->setScope(false);
8
+ $element->setCanUseWebsiteValue(false);
9
+ $element->setCanUseDefaultValue(false);
10
+ return parent::render($element);
11
+ }
12
+
13
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
14
+ {
15
+ $subscribeButton = $this->getLayout()->createBlock('neklo_core/system_contact_send_button', 'neklo_core_contact_send');
16
+ $subscribeButton->setTemplate('neklo/core/system/contact/button.phtml');
17
+ $subscribeButton->setContainerId($element->getContainer()->getHtmlId());
18
+ return $subscribeButton->toHtml();
19
+ }
20
+ }
app/code/community/Neklo/Core/Block/System/Contact/Send/Button.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Block_System_Contact_Send_Button extends Mage_Adminhtml_Block_Template
4
+ {
5
+ /**
6
+ * @return Mage_Adminhtml_Block_Widget_Button
7
+ */
8
+ public function getButton()
9
+ {
10
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button');
11
+ $button
12
+ ->setType('button')
13
+ ->setLabel($this->__('Send'))
14
+ ->setStyle("width:280px")
15
+ ->setId('neklo_core_contact_send')
16
+ ;
17
+ return $button;
18
+ }
19
+
20
+ /**
21
+ * @return string
22
+ */
23
+ public function getButtonHtml()
24
+ {
25
+ return $this->getButton()->toHtml();
26
+ }
27
+
28
+ /**
29
+ * @return string
30
+ */
31
+ public function getContainerId()
32
+ {
33
+ return parent::getContainerId();
34
+ }
35
+ }
app/code/community/Neklo/Core/Block/System/Extension.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Block_System_Extension extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
4
+ {
5
+ protected function _getHeaderHtml($element)
6
+ {
7
+ return parent::_getHeaderHtml($element) . $this->_getContentHtml();
8
+ }
9
+
10
+ protected function _getContentHtml()
11
+ {
12
+ $extensionListBlock = $this->getLayout()->createBlock('neklo_core/system_extension_list', 'neklo_core_extension_list');
13
+ $extensionListBlock->setTemplate('neklo/core/system/extension/list.phtml');
14
+ return $extensionListBlock->toHtml();
15
+ }
16
+ }
app/code/community/Neklo/Core/Block/System/Extension/List.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Block_System_Extension_List extends Mage_Adminhtml_Block_Template
4
+ {
5
+ const DOMAIN = 'http://store.neklo.com/';
6
+ const IMAGE_EXTENSION = '.jpg';
7
+
8
+ protected $_feedData = null;
9
+
10
+ /**
11
+ * @param string $code
12
+ *
13
+ * @return bool
14
+ */
15
+ public function canShowExtension($code)
16
+ {
17
+ $feedData = $this->_getExtensionInfo(strtolower($code));
18
+ return !!count($feedData);
19
+ }
20
+
21
+ /**
22
+ * @return array
23
+ */
24
+ public function getExtensionList()
25
+ {
26
+ return Mage::helper('neklo_core/extension')->getModuleConfigList();
27
+ }
28
+
29
+ /**
30
+ * @param string $code
31
+ *
32
+ * @return mixed
33
+ */
34
+ public function getExtensionName($code)
35
+ {
36
+ $feedData = $this->_getExtensionInfo(strtolower($code));
37
+ if (!array_key_exists('name', $feedData)) {
38
+ return $code;
39
+ }
40
+ return $feedData['name'];
41
+ }
42
+
43
+ /**
44
+ * @param string $code
45
+ * @param $config
46
+ *
47
+ * @return bool
48
+ */
49
+ public function isExtensionVersionOutdated($code, $config)
50
+ {
51
+ $currentVersion = $this->getExtensionVersion($config);
52
+ $lastVersion = $this->getLastExtensionVersion($code);
53
+ return version_compare($currentVersion, $lastVersion) === -1;
54
+ }
55
+
56
+ public function getExtensionVersion($config)
57
+ {
58
+ $version = (string)$config->version;
59
+ if (!$version) {
60
+ return '';
61
+ }
62
+ return $version;
63
+ }
64
+
65
+ public function getLastExtensionVersion($code)
66
+ {
67
+ $feedData = $this->_getExtensionInfo(strtolower($code));
68
+ if (!array_key_exists('version', $feedData)) {
69
+ return '0';
70
+ }
71
+ return $feedData['version'];
72
+ }
73
+
74
+ public function getExtensionUrl($code)
75
+ {
76
+ $feedData = $this->_getExtensionInfo(strtolower($code));
77
+ if (!array_key_exists('url', $feedData)) {
78
+ return null;
79
+ }
80
+ return $feedData['url'];
81
+ }
82
+
83
+ public function getImageUrl($code)
84
+ {
85
+ $imgUrl = self::DOMAIN . 'cache/' . ($this->_getCacheKey() ? $this->_getCacheKey() . '/' : '') . strtolower($code) . self::IMAGE_EXTENSION;
86
+ return $imgUrl;
87
+ }
88
+
89
+ protected function _getCacheKey()
90
+ {
91
+ return Mage::helper('neklo_core/extension')->getCacheKey();
92
+ }
93
+
94
+ protected function _getExtensionInfo($code)
95
+ {
96
+ if (is_null($this->_feedData)) {
97
+ $this->_feedData = Mage::getModel('neklo_core/feed_extension')->getFeed();
98
+ }
99
+ if (!array_key_exists($code, $this->_feedData)) {
100
+ return array();
101
+ }
102
+ return $this->_feedData[$code];
103
+ }
104
+ }
app/code/community/Neklo/Core/Block/System/Extensions.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- class Neklo_Core_Block_System_Extensions extends Neklo_Core_Block_System_Abstract
4
- {
5
- public function render(Varien_Data_Form_Element_Abstract $element)
6
- {
7
- $html = $this->_getHeaderHtml($element);
8
- $html .= '<tr><td colspan="2"><h4>' . $this->__('Installed Neklo Extensions') . '</h4></td></tr>';
9
- $html .= $this->_getContentHtml($element);
10
- $html .= $this->_getFooterHtml($element);
11
- $html .= '<style>.installed-extensions td {padding: 4px;}</style>';
12
- return $html;
13
- }
14
-
15
- protected function _getContentHtml($fieldset)
16
- {
17
- $html = '<tr class="installed-extensions">';
18
- $modules = $this->_getModules();
19
- $count = count($modules);
20
-
21
- $columns = 0;
22
- if ($count < 6) {
23
- $columns = 5;
24
- } elseif ($count % 5 == 0) {
25
- $columns = 5;
26
- } elseif ($count % 4 == 0) {
27
- $columns = 4;
28
- } elseif ($count % 3 == 0) {
29
- $columns = 3;
30
- } elseif (($count + 1) % 5 == 0) {
31
- $columns = 5;
32
- } elseif (($count + 1) % 4 == 0) {
33
- $columns = 4;
34
- } elseif (($count + 1) % 3 == 0) {
35
- $columns = 3;
36
- } else {
37
- $columns = 4;
38
- }
39
-
40
- foreach ($modules as $index => $code) {
41
- if (($index % $columns) == 0 && $index != 0) {
42
- $html .= '</tr><tr class="installed-extensions">';
43
- }
44
- $html .= '<td align="center">';
45
-
46
- $config = Mage::getConfig()->getNode('modules/' . $code);
47
-
48
- $name = ($config->extension_name ? $config->extension_name : $code);
49
-
50
- $imgUrl = Mage::app()->getRequest()->getParam('neklo_cache') . strtolower($code) . '.jpg';
51
- $img = '<img src="' . $imgUrl . '" alt="' . $name . '">';
52
-
53
- if ($config->url) {
54
- $url = 'htt' . 'p:/' . '/st' . 'ore' . '.ne' . 'klo' . '.co' . 'm/' . $config->url . '.html';
55
- $url = str_replace('<domain>' . '</domain>', '/', $url);
56
- $img = '<a href="' . $url . '" target="_blank">' . $img . '</a>';
57
- }
58
-
59
- $html .= $img . '<br>';
60
- $html .= $name . '<br>v' . $config->version;
61
- $html .= '</td>';
62
- }
63
- $html .= '</tr>';
64
- return $html;
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Neklo/Core/Block/System/Newsletter.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- class Neklo_Core_Block_System_Newsletter extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
4
- {
5
- protected function _getHeaderTitleHtml($element)
6
- {
7
- return '<div class="entry-edit-head collapseable"><a id="' . $element->getHtmlId() . '-head" href="#" style="background:none;">' . $element->getLegend() . '</a></div>';
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/Neklo/Core/Block/System/Newsletter/Subscribe.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
-
3
- class Neklo_Core_Block_System_Newsletter_Subscribe extends Mage_Adminhtml_Block_System_Config_Form_Field
4
- {
5
- public function render(Varien_Data_Form_Element_Abstract $element)
6
- {
7
- $element->setScope(false);
8
- $element->setCanUseWebsiteValue(false);
9
- $element->setCanUseDefaultValue(false);
10
- return parent::render($element);
11
- }
12
-
13
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
14
- {
15
- $subscribeButton = $this->getLayout()->createBlock('neklo_core/system_newsletter_subscribe_button', 'neklo_core_subscribe');
16
- $subscribeButton->setTemplate('neklo/core/system/subscribe/button.phtml');
17
- $subscribeButton->setContainerId($element->getContainer()->getHtmlId());
18
- return $subscribeButton->toHtml();
19
- }
20
  }
1
+ <?php
2
+
3
+ class Neklo_Core_Block_System_Newsletter_Subscribe extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ public function render(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ $element->setScope(false);
8
+ $element->setCanUseWebsiteValue(false);
9
+ $element->setCanUseDefaultValue(false);
10
+ return parent::render($element);
11
+ }
12
+
13
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
14
+ {
15
+ $subscribeButton = $this->getLayout()->createBlock('neklo_core/system_newsletter_subscribe_button', 'neklo_core_subscribe');
16
+ $subscribeButton->setTemplate('neklo/core/system/subscribe/button.phtml');
17
+ $subscribeButton->setContainerId($element->getContainer()->getHtmlId());
18
+ return $subscribeButton->toHtml();
19
+ }
20
  }
app/code/community/Neklo/Core/Block/System/Newsletter/Subscribe/Button.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
-
3
- class Neklo_Core_Block_System_Newsletter_Subscribe_Button extends Mage_Adminhtml_Block_Template
4
- {
5
- /**
6
- * @return Mage_Adminhtml_Block_Widget_Button
7
- */
8
- public function getButton()
9
- {
10
- $button = $this->getLayout()->createBlock('adminhtml/widget_button');
11
- $button
12
- ->setType('button')
13
- ->setLabel($this->__('Subscribe'))
14
- ->setStyle("width:280px")
15
- ->setId('neklo_core_subscribe')
16
- ;
17
- return $button;
18
- }
19
-
20
- /**
21
- * @return string
22
- */
23
- public function getButtonHtml()
24
- {
25
- return $this->getButton()->toHtml();
26
- }
27
-
28
- /**
29
- * @return string
30
- */
31
- public function getContainerId()
32
- {
33
- return parent::getContainerId();
34
- }
35
  }
1
+ <?php
2
+
3
+ class Neklo_Core_Block_System_Newsletter_Subscribe_Button extends Mage_Adminhtml_Block_Template
4
+ {
5
+ /**
6
+ * @return Mage_Adminhtml_Block_Widget_Button
7
+ */
8
+ public function getButton()
9
+ {
10
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button');
11
+ $button
12
+ ->setType('button')
13
+ ->setLabel($this->__('Subscribe'))
14
+ ->setStyle("width:280px")
15
+ ->setId('neklo_core_subscribe')
16
+ ;
17
+ return $button;
18
+ }
19
+
20
+ /**
21
+ * @return string
22
+ */
23
+ public function getButtonHtml()
24
+ {
25
+ return $this->getButton()->toHtml();
26
+ }
27
+
28
+ /**
29
+ * @return string
30
+ */
31
+ public function getContainerId()
32
+ {
33
+ return parent::getContainerId();
34
+ }
35
  }
app/code/community/Neklo/Core/Helper/Config.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Helper_Config extends Mage_Compiler_Helper_Data
4
+ {
5
+ const NOTIFICATION_TYPE = 'neklo_core/notification/type';
6
+
7
+ /**
8
+ * @param null|int|Mage_Core_Model_Store $store
9
+ *
10
+ * @return array
11
+ */
12
+ public function getNotificationTypeList($store = null)
13
+ {
14
+ return explode(',', Mage::getStoreConfig(self::NOTIFICATION_TYPE, $store));
15
+ }
16
+ }
app/code/community/Neklo/Core/Helper/Data.php CHANGED
@@ -2,6 +2,9 @@
2
 
3
  class Neklo_Core_Helper_Data extends Mage_Core_Helper_Abstract
4
  {
 
 
 
5
  public function __()
6
  {
7
  $args = func_get_args();
@@ -15,6 +18,11 @@ class Neklo_Core_Helper_Data extends Mage_Core_Helper_Abstract
15
 
16
  protected function _getLogoUrl()
17
  {
18
- return $this->_getRequest()->getPost('neklo_cache') . 'neklo.png';
 
 
 
 
 
19
  }
20
  }
2
 
3
  class Neklo_Core_Helper_Data extends Mage_Core_Helper_Abstract
4
  {
5
+ const DOMAIN = 'http://store.neklo.com/';
6
+ const LOGO_IMG = 'neklo.png';
7
+
8
  public function __()
9
  {
10
  $args = func_get_args();
18
 
19
  protected function _getLogoUrl()
20
  {
21
+ return self::DOMAIN . 'cache/' . ($this->_getCacheKey() ? $this->_getCacheKey() . '/' : '') . self::LOGO_IMG;
22
+ }
23
+
24
+ protected function _getCacheKey()
25
+ {
26
+ return Mage::helper('neklo_core/extension')->getCacheKey();
27
  }
28
  }
app/code/community/Neklo/Core/Helper/Extension.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Helper_Extension extends Mage_Core_Helper_Abstract
4
+ {
5
+ protected $_protectedModuleCodeList = array(
6
+ 'Neklo_Core'
7
+ );
8
+
9
+ protected $_cacheKey = null;
10
+ protected $_moduleConfigList = null;
11
+ protected $_moduleList = null;
12
+
13
+ public function getModuleList()
14
+ {
15
+ if (is_null($this->_moduleList)) {
16
+ $moduleList = array();
17
+ foreach ($this->getModuleConfigList() as $moduleCode => $moduleConfig) {
18
+ $moduleList[$moduleCode] = array(
19
+ 'name' => $moduleConfig->extension_name ? $moduleConfig->extension_name : $moduleCode,
20
+ 'version' => $moduleConfig->version,
21
+ );
22
+ }
23
+ $this->_moduleList = $moduleList;
24
+ }
25
+ return $this->_moduleList;
26
+ }
27
+
28
+ public function getModuleConfigList()
29
+ {
30
+ if (is_null($this->_moduleConfigList)) {
31
+ $moduleConfigList = (array)Mage::getConfig()->getNode('modules')->children();
32
+ ksort($moduleConfigList);
33
+ $moduleList = array();
34
+ foreach ($moduleConfigList as $moduleCode => $moduleConfig) {
35
+ if (!$this->_canShowExtension($moduleCode, $moduleConfig)) {
36
+ continue;
37
+ }
38
+ $moduleList[$moduleCode] = $moduleConfig;
39
+ }
40
+ $this->_moduleConfigList = $moduleList;
41
+ }
42
+ return $this->_moduleConfigList;
43
+ }
44
+
45
+ public function getCacheKey()
46
+ {
47
+ if (is_null($this->_cacheKey)) {
48
+ $cacheList = array();
49
+ foreach ($this->getModuleConfigList() as $moduleCode => $moduleConfig) {
50
+ $version = explode('.', $moduleConfig->version);
51
+ $version = (intval($version[0]) - 1) << 12 | intval($version[1]) << 6 | intval($version[2]) << 0;
52
+ $cacheList[] = dechex(intval($moduleConfig->build)) . 't' . dechex(intval($moduleConfig->build) - hexdec($moduleConfig->encoding)) . 't' . substr(md5(strtolower($moduleCode)), 0, 2) . $version;
53
+ }
54
+ $this->_cacheKey = implode('n', $cacheList);
55
+ }
56
+ return $this->_cacheKey;
57
+ }
58
+
59
+ /**
60
+ * @param string $code
61
+ * @param Mage_Core_Model_Config_Element $config
62
+ *
63
+ * @return bool
64
+ */
65
+ protected function _canShowExtension($code, $config)
66
+ {
67
+ if (!$code || !$config) {
68
+ return false;
69
+ }
70
+ if (!($config instanceof Mage_Core_Model_Config_Element)) {
71
+ return false;
72
+ }
73
+ if (!is_object($config) || !method_exists($config, 'is') || !$config->is('active', 'true')) {
74
+ return false;
75
+ }
76
+ if (!$this->_isNekloExtension($code)) {
77
+ return false;
78
+ }
79
+ if ($this->_isProtectedExtension($code)) {
80
+ return false;
81
+ }
82
+ return true;
83
+ }
84
+
85
+ /**
86
+ * @param string $code
87
+ *
88
+ * @return bool
89
+ */
90
+ protected function _isNekloExtension($code)
91
+ {
92
+ return (strstr($code,'Neklo_') !== false);
93
+ }
94
+
95
+ /**
96
+ * @param string $code
97
+ *
98
+ * @return bool
99
+ */
100
+ protected function _isProtectedExtension($code)
101
+ {
102
+ return in_array($code, $this->_protectedModuleCodeList);
103
+ }
104
+ }
app/code/community/Neklo/Core/Model/Feed.php CHANGED
@@ -1,34 +1,92 @@
1
- <?php
2
-
3
- class Neklo_Core_Model_Feed extends Mage_AdminNotification_Model_Feed
4
- {
5
- const XML_USE_HTTPS_PATH = 'neklo_core/admin_notification/use_https';
6
- const XML_FEED_URL_PATH = 'neklo_core/admin_notification/feed_url';
7
- const XML_FREQUENCY_PATH = 'neklo_core/admin_notification/frequency';
8
-
9
- const LAST_CHECK_CACHE_KEY = 'neklo_core_admin_notifications_last_check';
10
-
11
- public function getFrequency()
12
- {
13
- return Mage::getStoreConfig(self::XML_FREQUENCY_PATH) * 3600;
14
- }
15
-
16
- public function getLastUpdate()
17
- {
18
- return Mage::app()->loadCache(self::LAST_CHECK_CACHE_KEY);
19
- }
20
-
21
- public function setLastUpdate()
22
- {
23
- Mage::app()->saveCache(time(), self::LAST_CHECK_CACHE_KEY);
24
- return $this;
25
- }
26
-
27
- public function getFeedUrl()
28
- {
29
- if (is_null($this->_feedUrl)) {
30
- $this->_feedUrl = (Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://') . Mage::getStoreConfig(self::XML_FEED_URL_PATH);
31
- }
32
- return $this->_feedUrl;
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
1
+ <?php
2
+
3
+ class Neklo_Core_Model_Feed extends Mage_AdminNotification_Model_Feed
4
+ {
5
+ const XML_USE_HTTPS_PATH = 'neklo_core/notification/use_https';
6
+ const XML_FEED_URL_PATH = 'neklo_core/notification/feed_url';
7
+ const XML_FREQUENCY_PATH = 'neklo_core/notification/frequency';
8
+
9
+ const LAST_CHECK_CACHE_KEY = 'neklo_core_admin_notifications_last_check';
10
+
11
+ public function getFrequency()
12
+ {
13
+ return Mage::getStoreConfig(self::XML_FREQUENCY_PATH) * 3600;
14
+ }
15
+
16
+ public function getLastUpdate()
17
+ {
18
+ return Mage::app()->loadCache(self::LAST_CHECK_CACHE_KEY);
19
+ }
20
+
21
+ public function setLastUpdate()
22
+ {
23
+ Mage::app()->saveCache(time(), self::LAST_CHECK_CACHE_KEY);
24
+ return $this;
25
+ }
26
+
27
+ public function getFeedUrl()
28
+ {
29
+ if (is_null($this->_feedUrl)) {
30
+ $this->_feedUrl = (Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://') . Mage::getStoreConfig(self::XML_FEED_URL_PATH);
31
+ }
32
+ return $this->_feedUrl;
33
+ }
34
+
35
+ public function checkUpdate()
36
+ {
37
+ if (($this->getFrequency() + $this->getLastUpdate()) > time()) {
38
+ return $this;
39
+ }
40
+
41
+ $feedData = array();
42
+ $feedXml = $this->getFeedData();
43
+ if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
44
+ foreach ($feedXml->channel->item as $item) {
45
+ if (!$this->_isAllowedItem($item)) {
46
+ continue;
47
+ }
48
+ $feedData[] = array(
49
+ 'severity' => (int)$item->severity,
50
+ 'date_added' => $this->getDate((string)$item->pubDate),
51
+ 'title' => (string)$item->title,
52
+ 'description' => (string)$item->description,
53
+ 'url' => (string)$item->link,
54
+ );
55
+ }
56
+ if ($feedData) {
57
+ $inboxParser = Mage::getModel('adminnotification/inbox');
58
+ if ($inboxParser) {
59
+ $inboxParser->parse(array_reverse($feedData));
60
+ }
61
+ }
62
+ }
63
+ $this->setLastUpdate();
64
+ return $this;
65
+ }
66
+
67
+ protected function _isAllowedItem($item)
68
+ {
69
+ $itemType = $item->type ? $item->type : Neklo_Core_Model_Source_Subscription_Type::INFO_CODE;
70
+ $allowedTypeList = Mage::helper('neklo_core/config')->getNotificationTypeList();
71
+ if ($itemType == Neklo_Core_Model_Source_Subscription_Type::UPDATE_CODE) {
72
+ if (in_array(Neklo_Core_Model_Source_Subscription_Type::UPDATE_ALL_CODE, $allowedTypeList)) {
73
+ return true;
74
+ }
75
+ if (in_array(Neklo_Core_Model_Source_Subscription_Type::UPDATE_CODE, $allowedTypeList)) {
76
+ $installedExtensionList = array_keys(Mage::helper('neklo_core/extension')->getModuleList());
77
+ $isPresent = false;
78
+ foreach ($item->extension->children() as $extensionCode) {
79
+ if (in_array((string)$extensionCode, $installedExtensionList)) {
80
+ $isPresent = true;
81
+ }
82
+ }
83
+ return $isPresent;
84
+ }
85
+ }
86
+ if (!in_array($itemType, $allowedTypeList)) {
87
+
88
+ return false;
89
+ }
90
+ return true;
91
+ }
92
  }
app/code/community/Neklo/Core/Model/Feed/Extension.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Model_Feed_Extension
4
+ {
5
+ const FEED_URL = 'http://store.neklo.com/feed.json';
6
+ const CACHE_ID = 'NEKLO_EXTENSION_FEED';
7
+ const CACHE_LIFETIME = 172800;
8
+
9
+ public function getFeed()
10
+ {
11
+ if (!$feed = Mage::app()->loadCache(self::CACHE_ID)) {
12
+ $feed = $this->_getFeedFromResource();
13
+ $this->_save($feed);
14
+ }
15
+ $feedArray = Mage::helper('core')->jsonDecode($feed);
16
+ if (!is_array($feedArray)) {
17
+ $feedArray = array();
18
+ }
19
+ return $feedArray;
20
+ }
21
+
22
+ protected function _getFeedFromResource()
23
+ {
24
+ $ch = curl_init();
25
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
26
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
27
+ curl_setopt($ch, CURLOPT_URL, self::FEED_URL);
28
+ curl_setopt(
29
+ $ch,
30
+ CURLOPT_HTTPHEADER,
31
+ array(
32
+ 'Content-Type: application/json'
33
+ )
34
+ );
35
+ $result = curl_exec($ch);
36
+ if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
37
+ $result = '{}';
38
+ }
39
+ curl_close($ch);
40
+ return $result;
41
+ }
42
+
43
+ protected function _save($feed)
44
+ {
45
+ Mage::app()->saveCache($feed, self::CACHE_ID, array(), self::CACHE_LIFETIME);
46
+ return $this;
47
+ }
48
+ }
app/code/community/Neklo/Core/Model/Observer.php CHANGED
@@ -2,15 +2,51 @@
2
 
3
  class Neklo_Core_Model_Observer
4
  {
5
- public function renderContact($observer)
6
- {
7
- Mage::getBlockSingleton('neklo_core/system_contact')->render(new Varien_Data_Form_Element_Fieldset);
8
- }
9
-
10
  public function checkUpdate(Varien_Event_Observer $observer)
11
  {
12
  if (Mage::getSingleton('admin/session')->isLoggedIn()) {
13
  Mage::getModel('neklo_core/feed')->checkUpdate();
14
  }
15
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
2
 
3
  class Neklo_Core_Model_Observer
4
  {
 
 
 
 
 
5
  public function checkUpdate(Varien_Event_Observer $observer)
6
  {
7
  if (Mage::getSingleton('admin/session')->isLoggedIn()) {
8
  Mage::getModel('neklo_core/feed')->checkUpdate();
9
  }
10
  }
11
+
12
+ public function sortModuleTabList(Varien_Event_Observer $observer)
13
+ {
14
+ $configContainerBlock = $observer->getBlock();
15
+ if (!$configContainerBlock instanceof Mage_Adminhtml_Block_System_Config_Tabs) {
16
+ return null;
17
+ }
18
+ $tabList = $configContainerBlock->getTabs();
19
+ foreach ($tabList as $tab) {
20
+ if ($tab->getId() !== 'neklo') {
21
+ continue;
22
+ }
23
+
24
+ $sectionList = $tab->getSections();
25
+ if (!$sectionList || !$sectionList->getSize()) {
26
+ continue;
27
+ }
28
+
29
+ $sectionListArray = $sectionList->toArray();
30
+ $sectionListArray = $sectionListArray['items'];
31
+ usort($sectionListArray, array($this, '_sort'));
32
+
33
+ $tab->getSections()->clear();
34
+ foreach ($sectionListArray as $_section) {
35
+ $section = new Varien_Object($_section);
36
+ $section->setId($_section['id']);
37
+ $tab->getSections()->addItem($section);
38
+ }
39
+ }
40
+ }
41
+
42
+ protected function _sort($a, $b)
43
+ {
44
+ if ($a['id'] == 'neklo_core') {
45
+ return 1;
46
+ }
47
+ if ($b['id'] == 'neklo_core') {
48
+ return -1;
49
+ }
50
+ return strcasecmp($a['label'], $b['label']);
51
+ }
52
  }
app/code/community/Neklo/Core/Model/Source/Reason.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Model_Source_Reason
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $reasonList = array();
8
+ $reasonList[''] = $this->__('Please select');
9
+ $reasonList['Magento v' . Mage::getVersion()] = $this->__('Magento Related Support');
10
+ $reasonList['New Extension'] = $this->__('Request New Extension Development');
11
+
12
+ $moduleList = Mage::helper('neklo_core/extension')->getModuleList();
13
+ foreach ($moduleList as $moduleCode => $moduleData) {
14
+ $moduleTitle = $moduleData['name'] . ' v' . $moduleData['version'];
15
+ $reasonList[$moduleCode . ' ' . $moduleData['version']] = $this->__('%s Support', $moduleTitle);
16
+ }
17
+
18
+ $reasonList['other'] = $this->__('Other Reason');
19
+ return $reasonList;
20
+ }
21
+
22
+ public function __()
23
+ {
24
+ $args = func_get_args();
25
+ $helper = Mage::helper('neklo_core');
26
+ return call_user_func_array(array($helper, "__"), $args);
27
+ }
28
+ }
app/code/community/Neklo/Core/Model/Source/Subscription/Type.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Model_Source_Subscription_Type
4
+ {
5
+ const UPDATE_CODE = 'UPDATE';
6
+ const UPDATE_LABEL = 'My extensions updates';
7
+
8
+ const RELEASE_CODE = 'RELEASE';
9
+ const RELEASE_LABEL = 'New Releases';
10
+
11
+ const UPDATE_ALL_CODE = 'UPDATE_ALL';
12
+ const UPDATE_ALL_LABEL = 'All extensions updates';
13
+
14
+ const PROMO_CODE = 'PROMO';
15
+ const PROMO_LABEL = 'Promotions / Discounts';
16
+
17
+ const INFO_CODE = 'INFO';
18
+ const INFO_LABEL = 'Other information';
19
+
20
+ public function toOptionArray()
21
+ {
22
+ return array(
23
+ array(
24
+ 'value' => self::UPDATE_CODE,
25
+ 'label' => Mage::helper('neklo_core')->__(self::UPDATE_LABEL),
26
+ ),
27
+ array(
28
+ 'value' => self::RELEASE_CODE,
29
+ 'label' => Mage::helper('neklo_core')->__(self::RELEASE_LABEL),
30
+ ),
31
+ array(
32
+ 'value' => self::UPDATE_ALL_CODE,
33
+ 'label' => Mage::helper('neklo_core')->__(self::UPDATE_ALL_LABEL),
34
+ ),
35
+ array(
36
+ 'value' => self::PROMO_CODE,
37
+ 'label' => Mage::helper('neklo_core')->__(self::PROMO_LABEL),
38
+ ),
39
+ array(
40
+ 'value' => self::INFO_CODE,
41
+ 'label' => Mage::helper('neklo_core')->__(self::INFO_LABEL),
42
+ )
43
+ );
44
+ }
45
+ }
app/code/community/Neklo/Core/Model/System/Config/Backend/Empty.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_Core_Model_System_Config_Backend_Empty extends Mage_Core_Model_Config_Data
4
+ {
5
+ public function getValue()
6
+ {
7
+ return null;
8
+ }
9
+ }
app/code/community/Neklo/Core/controllers/Adminhtml/Neklo/Core/ContactController.php CHANGED
@@ -2,36 +2,28 @@
2
 
3
  class Neklo_Core_Adminhtml_Neklo_Core_ContactController extends Mage_Adminhtml_Controller_Action
4
  {
5
- const CONTACT_URL = 'https://store.neklo.com/neklo_support/';
6
 
7
- public function indexAction()
8
  {
9
  $result = array(
10
- 'error' => 0,
11
  );
12
  try {
13
  $data = $this->getRequest()->getPost();
14
  $data['version'] = Mage::getVersion();
15
  $data['url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
16
- $data['id'] = '0-0-0';
17
  $this->_sendContactEmail($data);
18
  } catch (Exception $e) {
19
- $result['message'][] = $e->getMessage();
20
- $result['error'] = 1;
21
  $this->getResponse()->setBody(Zend_Json::encode($result));
22
  return;
23
  }
24
- $result['message'][] = $this->__("Thank you for your request.");
25
- $result['message'][] = $this->__("We'll respond as soon as possible.");
26
- $result['message'][] = $this->__("We'll send copy of your request to your email.");
27
  $this->getResponse()->setBody(Zend_Json::encode($result));
28
  }
29
 
30
- protected function _isAllowed()
31
- {
32
- return Mage::getSingleton('admin/session')->isAllowed('system/config/neklo_core');
33
- }
34
-
35
  protected function _sendContactEmail($data)
36
  {
37
  $params = Mage::helper('core')->urlEncode(Mage::helper('core')->jsonEncode($data));
@@ -51,4 +43,9 @@ class Neklo_Core_Adminhtml_Neklo_Core_ContactController extends Mage_Adminhtml_C
51
  ;
52
  }
53
  }
 
 
 
 
 
54
  }
2
 
3
  class Neklo_Core_Adminhtml_Neklo_Core_ContactController extends Mage_Adminhtml_Controller_Action
4
  {
5
+ const CONTACT_URL = 'http://store.neklo.com/neklo_support/index/index/';
6
 
7
+ public function sendAction()
8
  {
9
  $result = array(
10
+ 'success' => true,
11
  );
12
  try {
13
  $data = $this->getRequest()->getPost();
14
  $data['version'] = Mage::getVersion();
15
  $data['url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
16
+ $data['id'] = '<order_item_customer></order_item_customer>';
17
  $this->_sendContactEmail($data);
18
  } catch (Exception $e) {
19
+ Mage::logException($e);
20
+ $result['success'] = false;
21
  $this->getResponse()->setBody(Zend_Json::encode($result));
22
  return;
23
  }
 
 
 
24
  $this->getResponse()->setBody(Zend_Json::encode($result));
25
  }
26
 
 
 
 
 
 
27
  protected function _sendContactEmail($data)
28
  {
29
  $params = Mage::helper('core')->urlEncode(Mage::helper('core')->jsonEncode($data));
43
  ;
44
  }
45
  }
46
+
47
+ protected function _isAllowed()
48
+ {
49
+ return Mage::getSingleton('admin/session')->isAllowed('system/config/neklo_core');
50
+ }
51
  }
app/code/community/Neklo/Core/controllers/Adminhtml/Neklo/Core/NewsletterController.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  class Neklo_Core_Adminhtml_Neklo_Core_NewsletterController extends Mage_Adminhtml_Controller_Action
4
  {
5
- const SUBSCRIBE_URL = 'https://store.neklo.com/neklo_subscribe/';
6
 
7
  public function subscribeAction()
8
  {
2
 
3
  class Neklo_Core_Adminhtml_Neklo_Core_NewsletterController extends Mage_Adminhtml_Controller_Action
4
  {
5
+ const SUBSCRIBE_URL = 'http://store.neklo.com/neklo_subscribe/index/index/';
6
 
7
  public function subscribeAction()
8
  {
app/code/community/Neklo/Core/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Neklo_Core>
5
- <version>1.0.2</version>
6
  </Neklo_Core>
7
  </modules>
8
  <admin>
@@ -34,6 +34,13 @@
34
  </models>
35
  </global>
36
  <adminhtml>
 
 
 
 
 
 
 
37
  <translate>
38
  <modules>
39
  <Neklo_Core>
@@ -44,14 +51,6 @@
44
  </modules>
45
  </translate>
46
  <events>
47
- <controller_action_predispatch_adminhtml_system_config_edit>
48
- <observers>
49
- <neklo_core>
50
- <class>neklo_core/observer</class>
51
- <method>renderContact</method>
52
- </neklo_core>
53
- </observers>
54
- </controller_action_predispatch_adminhtml_system_config_edit>
55
  <controller_action_predispatch>
56
  <observers>
57
  <neklo_core_admin_notification>
@@ -60,16 +59,25 @@
60
  </neklo_core_admin_notification>
61
  </observers>
62
  </controller_action_predispatch>
 
 
 
 
 
 
 
 
63
  </events>
64
  </adminhtml>
65
  <default>
66
  <neklo_core>
67
- <admin_notification>
68
  <feed_url>store.neklo.com/magento-update/magento-notifications.rss</feed_url>
69
  <use_https>0</use_https>
70
  <frequency>24</frequency>
71
  <last_update>0</last_update>
72
- </admin_notification>
 
73
  </neklo_core>
74
  </default>
75
  </config>
2
  <config>
3
  <modules>
4
  <Neklo_Core>
5
+ <version>1.1.0</version>
6
  </Neklo_Core>
7
  </modules>
8
  <admin>
34
  </models>
35
  </global>
36
  <adminhtml>
37
+ <layout>
38
+ <updates>
39
+ <awall module="Neklo_Core">
40
+ <file>neklo/core.xml</file>
41
+ </awall>
42
+ </updates>
43
+ </layout>
44
  <translate>
45
  <modules>
46
  <Neklo_Core>
51
  </modules>
52
  </translate>
53
  <events>
 
 
 
 
 
 
 
 
54
  <controller_action_predispatch>
55
  <observers>
56
  <neklo_core_admin_notification>
59
  </neklo_core_admin_notification>
60
  </observers>
61
  </controller_action_predispatch>
62
+ <adminhtml_block_html_before>
63
+ <observers>
64
+ <sort_module_tab_list>
65
+ <class>neklo_core/observer</class>
66
+ <method>sortModuleTabList</method>
67
+ </sort_module_tab_list>
68
+ </observers>
69
+ </adminhtml_block_html_before>
70
  </events>
71
  </adminhtml>
72
  <default>
73
  <neklo_core>
74
+ <notification>
75
  <feed_url>store.neklo.com/magento-update/magento-notifications.rss</feed_url>
76
  <use_https>0</use_https>
77
  <frequency>24</frequency>
78
  <last_update>0</last_update>
79
+ <type>UPDATE,RELEASE,UPDATE_ALL,PROMO,INFO</type>
80
+ </notification>
81
  </neklo_core>
82
  </default>
83
  </config>
app/code/community/Neklo/Core/etc/system.xml CHANGED
@@ -16,29 +16,97 @@
16
  <show_in_website>1</show_in_website>
17
  <show_in_store>1</show_in_store>
18
  <groups>
19
- <extensions translate="label">
20
  <label>Extensions Information</label>
21
  <frontend_type>text</frontend_type>
22
- <frontend_model>neklo_core/system_extensions</frontend_model>
23
- <sort_order>1</sort_order>
24
  <show_in_default>1</show_in_default>
25
  <show_in_website>1</show_in_website>
26
  <show_in_store>1</show_in_store>
27
- </extensions>
 
28
  <contact translate="label">
29
  <label>Contact Form</label>
30
  <frontend_type>text</frontend_type>
31
  <frontend_model>neklo_core/system_contact</frontend_model>
32
- <sort_order>2</sort_order>
33
  <show_in_default>1</show_in_default>
34
- <show_in_website>1</show_in_website>
35
- <show_in_store>1</show_in_store>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  </contact>
37
  <newsletter translate="label">
38
  <label>Subscribe to Newsletter</label>
39
  <frontend_type>text</frontend_type>
40
- <frontend_model>neklo_core/system_newsletter</frontend_model>
41
- <sort_order>10</sort_order>
42
  <show_in_default>1</show_in_default>
43
  <show_in_website>0</show_in_website>
44
  <show_in_store>0</show_in_store>
@@ -47,20 +115,20 @@
47
  <name translate="label">
48
  <label>Name</label>
49
  <frontend_type>text</frontend_type>
 
50
  <sort_order>10</sort_order>
51
  <show_in_default>1</show_in_default>
52
  <show_in_website>0</show_in_website>
53
  <show_in_store>0</show_in_store>
54
- <validate>required-entry</validate>
55
  </name>
56
  <email translate="label">
57
  <label>Email</label>
58
  <frontend_type>text</frontend_type>
 
59
  <sort_order>20</sort_order>
60
  <show_in_default>1</show_in_default>
61
  <show_in_website>0</show_in_website>
62
  <show_in_store>0</show_in_store>
63
- <validate>required-entry validate-email</validate>
64
  </email>
65
  <subscribe_button>
66
  <frontend_model>neklo_core/system_newsletter_subscribe</frontend_model>
@@ -71,6 +139,25 @@
71
  </subscribe_button>
72
  </fields>
73
  </newsletter>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  </groups>
75
  </neklo_core>
76
  </sections>
16
  <show_in_website>1</show_in_website>
17
  <show_in_store>1</show_in_store>
18
  <groups>
19
+ <extension translate="label">
20
  <label>Extensions Information</label>
21
  <frontend_type>text</frontend_type>
22
+ <frontend_model>neklo_core/system_extension</frontend_model>
23
+ <sort_order>10</sort_order>
24
  <show_in_default>1</show_in_default>
25
  <show_in_website>1</show_in_website>
26
  <show_in_store>1</show_in_store>
27
+ <expanded>1</expanded>
28
+ </extension>
29
  <contact translate="label">
30
  <label>Contact Form</label>
31
  <frontend_type>text</frontend_type>
32
  <frontend_model>neklo_core/system_contact</frontend_model>
33
+ <sort_order>20</sort_order>
34
  <show_in_default>1</show_in_default>
35
+ <show_in_website>0</show_in_website>
36
+ <show_in_store>0</show_in_store>
37
+ <expanded>1</expanded>
38
+ <fields>
39
+ <name translate="label">
40
+ <label>Contact Name</label>
41
+ <frontend_type>text</frontend_type>
42
+ <backend_model>neklo_core/system_config_backend_empty</backend_model>
43
+ <sort_order>10</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>0</show_in_website>
46
+ <show_in_store>0</show_in_store>
47
+ </name>
48
+ <email translate="label">
49
+ <label>Contact Email</label>
50
+ <frontend_type>text</frontend_type>
51
+ <backend_model>neklo_core/system_config_backend_empty</backend_model>
52
+ <sort_order>20</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>0</show_in_website>
55
+ <show_in_store>0</show_in_store>
56
+ </email>
57
+ <subject translate="label">
58
+ <label>Subject</label>
59
+ <frontend_type>text</frontend_type>
60
+ <backend_model>neklo_core/system_config_backend_empty</backend_model>
61
+ <sort_order>30</sort_order>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>0</show_in_website>
64
+ <show_in_store>0</show_in_store>
65
+ </subject>
66
+ <reason translate="label">
67
+ <label>Reason</label>
68
+ <frontend_type>select</frontend_type>
69
+ <source_model>neklo_core/source_reason</source_model>
70
+ <backend_model>neklo_core/system_config_backend_empty</backend_model>
71
+ <sort_order>40</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>0</show_in_website>
74
+ <show_in_store>0</show_in_store>
75
+ </reason>
76
+ <other_reason translate="label">
77
+ <label>Other Reason</label>
78
+ <frontend_type>text</frontend_type>
79
+ <backend_model>neklo_core/system_config_backend_empty</backend_model>
80
+ <sort_order>50</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>0</show_in_website>
83
+ <show_in_store>0</show_in_store>
84
+ <depends>
85
+ <reason>other</reason>
86
+ </depends>
87
+ </other_reason>
88
+ <message translate="label">
89
+ <label>Message</label>
90
+ <frontend_type>textarea</frontend_type>
91
+ <backend_model>neklo_core/system_config_backend_empty</backend_model>
92
+ <sort_order>60</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <show_in_website>0</show_in_website>
95
+ <show_in_store>0</show_in_store>
96
+ </message>
97
+ <button>
98
+ <frontend_model>neklo_core/system_contact_send</frontend_model>
99
+ <sort_order>70</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>0</show_in_website>
102
+ <show_in_store>0</show_in_store>
103
+ </button>
104
+ </fields>
105
  </contact>
106
  <newsletter translate="label">
107
  <label>Subscribe to Newsletter</label>
108
  <frontend_type>text</frontend_type>
109
+ <sort_order>30</sort_order>
 
110
  <show_in_default>1</show_in_default>
111
  <show_in_website>0</show_in_website>
112
  <show_in_store>0</show_in_store>
115
  <name translate="label">
116
  <label>Name</label>
117
  <frontend_type>text</frontend_type>
118
+ <backend_model>neklo_core/system_config_backend_empty</backend_model>
119
  <sort_order>10</sort_order>
120
  <show_in_default>1</show_in_default>
121
  <show_in_website>0</show_in_website>
122
  <show_in_store>0</show_in_store>
 
123
  </name>
124
  <email translate="label">
125
  <label>Email</label>
126
  <frontend_type>text</frontend_type>
127
+ <backend_model>neklo_core/system_config_backend_empty</backend_model>
128
  <sort_order>20</sort_order>
129
  <show_in_default>1</show_in_default>
130
  <show_in_website>0</show_in_website>
131
  <show_in_store>0</show_in_store>
 
132
  </email>
133
  <subscribe_button>
134
  <frontend_model>neklo_core/system_newsletter_subscribe</frontend_model>
139
  </subscribe_button>
140
  </fields>
141
  </newsletter>
142
+ <notification>
143
+ <label>Notifications</label>
144
+ <frontend_type>text</frontend_type>
145
+ <sort_order>40</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>0</show_in_website>
148
+ <show_in_store>0</show_in_store>
149
+ <fields>
150
+ <type translate="label">
151
+ <label>Receive news about:</label>
152
+ <frontend_type>multiselect</frontend_type>
153
+ <sort_order>10</sort_order>
154
+ <show_in_default>1</show_in_default>
155
+ <show_in_website>0</show_in_website>
156
+ <show_in_store>0</show_in_store>
157
+ <source_model>neklo_core/source_subscription_type</source_model>
158
+ </type>
159
+ </fields>
160
+ </notification>
161
  </groups>
162
  </neklo_core>
163
  </sections>
app/code/community/Neklo/FacebookPage/Block/Sdk.php CHANGED
@@ -1,19 +1,28 @@
1
- <?php
2
- class Neklo_FacebookPage_Block_Sdk extends Mage_Core_Block_Template
3
- {
4
- /**
5
- * @return bool
6
- */
7
- public function canShow()
8
- {
9
- return $this->getConfig()->isEnabled();
10
- }
11
-
12
- /**
13
- * @return Neklo_FacebookPage_Helper_Config
14
- */
15
- public function getConfig()
16
- {
17
- return Mage::helper('neklo_facebookpage/config');
18
- }
19
- }
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Neklo_FacebookPage_Block_Sdk extends Mage_Core_Block_Template
4
+ {
5
+ /**
6
+ * @return bool
7
+ */
8
+ public function canShow()
9
+ {
10
+ return $this->getConfig()->isEnabled();
11
+ }
12
+
13
+ /**
14
+ * @return Neklo_FacebookPage_Helper_Config
15
+ */
16
+ public function getConfig()
17
+ {
18
+ return Mage::helper('neklo_facebookpage/config');
19
+ }
20
+
21
+ /**
22
+ * @return string
23
+ */
24
+ public function getLocaleCode()
25
+ {
26
+ return Mage::app()->getLocale()->getLocaleCode();
27
+ }
28
+ }
app/code/community/Neklo/FacebookPage/Block/Widget/Page.php CHANGED
@@ -1,140 +1,140 @@
1
- <?php
2
- class Neklo_FacebookPage_Block_Widget_Page extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
3
- {
4
- const FACEBOOK_URL = 'https://www.facebook.com/';
5
-
6
- const WIDTH_DEFAULT = 340;
7
- const WIDTH_MIN = 180;
8
- const WIDTH_MAX = 500;
9
-
10
- const HEIGHT_DEFAULT = 500;
11
- const HEIGHT_MIN = 70;
12
-
13
- const TABS_DEFAULT = 'timeline';
14
-
15
- /**
16
- * @return bool
17
- */
18
- public function isEnabled()
19
- {
20
- return $this->getConfig()->isEnabled() && $this->getData('is_enabled') && $this->hasData('href');
21
- }
22
-
23
- /**
24
- * @return null|string
25
- */
26
- public function getHref()
27
- {
28
- if (!$this->hasData('href')) {
29
- return null;
30
- }
31
- return self::FACEBOOK_URL . $this->getData('href');
32
- }
33
-
34
- /**
35
- * @return int
36
- */
37
- public function getWidth()
38
- {
39
- if (!$this->hasData('width')) {
40
- return self::WIDTH_DEFAULT;
41
- }
42
- $width = (int)$this->getData('width');
43
- if ($width < self::WIDTH_MIN) {
44
- return self::WIDTH_MIN;
45
- }
46
- if ($width > self::WIDTH_MAX) {
47
- return self::WIDTH_MAX;
48
- }
49
- return $width;
50
- }
51
-
52
- /**
53
- * @return int
54
- */
55
- public function getHeight()
56
- {
57
- if (!$this->hasData('height')) {
58
- return self::HEIGHT_DEFAULT;
59
- }
60
- $height = (int)$this->getData('height');
61
- if ($height < self::HEIGHT_MIN) {
62
- return self::HEIGHT_MIN;
63
- }
64
- return $height;
65
- }
66
-
67
- /**
68
- * @return string
69
- */
70
- public function getTabs()
71
- {
72
- if (!$this->hasData('tabs')) {
73
- return self::TABS_DEFAULT;
74
- }
75
- return $this->getData('tabs');
76
- }
77
-
78
- /**
79
- * @return bool
80
- */
81
- public function isHideCover()
82
- {
83
- if (!$this->hasData('hide_cover')) {
84
- return false;
85
- }
86
- return !!$this->getData('hide_cover');
87
- }
88
-
89
- /**
90
- * @return bool
91
- */
92
- public function isShowFacepile()
93
- {
94
- if (!$this->hasData('show_facepile')) {
95
- return true;
96
- }
97
- return !!$this->getData('show_facepile');
98
- }
99
-
100
- /**
101
- * @return bool
102
- */
103
- public function isHideCta()
104
- {
105
- if (!$this->hasData('hide_cta')) {
106
- return false;
107
- }
108
- return !!$this->getData('hide_cta');
109
- }
110
-
111
- /**
112
- * @return bool
113
- */
114
- public function isSmallHeader()
115
- {
116
- if (!$this->hasData('small_header')) {
117
- return false;
118
- }
119
- return !!$this->getData('small_header');
120
- }
121
-
122
- /**
123
- * @return bool
124
- */
125
- public function isAdaptContainerWidth()
126
- {
127
- if (!$this->hasData('adapt_container_width')) {
128
- return true;
129
- }
130
- return !!$this->getData('adapt_container_width');
131
- }
132
-
133
- /**
134
- * @return Neklo_FacebookPage_Helper_Config
135
- */
136
- public function getConfig()
137
- {
138
- return Mage::helper('neklo_facebookpage/config');
139
- }
140
  }
1
+ <?php
2
+ class Neklo_FacebookPage_Block_Widget_Page extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
3
+ {
4
+ const FACEBOOK_URL = 'https://www.facebook.com/';
5
+
6
+ const WIDTH_DEFAULT = 340;
7
+ const WIDTH_MIN = 180;
8
+ const WIDTH_MAX = 500;
9
+
10
+ const HEIGHT_DEFAULT = 500;
11
+ const HEIGHT_MIN = 70;
12
+
13
+ const TABS_DEFAULT = 'timeline';
14
+
15
+ /**
16
+ * @return bool
17
+ */
18
+ public function isEnabled()
19
+ {
20
+ return $this->getConfig()->isEnabled() && $this->getData('is_enabled') && $this->hasData('href');
21
+ }
22
+
23
+ /**
24
+ * @return null|string
25
+ */
26
+ public function getHref()
27
+ {
28
+ if (!$this->hasData('href')) {
29
+ return null;
30
+ }
31
+ return self::FACEBOOK_URL . $this->getData('href');
32
+ }
33
+
34
+ /**
35
+ * @return int
36
+ */
37
+ public function getWidth()
38
+ {
39
+ if (!$this->hasData('width')) {
40
+ return self::WIDTH_DEFAULT;
41
+ }
42
+ $width = (int)$this->getData('width');
43
+ if ($width < self::WIDTH_MIN) {
44
+ return self::WIDTH_MIN;
45
+ }
46
+ if ($width > self::WIDTH_MAX) {
47
+ return self::WIDTH_MAX;
48
+ }
49
+ return $width;
50
+ }
51
+
52
+ /**
53
+ * @return int
54
+ */
55
+ public function getHeight()
56
+ {
57
+ if (!$this->hasData('height')) {
58
+ return self::HEIGHT_DEFAULT;
59
+ }
60
+ $height = (int)$this->getData('height');
61
+ if ($height < self::HEIGHT_MIN) {
62
+ return self::HEIGHT_MIN;
63
+ }
64
+ return $height;
65
+ }
66
+
67
+ /**
68
+ * @return string
69
+ */
70
+ public function getTabs()
71
+ {
72
+ if (!$this->hasData('tabs')) {
73
+ return self::TABS_DEFAULT;
74
+ }
75
+ return $this->getData('tabs');
76
+ }
77
+
78
+ /**
79
+ * @return bool
80
+ */
81
+ public function isHideCover()
82
+ {
83
+ if (!$this->hasData('hide_cover')) {
84
+ return false;
85
+ }
86
+ return !!$this->getData('hide_cover');
87
+ }
88
+
89
+ /**
90
+ * @return bool
91
+ */
92
+ public function isShowFacepile()
93
+ {
94
+ if (!$this->hasData('show_facepile')) {
95
+ return true;
96
+ }
97
+ return !!$this->getData('show_facepile');
98
+ }
99
+
100
+ /**
101
+ * @return bool
102
+ */
103
+ public function isHideCta()
104
+ {
105
+ if (!$this->hasData('hide_cta')) {
106
+ return false;
107
+ }
108
+ return !!$this->getData('hide_cta');
109
+ }
110
+
111
+ /**
112
+ * @return bool
113
+ */
114
+ public function isSmallHeader()
115
+ {
116
+ if (!$this->hasData('small_header')) {
117
+ return false;
118
+ }
119
+ return !!$this->getData('small_header');
120
+ }
121
+
122
+ /**
123
+ * @return bool
124
+ */
125
+ public function isAdaptContainerWidth()
126
+ {
127
+ if (!$this->hasData('adapt_container_width')) {
128
+ return true;
129
+ }
130
+ return !!$this->getData('adapt_container_width');
131
+ }
132
+
133
+ /**
134
+ * @return Neklo_FacebookPage_Helper_Config
135
+ */
136
+ public function getConfig()
137
+ {
138
+ return Mage::helper('neklo_facebookpage/config');
139
+ }
140
  }
app/code/community/Neklo/FacebookPage/Helper/Config.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
-
3
- class Neklo_FacebookPage_Helper_Config extends Mage_Core_Helper_Data
4
- {
5
- const GENERAL_IS_ENABLED = 'neklo_facebookpage/general/is_enabled';
6
-
7
- /**
8
- * @param null|int|Mage_Core_Model_Store $store
9
- *
10
- * @return bool
11
- */
12
- public function isEnabled($store = null)
13
- {
14
- $isConfigEnabled = Mage::getStoreConfigFlag(self::GENERAL_IS_ENABLED, $store);
15
- $isModuleEnabled = $this->isModuleEnabled();
16
- $isModuleOutputEnabled = $this->isModuleOutputEnabled();
17
- return $isConfigEnabled && $isModuleEnabled && $isModuleOutputEnabled;
18
- }
19
  }
1
+ <?php
2
+
3
+ class Neklo_FacebookPage_Helper_Config extends Mage_Core_Helper_Data
4
+ {
5
+ const GENERAL_IS_ENABLED = 'neklo_facebookpage/general/is_enabled';
6
+
7
+ /**
8
+ * @param null|int|Mage_Core_Model_Store $store
9
+ *
10
+ * @return bool
11
+ */
12
+ public function isEnabled($store = null)
13
+ {
14
+ $isConfigEnabled = Mage::getStoreConfigFlag(self::GENERAL_IS_ENABLED, $store);
15
+ $isModuleEnabled = $this->isModuleEnabled();
16
+ $isModuleOutputEnabled = $this->isModuleOutputEnabled();
17
+ return $isConfigEnabled && $isModuleEnabled && $isModuleOutputEnabled;
18
+ }
19
  }
app/code/community/Neklo/FacebookPage/Model/Source/Tabs.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
-
3
- class Neklo_FacebookPage_Model_Source_Tabs
4
- {
5
- const TIMELINE_CODE = 'timeline';
6
- const TIMELINE_LABEL = 'Timeline';
7
-
8
- const EVENTS_CODE = 'events';
9
- const EVENTS_LABEL = 'Events';
10
-
11
- const MESSAGES_CODE = 'messages';
12
- const MESSAGES_LABEL = 'Messages';
13
-
14
- public function toOptionArray()
15
- {
16
- $helper = Mage::helper('neklo_facebookpage');
17
- return array(
18
- array(
19
- 'value' => self::TIMELINE_CODE,
20
- 'label' => $helper->__(self::TIMELINE_LABEL),
21
- ),
22
- array(
23
- 'value' => self::EVENTS_CODE,
24
- 'label' => $helper->__(self::EVENTS_LABEL),
25
- ),
26
- array(
27
- 'value' => self::MESSAGES_CODE,
28
- 'label' => $helper->__(self::MESSAGES_LABEL),
29
- ),
30
- );
31
- }
32
-
33
- public function toArray()
34
- {
35
- $helper = Mage::helper('neklo_facebookpage');
36
- return array(
37
- self::TIMELINE_CODE => $helper->__(self::TIMELINE_LABEL),
38
- self::EVENTS_CODE => $helper->__(self::EVENTS_LABEL),
39
- self::MESSAGES_CODE => $helper->__(self::MESSAGES_LABEL),
40
- );
41
- }
42
  }
1
+ <?php
2
+
3
+ class Neklo_FacebookPage_Model_Source_Tabs
4
+ {
5
+ const TIMELINE_CODE = 'timeline';
6
+ const TIMELINE_LABEL = 'Timeline';
7
+
8
+ const EVENTS_CODE = 'events';
9
+ const EVENTS_LABEL = 'Events';
10
+
11
+ const MESSAGES_CODE = 'messages';
12
+ const MESSAGES_LABEL = 'Messages';
13
+
14
+ public function toOptionArray()
15
+ {
16
+ $helper = Mage::helper('neklo_facebookpage');
17
+ return array(
18
+ array(
19
+ 'value' => self::TIMELINE_CODE,
20
+ 'label' => $helper->__(self::TIMELINE_LABEL),
21
+ ),
22
+ array(
23
+ 'value' => self::EVENTS_CODE,
24
+ 'label' => $helper->__(self::EVENTS_LABEL),
25
+ ),
26
+ array(
27
+ 'value' => self::MESSAGES_CODE,
28
+ 'label' => $helper->__(self::MESSAGES_LABEL),
29
+ ),
30
+ );
31
+ }
32
+
33
+ public function toArray()
34
+ {
35
+ $helper = Mage::helper('neklo_facebookpage');
36
+ return array(
37
+ self::TIMELINE_CODE => $helper->__(self::TIMELINE_LABEL),
38
+ self::EVENTS_CODE => $helper->__(self::EVENTS_LABEL),
39
+ self::MESSAGES_CODE => $helper->__(self::MESSAGES_LABEL),
40
+ );
41
+ }
42
  }
app/code/community/Neklo/FacebookPage/etc/config.xml CHANGED
@@ -1,50 +1,50 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
- <modules>
4
- <Neklo_FacebookPage>
5
- <version>1.0.0</version>
6
- </Neklo_FacebookPage>
7
- </modules>
8
- <global>
9
- <blocks>
10
- <neklo_facebookpage>
11
- <class>Neklo_FacebookPage_Block</class>
12
- </neklo_facebookpage>
13
- </blocks>
14
- <helpers>
15
- <neklo_facebookpage>
16
- <class>Neklo_FacebookPage_Helper</class>
17
- </neklo_facebookpage>
18
- </helpers>
19
- <models>
20
- <neklo_facebookpage_source>
21
- <class>Neklo_FacebookPage_Model_Source</class>
22
- </neklo_facebookpage_source>
23
- </models>
24
- </global>
25
- <frontend>
26
- <layout>
27
- <updates>
28
- <neklo_facebookpage>
29
- <file>neklo/facebookpage.xml</file>
30
- </neklo_facebookpage>
31
- </updates>
32
- </layout>
33
- <translate>
34
- <modules>
35
- <Neklo_FacebookPage>
36
- <files>
37
- <default>Neklo_FacebookPage.csv</default>
38
- </files>
39
- </Neklo_FacebookPage>
40
- </modules>
41
- </translate>
42
- </frontend>
43
- <default>
44
- <neklo_facebookpage>
45
- <general>
46
- <is_enabled>1</is_enabled>
47
- </general>
48
- </neklo_facebookpage>
49
- </default>
50
  </config>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Neklo_FacebookPage>
5
+ <version>1.0.1</version>
6
+ </Neklo_FacebookPage>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <neklo_facebookpage>
11
+ <class>Neklo_FacebookPage_Block</class>
12
+ </neklo_facebookpage>
13
+ </blocks>
14
+ <helpers>
15
+ <neklo_facebookpage>
16
+ <class>Neklo_FacebookPage_Helper</class>
17
+ </neklo_facebookpage>
18
+ </helpers>
19
+ <models>
20
+ <neklo_facebookpage_source>
21
+ <class>Neklo_FacebookPage_Model_Source</class>
22
+ </neklo_facebookpage_source>
23
+ </models>
24
+ </global>
25
+ <frontend>
26
+ <layout>
27
+ <updates>
28
+ <neklo_facebookpage>
29
+ <file>neklo/facebookpage.xml</file>
30
+ </neklo_facebookpage>
31
+ </updates>
32
+ </layout>
33
+ <translate>
34
+ <modules>
35
+ <Neklo_FacebookPage>
36
+ <files>
37
+ <default>Neklo_FacebookPage.csv</default>
38
+ </files>
39
+ </Neklo_FacebookPage>
40
+ </modules>
41
+ </translate>
42
+ </frontend>
43
+ <default>
44
+ <neklo_facebookpage>
45
+ <general>
46
+ <is_enabled>1</is_enabled>
47
+ </general>
48
+ </neklo_facebookpage>
49
+ </default>
50
  </config>
app/code/community/Neklo/FacebookPage/etc/system.xml CHANGED
@@ -1,35 +1,35 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <sections>
4
- <neklo_facebookpage translate="label" module="neklo_facebookpage">
5
- <label>Facebook Page Plugin</label>
6
- <tab>neklo</tab>
7
- <frontend_type>text</frontend_type>
8
- <sort_order>150</sort_order>
9
- <show_in_default>1</show_in_default>
10
- <show_in_website>1</show_in_website>
11
- <show_in_store>1</show_in_store>
12
- <groups>
13
- <general translate="label">
14
- <label>General Settings</label>
15
- <frontend_type>text</frontend_type>
16
- <sort_order>10</sort_order>
17
- <show_in_default>1</show_in_default>
18
- <show_in_website>1</show_in_website>
19
- <show_in_store>1</show_in_store>
20
- <fields>
21
- <is_enabled translate="label">
22
- <label>Is Enabled</label>
23
- <frontend_type>select</frontend_type>
24
- <source_model>adminhtml/system_config_source_yesno</source_model>
25
- <sort_order>10</sort_order>
26
- <show_in_default>1</show_in_default>
27
- <show_in_website>1</show_in_website>
28
- <show_in_store>1</show_in_store>
29
- </is_enabled>
30
- </fields>
31
- </general>
32
- </groups>
33
- </neklo_facebookpage>
34
- </sections>
35
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <neklo_facebookpage translate="label" module="neklo_facebookpage">
5
+ <label>Facebook Page Plugin</label>
6
+ <tab>neklo</tab>
7
+ <frontend_type>text</frontend_type>
8
+ <sort_order>150</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <general translate="label">
14
+ <label>General Settings</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>10</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <fields>
21
+ <is_enabled translate="label">
22
+ <label>Is Enabled</label>
23
+ <frontend_type>select</frontend_type>
24
+ <source_model>adminhtml/system_config_source_yesno</source_model>
25
+ <sort_order>10</sort_order>
26
+ <show_in_default>1</show_in_default>
27
+ <show_in_website>1</show_in_website>
28
+ <show_in_store>1</show_in_store>
29
+ </is_enabled>
30
+ </fields>
31
+ </general>
32
+ </groups>
33
+ </neklo_facebookpage>
34
+ </sections>
35
  </config>
app/code/community/Neklo/FacebookPage/etc/widget.xml CHANGED
@@ -1,116 +1,116 @@
1
- <?xml version="1.0"?>
2
- <widgets>
3
- <neklo_facebook_page type="neklo_facebookpage/widget_page" translate="label" module="neklo_facebookpage">
4
- <name>[NEKLO] Facebook Page Plugin</name>
5
- <parameters>
6
- <is_enabled translate="label">
7
- <label>Is Enabled</label>
8
- <required>1</required>
9
- <visible>1</visible>
10
- <sort_order>10</sort_order>
11
- <type>select</type>
12
- <source_model>adminhtml/system_config_source_yesno</source_model>
13
- <value>1</value>
14
- </is_enabled>
15
- <href translate="label description">
16
- <label>URL Key</label>
17
- <description><![CDATA[The URL Key of the Facebook Page<br/>Example: use <b>neklollc</b> for https://www.facebook.com/<b>neklollc</b>]]></description>
18
- <required>1</required>
19
- <visible>1</visible>
20
- <sort_order>20</sort_order>
21
- <type>text</type>
22
- </href>
23
- <width translate="label description">
24
- <label>Width</label>
25
- <description><![CDATA[The pixel width of the plugin. Min. is <b>180</b> & Max. is <b>500</b>]]></description>
26
- <required>0</required>
27
- <visible>1</visible>
28
- <sort_order>30</sort_order>
29
- <type>text</type>
30
- <value>340</value>
31
- </width>
32
- <height translate="label description">
33
- <label>Height</label>
34
- <description><![CDATA[The pixel height of the plugin. Min. is <b>70</b>]]></description>
35
- <required>0</required>
36
- <visible>1</visible>
37
- <sort_order>40</sort_order>
38
- <type>text</type>
39
- <value>500</value>
40
- </height>
41
- <tabs translate="label">
42
- <label>Tabs to render</label>
43
- <required>1</required>
44
- <visible>1</visible>
45
- <sort_order>50</sort_order>
46
- <type>multiselect</type>
47
- <source_model>neklo_facebookpage_source/tabs</source_model>
48
- <value>timeline</value>
49
- </tabs>
50
- <hide_cover translate="label description">
51
- <label>Hide Cover Photo</label>
52
- <description><![CDATA[Hide the cover photo in the header]]></description>
53
- <required>0</required>
54
- <visible>1</visible>
55
- <sort_order>60</sort_order>
56
- <type>select</type>
57
- <source_model>adminhtml/system_config_source_yesno</source_model>
58
- <value>0</value>
59
- </hide_cover>
60
- <show_facepile translate="label description">
61
- <label>Show Friend's Faces</label>
62
- <description><![CDATA[Show profile photos when friends like this]]></description>
63
- <required>0</required>
64
- <visible>1</visible>
65
- <sort_order>70</sort_order>
66
- <type>select</type>
67
- <source_model>adminhtml/system_config_source_yesno</source_model>
68
- <value>1</value>
69
- </show_facepile>
70
- <hide_cta translate="label">
71
- <label>Hide CTA</label>
72
- <description><![CDATA[Hide the custom call to action button (if available)]]></description>
73
- <required>0</required>
74
- <visible>1</visible>
75
- <sort_order>80</sort_order>
76
- <type>select</type>
77
- <source_model>adminhtml/system_config_source_yesno</source_model>
78
- <value>0</value>
79
- </hide_cta>
80
- <small_header translate="label description">
81
- <label>Use Small Header</label>
82
- <description><![CDATA[Uses a smaller version of the page header]]></description>
83
- <required>0</required>
84
- <visible>1</visible>
85
- <sort_order>90</sort_order>
86
- <type>select</type>
87
- <source_model>adminhtml/system_config_source_yesno</source_model>
88
- <value>0</value>
89
- </small_header>
90
- <adapt_container_width translate="label description">
91
- <label>Adapt to plugin container width</label>
92
- <description><![CDATA[Plugin will try to fit inside container]]></description>
93
- <required>0</required>
94
- <visible>1</visible>
95
- <sort_order>100</sort_order>
96
- <type>select</type>
97
- <source_model>adminhtml/system_config_source_yesno</source_model>
98
- <value>1</value>
99
- </adapt_container_width>
100
- <template translate="label">
101
- <label>Template</label>
102
- <required>1</required>
103
- <visible>1</visible>
104
- <sort_order>110</sort_order>
105
- <type>select</type>
106
- <value>neklo/facebookpage/widget/page.phtml</value>
107
- <values>
108
- <featured translate="label">
109
- <value>neklo/facebookpage/widget/page.phtml</value>
110
- <label>Facebook Page Plugin Template</label>
111
- </featured>
112
- </values>
113
- </template>
114
- </parameters>
115
- </neklo_facebook_page>
116
  </widgets>
1
+ <?xml version="1.0"?>
2
+ <widgets>
3
+ <neklo_facebook_page type="neklo_facebookpage/widget_page" translate="label" module="neklo_facebookpage">
4
+ <name>[NEKLO] Facebook Page Plugin</name>
5
+ <parameters>
6
+ <is_enabled translate="label">
7
+ <label>Is Enabled</label>
8
+ <required>1</required>
9
+ <visible>1</visible>
10
+ <sort_order>10</sort_order>
11
+ <type>select</type>
12
+ <source_model>adminhtml/system_config_source_yesno</source_model>
13
+ <value>1</value>
14
+ </is_enabled>
15
+ <href translate="label description">
16
+ <label>URL Key</label>
17
+ <description><![CDATA[The URL Key of the Facebook Page<br/>Example: use <b>neklollc</b> for https://www.facebook.com/<b>neklollc</b>]]></description>
18
+ <required>1</required>
19
+ <visible>1</visible>
20
+ <sort_order>20</sort_order>
21
+ <type>text</type>
22
+ </href>
23
+ <width translate="label description">
24
+ <label>Width</label>
25
+ <description><![CDATA[The pixel width of the plugin. Min. is <b>180</b> & Max. is <b>500</b>]]></description>
26
+ <required>0</required>
27
+ <visible>1</visible>
28
+ <sort_order>30</sort_order>
29
+ <type>text</type>
30
+ <value>340</value>
31
+ </width>
32
+ <height translate="label description">
33
+ <label>Height</label>
34
+ <description><![CDATA[The pixel height of the plugin. Min. is <b>70</b>]]></description>
35
+ <required>0</required>
36
+ <visible>1</visible>
37
+ <sort_order>40</sort_order>
38
+ <type>text</type>
39
+ <value>500</value>
40
+ </height>
41
+ <tabs translate="label">
42
+ <label>Tabs to render</label>
43
+ <required>1</required>
44
+ <visible>1</visible>
45
+ <sort_order>50</sort_order>
46
+ <type>multiselect</type>
47
+ <source_model>neklo_facebookpage_source/tabs</source_model>
48
+ <value>timeline</value>
49
+ </tabs>
50
+ <hide_cover translate="label description">
51
+ <label>Hide Cover Photo</label>
52
+ <description><![CDATA[Hide the cover photo in the header]]></description>
53
+ <required>0</required>
54
+ <visible>1</visible>
55
+ <sort_order>60</sort_order>
56
+ <type>select</type>
57
+ <source_model>adminhtml/system_config_source_yesno</source_model>
58
+ <value>0</value>
59
+ </hide_cover>
60
+ <show_facepile translate="label description">
61
+ <label>Show Friend's Faces</label>
62
+ <description><![CDATA[Show profile photos when friends like this]]></description>
63
+ <required>0</required>
64
+ <visible>1</visible>
65
+ <sort_order>70</sort_order>
66
+ <type>select</type>
67
+ <source_model>adminhtml/system_config_source_yesno</source_model>
68
+ <value>1</value>
69
+ </show_facepile>
70
+ <hide_cta translate="label">
71
+ <label>Hide CTA</label>
72
+ <description><![CDATA[Hide the custom call to action button (if available)]]></description>
73
+ <required>0</required>
74
+ <visible>1</visible>
75
+ <sort_order>80</sort_order>
76
+ <type>select</type>
77
+ <source_model>adminhtml/system_config_source_yesno</source_model>
78
+ <value>0</value>
79
+ </hide_cta>
80
+ <small_header translate="label description">
81
+ <label>Use Small Header</label>
82
+ <description><![CDATA[Uses a smaller version of the page header]]></description>
83
+ <required>0</required>
84
+ <visible>1</visible>
85
+ <sort_order>90</sort_order>
86
+ <type>select</type>
87
+ <source_model>adminhtml/system_config_source_yesno</source_model>
88
+ <value>0</value>
89
+ </small_header>
90
+ <adapt_container_width translate="label description">
91
+ <label>Adapt to plugin container width</label>
92
+ <description><![CDATA[Plugin will try to fit inside container]]></description>
93
+ <required>0</required>
94
+ <visible>1</visible>
95
+ <sort_order>100</sort_order>
96
+ <type>select</type>
97
+ <source_model>adminhtml/system_config_source_yesno</source_model>
98
+ <value>1</value>
99
+ </adapt_container_width>
100
+ <template translate="label">
101
+ <label>Template</label>
102
+ <required>1</required>
103
+ <visible>1</visible>
104
+ <sort_order>110</sort_order>
105
+ <type>select</type>
106
+ <value>neklo/facebookpage/widget/page.phtml</value>
107
+ <values>
108
+ <featured translate="label">
109
+ <value>neklo/facebookpage/widget/page.phtml</value>
110
+ <label>Facebook Page Plugin Template</label>
111
+ </featured>
112
+ </values>
113
+ </template>
114
+ </parameters>
115
+ </neklo_facebook_page>
116
  </widgets>
app/design/adminhtml/default/default/layout/neklo/core.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_system_config_edit>
4
+ <reference name="head">
5
+ <action method="addCss">
6
+ <name>neklo/core/css/style.css</name>
7
+ </action>
8
+ </reference>
9
+ </adminhtml_system_config_edit>
10
+ </layout>
app/design/adminhtml/default/default/template/neklo/core/system/contact/button.phtml ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /* @var $this Neklo_Core_Block_System_Contact_Send_Button */ ?>
2
+ <?php echo $this->getButtonHtml(); ?>
3
+ <div class="neklo_core_message contact"></div>
4
+ <script>
5
+ var NekloCoreContact = Class.create({
6
+ initialize: function (config) {
7
+ this.initConfig(config);
8
+ this.initElements();
9
+ this.initObservers();
10
+ },
11
+
12
+ initConfig: function (config) {
13
+ this.config = config;
14
+ this.sendUrl = this.config.sendUrl || '';
15
+
16
+ this.successMessage = this.config.successMessage || '';
17
+ this.errorMessage = this.config.errorMessage || '';
18
+
19
+ this.successMessageClass = this.config.successMessageClass || '';
20
+ this.errorMessageClass = this.config.errorMessageClass || '';
21
+
22
+
23
+ this.formContainerId = this.config.formContainerId || '';
24
+ this.formElementSelectorList = this.config.formElementSelectorList || [];
25
+ },
26
+
27
+ initElements: function () {
28
+ this.sendButton = $(this.config.sendButtonId) || null;
29
+ this.loadingMask = $(this.config.loadingMaskId) || null;
30
+ this.messageContainer = $$(this.config.messageContainerSelector).first() || null;
31
+ },
32
+
33
+ initObservers: function () {
34
+ if (this.sendButton) {
35
+ this.sendButton.observe('click', this.send.bind(this));
36
+ }
37
+ },
38
+
39
+ send: function () {
40
+ if (!this.sendUrl) {
41
+ return;
42
+ }
43
+ if (!this.validate()) {
44
+ return;
45
+ }
46
+
47
+ var me = this;
48
+ var sendData = {};
49
+ $H(this.formElementSelectorList).map().each(function(elementSelector) {
50
+ if (Validation.isVisible($(me.formContainerId + '_' + elementSelector.key))) {
51
+ sendData[elementSelector.key] = $(me.formContainerId + '_' + elementSelector.key).getValue();
52
+ }
53
+ });
54
+
55
+ new Ajax.Request(
56
+ this.sendUrl,
57
+ {
58
+ method: 'post',
59
+ parameters: sendData,
60
+ onCreate: this._onSendCreate.bind(this),
61
+ onComplete: this._onSendComplete.bind(this),
62
+ onSuccess: this._onSendSuccess.bind(this),
63
+ onFailure: this._onSendFailure.bind(this)
64
+ }
65
+ );
66
+ },
67
+
68
+ validate: function () {
69
+ var me = this;
70
+ var result = true;
71
+ $H(this.formElementSelectorList).map().each(function(elementSelector) {
72
+ var element = $(me.formContainerId + '_' + elementSelector.key);
73
+ elementSelector.value.each(function(className) {
74
+ element.addClassName(className);
75
+ });
76
+ result = Validation.validate($(me.formContainerId + '_' + elementSelector.key)) && result;
77
+ elementSelector.value.each(function(className) {
78
+ element.removeClassName(className);
79
+ });
80
+ });
81
+ return result;
82
+ },
83
+
84
+ showLoadingMask: function () {
85
+ if (this.loadingMask) {
86
+ this.loadingMask.show();
87
+ }
88
+ },
89
+
90
+ hideLoadingMask: function () {
91
+ if (this.loadingMask) {
92
+ this.loadingMask.hide();
93
+ }
94
+ },
95
+
96
+ _onSendCreate: function () {
97
+ this.clearMessageContainer();
98
+ this.showLoadingMask();
99
+ },
100
+
101
+ _onSendComplete: function () {
102
+ this.hideLoadingMask();
103
+ },
104
+
105
+ _onSendSuccess: function (response) {
106
+ try {
107
+ var result = response.responseText.evalJSON();
108
+ if (typeof(result.success) != 'undefined') {
109
+ if (result.success) {
110
+ this.showSuccess();
111
+ this.clearForm();
112
+ } else {
113
+ this.showError();
114
+ }
115
+ }
116
+ } catch (e) {
117
+ this.showError();
118
+ }
119
+ },
120
+
121
+ _onSendFailure: function () {
122
+ this.showError();
123
+ },
124
+
125
+ showSuccess: function () {
126
+ this.showMessage(this.successMessage, this.successMessageClass);
127
+ },
128
+
129
+ showError: function () {
130
+ this.showMessage(this.errorMessage, this.errorMessageClass);
131
+ },
132
+
133
+ showMessage: function (message, className) {
134
+ this.clearMessageContainer();
135
+ var messageElement = new Element('p', {'class': className}).update(this.prepareMessage(message));
136
+ this.messageContainer.appendChild(messageElement);
137
+ },
138
+
139
+ clearMessageContainer: function () {
140
+ this.messageContainer.update('');
141
+ },
142
+
143
+ prepareMessage: function (message) {
144
+ if ((typeof message) == 'string') {
145
+ return message;
146
+ }
147
+ if (Array.isArray(message)) {
148
+ return message.join("<br/>");
149
+ }
150
+ return '';
151
+ },
152
+
153
+ clearForm: function() {
154
+ var me = this;
155
+ $H(this.formElementSelectorList).map().each(function(elementSelector) {
156
+ $(me.formContainerId + '_' + elementSelector.key).setValue('');
157
+ });
158
+ }
159
+ });
160
+
161
+ var contactForm = new NekloCoreContact({
162
+ 'sendUrl': '<?php echo $this->getUrl('adminhtml/neklo_core_contact/send'); ?>',
163
+
164
+ 'successMessage': [
165
+ '<?php echo $this->jsQuoteEscape($this->__("Thank you for your request.")); ?>',
166
+ '<?php echo $this->jsQuoteEscape($this->__("We'll respond as soon as possible.")); ?>',
167
+ '<?php echo $this->jsQuoteEscape($this->__("We'll send copy of your request to your email.")); ?>'
168
+ ],
169
+ 'errorMessage': [
170
+ '<?php echo $this->jsQuoteEscape($this->__('Oops! Something went wrong!')); ?>'
171
+ ],
172
+
173
+ 'successMessageClass': 'success',
174
+ 'errorMessageClass': 'error',
175
+
176
+ 'formContainerId' : '<?php echo $this->getContainerId(); ?>',
177
+ 'formElementSelectorList': {
178
+ 'name': ['required-entry'],
179
+ 'email': ['required-entry', 'validate-email'],
180
+ 'subject': ['required-entry'],
181
+ 'reason': ['required-entry'],
182
+ 'other_reason': ['required-entry'],
183
+ 'message': ['required-entry']
184
+ },
185
+
186
+ 'sendButtonId': 'neklo_core_contact_send',
187
+ 'loadingMaskId': 'loading-mask',
188
+ 'messageContainerSelector': '.neklo_core_message.contact'
189
+ });
190
+ </script>
app/design/adminhtml/default/default/template/neklo/core/system/contact/header.phtml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php /* @var $this Neklo_Core_Block_System_Contact_Header */ ?>
2
+ <h4><?php echo $this->__('Contact Neklo Support Team or visit <a href="%s" target="_blank">%s</a> for additional information', $this->getStoreUrl(), $this->getStoreLabel()); ?></h4>
app/design/adminhtml/default/default/template/neklo/core/system/extension/list.phtml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /* @var $this Neklo_Core_Block_System_Extension_List */ ?>
2
+ <h4><?php echo $this->__('Installed Neklo Extensions') ?></h4>
3
+ <?php $moduleConfigList = $this->getExtensionList(); ?>
4
+ <ul id="neklo_core_extension_list">
5
+ <?php foreach ($moduleConfigList as $moduleCode => $moduleConfig): ?>
6
+ <?php if (!$this->canShowExtension($moduleCode)) continue; ?>
7
+ <li class="neklo-item">
8
+ <?php if ($this->getExtensionUrl($moduleCode)): ?>
9
+ <a class="neklo-link" href="<?php echo $this->getExtensionUrl($moduleCode); ?>" target="_blank">
10
+ <?php endif; ?>
11
+ <div class="ovh">
12
+ <div class="neklo-row neklo-ext-name"><?php echo $this->getExtensionName($moduleCode); ?> <?php echo $this->getExtensionVersion($moduleConfig); ?></div>
13
+ <div class="neklo-img neklo-row"><img src="<?php echo $this->getImageUrl($moduleCode); ?>"/></div>
14
+ <?php if ($this->isExtensionVersionOutdated($moduleCode, $moduleConfig)): ?>
15
+ <?php echo $this->__('New release %s is available', $this->getLastExtensionVersion($moduleCode)); ?> <img src="<?php echo $this->getSkinUrl('neklo/core/images/update.gif'); ?>" alt="">
16
+ <?php else: ?>
17
+ <?php echo $this->__('Your version is up to date'); ?> <img src="<?php echo $this->getSkinUrl('neklo/core/images/ok.gif'); ?>" alt="">
18
+ <?php endif; ?>
19
+ </div>
20
+ <?php if ($this->getExtensionUrl($moduleCode)): ?>
21
+ </a>
22
+ <?php endif; ?>
23
+ </li>
24
+ <?php endforeach; ?>
25
+ </ul>
app/design/adminhtml/default/default/template/neklo/core/system/subscribe/button.phtml CHANGED
@@ -1,161 +1,180 @@
1
- <?php /* @var $this Neklo_Core_Block_System_Newsletter_Subscribe_Button */ ?>
2
- <?php echo $this->getButtonHtml(); ?>
3
- <div class="neklo_core_message"></div>
4
- <script>
5
- var NekloCoreSubscribe = Class.create({
6
- initialize: function (config) {
7
- this.initConfig(config);
8
- this.initElements();
9
- this.initObservers();
10
- },
11
-
12
- initConfig: function (config) {
13
- this.config = config;
14
- this.subscribeUrl = this.config.subscribeUrl || '';
15
-
16
- this.successMessage = this.config.successMessage || '';
17
- this.errorMessage = this.config.errorMessage || '';
18
-
19
- this.successMessageClass = this.config.successMessageClass || '';
20
- this.errorMessageClass = this.config.errorMessageClass || '';
21
-
22
-
23
- this.formContainerId = this.config.formContainerId || '';
24
- this.formElementSelectorList = this.config.formElementSelectorList || [];
25
- },
26
-
27
- initElements: function () {
28
- this.subscribeButton = $(this.config.subscribeButtonId) || null;
29
- this.loadingMask = $(this.config.loadingMaskId) || null;
30
- this.messageContainer = $$(this.config.messageContainerSelector).first() || null;
31
- },
32
-
33
- initObservers: function () {
34
- if (this.subscribeButton) {
35
- this.subscribeButton.observe('click', this.subscribe.bind(this));
36
- }
37
- },
38
-
39
- subscribe: function () {
40
- if (!this.validate()) {
41
- return;
42
- }
43
-
44
- var me = this;
45
- var subscribeData = {};
46
- this.formElementSelectorList.each(function (elementSelector) {
47
- subscribeData[elementSelector] = $(me.formContainerId + '_' + elementSelector).getValue();
48
- });
49
-
50
- new Ajax.Request(
51
- this.subscribeUrl,
52
- {
53
- method: 'post',
54
- parameters: subscribeData,
55
- onCreate: this._onSubscribeCreate.bind(this),
56
- onComplete: this._onSubscribeComplete.bind(this),
57
- onSuccess: this._onSubscribeSuccess.bind(this),
58
- onFailure: this._onSubscribeFailure.bind(this)
59
- }
60
- );
61
- },
62
-
63
- validate: function () {
64
- var me = this;
65
- var result = true;
66
- this.formElementSelectorList.each(function (elementSelector) {
67
- result = Validation.validate($(me.formContainerId + '_' + elementSelector));
68
- });
69
- return result;
70
- },
71
-
72
- showLoadingMask: function () {
73
- if (this.loadingMask) {
74
- this.loadingMask.show();
75
- }
76
- },
77
-
78
- hideLoadingMask: function () {
79
- if (this.loadingMask) {
80
- this.loadingMask.hide();
81
- }
82
- },
83
-
84
- _onSubscribeCreate: function () {
85
- this.clearMessageContainer();
86
- this.showLoadingMask();
87
- },
88
-
89
- _onSubscribeComplete: function () {
90
- this.hideLoadingMask();
91
- },
92
-
93
- _onSubscribeSuccess: function (response) {
94
- try {
95
- var result = response.responseText.evalJSON();
96
- if (typeof(result.success) != 'undefined') {
97
- if (result.success) {
98
- this.showSuccess();
99
- } else {
100
- this.showError();
101
- }
102
- }
103
- } catch (e) {
104
- this.showError();
105
- }
106
- },
107
-
108
- _onSubscribeFailure: function () {
109
- this.showError();
110
- },
111
-
112
- showSuccess: function () {
113
- this.showMessage(this.successMessage, this.successMessageClass);
114
- },
115
-
116
- showError: function () {
117
- this.showMessage(this.errorMessage, this.errorMessageClass);
118
- },
119
-
120
- showMessage: function (message, className) {
121
- this.clearMessageContainer();
122
- var messageElement = new Element('p', {'class': className}).update(message);
123
- this.messageContainer.appendChild(messageElement);
124
- },
125
-
126
- clearMessageContainer: function () {
127
- this.messageContainer.update('');
128
- }
129
- });
130
-
131
- var subscribeForm = new NekloCoreSubscribe({
132
- 'subscribeUrl': '<?php echo $this->getUrl('adminhtml/neklo_core_newsletter/subscribe'); ?>',
133
-
134
- 'successMessage': '<?php echo $this->__('Successfully subscribed'); ?>',
135
- 'errorMessage': '<?php echo $this->__('Subscribe error'); ?>',
136
-
137
- 'successMessageClass': 'success',
138
- 'errorMessageClass': 'error',
139
-
140
- 'formContainerId' : '<?php echo $this->getContainerId(); ?>',
141
- 'formElementSelectorList': ['name', 'email'],
142
-
143
- 'subscribeButtonId': 'neklo_core_subscribe',
144
- 'loadingMaskId': 'loading-mask',
145
- 'messageContainerSelector': '.neklo_core_message'
146
- });
147
- </script>
148
- <style>
149
- .neklo_core_message {
150
- text-align: center;
151
- padding: 5px 0;
152
- font-weight: bold;
153
- width: 280px;
154
- }
155
- .neklo_core_message .error {
156
- color: #D40707;
157
- }
158
- .neklo_core_message .success {
159
- color: #3d6611;
160
- }
161
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /* @var $this Neklo_Core_Block_System_Newsletter_Subscribe_Button */ ?>
2
+ <?php echo $this->getButtonHtml(); ?>
3
+ <div class="neklo_core_message subscribe"></div>
4
+ <script>
5
+ var NekloCoreSubscribe = Class.create({
6
+ initialize: function (config) {
7
+ this.initConfig(config);
8
+ this.initElements();
9
+ this.initObservers();
10
+ },
11
+
12
+ initConfig: function (config) {
13
+ this.config = config;
14
+ this.subscribeUrl = this.config.subscribeUrl || '';
15
+
16
+ this.successMessage = this.config.successMessage || '';
17
+ this.errorMessage = this.config.errorMessage || '';
18
+
19
+ this.successMessageClass = this.config.successMessageClass || '';
20
+ this.errorMessageClass = this.config.errorMessageClass || '';
21
+
22
+
23
+ this.formContainerId = this.config.formContainerId || '';
24
+ this.formElementSelectorList = this.config.formElementSelectorList || [];
25
+ },
26
+
27
+ initElements: function () {
28
+ this.sendButton = $(this.config.subscribeButtonId) || null;
29
+ this.loadingMask = $(this.config.loadingMaskId) || null;
30
+ this.messageContainer = $$(this.config.messageContainerSelector).first() || null;
31
+ },
32
+
33
+ initObservers: function () {
34
+ if (this.sendButton) {
35
+ this.sendButton.observe('click', this.subscribe.bind(this));
36
+ }
37
+ },
38
+
39
+ subscribe: function () {
40
+ if (!this.subscribeUrl) {
41
+ return;
42
+ }
43
+ if (!this.validate()) {
44
+ return;
45
+ }
46
+
47
+ var me = this;
48
+ var subscribeData = {};
49
+ $H(this.formElementSelectorList).map().each(function(elementSelector) {
50
+ if (Validation.isVisible($(me.formContainerId + '_' + elementSelector.key))) {
51
+ subscribeData[elementSelector.key] = $(me.formContainerId + '_' + elementSelector.key).getValue();
52
+ }
53
+ });
54
+
55
+ new Ajax.Request(
56
+ this.subscribeUrl,
57
+ {
58
+ method: 'post',
59
+ parameters: subscribeData,
60
+ onCreate: this._onSubscribeCreate.bind(this),
61
+ onComplete: this._onSubscribeComplete.bind(this),
62
+ onSuccess: this._onSubscribeSuccess.bind(this),
63
+ onFailure: this._onSubscribeFailure.bind(this)
64
+ }
65
+ );
66
+ },
67
+
68
+ validate: function () {
69
+ var me = this;
70
+ var result = true;
71
+ $H(this.formElementSelectorList).map().each(function(elementSelector) {
72
+ var element = $(me.formContainerId + '_' + elementSelector.key);
73
+ elementSelector.value.each(function(className) {
74
+ element.addClassName(className);
75
+ });
76
+ result = Validation.validate($(me.formContainerId + '_' + elementSelector.key)) && result;
77
+ elementSelector.value.each(function(className) {
78
+ element.removeClassName(className);
79
+ });
80
+ });
81
+ return result;
82
+ },
83
+
84
+ showLoadingMask: function () {
85
+ if (this.loadingMask) {
86
+ this.loadingMask.show();
87
+ }
88
+ },
89
+
90
+ hideLoadingMask: function () {
91
+ if (this.loadingMask) {
92
+ this.loadingMask.hide();
93
+ }
94
+ },
95
+
96
+ _onSubscribeCreate: function () {
97
+ this.clearMessageContainer();
98
+ this.showLoadingMask();
99
+ },
100
+
101
+ _onSubscribeComplete: function () {
102
+ this.hideLoadingMask();
103
+ },
104
+
105
+ _onSubscribeSuccess: function (response) {
106
+ try {
107
+ var result = response.responseText.evalJSON();
108
+ if (typeof(result.success) != 'undefined') {
109
+ if (result.success) {
110
+ this.showSuccess();
111
+ this.clearForm();
112
+ } else {
113
+ this.showError();
114
+ }
115
+ }
116
+ } catch (e) {
117
+ this.showError();
118
+ }
119
+ },
120
+
121
+ _onSubscribeFailure: function () {
122
+ this.showError();
123
+ },
124
+
125
+ showSuccess: function () {
126
+ this.showMessage(this.successMessage, this.successMessageClass);
127
+ },
128
+
129
+ showError: function () {
130
+ this.showMessage(this.errorMessage, this.errorMessageClass);
131
+ },
132
+
133
+ showMessage: function (message, className) {
134
+ this.clearMessageContainer();
135
+ var messageElement = new Element('p', {'class': className}).update(this.prepareMessage(message));
136
+ this.messageContainer.appendChild(messageElement);
137
+ },
138
+
139
+ clearMessageContainer: function () {
140
+ this.messageContainer.update('');
141
+ },
142
+
143
+ prepareMessage: function (message) {
144
+ if ((typeof message) == 'string') {
145
+ return message;
146
+ }
147
+ if (Array.isArray(message)) {
148
+ return message.join("<br/>");
149
+ }
150
+ return '';
151
+ },
152
+
153
+ clearForm: function() {
154
+ var me = this;
155
+ $H(this.formElementSelectorList).map().each(function(elementSelector) {
156
+ $(me.formContainerId + '_' + elementSelector.key).setValue('');
157
+ });
158
+ }
159
+ });
160
+
161
+ var subscribeForm = new NekloCoreSubscribe({
162
+ 'subscribeUrl': '<?php echo $this->getUrl('adminhtml/neklo_core_newsletter/subscribe'); ?>',
163
+
164
+ 'successMessage': '<?php echo $this->jsQuoteEscape($this->__('Successfully subscribed')); ?>',
165
+ 'errorMessage': '<?php echo $this->jsQuoteEscape($this->__('Oops! Something went wrong!')); ?>',
166
+
167
+ 'successMessageClass': 'success',
168
+ 'errorMessageClass': 'error',
169
+
170
+ 'formContainerId' : '<?php echo $this->getContainerId(); ?>',
171
+ 'formElementSelectorList': {
172
+ 'name': ['required-entry'],
173
+ 'email': ['required-entry', 'validate-email']
174
+ },
175
+
176
+ 'subscribeButtonId': 'neklo_core_subscribe',
177
+ 'loadingMaskId': 'loading-mask',
178
+ 'messageContainerSelector': '.neklo_core_message.subscribe'
179
+ });
180
+ </script>
app/design/frontend/base/default/template/neklo/facebookpage/sdk.phtml CHANGED
@@ -1,13 +1,13 @@
1
- <?php /* @var $this Neklo_FacebookPage_Block_Sdk */ ?>
2
- <?php if ($this->canShow()): ?>
3
- <div id="fb-root"></div>
4
- <script type="text/javascript">
5
- (function(d, s, id) {
6
- var js, fjs = d.getElementsByTagName(s)[0];
7
- if (d.getElementById(id)) return;
8
- js = d.createElement(s); js.id = id;
9
- js.src = "//connect.facebook.net/ru_RU/sdk.js#xfbml=1&version=v2.5";
10
- fjs.parentNode.insertBefore(js, fjs);
11
- }(document, 'script', 'facebook-jssdk'));
12
- </script>
13
  <?php endif; ?>
1
+ <?php /* @var $this Neklo_FacebookPage_Block_Sdk */ ?>
2
+ <?php if ($this->canShow()): ?>
3
+ <div id="fb-root"></div>
4
+ <script type="text/javascript">
5
+ (function(d, s, id) {
6
+ var js, fjs = d.getElementsByTagName(s)[0];
7
+ if (d.getElementById(id)) return;
8
+ js = d.createElement(s); js.id = id;
9
+ js.src = "//connect.facebook.net/<?php echo $this->getLocaleCode(); ?>/sdk.js#xfbml=1&version=v2.5";
10
+ fjs.parentNode.insertBefore(js, fjs);
11
+ }(document, 'script', 'facebook-jssdk'));
12
+ </script>
13
  <?php endif; ?>
app/etc/modules/Neklo_FacebookPage.xml CHANGED
@@ -7,9 +7,9 @@
7
  <depends>
8
  <Neklo_Core/>
9
  </depends>
10
- <extension_name>Facebook Widget</extension_name>
11
- <free>1</free>
12
- <url>facebook-widget-extension-for-magento</url>
13
  </Neklo_FacebookPage>
14
  </modules>
15
  </config>
7
  <depends>
8
  <Neklo_Core/>
9
  </depends>
10
+ <extension_name>Facebook Page Plugin</extension_name>
11
+ <url></url>
12
+ <encoding></encoding>
13
  </Neklo_FacebookPage>
14
  </modules>
15
  </config>
package.xml CHANGED
@@ -1,18 +1,2 @@
1
  <?xml version="1.0"?>
2
- <package>
3
- <name>Neklo_FacebookWidget</name>
4
- <version>1.0.0</version>
5
- <stability>stable</stability>
6
- <license>License</license>
7
- <channel>community</channel>
8
- <extends/>
9
- <summary>Summary</summary>
10
- <description>Description</description>
11
- <notes>The first stable release.</notes>
12
- <authors><author><name>NEKLO</name><user>NEKLO</user><email>info@neklo.com</email></author></authors>
13
- <date>2015-12-14</date>
14
- <time>13:45:55</time>
15
- <contents><target name="magecommunity"><dir name="Neklo"><dir name="FacebookPage"><dir name="Block"><file name="Sdk.php" hash="3ebc857b62498466a678736e3042b3fc"/><dir name="Widget"><file name="Page.php" hash="5bf76afe749a9e0b2df2364733549bdb"/></dir></dir><dir name="Helper"><file name="Config.php" hash="9f2025b1dbf117a533b137a52d960bf5"/><file name="Data.php" hash="2c1155e74eb10a85c9037d4a14b32839"/></dir><dir name="Model"><dir name="Source"><file name="Tabs.php" hash="ab6144c19ab9d9170cc2289735fa2bd6"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ede1cd359a3bd4fdd33aab424f515ffd"/><file name="config.xml" hash="6fa06bd362ac51a96234c4bf06f41e98"/><file name="system.xml" hash="670d2e8d96a5566d9d998e26f0b7441f"/><file name="widget.xml" hash="eb41072c8782b6106c2cf51edb0ffa85"/></dir></dir><dir name="Core"><dir name="Block"><dir name="System"><file name="Abstract.php" hash="d13dedc9e28f3fba42d5b4e5e23c5a58"/><file name="Contact.php" hash="b9d03eda3b0ff0b8ffd17a777bc36d9b"/><file name="Extensions.php" hash="26e96fa54e769bc30a6bdf6395c80d34"/><dir name="Newsletter"><dir name="Subscribe"><file name="Button.php" hash="c24e57030e1a6d16611eb516a9249c34"/></dir><file name="Subscribe.php" hash="7b9b021aa6f12c0eff8576c4cb6cd60d"/></dir><file name="Newsletter.php" hash="46a84ace83bf1a4a81a3e4bf90272c6c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="e13a6d27a50ea228c8751e6465c8f463"/></dir><dir name="Model"><file name="Feed.php" hash="8a669a60ad96195af2ff706c1e3ec26e"/><file name="Observer.php" hash="dea6141e7f7bb7acde44f242d0ae7083"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Neklo"><dir name="Core"><file name="ContactController.php" hash="88982513d6006d5f3b320e41b3cb96be"/><file name="NewsletterController.php" hash="b8334402bcc20afc829b5ea0cb763cab"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="68b00ad4118462d74b0c0a7126063462"/><file name="config.xml" hash="3cfaca93a4cffbec6a1dc7113b510bb2"/><file name="system.xml" hash="66e1ccd2fc1c3fdd511dc99a8575009d"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="neklo"><file name="facebookpage.xml" hash="2bcdcba08dab099e48918b05e59f3021"/></dir></dir><dir name="template"><dir name="neklo"><dir name="facebookpage"><file name="sdk.phtml" hash="6f1525354ffb632fd88198141b19686d"/><dir name="widget"><file name="page.phtml" hash="f5b13730fb88ac0c21b2e4fc4ca0ac99"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="neklo"><dir name="core"><dir name="system"><dir name="subscribe"><file name="button.phtml" hash="4e9fe3dfa9e291976ff45c2e25ce7b10"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Neklo_FacebookPage.xml" hash="a9e3813f9493d1f60aa76c07a42fa7e3"/><file name="Neklo_Core.xml" hash="335032ff690c5272626dca9106642680"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="neklo"><dir name="facebookpage"><file name="styles.css" hash="da7be054b9e6ef77f56bbfc5de6c8d97"/></dir></dir></dir><dir name="images"><dir name="neklo"><dir name="facebookpage"><file name="facebook-loader.gif" hash="a11c3108c26c904dd9d8a641cf79cf06"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Neklo_Core.csv" hash="c6abfbb8be878de9c02339e2ecfc4e16"/></dir></target></contents>
16
- <compatible/>
17
- <dependencies><required><php><min>5.2.7</min><max>6.0.0</max></php></required></dependencies>
18
- </package>
1
  <?xml version="1.0"?>
2
+ <package><name>Neklo_FacebookPage</name><version>1.0.1</version><stability>stable</stability><license>License</license><channel>community</channel><extends></extends><summary>Locale has been fixed</summary><description>NEKLO Facebook Widget adds Facebook to your online store, allowing you to display recent posts related to your products and thus make the store more live and appealing.</description><notes>* Locale fix</notes><authors><author><name>NEKLO</name><user>NEKLO</user><email>info@neklo.com</email></author></authors><date>2016-04-26</date><time>0:11:18</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Neklo_Core.xml" hash="335032ff690c5272626dca9106642680"/><file name="Neklo_FacebookPage.xml" hash="6760403f5f7926f753e79d06693052f0"/></dir></dir><dir name="code"><dir name="community"><dir name="Neklo"><dir name="FacebookPage"><dir name="etc"><file name="adminhtml.xml" hash="ede1cd359a3bd4fdd33aab424f515ffd"/><file name="config.xml" hash="22efdb32a2b36d57496e1f9518d5d95b"/><file name="system.xml" hash="99a8a60e6d16679a2b8ba3877f75aa47"/><file name="widget.xml" hash="37d35a8d68988eed0f77e14774421dfb"/></dir><dir name="Block"><file name="Sdk.php" hash="81f613b5f94b1dd5b6be079c4fc7d68e"/><dir name="Widget"><file name="Page.php" hash="9c509d2aeca148564006389b3a816976"/></dir></dir><dir name="Model"><dir name="Source"><file name="Tabs.php" hash="914614a4145ae8a079d00c3c439eca25"/></dir></dir><dir name="Helper"><file name="Config.php" hash="f2fffd08ac16c761cf85bd486265bed5"/><file name="Data.php" hash="2c1155e74eb10a85c9037d4a14b32839"/></dir></dir><dir name="Core"><dir name="etc"><file name="adminhtml.xml" hash="68b00ad4118462d74b0c0a7126063462"/><file name="config.xml" hash="98b3df39506f1971dfaf517385972797"/><file name="system.xml" hash="f9ee62f79b22584cc6180ec5e8049539"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Neklo"><dir name="Core"><file name="ContactController.php" hash="fe735a9c3c0ad9c4ecb88edd009059a9"/><file name="NewsletterController.php" hash="b9342c80bf94c29a463251b1c7b02705"/></dir></dir></dir></dir><dir name="Block"><dir name="System"><file name="Contact.php" hash="a0e89ca48de64bb8526c35598f99802b"/><file name="Extension.php" hash="8cd6609bd4f00bf8a8f5913d20e98e65"/><dir name="Contact"><file name="Header.php" hash="a6c4f8dbf002a0d2f6be0ea37445a562"/><file name="Send.php" hash="333d3059033faa826ef3781946676b16"/><dir name="Send"><file name="Button.php" hash="c94e2ae59246a968d7eb2e89e63485c8"/></dir></dir><dir name="Newsletter"><file name="Subscribe.php" hash="1015b8e49758e40c829667e94bb06220"/><dir name="Subscribe"><file name="Button.php" hash="98162d3c3280bdc3da75c90c45fc9500"/></dir></dir><dir name="Extension"><file name="List.php" hash="0006ff459c6b19de9349fa31c8be6b2b"/></dir></dir></dir><dir name="Model"><file name="Feed.php" hash="b5e0d2343b2c9db1f4d86ca0e8b3a922"/><file name="Observer.php" hash="dfc8c917e3f3882d1d99c734831c6e0b"/><dir name="Source"><file name="Reason.php" hash="02eb3c4cfe3433e5a8194862aef636c4"/><dir name="Subscription"><file name="Type.php" hash="616c3f7e7e4ebe3e42e16d54d159d378"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Empty.php" hash="2af2d53c7c56b9ea4a148a2862da224b"/></dir></dir></dir><dir name="Feed"><file name="Extension.php" hash="1ff201b02db7827df350b11c19902fa2"/></dir></dir><dir name="Helper"><file name="Config.php" hash="42eff18ca97b961e1186a790abcb8690"/><file name="Data.php" hash="5492cb13c72b737d85e9009f0f623336"/><file name="Extension.php" hash="c0c987bd848e5270ec31544460438eab"/></dir></dir></dir></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="neklo"><file name="core.xml" hash="8851b2c111c8e0745fb78af2bb57e6a6"/></dir></dir><dir name="template"><dir name="neklo"><dir name="core"><dir name="system"><dir name="contact"><file name="button.phtml" hash="f7b5f21ddb974aa32c888c29f3057d18"/><file name="header.phtml" hash="3c0a401955a9b2bac799aa65b5bf7a81"/></dir><dir name="extension"><file name="list.phtml" hash="29378800cc0a7488badb2698a02220d7"/></dir><dir name="subscribe"><file name="button.phtml" hash="865b84befba4d00e6a1e4de2b989776e"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="neklo"><file name="facebookpage.xml" hash="2bcdcba08dab099e48918b05e59f3021"/></dir></dir><dir name="template"><dir name="neklo"><dir name="facebookpage"><file name="sdk.phtml" hash="3ad84b1d17d9e06e9f9a6fe2a7b0b8c9"/><dir name="widget"><file name="page.phtml" hash="f5b13730fb88ac0c21b2e4fc4ca0ac99"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="locale"><dir name="en_US"><file name="Neklo_Core.csv" hash="c6abfbb8be878de9c02339e2ecfc4e16"/></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="neklo"><dir name="core"><dir name="images"><file name="ok.gif" hash="a38bc2ee6e116e39c6e2e3013ee50f5e"/><file name="update.gif" hash="8342e11f7739fcfa25134707f0536ed6"/></dir><dir name="css"><file name="style.css" hash="77e35507d6f2e748afc08f11f322120d"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="neklo"><dir name="facebookpage"><file name="facebook-loader.GIF" hash="a11c3108c26c904dd9d8a641cf79cf06"/></dir></dir></dir><dir name="css"><dir name="neklo"><dir name="facebookpage"><file name="styles.css" hash="4667b1b222847a35ffb835310c8316a1"/></dir></dir></dir></dir></dir></dir></dir></target></contents></package>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/adminhtml/default/default/neklo/core/css/style.css ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ovh{
2
+ overflow: hidden;
3
+ display: inline-block;
4
+ font-size: 16px;
5
+ color: #494848;
6
+ text-align: center;
7
+ }
8
+ .neklo-img{
9
+ width: 150px;
10
+ height: 150px;
11
+ margin: 0 auto;
12
+ }
13
+ .neklo-img img{
14
+ width: 100%;
15
+ height: 100%;
16
+ }
17
+ .neklo-row{
18
+ margin-bottom: 20px;
19
+ }
20
+ .neklo-link, .neklo-link:hover{
21
+ color: #494848;
22
+ text-decoration: none;
23
+ }
24
+ .neklo-link:hover .neklo-ext-name{
25
+ text-decoration: underline;
26
+ }
27
+ .neklo-ext-name{
28
+ font-weight: bold;
29
+ min-height: 36px;
30
+ margin-bottom: 10px;
31
+ }
32
+ .neklo-item{
33
+ border: 1px solid #ccc;
34
+ display: inline-block;
35
+ padding: 20px;
36
+ margin: 0 20px 20px 0 !important;
37
+ vertical-align: top;
38
+ width: 270px;
39
+ text-align: center;
40
+ }
41
+ .neklo_core_message {
42
+ text-align: center;
43
+ padding: 5px 0;
44
+ font-weight: bold;
45
+ width: 280px;
46
+ }
47
+ .neklo_core_message .error {
48
+ color: #D40707;
49
+ }
50
+ .neklo_core_message .success {
51
+ color: #3d6611;
52
+ }
skin/adminhtml/default/default/neklo/core/images/ok.gif ADDED
Binary file
skin/adminhtml/default/default/neklo/core/images/update.gif ADDED
Binary file
skin/frontend/base/default/css/neklo/facebookpage/styles.css CHANGED
@@ -1,14 +1,14 @@
1
- .neklo-facebook-page {
2
- position: relative;
3
- }
4
-
5
- .neklo-facebook-page .fb-xfbml-parse-ignore {
6
- position: absolute;
7
- left: 0;
8
- right: 0;
9
- top: 0;
10
- bottom: 0;
11
- margin: auto;
12
- width: 64px;
13
- height: 64px;
14
  }
1
+ .neklo-facebook-page {
2
+ position: relative;
3
+ }
4
+
5
+ .neklo-facebook-page .fb-xfbml-parse-ignore {
6
+ position: absolute;
7
+ left: 0;
8
+ right: 0;
9
+ top: 0;
10
+ bottom: 0;
11
+ margin: auto;
12
+ width: 64px;
13
+ height: 64px;
14
  }
skin/frontend/base/default/images/neklo/facebookpage/{facebook-loader.gif → facebook-loader.GIF} RENAMED
File without changes