本文整理汇总了PHP中Varien_Data_Form::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::setId方法的具体用法?PHP Varien_Data_Form::setId怎么用?PHP Varien_Data_Form::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::setId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/saveNew'));
$this->setForm($form);
$fieldset = $form->addFieldset('productquestions_form', array('legend' => $this->__('Question details')));
$fieldset->addField('question_product_link', 'note', array('label' => $this->__('Product')));
$fieldset->addField('question_product_name', 'hidden', array('name' => 'question_product_name'));
$fieldset->addField('question_product_id', 'hidden', array('name' => 'question_product_id'));
if (Mage::app()->isSingleStoreMode()) {
$fieldset->addField('question_store_id', 'hidden', array('name' => 'question_store_id', 'value' => Mage::app()->getStore()->getId()));
} else {
$fieldset->addField('question_store_id', 'select', array('name' => 'question_store_id', 'label' => $this->__('Asked from'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false)));
}
$fieldset->addField('question_datetime', 'hidden', array('name' => 'question_datetime', 'value' => Mage::getModel('core/date')->gmtDate()));
$fieldset->addField('question_date', 'date', array('name' => 'question_date', 'label' => $this->__('Asked on'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT, 'value' => Mage::getModel('core/date')->gmtDate()));
if (Mage::app()->isSingleStoreMode()) {
$fieldset->addField('question_store_ids', 'hidden', array('name' => 'question_store_ids[]', 'value' => Mage::app()->getStore()->getId()));
} else {
$fieldset->addField('question_store_ids', 'multiselect', array('name' => 'question_store_ids[]', 'label' => $this->__('Show in stores'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true)));
}
$fieldset->addField('question_author_name', 'text', array('name' => 'question_author_name', 'label' => $this->__('Author name'), 'required' => true, 'style' => 'width:700px;', 'value' => Mage::getSingleton('admin/session')->getUser()->getName()));
$fieldset->addField('question_author_email', 'text', array('name' => 'question_author_email', 'label' => $this->__('Author email'), 'required' => true, 'class' => 'validate-email', 'style' => 'width:700px;', 'value' => Mage::getSingleton('admin/session')->getUser()->getEmail()));
$fieldset->addField('question_text', 'editor', array('name' => 'question_text', 'label' => $this->__('Question'), 'required' => true, 'style' => 'width:700px; height:200px;'));
$fieldset->addField('question_reply_text', 'editor', array('name' => 'question_reply_text', 'label' => $this->__('Your reply'), 'title' => $this->__('Your reply'), 'style' => 'width:700px; height:500px;', 'wysiwyg' => false, 'required' => true));
return parent::_prepareForm();
}
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:30,代码来源:AW_Productquestions_Block_Adminhtml_Productquestions_Add_Form.php
示例2: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('add_review_form', array('legend' => Mage::helper('review')->__('Review Details')));
$fieldset->addField('product_name', 'note', array('label' => Mage::helper('review')->__('Product'), 'text' => 'product_name'));
$fieldset->addField('detailed_rating', 'note', array('label' => Mage::helper('review')->__('Product Rating'), 'required' => true, 'text' => '<div id="rating_detail">' . $this->getLayout()->createBlock('adminhtml/review_rating_detailed')->toHtml() . '</div>'));
$fieldset->addField('status_id', 'select', array('label' => Mage::helper('review')->__('Status'), 'required' => true, 'name' => 'status_id', 'values' => Mage::helper('review')->getReviewStatusesOptionArray()));
/**
* Check is single store mode
*/
if (!Mage::app()->isSingleStoreMode()) {
$field = $fieldset->addField('select_stores', 'multiselect', array('label' => Mage::helper('review')->__('Visible In'), 'required' => true, 'name' => 'select_stores[]', 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()));
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$field->setRenderer($renderer);
}
$fieldset->addField('nickname', 'text', array('name' => 'nickname', 'title' => Mage::helper('review')->__('Nickname'), 'label' => Mage::helper('review')->__('Nickname'), 'maxlength' => '50', 'required' => true));
$fieldset->addField('title', 'text', array('name' => 'title', 'title' => Mage::helper('review')->__('Summary of Review'), 'label' => Mage::helper('review')->__('Summary of Review'), 'maxlength' => '255', 'required' => true));
$fieldset->addField('detail', 'textarea', array('name' => 'detail', 'title' => Mage::helper('review')->__('Review'), 'label' => Mage::helper('review')->__('Review'), 'style' => 'height: 600px;', 'required' => true));
$fieldset->addField('product_id', 'hidden', array('name' => 'product_id'));
/*$gridFieldset = $form->addFieldset('add_review_grid', array('legend' => Mage::helper('review')->__('Please select a product')));
$gridFieldset->addField('products_grid', 'note', array(
'text' => $this->getLayout()->createBlock('adminhtml/review_product_grid')->toHtml(),
));*/
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/post'));
$this->setForm($form);
}
示例3: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$model = Mage::getModel('salesrule/rule');
$templates = $model->getCollection();
// $templates->addFieldToFilter('uses_per_coupon', array('gt' => 0));
$templates->addFieldToFilter('name', array('like' => '_TEMPLATE:%'));
$ruleKV = array();
foreach ($templates as $t) {
$ruleKV[$t['rule_id']] = substr($t['name'], 10);
}
$fieldset = $form->addFieldset('new_bulkcoupon', array('legend' => Mage::helper('coupongenerator')->__('Coupon Details')));
$fieldset->addField('rule_id', 'select', array('name' => 'rule_id', 'title' => Mage::helper('coupongenerator')->__('Template Rule'), 'label' => Mage::helper('coupongenerator')->__('Template Rule'), 'maxlength' => '250', 'required' => true, 'values' => $ruleKV));
$fieldset->addField('prefix', 'text', array('name' => 'prefix', 'title' => Mage::helper('coupongenerator')->__('Coupon Prefix'), 'label' => Mage::helper('coupongenerator')->__('Coupon Prefix'), 'maxlength' => '50', 'required' => true));
$fieldset->addField('name_prefix', 'text', array('name' => 'name_prefix', 'title' => Mage::helper('coupongenerator')->__('Rule Name Prefix'), 'label' => Mage::helper('coupongenerator')->__('Rule Name Prefix'), 'maxlength' => '50', 'required' => true));
$fieldset->addField('quantity', 'text', array('name' => 'quantity', 'title' => Mage::helper('coupongenerator')->__('Quantity'), 'label' => Mage::helper('coupongenerator')->__('Quantity'), 'maxlength' => '50', 'class' => 'input-text required-entry validate-quantity', 'required' => true));
$fieldset->addField('rand_len', 'text', array('name' => 'rand_len', 'title' => Mage::helper('coupongenerator')->__('Random String Length'), 'label' => Mage::helper('coupongenerator')->__('Random String Length'), 'maxlength' => '2', 'class' => 'input-text required-entry validate-rand_len', 'required' => true));
$dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
$fieldset->addField('expires', 'date', array('name' => 'expires', 'title' => Mage::helper('coupongenerator')->__('Expires'), 'label' => Mage::helper('coupongenerator')->__('Expires'), 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT, 'format' => $dateFormatIso, 'image' => $this->getSkinUrl('images/grid-cal.gif')));
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/post'));
$this->setForm($form);
}
示例4: _prepareLayout
/**
* Prepare form for render
*/
protected function _prepareLayout()
{
parent::_prepareLayout();
$form = new Varien_Data_Form();
$customerGroup = Mage::registry('current_group');
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('customer')->__('Group Information')));
$name = $fieldset->addField('customer_group_code', 'text', array('name' => 'code', 'label' => Mage::helper('customer')->__('Group Name'), 'title' => Mage::helper('customer')->__('Group Name'), 'class' => 'required-entry', 'required' => true));
if ($customerGroup->getId() == 0 && $customerGroup->getCustomerGroupCode()) {
$name->setDisabled(true);
}
$fieldset->addField('tax_class_id', 'select', array('name' => 'tax_class', 'label' => Mage::helper('customer')->__('Tax class'), 'title' => Mage::helper('customer')->__('Tax class'), 'class' => 'required-entry', 'required' => true, 'values' => Mage::getSingleton('tax/class_source_customer')->toOptionArray()));
if (!is_null($customerGroup->getId())) {
// If edit add id
$form->addField('id', 'hidden', array('name' => 'id', 'value' => $customerGroup->getId()));
}
if (Mage::getSingleton('adminhtml/session')->getCustomerGroupData()) {
$form->addValues(Mage::getSingleton('adminhtml/session')->getCustomerGroupData());
Mage::getSingleton('adminhtml/session')->setCustomerGroupData(null);
} else {
$form->addValues($customerGroup->getData());
}
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/save'));
$this->setForm($form);
}
示例5: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$installment = Mage::registry('current_installment_payment');
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('installment')->__('Installment Payment')));
$fieldset->addField('order_id', 'text', array('name' => 'order_id', 'label' => Mage::helper('installment')->__('Order Id'), 'title' => Mage::helper('installment')->__('Order Id'), 'readonly' => true));
$fieldset->addField('installment_master_amount_due', 'text', array('name' => 'amount_due', 'label' => Mage::helper('installment')->__('Amount Due'), 'title' => Mage::helper('installment')->__('Amount Due'), 'required' => true));
if (!is_null($installment->getId())) {
// If edit add id
$form->addField('id', 'hidden', array('name' => 'id', 'value' => $installment->getId()));
}
$data = Mage::getSingleton('adminhtml/session')->getInstallmentPaymentData();
if (Mage::getSingleton('adminhtml/session')->getInstallmentPaymentData()) {
$form->addValues(Mage::getSingleton('adminhtml/session')->getInstallmentPaymentData());
Mage::getSingleton('adminhtml/session')->setInstallmentPaymentData(null);
} else {
$form->addValues($installment->getData());
}
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/adjust'));
$form->setPost(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例6: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('review_fieldset', array('legend' => Mage::helper('adminhtml')->__('Review your payment and pay')));
$data = $this->getRequest()->getPost();
$paymentMethod = Mage::getModel('affiliateplus/payment');
if ($paymentId = $this->getRequest()->getParam('id')) {
$paymentMethod->load($paymentId);
}
$paymentMethod = $paymentMethod->addData($data)->getPayment();
foreach ($data as $key => $value) {
if ($key == 'form_key') {
continue;
}
if (strpos($key, $paymentMethod->getPaymentCode()) === 0) {
$paymentMethod->setData(str_replace($paymentMethod->getPaymentCode() . '_', '', $key), $value);
}
$fieldset->addField($key, 'hidden', array('name' => $key));
}
$fieldset->addField('show_account_email', 'note', array('label' => Mage::helper('affiliateplus')->__('To Account'), 'text' => $data['account_email']));
$fieldset->addField('show_amount', 'note', array('label' => Mage::helper('affiliateplus')->__('Amount To Transfer'), 'text' => Mage::app()->getStore()->getBaseCurrency()->format($data['amount'])));
if ($this->getRequest()->getParam('masspayout') == 'true') {
$data['fee'] = $paymentMethod->getEstimateFee($data['amount'], Mage::getStoreConfig('affiliateplus/payment/who_pay_fees', $this->getRequest()->getParam('store')));
}
$fieldset->addField('show_fee', 'note', array('label' => Mage::helper('affiliateplus')->__('Estimated Fee'), 'text' => Mage::app()->getStore()->getBaseCurrency()->format($data['fee'])));
$fieldset->addField('payment_info', 'note', array('label' => Mage::helper('affiliateplus')->__('Payment Info'), 'text' => $paymentMethod->getInfoHtml()));
$form->setValues($data);
$form->setAction($this->getUrl('*/*/savePayment', array('id' => $this->getRequest()->getParam('id'), 'masspayout' => $this->getRequest()->getParam('masspayout'), 'store' => $this->getRequest()->getParam('store'))));
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$this->setForm($form);
return parent::_prepareForm();
}
示例7: _prepareForm
/**
* Prepare form before rendering HTML
*
* @return BlueVisionTec_GoogleShoppingApi_Block_Adminhtml_Types_Edit_Form
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$itemType = $this->getItemType();
$fieldset = $form->addFieldset('content_fieldset', array('legend' => $this->__('Attribute set mapping')));
if (!($targetCountry = $itemType->getTargetCountry())) {
$isoKeys = array_keys($this->_getCountriesArray());
$targetCountry = isset($isoKeys[0]) ? $isoKeys[0] : null;
}
$countrySelect = $fieldset->addField('select_target_country', 'select', array('label' => $this->__('Target Country'), 'title' => $this->__('Target Country'), 'name' => 'target_country', 'required' => true, 'options' => $this->_getCountriesArray(), 'value' => $targetCountry));
if ($itemType->getTargetCountry()) {
$countrySelect->setDisabled(true);
}
$attributeSetsSelect = $this->getAttributeSetsSelectElement($targetCountry)->setValue($itemType->getAttributeSetId());
if ($itemType->getAttributeSetId()) {
$attributeSetsSelect->setDisabled(true);
}
$fieldset->addField('attribute_set', 'note', array('label' => $this->__('Attribute Set'), 'title' => $this->__('Attribute Set'), 'required' => true, 'text' => '<div id="attribute_set_select">' . $attributeSetsSelect->toHtml() . '</div>'));
$attributesBlock = $this->getLayout()->createBlock('googleshoppingapi/adminhtml_types_edit_attributes')->setTargetCountry($targetCountry);
if ($itemType->getId()) {
$attributesBlock->setAttributeSetId($itemType->getAttributeSetId())->setAttributeSetSelected(true);
}
$attributes = Mage::registry('attributes');
if (is_array($attributes) && count($attributes) > 0) {
$attributesBlock->setAttributesData($attributes);
}
$fieldset->addField('attributes_box', 'note', array('label' => $this->__('Attributes Mapping'), 'text' => '<div id="attributes_details">' . $attributesBlock->toHtml() . '</div>'));
$form->addValues($itemType->getData());
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setMethod('post');
$form->setAction($this->getSaveUrl());
$this->setForm($form);
return parent::_prepareForm();
}
示例8: _prepareLayout
/**
* Prepare form for render
*/
protected function _prepareLayout()
{
parent::_prepareLayout();
$form = new Varien_Data_Form();
$customerGroup = Mage::registry('current_group');
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('Mage_Customer_Helper_Data')->__('Group Information')));
$validateClass = sprintf('required-entry validate-length maximum-length-%d', Mage_Customer_Model_Group::GROUP_CODE_MAX_LENGTH);
$name = $fieldset->addField('customer_group_code', 'text', array('name' => 'code', 'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Group Name'), 'title' => Mage::helper('Mage_Customer_Helper_Data')->__('Group Name'), 'note' => Mage::helper('Mage_Customer_Helper_Data')->__('Maximum length must be less then %s symbols', Mage_Customer_Model_Group::GROUP_CODE_MAX_LENGTH), 'class' => $validateClass, 'required' => true));
if ($customerGroup->getId() == 0 && $customerGroup->getCustomerGroupCode()) {
$name->setDisabled(true);
}
$fieldset->addField('tax_class_id', 'select', array('name' => 'tax_class', 'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Tax Class'), 'title' => Mage::helper('Mage_Customer_Helper_Data')->__('Tax Class'), 'class' => 'required-entry', 'required' => true, 'values' => Mage::getSingleton('Mage_Tax_Model_Class_Source_Customer')->toOptionArray()));
if (!is_null($customerGroup->getId())) {
// If edit add id
$form->addField('id', 'hidden', array('name' => 'id', 'value' => $customerGroup->getId()));
}
if (Mage::getSingleton('Mage_Adminhtml_Model_Session')->getCustomerGroupData()) {
$form->addValues(Mage::getSingleton('Mage_Adminhtml_Model_Session')->getCustomerGroupData());
Mage::getSingleton('Mage_Adminhtml_Model_Session')->setCustomerGroupData(null);
} else {
$form->addValues($customerGroup->getData());
}
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/save'));
$this->setForm($form);
}
示例9: _prepareForm
/**
* Prepare student form
*
* @return Mage_Adminhtml_Block_Widget_Form
*/
protected function _prepareForm()
{
$data = Mage::registry('current_product');
$helper = Mage::helper('dailydeals');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post'));
$fieldset = $form->addFieldset('deals_form', array('legend' => $helper->__('Product Information')));
if (!is_null($data->getId())) {
// If edit add id
$form->addField('entity_id', 'hidden', array('name' => 'entity_id', 'value' => $data->getId()));
}
$fieldset->addField('name', 'label', array('label' => $helper->__('Product Name'), 'class' => 'required-entry', 'required' => true, 'name' => 'name'));
$fieldset->addField('price', 'label', array('label' => $helper->__('Original Price'), 'class' => 'required-entry', 'required' => true, 'name' => 'price'));
if ($data->getStockItem()->getQty()) {
$data->setNewQty((int) $data->getStockItem()->getQty());
$fieldset->addField('new_qty', 'label', array('label' => $helper->__('Qty'), 'class' => 'required-entry', 'required' => true, 'name' => 'new_qty'));
}
$fieldset->addField('deal_price', 'text', array('label' => $helper->__('Deal Price'), 'class' => 'required-entry', 'required' => true, 'name' => 'deal_price'));
$qty = (int) Mage::getModel('catalog/product')->load($data->getId())->getData('stock_item')->getQty();
if (!$qty) {
$fieldset->addField('deal_qty', 'text', array('label' => $helper->__('Deal Qty'), 'class' => $helper->returnProductQtyFieldParams(null, $data->getId()), 'name' => 'deal_qty', 'required' => true, 'note' => $helper->__('Quantity products with special price'), 'disabled' => true));
} else {
$fieldset->addField('deal_qty', 'text', array('label' => $helper->__('Deal Qty'), 'class' => $helper->returnProductQtyFieldParams(null, $data->getId()), 'name' => 'deal_qty', 'required' => true, 'note' => $helper->__('Quantity products with special price')));
}
$dateStrFormat = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
$fieldset->addField('choice_type_dealstime', 'select', array('label' => $helper->__('Choise deals for days of week.'), 'name' => 'choice_type_dealstime', 'onclick' => "", 'onchange' => "", 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray(), 'disabled' => false, 'readonly' => false));
$fieldset->addField('deal_update_days_product', 'multiselect', array('label' => $helper->__('Deal Products will be run and update each'), 'name' => 'deal_update_days_product', 'note' => $helper->__('Selected Deals Days'), 'required' => true, 'values' => Mage::getModel('dailydeals/entity_attribute_source_days')->getAllOptions()));
$fieldset->addField('deal_start_time', 'date', array('name' => 'deal_start_time', 'label' => $helper->__('Start Time'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'class' => 'validate-date validate-date-range date-range-deal_start_time', 'required' => true, 'format' => $dateStrFormat, 'no_span' => true));
$fieldset->addField('deal_end_time', 'date', array('name' => 'deal_end_time', 'label' => $helper->__('End Time'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'class' => 'validate-date validate-date-range date-range-deal_end_time', 'required' => true, 'format' => $dateStrFormat, 'no_span' => true));
$fieldset->addField('deal_status', 'select', array('label' => $helper->__('Status'), 'name' => 'deal_status', 'values' => Mage::getModel('dailydeals/System_Config_Source_Enabling')->toArray(), 'value' => true));
$form->setValues($data);
$form->setUseContainer(true);
$form->setId('edit_form');
$this->setForm($form);
$this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')->addFieldMap('choice_type_dealstime', 'choice_type_dealstime')->addFieldMap('deal_update_days_product', 'deal_update_days_product')->addFieldMap('deal_start_time', 'deal_start_time')->addFieldMap('deal_end_time', 'deal_end_time')->addFieldDependence('deal_update_days_product', 'choice_type_dealstime', '1')->addFieldDependence('deal_start_time', 'choice_type_dealstime', '0')->addFieldDependence('deal_end_time', 'choice_type_dealstime', '0'));
}
示例10: _prepareForm
protected function _prepareForm()
{
$faq = Mage::registry('current_origins');
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('edit_origins', array('legend' => Mage::helper('shiphawk_shipping')->__('Origins Details')));
if ($faq->getId()) {
$fieldset->addField('id', 'hidden', array('name' => 'id', 'required' => true));
}
$fieldset->addField('shiphawk_origin_title', 'text', array('name' => 'shiphawk_origin_title', 'title' => Mage::helper('shiphawk_shipping')->__('Title'), 'label' => Mage::helper('shiphawk_shipping')->__('Title'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_firstname', 'text', array('name' => 'shiphawk_origin_firstname', 'title' => Mage::helper('shiphawk_shipping')->__('First Name'), 'label' => Mage::helper('shiphawk_shipping')->__('First Name'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_lastname', 'text', array('name' => 'shiphawk_origin_lastname', 'title' => Mage::helper('shiphawk_shipping')->__('Last Name'), 'label' => Mage::helper('shiphawk_shipping')->__('Last Name'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_addressline1', 'text', array('name' => 'shiphawk_origin_addressline1', 'title' => Mage::helper('shiphawk_shipping')->__('Address'), 'label' => Mage::helper('shiphawk_shipping')->__('Address'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_addressline2', 'text', array('name' => 'shiphawk_origin_addressline2', 'title' => Mage::helper('shiphawk_shipping')->__('Address'), 'label' => Mage::helper('shiphawk_shipping')->__('Address Line 2'), 'required' => false, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_city', 'text', array('name' => 'shiphawk_origin_city', 'title' => Mage::helper('shiphawk_shipping')->__('City'), 'label' => Mage::helper('shiphawk_shipping')->__('City'), 'required' => true, 'width' => '400px'));
$regions = $this->getRegions();
$fieldset->addField('shiphawk_origin_state', 'select', array('name' => 'shiphawk_origin_state', 'title' => Mage::helper('shiphawk_shipping')->__('State'), 'label' => Mage::helper('shiphawk_shipping')->__('State'), 'required' => true, 'values' => $regions, 'width' => '100%'));
$fieldset->addField('shiphawk_origin_zipcode', 'text', array('name' => 'shiphawk_origin_zipcode', 'title' => Mage::helper('shiphawk_shipping')->__('Zip Code'), 'label' => Mage::helper('shiphawk_shipping')->__('Zip Code'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_phonenum', 'text', array('name' => 'shiphawk_origin_phonenum', 'title' => Mage::helper('shiphawk_shipping')->__('Phone number'), 'label' => Mage::helper('shiphawk_shipping')->__('Phone number'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_location', 'select', array('name' => 'shiphawk_origin_location', 'title' => Mage::helper('shiphawk_shipping')->__('Location'), 'label' => Mage::helper('shiphawk_shipping')->__('Location'), 'required' => true, 'values' => array(array('value' => 'commercial', 'label' => 'commercial'), array('value' => 'residential', 'label' => 'residential')), 'width' => '400px'));
$fieldset->addField('shiphawk_origin_email', 'text', array('name' => 'shiphawk_origin_email', 'title' => Mage::helper('shiphawk_shipping')->__('Email'), 'label' => Mage::helper('shiphawk_shipping')->__('Email'), 'required' => false, 'width' => '400px'));
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/save'));
$form->setValues($faq->getData());
$this->setForm($form);
}
示例11: _prepareForm
protected function _prepareForm()
{
$helper = Mage::helper('thememanager');
$theme = Mage::app()->getRequest()->getParam('theme');
$form = new Varien_Data_Form(array('method' => 'post', 'name' => 'form_data', 'action' => $this->getUrl('*/*/installSkin'), 'onsubmit' => 'return InstallSkin();', 'enctype' => 'multipart/form-data'));
$form->addField('activationNote', 'note', array('text' => $helper->__('Activation Options'), 'class' => 'activation-title'));
$form->addField('submit1', 'submit', array('required' => true, 'value' => $this->__('Activate Theme'), 'class' => 'install-demo-btn', 'tabindex' => 1));
$fieldset = $form->addFieldset('store_fieldset', array('legend' => $helper->__('Select Store')));
/**
* Check is single store mode
*/
$already_installed = array();
$installed_thems = $helper->getUsedThems();
if (!Mage::app()->isSingleStoreMode()) {
$values = Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false);
foreach ($values as $f => &$v) {
if (!empty($v['value'])) {
foreach ($v['value'] as $key => &$store) {
if (isset($installed_thems[$store['value']]) && $theme == $installed_thems[$store['value']]) {
$already_installed[$store['value']] = trim($store['label']);
$store['label'] .= ' - ' . $helper->__('Already installed');
}
}
}
}
$field = $fieldset->addField('ActivationStoreMultiselect', 'multiselect', array('name' => 'stores[]', 'label' => $helper->__('Store View'), 'title' => $helper->__('Store View'), 'required' => true, 'values' => $values));
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$field->setRenderer($renderer);
} else {
$id = Mage::app()->getStore(true)->getId();
$fieldset->addField('store_id', 'hidden', array('name' => 'stores[]', 'value' => $id));
if (isset($installed_thems[$id]) || $theme == $installed_thems[$id]) {
$already_installed[$id] = Mage::app()->getStore(true)->getName();
}
}
$delete_all_the_settings = '<p class="hided_element installed_store_action_note checked__delete_all" style="color:#f90000;">' . $helper->__('All configs (category/products/cms configs) created before for this store will be removed completely. Backup your data before theme activation!') . '</p>';
foreach ($already_installed as $store_id => $store_name) {
$name = 'installed_store_action_' . $store_id;
$store_name = trim(preg_replace('/([^\\pL\\pN\\pP\\pS\\pZ])|([\\xC2\\xA0])/u', '', $store_name));
$fieldset->addField($name, 'select', array('name' => $name, 'label' => $helper->__('There are several created settings for selected store "%s"', $store_name), 'required' => true, 'class' => 'installed_store_actions installed_store_action-' . $store_id, 'values' => array('' => $helper->__('Please select'), 'delete_all' => $helper->__('Delete all the settings'), 'replace_default_only' => $helper->__('Replace default theme only.')), 'after_element_html' => $delete_all_the_settings . '<p class="hided_element installed_store_action_note checked__replace_default_only" style="color: #f90000;">' . $helper->__('Default config settings will be replaced. Keep in mind that created configs (category/products/cms configs) might affect on displaying of new theme.') . '</p>'));
}
$fieldset->addField('delete_all_settings', 'hidden', array('name' => 'delete_all_settings', 'value' => '1', 'after_element_html' => $delete_all_the_settings));
$predefined_arr = Mage::helper('thememanager/themeConfig')->getPredefined();
$fieldset2 = $form->addFieldset('skin_fieldset', array('legend' => Mage::helper('thememanager')->__('Select Skin')));
$fieldset2->addType('selectSkin', 'Meigee_Thememanager_Block_Adminhtml_Thems_ActivateTheme_SelectSkin');
$fieldset2->addField('selectSkin', 'selectSkin', array('text' => $helper->__('Select Theme'), 'skins' => $predefined_arr, 'namesapce' => $theme));
$fieldset->addField('theme', 'hidden', array('name' => 'theme', 'value' => $theme));
$form->addField('submit2', 'submit', array('required' => true, 'value' => $this->__('Activate Theme'), 'class' => 'install-demo-btn bottom', 'tabindex' => 1));
if (1 == count($predefined_arr) && Mage::app()->isSingleStoreMode() && empty($already_installed)) {
$redirectUrl = $this->getUrl('*/*/installSkin', array('stores' => $id, 'skin' => key($predefined_arr), 'theme' => $theme, 'isAjax' => 'true'));
$this->setRedirectUrl($redirectUrl);
}
$form->setUseContainer(true);
$form->setId('install_form');
$this->setForm($form);
return parent::_prepareForm();
}
示例12: _prepareForm
protected function _prepareForm()
{
$rateObject = new Varien_Object(Mage::getSingleton('tax/calculation_rate')->getData());
$form = new Varien_Data_Form();
$countries = Mage::getModel('adminhtml/system_config_source_country')->toOptionArray();
unset($countries[0]);
if (!$rateObject->hasTaxCountryId()) {
$rateObject->setTaxCountryId(Mage::getStoreConfig(Mage_Tax_Model_Config::CONFIG_XML_PATH_DEFAULT_COUNTRY));
}
if (!$rateObject->hasTaxRegionId()) {
$rateObject->setTaxRegionId(Mage::getStoreConfig(Mage_Tax_Model_Config::CONFIG_XML_PATH_DEFAULT_REGION));
}
$regionCollection = Mage::getModel('directory/region')->getCollection()->addCountryFilter($rateObject->getTaxCountryId());
$regions = $regionCollection->toOptionArray();
if ($regions) {
$regions[0]['label'] = '*';
} else {
$regions = array(array('value' => '', 'label' => '*'));
}
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('tax')->__('Tax Rate Information')));
if ($rateObject->getTaxCalculationRateId() > 0) {
$fieldset->addField('tax_calculation_rate_id', 'hidden', array('name' => 'tax_calculation_rate_id', 'value' => $rateObject->getTaxCalculationRateId()));
}
$fieldset->addField('code', 'text', array('name' => 'code', 'label' => Mage::helper('tax')->__('Tax Identifier'), 'title' => Mage::helper('tax')->__('Tax Identifier'), 'class' => 'required-entry', 'required' => true));
$fieldset->addField('tax_country_id', 'select', array('name' => 'tax_country_id', 'label' => Mage::helper('tax')->__('Country'), 'required' => true, 'values' => $countries));
$fieldset->addField('tax_region_id', 'select', array('name' => 'tax_region_id', 'label' => Mage::helper('tax')->__('State'), 'values' => $regions));
$fieldset->addField('zip_is_range', 'select', array('name' => 'zip_is_range', 'label' => Mage::helper('tax')->__('Zip/Post is Range'), 'options' => array('0' => Mage::helper('tax')->__('No'), '1' => Mage::helper('tax')->__('Yes'))));
if (!$rateObject->hasTaxPostcode()) {
$rateObject->setTaxPostcode(Mage::getStoreConfig(Mage_Tax_Model_Config::CONFIG_XML_PATH_DEFAULT_POSTCODE));
}
$allwarehouse[] = 0;
$warehouses = Mage::getModel('awa_inventory/warehouse')->getCollection()->addFieldToFilter('status', 1);
foreach ($warehouses as $warehouse) {
$allwarehouse[] = $warehouse->getEntityId();
}
$fieldset->addField('tax_postcode', 'text', array('name' => 'tax_postcode', 'label' => Mage::helper('tax')->__('Zip/Post Code'), 'note' => Mage::helper('tax')->__("'*' - matches any; 'xyz*' - matches any that begins on 'xyz' and not longer than %d.", Mage::helper('tax')->getPostCodeSubStringLength())));
$fieldset->addField('zip_from', 'text', array('name' => 'zip_from', 'label' => Mage::helper('tax')->__('Range From'), 'required' => true, 'maxlength' => 9, 'class' => 'validate-digits'));
$fieldset->addField('zip_to', 'text', array('name' => 'zip_to', 'label' => Mage::helper('tax')->__('Range To'), 'required' => true, 'maxlength' => 9, 'class' => 'validate-digits'));
$fieldset->addField('warehouse_id', 'select', array('name' => 'warehouse_id', 'label' => Mage::helper('tax')->__('Choose Warehose'), 'required' => true, 'maxlength' => 9, 'class' => 'validate-digits', 'values' => Mage::getModel('awa_inventory/warehouse_attribute_source_inputtype')->getAllOptions(true)));
$fieldset->addField('rate', 'text', array('name' => 'rate', 'label' => Mage::helper('tax')->__('Rate Percent'), 'title' => Mage::helper('tax')->__('Rate Percent'), 'required' => true, 'class' => 'validate-not-negative-number'));
$form->setAction($this->getUrl('*/tax_rate/save'));
$form->setUseContainer(true);
$form->setId('rate_form');
$form->setMethod('post');
if (!Mage::app()->isSingleStoreMode()) {
$form->addElement(Mage::getBlockSingleton('adminhtml/tax_rate_title_fieldset')->setLegend(Mage::helper('tax')->__('Tax Titles')));
}
$rateData = $rateObject->getData();
if ($rateObject->getZipIsRange()) {
list($rateData['zip_from'], $rateData['zip_to']) = explode('-', $rateData['tax_postcode']);
}
$form->setValues($rateData);
$this->setForm($form);
$this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')->addFieldMap('zip_is_range', 'zip_is_range')->addFieldMap('tax_postcode', 'tax_postcode')->addFieldMap('zip_from', 'zip_from')->addFieldMap('zip_to', 'zip_to')->addFieldDependence('zip_from', 'zip_is_range', '1')->addFieldDependence('zip_to', 'zip_is_range', '1')->addFieldDependence('tax_postcode', 'zip_is_range', '0'));
return parent::_prepareForm();
}
示例13: _prepareForm
/**
* Prepare Form.
*
* @return Mage_Webapi_Block_Adminhtml_User_Edit_Form
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/save'));
$form->setMethod('post');
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例14: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$form->addField('filter_value', 'select', array('name' => 'filter_value', 'onchange' => 'this.form.submit()', 'values' => array(array('label' => Mage::helper('customer')->__('All'), 'value' => ''), array('label' => Mage::helper('customer')->__('Customers Only'), 'value' => 'filterCustomers'), array('label' => Mage::helper('customer')->__('Visitors Only'), 'value' => 'filterGuests')), 'no_span' => true));
$form->setUseContainer(true);
$form->setId('filter_form');
$form->setMethod('post');
$this->setForm($form);
return parent::_prepareForm();
}
示例15: getForm
public function getForm()
{
$methodInstance = $this->_getOrder()->getPayment()->getMethodInstance();
$form = new Varien_Data_Form();
$form->setId('dotpay_dotpay_redirection_form')->setName('dotpay_dotpay_redirection_form')->setAction($methodInstance->getRedirectUrl())->setMethod('post')->setUseContainer(TRUE);
foreach ($methodInstance->getRedirectionFormData() as $name => $value) {
$form->addField($name, 'hidden', array('name' => $name, 'value' => $value));
}
return $form;
}