Version Notes
Send magento emails by protocol SMTP or save them to a files.
Download this release
Release Info
Developer | Marcin Frymark |
Extension | mail_transport |
Version | 0.1.0.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.0.0 to 0.1.0.1
- app/code/community/Alekseon/Core/Block/Adminhtml/System/Config/Fieldset/Alekseon.php +11 -0
- app/code/community/Alekseon/Core/Helper/Data.php +19 -0
- app/code/community/Alekseon/Core/Model/NonDbCollection.php +139 -0
- app/code/community/Alekseon/Core/etc/config.xml +33 -0
- app/etc/modules/Alekseon_Core.xml +17 -0
- package.xml +4 -4
app/code/community/Alekseon/Core/Block/Adminhtml/System/Config/Fieldset/Alekseon.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Alekseon_Core_Block_Adminhtml_System_Config_Fieldset_Alekseon extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
6 |
+
{
|
7 |
+
$alekseonUrl = Mage::helper('alekseon_core')->getAlekseonUrl();
|
8 |
+
$createdAtImageUrl = $alekseonUrl . '/images/created_by_alekseon.png';
|
9 |
+
return '<div><a href="' . $alekseonUrl . '" target="_blank"><img src="' . $createdAtImageUrl . '" alt="Created by Alekseon" title="Created by Alekseon" /></a></div>';
|
10 |
+
}
|
11 |
+
}
|
app/code/community/Alekseon/Core/Helper/Data.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @author Marcin Frymark
|
4 |
+
* @email contact@alekseon.com
|
5 |
+
* @company Alekseon
|
6 |
+
* @website www.alekseon.com
|
7 |
+
*/
|
8 |
+
class Alekseon_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
9 |
+
{
|
10 |
+
public function getAlekseonUrl()
|
11 |
+
{
|
12 |
+
return 'http://www.alekseon.com';
|
13 |
+
}
|
14 |
+
|
15 |
+
public function getAlekseonEmail()
|
16 |
+
{
|
17 |
+
return 'contact@alekseon.com';
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Alekseon/Core/Model/NonDbCollection.php
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @author Marcin Frymark
|
4 |
+
* @email contact@alekseon.com
|
5 |
+
* @company Alekseon
|
6 |
+
* @website www.alekseon.com
|
7 |
+
*/
|
8 |
+
class Alekseon_Core_Model_NonDbCollection extends Varien_Data_Collection
|
9 |
+
{
|
10 |
+
protected $_filters = array();
|
11 |
+
|
12 |
+
public function addFieldToFilter($attribute, $condition=null)
|
13 |
+
{
|
14 |
+
if (isset($condition['eq'])) {
|
15 |
+
$value = $condition['eq'];
|
16 |
+
$method = 'equal';
|
17 |
+
} elseif (isset($condition['like'])) {
|
18 |
+
$value = $condition['like'];
|
19 |
+
$method = 'like';
|
20 |
+
}
|
21 |
+
|
22 |
+
$this->_filters[] = array(
|
23 |
+
'attribute' => $attribute,
|
24 |
+
'method' => $method,
|
25 |
+
'value' => $value,
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function load($printQuery = false, $logQuery = false)
|
30 |
+
{
|
31 |
+
if ($this->isLoaded()) {
|
32 |
+
return $this;
|
33 |
+
}
|
34 |
+
|
35 |
+
$this->_addFilterToCollection();
|
36 |
+
$this->_sortCollection();
|
37 |
+
$this->_renderLimit();
|
38 |
+
|
39 |
+
$this->_setIsLoaded();
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getSize()
|
44 |
+
{
|
45 |
+
if (is_null($this->_totalRecords)) {
|
46 |
+
$this->_totalRecords = count($this->_items);
|
47 |
+
}
|
48 |
+
return intval($this->_totalRecords);
|
49 |
+
}
|
50 |
+
|
51 |
+
protected function _renderLimit()
|
52 |
+
{
|
53 |
+
if($this->_pageSize){
|
54 |
+
$from = ($this->getCurPage() - 1) * $this->_pageSize;
|
55 |
+
$to = ($this->getCurPage() - 1) * $this->_pageSize + $this->_pageSize - 1;
|
56 |
+
$items = $this->_items;
|
57 |
+
$this->_items = array();
|
58 |
+
$counter = 0;
|
59 |
+
foreach($items as $item) {
|
60 |
+
if ($counter >= $from && $counter <= $to) {
|
61 |
+
$this->addItem($item);
|
62 |
+
}
|
63 |
+
$counter++;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
protected function _sortCollection()
|
71 |
+
{
|
72 |
+
usort($this->_items , array($this, '_doCompare'));
|
73 |
+
return $this;
|
74 |
+
}
|
75 |
+
|
76 |
+
protected function _addFilterToCollection()
|
77 |
+
{
|
78 |
+
$items = $this->_items;
|
79 |
+
$this->_items = array();
|
80 |
+
foreach($items as $item) {
|
81 |
+
if ($this->_filterItem($item)) {
|
82 |
+
$this->addItem($item);
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
protected function _filterItem($item)
|
88 |
+
{
|
89 |
+
foreach ($this->_filters as $filter) {
|
90 |
+
$method = $filter['method'];
|
91 |
+
$attribute = $filter['attribute'];
|
92 |
+
$itemValue = $item[$attribute];
|
93 |
+
|
94 |
+
if (is_array($itemValue) && isset($itemValue['filter_condition'])) {
|
95 |
+
$itemValue = $itemValue['filter_condition'];
|
96 |
+
}
|
97 |
+
|
98 |
+
if (!$this->$method($itemValue, $filter['value'])) {
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
return true;
|
104 |
+
}
|
105 |
+
|
106 |
+
protected function _doCompare($a, $b)
|
107 |
+
{
|
108 |
+
foreach($this->_orders as $column => $order) {
|
109 |
+
$valueA = $a->getData($column);
|
110 |
+
$valueB = $b->getData($column);
|
111 |
+
if (is_array($valueA)) {
|
112 |
+
$valueA = implode(',', $valueA);
|
113 |
+
}
|
114 |
+
if (is_array($valueB)) {
|
115 |
+
$valueB = implode(',', $valueB);
|
116 |
+
}
|
117 |
+
|
118 |
+
$result = strcmp($valueA, $valueB);
|
119 |
+
|
120 |
+
if (strtolower($order) == 'asc') {
|
121 |
+
$result = -$result;
|
122 |
+
}
|
123 |
+
|
124 |
+
return $result;
|
125 |
+
}
|
126 |
+
return 0;
|
127 |
+
}
|
128 |
+
|
129 |
+
public function equal($filerValue, $needle)
|
130 |
+
{
|
131 |
+
return ($filerValue == $needle);
|
132 |
+
}
|
133 |
+
|
134 |
+
public function like($filerValue, $needle)
|
135 |
+
{
|
136 |
+
$needle = trim($needle, ' \'"%');
|
137 |
+
return stristr($filerValue, $needle);
|
138 |
+
}
|
139 |
+
}
|
app/code/community/Alekseon/Core/etc/config.xml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @author Marcin Frymark
|
5 |
+
* @email contact@alekseon.com
|
6 |
+
* @company Alekseon
|
7 |
+
* @website www.alekseon.com
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Alekseon_Core>
|
13 |
+
<version>0.1.0</version>
|
14 |
+
</Alekseon_Core>
|
15 |
+
</modules>
|
16 |
+
<global>
|
17 |
+
<blocks>
|
18 |
+
<alekseon_core>
|
19 |
+
<class>Alekseon_Core_Block</class>
|
20 |
+
</alekseon_core>
|
21 |
+
</blocks>
|
22 |
+
<models>
|
23 |
+
<alekseon_core>
|
24 |
+
<class>Alekseon_Core_Model</class>
|
25 |
+
</alekseon_core>
|
26 |
+
</models>
|
27 |
+
<helpers>
|
28 |
+
<alekseon_core>
|
29 |
+
<class>Alekseon_Core_Helper</class>
|
30 |
+
</alekseon_core>
|
31 |
+
</helpers>
|
32 |
+
</global>
|
33 |
+
</config>
|
app/etc/modules/Alekseon_Core.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @author Marcin Frymark
|
5 |
+
* @email contact@alekseon.com
|
6 |
+
* @company Alekseon
|
7 |
+
* @website www.alekseon.com
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Alekseon_Core>
|
13 |
+
<active>true</active>
|
14 |
+
<codePool>community</codePool>
|
15 |
+
</Alekseon_Core>
|
16 |
+
</modules>
|
17 |
+
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>mail_transport</name>
|
4 |
-
<version>0.1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Send magento emails by protocol SMTP or save them to a files.</description>
|
11 |
<notes>Send magento emails by protocol SMTP or save them to a files.</notes>
|
12 |
<authors><author><name>Marcin Frymark</name><user>Alekseon</user><email>contact@alekseon.com</email></author></authors>
|
13 |
-
<date>2014-03-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Alekseon"><dir name="MailTransport"><dir><dir name="Helper"><file name="Data.php" hash="4205979868b86789b2704c134630736a"/></dir><dir name="Model"><dir name="Email"><file name="Template.php" hash="b30c24c2853bb06f8c0ec3b470ad6951"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="EncryptionProtocols.php" hash="71dfa161d404dc77be304c9946e7318e"/><file name="MailTransportTypes.php" hash="c60afbdae29ed7afbf016b6fef33f94c"/><file name="SmtpAuthModes.php" hash="6b30e126782cdc9bb93755c179c06fc4"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="68a57d2d88b48e9238eddef0e6659d18"/><file name="config.xml" hash="d8a0279d4d1cd9076f8804ff52b2e7ab"/><file name="system.xml" hash="e257acfd5e5ec006f3d603d627e2811a"/></dir></dir></dir><dir name="AdminNotification"><dir><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Notification.php" hash="0cf97c24e0e7497955ee17fb14daef52"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="d82dbd74204aace87e9f28be31ba98e6"/></dir><dir name="Model"><file name="Feed.php" hash="d25c0486febfecd06567e9d487ffde11"/><file name="Observer.php" hash="0bc915784005f5424bfa4940bb496d05"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b63f6dd92e49def5499f7560bc1fa15c"/><file name="config.xml" hash="0ed69e4e9d2dbcfbd2cc24d2f79faf46"/><file name="system.xml" hash="7211e39b5159acca15740dfd391f69af"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Alekseon_MailTrasnport.xml" hash="e99dcf95b0657403cec683729a620450"/><file name="Alekseon_AdminNotification.xml" hash="9635261e9cedc0c69e49d20bcddfbc6e"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>mail_transport</name>
|
4 |
+
<version>0.1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Send magento emails by protocol SMTP or save them to a files.</description>
|
11 |
<notes>Send magento emails by protocol SMTP or save them to a files.</notes>
|
12 |
<authors><author><name>Marcin Frymark</name><user>Alekseon</user><email>contact@alekseon.com</email></author></authors>
|
13 |
+
<date>2014-03-13</date>
|
14 |
+
<time>19:48:23</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Alekseon"><dir name="MailTransport"><dir><dir name="Helper"><file name="Data.php" hash="4205979868b86789b2704c134630736a"/></dir><dir name="Model"><dir name="Email"><file name="Template.php" hash="b30c24c2853bb06f8c0ec3b470ad6951"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="EncryptionProtocols.php" hash="71dfa161d404dc77be304c9946e7318e"/><file name="MailTransportTypes.php" hash="c60afbdae29ed7afbf016b6fef33f94c"/><file name="SmtpAuthModes.php" hash="6b30e126782cdc9bb93755c179c06fc4"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="68a57d2d88b48e9238eddef0e6659d18"/><file name="config.xml" hash="d8a0279d4d1cd9076f8804ff52b2e7ab"/><file name="system.xml" hash="e257acfd5e5ec006f3d603d627e2811a"/></dir></dir></dir><dir name="AdminNotification"><dir><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Notification.php" hash="0cf97c24e0e7497955ee17fb14daef52"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="d82dbd74204aace87e9f28be31ba98e6"/></dir><dir name="Model"><file name="Feed.php" hash="d25c0486febfecd06567e9d487ffde11"/><file name="Observer.php" hash="0bc915784005f5424bfa4940bb496d05"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b63f6dd92e49def5499f7560bc1fa15c"/><file name="config.xml" hash="0ed69e4e9d2dbcfbd2cc24d2f79faf46"/><file name="system.xml" hash="7211e39b5159acca15740dfd391f69af"/></dir></dir></dir><dir name="Core"><dir><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Alekseon.php" hash="1d51aaf89f838ec44b2c2bbafb74a664"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="8e117e0ba3c38786238baf66af89a127"/></dir><dir name="Model"><file name="NonDbCollection.php" hash="bdc61355076c70c8dfa97943015c101d"/></dir><dir name="etc"><file name="config.xml" hash="e92d2921b6d48fd4171637f99df3c05c"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Alekseon_MailTrasnport.xml" hash="e99dcf95b0657403cec683729a620450"/><file name="Alekseon_AdminNotification.xml" hash="9635261e9cedc0c69e49d20bcddfbc6e"/><file name="Alekseon_Core.xml" hash="c579cb3ce377e8c4ffa86ef00cb7c006"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|