1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27:
28: 29: 30: 31: 32: 33: 34:
35: class Mage_Core_Model_Source_Email_Variables
36: {
37: 38: 39: 40: 41:
42: protected $_configVariables = array();
43:
44: 45: 46: 47:
48: public function __construct()
49: {
50: $this->_configVariables = array(
51: array(
52: 'value' => Mage_Core_Model_Url::XML_PATH_UNSECURE_URL,
53: 'label' => Mage::helper('core')->__('Base Unsecure URL')
54: ),
55: array(
56: 'value' => Mage_Core_Model_Url::XML_PATH_SECURE_URL,
57: 'label' => Mage::helper('core')->__('Base Secure URL')
58: ),
59: array(
60: 'value' => 'trans_email/ident_general/name',
61: 'label' => Mage::helper('core')->__('General Contact Name')
62: ),
63: array(
64: 'value' => 'trans_email/ident_general/email',
65: 'label' => Mage::helper('core')->__('General Contact Email')
66: ),
67: array(
68: 'value' => 'trans_email/ident_sales/name',
69: 'label' => Mage::helper('core')->__('Sales Representative Contact Name')
70: ),
71: array(
72: 'value' => 'trans_email/ident_sales/email',
73: 'label' => Mage::helper('core')->__('Sales Representative Contact Email')
74: ),
75: array(
76: 'value' => 'trans_email/ident_custom1/name',
77: 'label' => Mage::helper('core')->__('Custom1 Contact Name')
78: ),
79: array(
80: 'value' => 'trans_email/ident_custom1/email',
81: 'label' => Mage::helper('core')->__('Custom1 Contact Email')
82: ),
83: array(
84: 'value' => 'trans_email/ident_custom2/name',
85: 'label' => Mage::helper('core')->__('Custom2 Contact Name')
86: ),
87: array(
88: 'value' => 'trans_email/ident_custom2/email',
89: 'label' => Mage::helper('core')->__('Custom2 Contact Email')
90: ),
91: array(
92: 'value' => 'general/store_information/name',
93: 'label' => Mage::helper('core')->__('Store Name')
94: ),
95: array(
96: 'value' => 'general/store_information/phone',
97: 'label' => Mage::helper('core')->__('Store Contact Telephone')
98: ),
99: array(
100: 'value' => 'general/store_information/address',
101: 'label' => Mage::helper('core')->__('Store Contact Address')
102: )
103: );
104: }
105:
106: 107: 108: 109: 110: 111:
112: public function toOptionArray($withGroup = false)
113: {
114: $optionArray = array();
115: foreach ($this->_configVariables as $variable) {
116: $optionArray[] = array(
117: 'value' => '{{config path="' . $variable['value'] . '"}}',
118: 'label' => Mage::helper('core')->__('%s', $variable['label'])
119: );
120: }
121: if ($withGroup && $optionArray) {
122: $optionArray = array(
123: 'label' => Mage::helper('core')->__('Store Contact Information'),
124: 'value' => $optionArray
125: );
126: }
127: return $optionArray;
128: }
129: }
130: