本文整理汇总了PHP中Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray方法的具体用法?PHP Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray怎么用?PHP Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Email_Template
的用法示例。
在下文中一共展示了Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDefaultTemplateAsOptionsArray
public function testDefaultTemplateAsOptionsArray()
{
$options = $this->_model->getDefaultTemplatesAsOptionsArray();
$this->assertInternalType('array', $options);
$this->assertNotEmpty($options);
foreach ($options as $option) {
$this->assertArrayHasKey('value', $option);
$this->assertArrayHasKey('label', $option);
$this->assertArrayHasKey('group', $option);
}
}
示例2: getAvailableTemplates
public function getAvailableTemplates($asHash = true)
{
$result = array();
$collection = Mage::getResourceModel('core/email_template_collection')->load();
$options = $collection->toOptionArray();
$defOptions = Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray();
// the same as + but to be sure
foreach ($defOptions as $v) {
$options[] = $v;
}
// convert to hash
foreach ($options as $v) {
$result[$v['value']] = $v['label'];
}
// sort by names alphabetically
asort($result);
if (!$asHash) {
$options = array();
foreach ($result as $k => $v) {
$options[] = array('value' => $k, 'label' => $v);
}
$result = $options;
}
return $result;
}
示例3: toOptionArray
public function toOptionArray()
{
$options = Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray();
$options[0]['label'] = Mage::helper('aw_hdu3')->__('Do not send');
$options[0]['value'] = 0;
return array_merge($options, parent::toOptionArray());
}
示例4: _beforeToHtml
/**
* Collect, sort and set template options
*
* @return Mage_Adminhtml_Block_System_Email_Template_Edit
*/
protected function _beforeToHtml()
{
$groupedOptions = array();
foreach (Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray() as $option) {
$groupedOptions[$option['group']][] = $option;
}
ksort($groupedOptions);
$this->setData('template_options', $groupedOptions);
return parent::_beforeToHtml();
}
示例5: render
/**
* Render form element
*
* @see Mage_Adminhtml_Block_System_Config_Form_Fieldset::render()
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$html = $this->_getHeaderHtml($element);
$emails = Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray();
foreach ($emails as $notificationType) {
if ($notificationType['value']) {
$html .= $this->_getFieldHtml($element, $notificationType);
}
}
$html .= $this->_getFooterHtml($element);
return $html;
}
示例6: getTemplateOptions
public function getTemplateOptions()
{
return Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray();
}