本文整理汇总了PHP中Varien_Data_Form::addFieldNameSuffix方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::addFieldNameSuffix方法的具体用法?PHP Varien_Data_Form::addFieldNameSuffix怎么用?PHP Varien_Data_Form::addFieldNameSuffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::addFieldNameSuffix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
/**
* Prepare form before rendering HTML
*
* @return Enterprise_Staging_Block_Manage_Staging_Edit_Tabs_Website
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$config = Mage::getSingleton('enterprise_staging/staging_config');
$log = $this->getLog();
$staging = $log->getStaging();
$fieldset = $form->addFieldset('general_fieldset', array('legend' => Mage::helper('enterprise_staging')->__('General Information')));
$fieldset->addField('created_at', 'label', array('label' => Mage::helper('enterprise_staging')->__('Logged At'), 'value' => $this->formatDate($log->getCreatedAt(), 'medium', true)));
$fieldset->addField('action', 'label', array('label' => Mage::helper('enterprise_staging')->__('Action'), 'value' => Mage::helper('enterprise_staging')->__($config->getActionLabel($log->getAction()))));
$fieldset->addField('status', 'label', array('label' => Mage::helper('enterprise_staging')->__('Status'), 'value' => Mage::helper('enterprise_staging')->__($config->getStatusLabel($log->getStatus()))));
$additionalData = $log->getAdditionalData();
if (!empty($additionalData)) {
$additionalData = unserialize($additionalData);
if (is_array($additionalData)) {
if (isset($additionalData['schedule_date'])) {
$fieldset->addField('schedule_date', 'label', array('label' => Mage::helper('enterprise_staging')->__('Schedule Date'), 'value' => Mage::helper('core')->formatDate($additionalData['schedule_date'], Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true)));
}
if (isset($additionalData['action_before_reset'])) {
$fieldset->addField('action_before_reset', 'label', array('label' => Mage::helper('enterprise_staging')->__('Action Before Resetting'), 'value' => Mage::helper('enterprise_staging')->__($config->getActionLabel($additionalData['action_before_reset']))));
}
}
}
if ($log->getAction() == Enterprise_Staging_Model_Staging_Config::ACTION_UNSCHEDULE_MERGE) {
$mergerUrl = $this->getUrl('*/staging_manage/merge', array('id' => $staging->getId()));
$fieldset->addField('link_to_staging_merge', 'link', array('href' => $mergerUrl, 'label' => Mage::helper('enterprise_staging')->__('Scheduled Merger'), 'value' => $mergerUrl));
}
$form->addFieldNameSuffix($this->getFieldNameSuffix());
$this->setForm($form);
return parent::_prepareForm();
}
示例2: _prepareForm
/**
* prepare the form
* @access protected
* @return Mage_Adminhtml_Block_Widget_Form
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset(uniqid('fieldset_'), array('legend' => $this->__('Rewrite %s', $this->getIncrement())));
foreach ($this->getStores() as $store) {
$fieldset->addField('rewrite_' . $store->getId(), 'text', array('name' => 'store_' . $store->getId(), 'label' => $this->__('Store %s', $store->getName())));
}
$fieldset->addField('redirect', 'select', array('name' => 'redirect', 'label' => $this->__('Redirect'), 'options' => array('' => Mage::helper('adminhtml')->__('No'), 'R' => Mage::helper('adminhtml')->__('Temporary (302)'), 'RP' => Mage::helper('adminhtml')->__('Permanent (301)'))));
$form->setHtmlIdPrefix('rewrite_' . $this->getIncrement() . '_');
$form->addFieldNameSuffix('rewrite[' . $this->getIncrement() . ']');
$this->setForm($form);
return parent::_prepareForm();
}