Version Notes
The first stable release.
Download this release
Release Info
Developer | NEKLO |
Extension | neklo_twitter |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- app/code/community/Neklo/Core/Block/System/Abstract.php +62 -0
- app/code/community/Neklo/Core/Block/System/Contact.php +165 -0
- app/code/community/Neklo/Core/Block/System/Extensions.php +66 -0
- app/code/community/Neklo/Core/Block/System/Newsletter.php +9 -0
- app/code/community/Neklo/Core/Block/System/Newsletter/Subscribe.php +20 -0
- app/code/community/Neklo/Core/Block/System/Newsletter/Subscribe/Button.php +35 -0
- app/code/community/Neklo/Core/Helper/Data.php +20 -0
- app/code/community/Neklo/Core/Model/Feed.php +34 -0
- app/code/community/Neklo/Core/Model/Observer.php +16 -0
- app/code/community/Neklo/Core/controllers/Adminhtml/Neklo/Core/ContactController.php +54 -0
- app/code/community/Neklo/Core/controllers/Adminhtml/Neklo/Core/NewsletterController.php +47 -0
- app/code/community/Neklo/Core/etc/adminhtml.xml +26 -0
- app/code/community/Neklo/Core/etc/config.xml +75 -0
- app/code/community/Neklo/Core/etc/system.xml +77 -0
- app/code/community/Neklo/Twitter/Block/Widget/Timeline.php +31 -0
- app/code/community/Neklo/Twitter/Helper/Config.php +19 -0
- app/code/community/Neklo/Twitter/Helper/Data.php +6 -0
- app/code/community/Neklo/Twitter/etc/adminhtml.xml +26 -0
- app/code/community/Neklo/Twitter/etc/config.xml +38 -0
- app/code/community/Neklo/Twitter/etc/system.xml +35 -0
- app/code/community/Neklo/Twitter/etc/widget.xml +39 -0
- app/design/adminhtml/default/default/template/neklo/core/system/subscribe/button.phtml +161 -0
- app/design/frontend/base/default/template/neklo/twitter/widget/timeline.phtml +4 -0
- app/etc/modules/Neklo_Core.xml +10 -0
- app/etc/modules/Neklo_Twitter.xml +15 -0
- app/locale/en_US/Neklo_Core.csv +19 -0
- package.xml +18 -0
app/code/community/Neklo/Core/Block/System/Abstract.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
}
|
app/code/community/Neklo/Core/Block/System/Extensions.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
ADDED
@@ -0,0 +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 |
+
}
|
app/code/community/Neklo/Core/Block/System/Newsletter/Subscribe/Button.php
ADDED
@@ -0,0 +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 |
+
}
|
app/code/community/Neklo/Core/Helper/Data.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Neklo_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
public function __()
|
6 |
+
{
|
7 |
+
$args = func_get_args();
|
8 |
+
if ($args[0] == '[NEKLO]') {
|
9 |
+
return '<img src="' . $this->_getLogoUrl() . '" height="11" alt="Neklo" title="" />';
|
10 |
+
}
|
11 |
+
$expr = new Mage_Core_Model_Translate_Expr(array_shift($args), $this->_getModuleName());
|
12 |
+
array_unshift($args, $expr);
|
13 |
+
return Mage::app()->getTranslator()->translate($args);
|
14 |
+
}
|
15 |
+
|
16 |
+
protected function _getLogoUrl()
|
17 |
+
{
|
18 |
+
return $this->_getRequest()->getPost('neklo_cache') . 'neklo.png';
|
19 |
+
}
|
20 |
+
}
|
app/code/community/Neklo/Core/Model/Feed.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
}
|
app/code/community/Neklo/Core/Model/Observer.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
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 |
+
}
|
app/code/community/Neklo/Core/controllers/Adminhtml/Neklo/Core/ContactController.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
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));
|
38 |
+
if ($params) {
|
39 |
+
$httpClient = new Varien_Http_Client();
|
40 |
+
$httpClient
|
41 |
+
->setMethod(Zend_Http_Client::POST)
|
42 |
+
->setUri(self::CONTACT_URL)
|
43 |
+
->setConfig(
|
44 |
+
array(
|
45 |
+
'maxredirects' => 0,
|
46 |
+
'timeout' => 30,
|
47 |
+
)
|
48 |
+
)
|
49 |
+
->setRawData($params)
|
50 |
+
->request()
|
51 |
+
;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
app/code/community/Neklo/Core/controllers/Adminhtml/Neklo/Core/NewsletterController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
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 |
+
{
|
9 |
+
$result = array(
|
10 |
+
'success' => true,
|
11 |
+
);
|
12 |
+
try {
|
13 |
+
$data = $this->getRequest()->getPost();
|
14 |
+
$this->_subscribe($data);
|
15 |
+
} catch (Exception $e) {
|
16 |
+
$result['success'] = false;
|
17 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function _subscribe($data)
|
24 |
+
{
|
25 |
+
$params = Mage::helper('core')->urlEncode(Mage::helper('core')->jsonEncode($data));
|
26 |
+
if ($params) {
|
27 |
+
$httpClient = new Varien_Http_Client();
|
28 |
+
$httpClient
|
29 |
+
->setMethod(Zend_Http_Client::POST)
|
30 |
+
->setUri(self::SUBSCRIBE_URL)
|
31 |
+
->setConfig(
|
32 |
+
array(
|
33 |
+
'maxredirects' => 0,
|
34 |
+
'timeout' => 30,
|
35 |
+
)
|
36 |
+
)
|
37 |
+
->setRawData($params)
|
38 |
+
->request()
|
39 |
+
;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
protected function _isAllowed()
|
44 |
+
{
|
45 |
+
return Mage::getSingleton('admin/session')->isAllowed('system/config/neklo_core');
|
46 |
+
}
|
47 |
+
}
|
app/code/community/Neklo/Core/etc/adminhtml.xml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<all>
|
6 |
+
<title>Allow Everything</title>
|
7 |
+
</all>
|
8 |
+
<admin>
|
9 |
+
<children>
|
10 |
+
<system>
|
11 |
+
<children>
|
12 |
+
<config>
|
13 |
+
<children>
|
14 |
+
<neklo_core translate="title" module="neklo_core">
|
15 |
+
<title>Neklo Extensions & Contact</title>
|
16 |
+
<sort_order>9999</sort_order>
|
17 |
+
</neklo_core>
|
18 |
+
</children>
|
19 |
+
</config>
|
20 |
+
</children>
|
21 |
+
</system>
|
22 |
+
</children>
|
23 |
+
</admin>
|
24 |
+
</resources>
|
25 |
+
</acl>
|
26 |
+
</config>
|
app/code/community/Neklo/Core/etc/config.xml
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Neklo_Core>
|
5 |
+
<version>1.0.2</version>
|
6 |
+
</Neklo_Core>
|
7 |
+
</modules>
|
8 |
+
<admin>
|
9 |
+
<routers>
|
10 |
+
<adminhtml>
|
11 |
+
<args>
|
12 |
+
<modules>
|
13 |
+
<neklo before="Mage_Adminhtml">Neklo_Core_Adminhtml</neklo>
|
14 |
+
</modules>
|
15 |
+
</args>
|
16 |
+
</adminhtml>
|
17 |
+
</routers>
|
18 |
+
</admin>
|
19 |
+
<global>
|
20 |
+
<blocks>
|
21 |
+
<neklo_core>
|
22 |
+
<class>Neklo_Core_Block</class>
|
23 |
+
</neklo_core>
|
24 |
+
</blocks>
|
25 |
+
<helpers>
|
26 |
+
<neklo_core>
|
27 |
+
<class>Neklo_Core_Helper</class>
|
28 |
+
</neklo_core>
|
29 |
+
</helpers>
|
30 |
+
<models>
|
31 |
+
<neklo_core>
|
32 |
+
<class>Neklo_Core_Model</class>
|
33 |
+
</neklo_core>
|
34 |
+
</models>
|
35 |
+
</global>
|
36 |
+
<adminhtml>
|
37 |
+
<translate>
|
38 |
+
<modules>
|
39 |
+
<Neklo_Core>
|
40 |
+
<files>
|
41 |
+
<default>Neklo_Core.csv</default>
|
42 |
+
</files>
|
43 |
+
</Neklo_Core>
|
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>
|
58 |
+
<class>neklo_core/observer</class>
|
59 |
+
<method>checkUpdate</method>
|
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>
|
app/code/community/Neklo/Core/etc/system.xml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<neklo translate="label" module="neklo_core">
|
5 |
+
<label>[NEKLO]</label>
|
6 |
+
<sort_order>310</sort_order>
|
7 |
+
</neklo>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<neklo_core translate="label" module="neklo_core">
|
11 |
+
<label>Extensions & Contact</label>
|
12 |
+
<tab>neklo</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>9999</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
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>
|
45 |
+
<expanded>1</expanded>
|
46 |
+
<fields>
|
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>
|
67 |
+
<sort_order>30</sort_order>
|
68 |
+
<show_in_default>1</show_in_default>
|
69 |
+
<show_in_website>0</show_in_website>
|
70 |
+
<show_in_store>0</show_in_store>
|
71 |
+
</subscribe_button>
|
72 |
+
</fields>
|
73 |
+
</newsletter>
|
74 |
+
</groups>
|
75 |
+
</neklo_core>
|
76 |
+
</sections>
|
77 |
+
</config>
|
app/code/community/Neklo/Twitter/Block/Widget/Timeline.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Neklo_Twitter_Block_Widget_Timeline extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @return bool
|
7 |
+
*/
|
8 |
+
public function isEnabled()
|
9 |
+
{
|
10 |
+
return $this->getConfig()->isEnabled() && $this->getData('is_enabled') && $this->hasData('widget_html');
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @return null|string
|
15 |
+
*/
|
16 |
+
public function getWidgetHtml()
|
17 |
+
{
|
18 |
+
if (!$this->hasData('widget_html')) {
|
19 |
+
return null;
|
20 |
+
}
|
21 |
+
return $this->getData('widget_html');
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @return Neklo_Twitter_Helper_Config
|
26 |
+
*/
|
27 |
+
public function getConfig()
|
28 |
+
{
|
29 |
+
return Mage::helper('neklo_twitter/config');
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Neklo/Twitter/Helper/Config.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Neklo_Twitter_Helper_Config extends Mage_Core_Helper_Data
|
4 |
+
{
|
5 |
+
const GENERAL_IS_ENABLED = 'neklo_twitter/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/Twitter/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Neklo_Twitter_Helper_Data extends Mage_Core_Helper_Data
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Neklo/Twitter/etc/adminhtml.xml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<all>
|
6 |
+
<title>Allow Everything</title>
|
7 |
+
</all>
|
8 |
+
<admin>
|
9 |
+
<children>
|
10 |
+
<system>
|
11 |
+
<children>
|
12 |
+
<config>
|
13 |
+
<children>
|
14 |
+
<neklo_twitter translate="title" module="neklo_twitter">
|
15 |
+
<title>Neklo LLC - Twitter Timeline</title>
|
16 |
+
<sort_order>150</sort_order>
|
17 |
+
</neklo_twitter>
|
18 |
+
</children>
|
19 |
+
</config>
|
20 |
+
</children>
|
21 |
+
</system>
|
22 |
+
</children>
|
23 |
+
</admin>
|
24 |
+
</resources>
|
25 |
+
</acl>
|
26 |
+
</config>
|
app/code/community/Neklo/Twitter/etc/config.xml
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Neklo_Twitter>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Neklo_Twitter>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<blocks>
|
10 |
+
<neklo_twitter>
|
11 |
+
<class>Neklo_Twitter_Block</class>
|
12 |
+
</neklo_twitter>
|
13 |
+
</blocks>
|
14 |
+
<helpers>
|
15 |
+
<neklo_twitter>
|
16 |
+
<class>Neklo_Twitter_Helper</class>
|
17 |
+
</neklo_twitter>
|
18 |
+
</helpers>
|
19 |
+
</global>
|
20 |
+
<frontend>
|
21 |
+
<translate>
|
22 |
+
<modules>
|
23 |
+
<Neklo_Twitter>
|
24 |
+
<files>
|
25 |
+
<default>Neklo_Twitter.csv</default>
|
26 |
+
</files>
|
27 |
+
</Neklo_Twitter>
|
28 |
+
</modules>
|
29 |
+
</translate>
|
30 |
+
</frontend>
|
31 |
+
<default>
|
32 |
+
<neklo_twitter>
|
33 |
+
<general>
|
34 |
+
<is_enabled>1</is_enabled>
|
35 |
+
</general>
|
36 |
+
</neklo_twitter>
|
37 |
+
</default>
|
38 |
+
</config>
|
app/code/community/Neklo/Twitter/etc/system.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<neklo_twitter translate="label" module="neklo_twitter">
|
5 |
+
<label>Twitter Timeline</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_twitter>
|
34 |
+
</sections>
|
35 |
+
</config>
|
app/code/community/Neklo/Twitter/etc/widget.xml
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<widgets>
|
3 |
+
<neklo_twitter type="neklo_twitter/widget_timeline" translate="label" module="neklo_twitter">
|
4 |
+
<name>[NEKLO] Twitter Timeline</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 |
+
<widget_html translate="label description">
|
16 |
+
<label>Widget HTML</label>
|
17 |
+
<description><![CDATA[Create a new timeline widget <a href="https://twitter.com/settings/widgets/new" target="_blank">here</a>]]></description>
|
18 |
+
<required>1</required>
|
19 |
+
<visible>1</visible>
|
20 |
+
<sort_order>20</sort_order>
|
21 |
+
<type>textarea</type>
|
22 |
+
</widget_html>
|
23 |
+
<template translate="label">
|
24 |
+
<label>Template</label>
|
25 |
+
<required>1</required>
|
26 |
+
<visible>1</visible>
|
27 |
+
<sort_order>30</sort_order>
|
28 |
+
<type>select</type>
|
29 |
+
<value>neklo/twitter/widget/timeline.phtml</value>
|
30 |
+
<values>
|
31 |
+
<featured translate="label">
|
32 |
+
<value>neklo/twitter/widget/timeline.phtml</value>
|
33 |
+
<label>Twitter Timeline Template</label>
|
34 |
+
</featured>
|
35 |
+
</values>
|
36 |
+
</template>
|
37 |
+
</parameters>
|
38 |
+
</neklo_twitter>
|
39 |
+
</widgets>
|
app/design/adminhtml/default/default/template/neklo/core/system/subscribe/button.phtml
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
app/design/frontend/base/default/template/neklo/twitter/widget/timeline.phtml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php /* @var $this Neklo_Twitter_Block_Widget_Timeline */ ?>
|
2 |
+
<?php if ($this->isEnabled()): ?>
|
3 |
+
<?php echo $this->getWidgetHtml(); ?>
|
4 |
+
<?php endif; ?>
|
app/etc/modules/Neklo_Core.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Neklo_Core>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<extension_name>Neklo Core</extension_name>
|
8 |
+
</Neklo_Core>
|
9 |
+
</modules>
|
10 |
+
</config>
|
app/etc/modules/Neklo_Twitter.xml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Neklo_Twitter>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<depends>
|
8 |
+
<Neklo_Core/>
|
9 |
+
</depends>
|
10 |
+
<extension_name>Twitter Timeline</extension_name>
|
11 |
+
<free>1</free>
|
12 |
+
<url>twitter-widget-extension-for-magento</url>
|
13 |
+
</Neklo_Twitter>
|
14 |
+
</modules>
|
15 |
+
</config>
|
app/locale/en_US/Neklo_Core.csv
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
%s Support (%s),%s Support (%s)
|
2 |
+
Contact Email,Contact Email
|
3 |
+
Contact Form,Contact Form
|
4 |
+
Contact Name,Contact Name
|
5 |
+
"Contact Neklo Support Team or visit <a href=""%s"" target=""_blank"">%s</a> for additional information","Contact Neklo Support Team or visit <a href=""%s"" target=""_blank"">%s</a> for additional information"
|
6 |
+
Extensions & Contact,Extensions & Contact
|
7 |
+
Extensions Information,Extensions Information
|
8 |
+
Installed Neklo Extensions,Installed Neklo Extensions
|
9 |
+
free,free
|
10 |
+
Magento Related Support (paid),Magento Related Support (paid)
|
11 |
+
Message,Message
|
12 |
+
Neklo Extensions & Contact,Neklo Extensions & Contact
|
13 |
+
Other Reason,Other Reason
|
14 |
+
Reason,Reason
|
15 |
+
Request New Extension Development (paid),Request New Extension Development (paid)
|
16 |
+
paid,paid
|
17 |
+
Please select,Please select
|
18 |
+
Send,Send
|
19 |
+
Subject,Subject
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Neklo_TwitterWidget</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:56:21</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Neklo"><dir name="Twitter"><dir name="Block"><dir name="Widget"><file name="Timeline.php" hash="a75f3e96a8b4850923d164db763848f9"/></dir></dir><dir name="Helper"><file name="Config.php" hash="b6ce85e9a6bf78771ec00a180c849668"/><file name="Data.php" hash="974a977b8394e30ac6cce32a37357de2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="49faf6db2d24330f306295e43a32a8dc"/><file name="config.xml" hash="e83aba5100dc312d5e4651d998fb912a"/><file name="system.xml" hash="d9507e904c7dffafea735c6c72b50123"/><file name="widget.xml" hash="cb4303b2069d989356b431060e2768d5"/></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="template"><dir name="neklo"><dir name="twitter"><dir name="widget"><file name="timeline.phtml" hash="9e94f183891ebbed8717915461e9909d"/></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_Twitter.xml" hash="7ed75490a6dd245c4ec2473c191a20dc"/><file name="Neklo_Core.xml" hash="335032ff690c5272626dca9106642680"/></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>
|