-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
4,592 additions
and
333 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
app/code/community/Ebizmarts/MailChimp/Block/Adminhtml/Mergevars/Add.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* Author : Ebizmarts <[email protected]> | ||
* Date : 4/24/13 | ||
* Time : 1:15 PM | ||
* File : Add.php | ||
* Module : Ebizmarts_MailChimp | ||
*/ | ||
class Ebizmarts_Mailchimp_Block_Adminhtml_Mergevars_Add extends Mage_Adminhtml_Block_Widget_Form_Container { | ||
protected $_mode = 'add'; | ||
public function __construct() { | ||
$this->_controller = 'adminhtml_mergevars'; | ||
$this->_blockGroup = 'mailchimp'; | ||
|
||
parent::__construct(); | ||
$this->_removeButton("delete"); | ||
$this->_removeButton("back"); | ||
$this->_removeButton("reset"); | ||
} | ||
// public function getMovtypes() | ||
// { | ||
// $types = Mage::getSingleton('mailchimp/system_config_source_movtype')->getMovtypes(); | ||
// return $types; | ||
// } | ||
public function getHeaderText() | ||
{ | ||
return Mage::helper('mailchimp')->__('New Field Type'); | ||
} | ||
public function _prepareForm() { | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
app/code/community/Ebizmarts/MailChimp/Block/Adminhtml/Mergevars/Add/Form.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Author : Ebizmarts <[email protected]> | ||
* Date : 4/24/13 | ||
* Time : 4:00 PM | ||
* File : Form.php | ||
* Module : Ebizmarts_MailChimp | ||
*/ | ||
class Ebizmarts_Mailchimp_Block_Adminhtml_Mergevars_Add_Form extends Mage_Adminhtml_Block_Widget_Form | ||
{ | ||
protected function _prepareForm() { | ||
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/saveadd'), 'method' => 'post')); | ||
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('mailchimp')->__('Mergevars Data'))); | ||
|
||
|
||
$fieldset->addField('mergevar_label', 'text', array( | ||
'name' => 'mergevar[label]', | ||
'label' => Mage::helper('mailchimp')->__('MergeVar Name'), | ||
'id' => 'mergevar_label', | ||
'title' => Mage::helper('mailchimp')->__('MergeVar Name'), | ||
'required' => true | ||
)); | ||
$fieldset->addField('mergevar_fieldtype','select',array( | ||
'name' => 'mergevar[fieldtype]', | ||
'label' => Mage::helper('mailchimp')->__('Field Type'), | ||
'id' => 'mergevar_fieldtype', | ||
'values' => Mage::getSingleton('mailchimp/system_config_source_fieldtype')->getFieldTypes(), | ||
'required' => true | ||
)); | ||
|
||
$fieldset->addField('mergevar_value', 'text', array( | ||
'name' => 'mergevar[value]', | ||
'label' => Mage::helper('mailchimp')->__('Value for case entry'), | ||
'id' => 'mergevar_value', | ||
'title' => Mage::helper('mailchimp')->__('Value for case entry'), | ||
'note' => 'This value should be added in the case of Data.php file', | ||
'required' => true | ||
)); | ||
|
||
|
||
|
||
$form->setUseContainer(true); | ||
$this->setForm($form); | ||
return parent::_prepareForm(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app/code/community/Ebizmarts/MailChimp/Block/Adminhtml/System/Config/CreateMergeFields.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* mc-magento Magento Component | ||
* | ||
* @category Ebizmarts | ||
* @package mc-magento | ||
* @author Ebizmarts Team <[email protected]> | ||
* @copyright Ebizmarts (http://ebizmarts.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @date: 30/8/16 1:02 PM | ||
* @file: CreateMergeFields.php | ||
*/ | ||
class Ebizmarts_MailChimp_Block_Adminhtml_System_Config_CreateMergeFields | ||
extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
protected function _construct() | ||
{ | ||
parent::_construct(); | ||
$this->setTemplate('ebizmarts/mailchimp/system/config/createmergefields.phtml'); | ||
} | ||
|
||
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
return $this->_toHtml(); | ||
} | ||
|
||
public function getButtonHtml() | ||
{ | ||
$button = $this->getLayout()->createBlock('adminhtml/widget_button') | ||
->setData( | ||
array( | ||
'id' => 'createmergefields_button', | ||
'label' => $this->helper('mailchimp')->__('Create Merge Fields'), | ||
'onclick' => 'javascript:createMergeFields(); return false;' | ||
) | ||
); | ||
|
||
return $button->toHtml(); | ||
} | ||
public function getAjaxCheckUrl() | ||
{ | ||
return Mage::helper('adminhtml')->getUrl('adminhtml/ecommerce/createMergeFields'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...de/community/Ebizmarts/MailChimp/Block/Adminhtml/System/Config/Fieldset/Mandrill/Hint.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/** | ||
* MailChimp For Magento | ||
* | ||
* @category Ebizmarts_MailChimp | ||
* @author Ebizmarts Team <[email protected]> | ||
* @copyright Ebizmarts (http://ebizmarts.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @date: 4/29/16 3:55 PM | ||
* @file: Hint.php | ||
*/ | ||
class Ebizmarts_MailChimp_Block_Adminhtml_System_Config_Fieldset_Mandrill_Hint | ||
extends Mage_Adminhtml_Block_Abstract | ||
implements Varien_Data_Form_Element_Renderer_Interface | ||
{ | ||
protected $_template = 'ebizmarts/mandrill/system/config/fieldset/hint.phtml'; | ||
|
||
/** | ||
* Render fieldset html | ||
* | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* @return string | ||
*/ | ||
public function render(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
return $this->toHtml(); | ||
} | ||
|
||
public function getMandrillVersion() | ||
{ | ||
return (string)Mage::getConfig()->getNode('modules/Ebizmarts_Mandrill/version'); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
app/code/community/Ebizmarts/MailChimp/Block/Adminhtml/System/Config/Userinfo.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
/** | ||
* Account details renderer for configuration settings | ||
* | ||
* @category Ebizmarts | ||
* @package Ebizmarts_Mandrill | ||
* @author Ebizmarts Team <[email protected]> | ||
* @license http://opensource.org/licenses/osl-3.0.php | ||
*/ | ||
class Ebizmarts_MailChimp_Block_Adminhtml_System_Config_Userinfo | ||
extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
|
||
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
$values = $element->getValues(); | ||
|
||
$html = '<ul class="checkboxes">'; | ||
|
||
foreach ($values as $dat) { | ||
$html .= "<li>{$dat['label']}</li>"; | ||
} | ||
|
||
$html .= '</ul>'; | ||
|
||
return $html; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/code/community/Ebizmarts/MailChimp/Helper/Mandrill.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* mc-magento Magento Component | ||
* | ||
* @category Ebizmarts | ||
* @package mc-magento | ||
* @author Ebizmarts Team <[email protected]> | ||
* @copyright Ebizmarts (http://ebizmarts.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @date: 8/30/16 3:31 PM | ||
* @file: Mandrill.php | ||
*/ | ||
class Ebizmarts_MailChimp_Helper_Mandrill extends Mage_Core_Helper_Abstract | ||
{ | ||
/** | ||
* @param $message | ||
*/ | ||
public function log($message) | ||
{ | ||
if (Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::MANDRILL_LOG)) { | ||
Mage::log($message, null, 'Mandrill_Request.log', true); | ||
} | ||
} | ||
/** | ||
* Get module User-Agent to use on API requests | ||
* | ||
* @return string | ||
*/ | ||
public function getUserAgent() | ||
{ | ||
$modules = Mage::getConfig()->getNode('modules')->children(); | ||
$modulesArray = (array)$modules; | ||
|
||
$aux = (array_key_exists('Enterprise_Enterprise', $modulesArray)) ? 'EE' : 'CE'; | ||
$v = (string)Mage::getConfig()->getNode('modules/Ebizmarts_Mandrill/version'); | ||
$version = strpos(Mage::getVersion(), '-') ? substr(Mage::getVersion(), 0, strpos(Mage::getVersion(), '-')) : Mage::getVersion(); | ||
return (string)'Ebizmarts_Mandrill' . $v . '/Mage' . $aux . $version; | ||
} | ||
} |
Oops, something went wrong.