本文整理汇总了PHP中Varien_Data_Form::addField方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::addField方法的具体用法?PHP Varien_Data_Form::addField怎么用?PHP Varien_Data_Form::addField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::addField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
$form->setHtmlIdPrefix("template");
$form->setFieldNameSuffix("template");
/* @var $template Mzax_Emarketing_Model_Template */
$template = Mage::registry('current_template');
if ($template->getId()) {
$form->addField('template_id', 'hidden', array('name' => 'template_id', 'value' => $template->getId()));
}
$fieldset = $form->addFieldset('base_fieldset', array('legend' => $this->__('Template Option'), 'class' => 'fieldset-wide'))->addType('editor', Mage::getConfig()->getModelClassName('mzax_emarketing/form_element_templateEditor'))->addType('credits', Mage::getConfig()->getModelClassName('mzax_emarketing/form_element_credits'));
$fieldset->addField('credits', 'credits', array('name' => 'credits', 'required' => true));
$fieldset->addField('name', 'text', array('name' => 'name', 'required' => true, 'label' => $this->__('Template Name'), 'title' => $this->__('Template Name')));
$fieldset->addField('description', 'textarea', array('name' => 'description', 'required' => true, 'label' => $this->__('Description'), 'title' => $this->__('Description'), 'style' => 'height:4em;', 'note' => "For internal use only"));
$snippets = new Mzax_Emarketing_Model_Medium_Email_Snippets();
Mage::getSingleton('mzax_emarketing/medium_email')->prepareSnippets($snippets);
$editorConfig = new Varien_Object();
$editorConfig->setFilesBrowserWindowUrl($this->getUrl('adminhtml/cms_wysiwyg_images/index'));
$editorConfig->setWidgetWindowUrl($this->getUrl('adminhtml/widget/index'));
$editorConfig->setSnippets($snippets);
$editor = $fieldset->addField('body', 'editor', array('name' => 'body', 'required' => true, 'label' => $this->__('Template HTML'), 'title' => $this->__('Template HTML'), 'logo' => $this->getSkinUrl('images/logo.gif'), 'fullscreen_title' => $this->__('Template %s', $template->getName()), 'style' => 'height:50em;', 'value' => '', 'config' => $editorConfig));
// Setting custom renderer for content field to remove label column
$renderer = $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element')->setTemplate('cms/page/edit/form/renderer/content.phtml');
$editor->setRenderer($renderer);
$form->addValues($template->getData());
$this->setForm($form);
$form->setUseContainer(true);
return parent::_prepareForm();
}
示例2: _toHtml
protected function _toHtml()
{
try {
$form = new Varien_Data_Form();
$form->setAction($this->_getSageSession()->getAcsurl())->setId('sagepaydirectpro_3dsecure')->setName('sagepaydirectpro_3dsecure')->setMethod('POST')->setUseContainer(true);
$params = array('_secure' => true, 'storeid' => Mage::app()->getStore()->getId());
$_shipSessData = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getShippingMethod();
if ($_shipSessData) {
$params['shipmethod'] = $_shipSessData;
}
$postUrl = Mage::getModel('core/url')->addSessionParam()->getUrl('sgps/directPayment/callback3d', $params);
$form->addField('PaReq', 'hidden', array('name' => 'PaReq', 'value' => $this->_getSageSession()->getPareq()));
$form->addField('MD', 'hidden', array('name' => 'MD', 'value' => $this->_getSageSession()->getEmede()));
#$form->addField('TermUrl', 'hidden', array('name'=>'TermUrl', 'value' => Mage::getUrl('sgps/directPayment/callback3d', array('_secure' => true))));
$form->addField('TermUrl', 'hidden', array('name' => 'TermUrl', 'value' => $postUrl));
$html = '<html><body>';
$html .= '<code>' . $this->__('Loading 3D secure form...') . '</code>';
$html .= $form->toHtml();
$html .= '<script type="text/javascript">document.getElementById("sagepaydirectpro_3dsecure").submit();</script>';
$html .= '</body></html>';
Sage_Log::log($html, null, 'SagePaySuite_REQUEST.log');
} catch (Exception $e) {
Ebizmarts_SagePaySuite_Log::we($e);
}
return $html;
}
示例3: _prepareForm
/**
* Prepare form before rendering HTML
*
* @return Enterprise_Cms_Block_Adminhtml_Cms_Hierarchy_Edit_Form
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form(array('id' => 'manage_form', 'method' => 'post'));
$currentWebsite = $this->getRequest()->getParam('website');
$currentStore = $this->getRequest()->getParam('store');
$excludeScopes = array();
if ($currentStore) {
$storeId = Mage::app()->getStore($currentStore)->getId();
$excludeScopes = array(Enterprise_Cms_Helper_Hierarchy::SCOPE_PREFIX_STORE . $storeId);
} elseif ($currentWebsite) {
$websiteId = Mage::app()->getWebsite($currentWebsite)->getId();
$excludeScopes = array(Enterprise_Cms_Helper_Hierarchy::SCOPE_PREFIX_WEBSITE . $websiteId);
}
$allStoreViews = $currentStore || $currentWebsite;
$form->addField('scopes', 'multiselect', array('name' => 'scopes[]', 'class' => 'manage-select', 'title' => Mage::helper('enterprise_cms')->__('Manage Hierarchies'), 'values' => $this->_prepareOptions($allStoreViews, $excludeScopes)));
if ($currentWebsite) {
$form->addField('website', 'hidden', array('name' => 'website', 'value' => $currentWebsite));
}
if ($currentStore) {
$form->addField('store', 'hidden', array('name' => 'store', 'value' => $currentStore));
}
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例4: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post'));
$form->setFieldNameSuffix('quickresponse');
$id = $this->getRequest()->getParam('id');
$fieldset = $form->addFieldset('quickresponse_fieldset', array('legend' => Mage::helper('webforms')->__('Quick Response')));
$fieldset->addField('title', 'text', array('label' => Mage::helper('webforms')->__('Title'), 'class' => 'required-entry', 'required' => true, 'style' => 'width:700px;', 'name' => 'title'));
$editor_type = 'textarea';
$config = '';
if ((double) substr(Mage::getVersion(), 0, 3) > 1.3 && substr(Mage::getVersion(), 0, 5) != '1.4.0' || Mage::helper('webforms')->getMageEdition() == 'EE') {
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('tab_id' => $this->getTabId()));
$wysiwygConfig["files_browser_window_url"] = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index');
$wysiwygConfig["directives_url"] = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
$wysiwygConfig["directives_url_quoted"] = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
$wysiwygConfig["add_widgets"] = false;
$wysiwygConfig["add_variables"] = false;
$wysiwygConfig["widget_plugin_src"] = false;
$plugins = $wysiwygConfig->setData("plugins", array());
$editor_type = 'editor';
$config = $wysiwygConfig;
}
$fieldset->addField('message', $editor_type, array('label' => Mage::helper('webforms')->__('Message'), 'title' => Mage::helper('webforms')->__('Message'), 'style' => 'width:700px; height:300px;', 'name' => 'message', 'required' => true, 'config' => $config));
if (Mage::getSingleton('adminhtml/session')->getFormData()) {
$form->setValues(Mage::getSingleton('adminhtml/session')->getFormData());
Mage::getSingleton('adminhtml/session')->setFormData(false);
} elseif (Mage::registry('quickresponse')->getId()) {
$form->setValues(Mage::registry('quickresponse')->getData());
}
$form->addField('quickresponse_id', 'hidden', array('name' => 'quickresponse_id', 'value' => $id));
$form->addField('saveandcontinue', 'hidden', array('name' => 'saveandcontinue'));
$form->setUseContainer(true);
$this->setForm($form);
}
开发者ID:monarcmoso,项目名称:beta2,代码行数:34,代码来源:VladimirPopov_WebForms_Block_Adminhtml_Quickresponse_Edit_Form.php
示例5: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
$model = Mage::getModel('webforms/fieldsets');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'), 'store' => $this->getRequest()->getParam('store'))), 'method' => 'post'));
$renderer = $this->getLayout()->createBlock('webforms/adminhtml_element_field');
$form->setFieldsetElementRenderer($renderer);
$form->setFieldNameSuffix('fieldset');
$form->setDataObject(Mage::registry('fieldsets_data'));
$fieldset = $form->addFieldset('fieldset_information', array('legend' => Mage::helper('webforms')->__('Information')));
$fieldset->addField('name', 'text', array('label' => Mage::helper('webforms')->__('Name'), 'class' => 'required-entry', 'required' => true, 'name' => 'name'));
$fieldset->addField('position', 'text', array('label' => Mage::helper('webforms')->__('Position'), 'required' => true, 'name' => 'position', 'note' => Mage::helper('webforms')->__('Fieldset position in the form')));
$fieldset->addField('is_active', 'select', array('label' => Mage::helper('webforms')->__('Status'), 'title' => Mage::helper('webforms')->__('Status'), 'name' => 'is_active', 'required' => true, 'options' => Mage::getModel('webforms/webforms')->getAvailableStatuses()));
$form->addField('webform_id', 'hidden', array('name' => 'webform_id', 'value' => 1));
$form->addField('saveandcontinue', 'hidden', array('name' => 'saveandcontinue'));
$fieldset = $form->addFieldset('fieldset_result', array('legend' => Mage::helper('webforms')->__('Results / Notifications')));
$fieldset->addField('result_display', 'select', array('label' => Mage::helper('webforms')->__('Display'), 'title' => Mage::helper('webforms')->__('Display'), 'name' => 'result_display', 'note' => Mage::helper('webforms')->__('Display fieldset name in result / notification messages'), 'values' => Mage::getModel('webforms/fieldsets_display')->toOptionArray()));
if (!$model->getId()) {
$model->setData('is_active', '0');
}
if (Mage::getSingleton('adminhtml/session')->getWebFormsData()) {
$form->setValues(Mage::getSingleton('adminhtml/session')->getWebFormsData());
Mage::getSingleton('adminhtml/session')->setWebFormsData(null);
} elseif (Mage::registry('fieldsets_data')) {
$form->setValues(Mage::registry('fieldsets_data')->getData());
}
// set default field values
if (!Mage::registry('fieldsets_data')->getId()) {
$form->setValues(array('webform_id' => $this->getRequest()->getParam('webform_id'), 'position' => 10));
}
$form->setUseContainer(true);
Mage::dispatchEvent('webforms_adminhtml_fieldsets_edit_form_prepare_layout', array('form' => $form, 'fieldset' => $fieldset));
$this->setForm($form);
}
示例6: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'), 'webform_id' => $this->getRequest()->getParam('webform_id'), 'store' => $this->getRequest()->getParam('store'))), 'method' => 'post'));
$renderer = $this->getLayout()->createBlock('webforms/adminhtml_element_field');
$form->setFieldsetElementRenderer($renderer);
$form->setFieldNameSuffix('logic');
$form->setDataObject(Mage::registry('logic'));
$fieldset = $form->addFieldset('fieldset_information', array('legend' => Mage::helper('webforms')->__('Logic Rule')));
$fieldset->addField('logic_condition', 'select', array('label' => Mage::helper('webforms')->__('Condition'), 'name' => 'logic_condition', 'options' => Mage::getModel('webforms/logic_condition')->getOptions()));
$fieldset->addField('value', 'multiselect', array('label' => Mage::helper('webforms')->__('Trigger value(s)'), 'required' => true, 'name' => 'value', 'note' => Mage::helper('webforms')->__('Select one or multiple trigger values.<br>Please, configure for each locale <b>Store View</b>.'), 'values' => Mage::registry('field')->getOptionsArray()));
$fieldset->addField('action', 'select', array('label' => Mage::helper('webforms')->__('Action'), 'name' => 'action', 'options' => Mage::getModel('webforms/logic_action')->getOptions(), 'note' => Mage::helper('webforms')->__('Action to perform with target elements')));
$fieldset->addField('target', 'multiselect', array('label' => Mage::helper('webforms')->__('Target element(s)'), 'required' => true, 'name' => 'target', 'note' => Mage::helper('webforms')->__('Select one or multiple target elements'), 'values' => Mage::registry('field')->getLogicTargetOptionsArray()));
if (Mage::registry('field')->getType() == 'select/checkbox') {
$fieldset->addField('aggregation', 'select', array('label' => Mage::helper('webforms')->__('Logic aggregation'), 'name' => 'aggregation', 'options' => Mage::getModel('webforms/logic_aggregation')->getOptions()));
}
$fieldset->addField('is_active', 'select', array('label' => Mage::helper('webforms')->__('Status'), 'title' => Mage::helper('webforms')->__('Status'), 'name' => 'is_active', 'options' => Mage::getModel('webforms/webforms')->getAvailableStatuses()));
$form->addField('field_id', 'hidden', array('name' => 'field_id'));
$form->addField('saveandcontinue', 'hidden', array('name' => 'saveandcontinue'));
if (Mage::getSingleton('adminhtml/session')->getWebFormsData()) {
$form->setValues(Mage::getSingleton('adminhtml/session')->getWebFormsData());
Mage::getSingleton('adminhtml/session')->setWebFormsData(null);
} elseif (Mage::registry('logic')) {
$form->setValues(Mage::registry('logic')->getData());
}
$form->setUseContainer(true);
Mage::dispatchEvent('webforms_adminhtml_logic_edit_form_prepare_layout', array('form' => $form));
$this->setForm($form);
}
示例7: loadVendorRatesAction
public function loadVendorRatesAction()
{
$tsHlp = Mage::helper('udtiership');
$deliveryType = $this->getRequest()->getParam('delivery_type');
$vId = $this->getRequest()->getParam('vendor_id');
if (!Mage::helper('udtiership')->isV2Rates() || !$deliveryType) {
Mage::app()->getResponse()->setBody('');
return;
}
$_form = new Varien_Data_Form();
$extraCond = array('__use_vendor' => true);
if (!empty($vId)) {
$extraCond['vendor_id=?'] = $vId;
} else {
$extraCond[] = new Zend_Db_Expr('false');
}
if (Mage::helper('udtiership')->isV2SimpleRates()) {
$ratesEl = $_form->addField('tiership_v2_simple_rates', 'select', array('name' => 'tiership_v2_simple_rates', 'label' => Mage::helper('udtiership')->__('V2 Simple First/Additional Rates'), 'value' => $tsHlp->getV2SimpleRates($deliveryType, $extraCond)));
$renderer = Mage::app()->getLayout()->createBlock('udtiership/adminhtml_vendorEditTab_shippingRates_v2_renderer_simpleRates');
} elseif (Mage::helper('udtiership')->isV2SimpleConditionalRates()) {
$ratesEl = $_form->addField('tiership_v2_simple_cond_rates', 'select', array('name' => 'tiership_v2_simple_cond_rates', 'label' => Mage::helper('udtiership')->__('V2 Simple Conditional Rates'), 'value' => $tsHlp->getV2SimpleCondRates($deliveryType, $extraCond)));
$renderer = Mage::app()->getLayout()->createBlock('udtiership/adminhtml_vendorEditTab_shippingRates_v2_renderer_simpleCondRates');
} else {
$ratesEl = $_form->addField('tiership_v2_rates', 'select', array('name' => 'tiership_v2_rates', 'label' => Mage::helper('udtiership')->__('V2 Rates'), 'value' => $tsHlp->getV2Rates($deliveryType, $extraCond)));
$renderer = Mage::app()->getLayout()->createBlock('udtiership/adminhtml_vendorEditTab_shippingRates_v2_renderer_rates');
}
$ratesEl->setDeliveryType($deliveryType);
$renderer->setDeliveryType($deliveryType);
Mage::app()->getResponse()->setBody($renderer->render($ratesEl));
}
示例8: _toHtml
protected function _toHtml()
{
$session = Mage::getSingleton('checkout/session');
$order = Mage::getModel('sales/order')->loadbyIncrementId($session->getLastRealOrderId());
// Prevent ugly errors
$data = $order->getData();
if (empty($data) || !is_object($order) || !is_object($order->getBillingAddress())) {
return "<h3>Please refresh the page</h3>";
}
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_HOLDED, 'Customer redirected to NETBANX payment page, awaiting payment confirmation from NETBANX', true);
$order->save();
// Construct the redirection form
$form = new Varien_Data_Form(array('id' => 'netbanx_iframe', 'action' => $this->payment_url(), 'name' => 'netbanx_iframe', 'method' => 'POST'));
$form->setUseContainer(true);
$form->addField("clickhere", 'submit', array('name' => "clickhere", 'value' => "click here", 'label' => 'If it\'s taking too long'));
// Add all the NETBANX parameters
foreach ($this->craft_parameters($order) as $name => $value) {
$form->addField($name, 'hidden', array('name' => $name, 'value' => $value));
}
// Craft the HTML and return
$html = $form->toHtml();
$html .= '<script type="text/javascript">document.getElementById("netbanx_iframe").submit();</script>';
if (Mage::getStoreConfig('payment/Netbanx/iframe')) {
$html = '<html><body>' . $this->__('Please wait whilst you\'re taken to the secure NETBANX page.') . '<br><br>' . $html . '</body></html>';
}
return $html;
}
示例9: redirectAction
/**
* When a customer chooses Firstdatae4 on Checkout/Payment page
*
*/
public function redirectAction()
{
if ($this->getRequest()->getPost()) {
$session = Mage::getSingleton("core/session");
$session->setData("fde4-recurring", $this->getRequest()->getPost('recurring'));
$session = Mage::getSingleton('checkout/session');
$this->create($this->getRequest()->getPost('recurring'));
$session->setFirstdatae4StandardQuoteId($session->getQuoteId());
$this->getResponse()->setBody($this->getLayout()->createBlock('firstdatae4/standard_redirect')->toHtml());
$session->unsQuoteId();
} else {
$recurring = new Varien_Data_Form();
$recurring->setAction(Mage::getBaseUrl() . 'firstdatae4/standard/redirect/')->setId('recurring-profiles')->setName('recurring-profiles')->setMethod('POST')->setUseContainer(true);
$model = Mage::getModel('firstdatae4/plans');
$plans = $model->toOptionArray();
foreach ($plans as $key => $value) {
$radio = 'rp_' . $key;
$config = Mage::getStoreConfig('firstdatae4/config/' . $radio, Mage::app()->getStore());
if ($config != '0') {
$recurring->addField($radio, 'radio', array('name' => 'recurring', 'value' => $config, 'label' => $value));
}
}
$recurring->addField('none', 'radio', array('name' => 'recurring', 'value' => 0, 'label' => Mage::helper('firstdatae4')->__("I do not want any plan at this time")));
$recurring->addField('submit', 'submit', array('name' => 'button', 'value' => 'Submit'));
$html = '<html>' . '<style>' . ' *{ margin: 0; padding:0 ; font-family: Arial; } #top-box{ background-color: #166700; padding: 10px; color: #fff; }' . ' #content { padding: 10px; } input { margin-right: 7px; }' . ' #submit { background: none repeat scroll 0 0 #738d00; border: 0 none; border-radius: 3px; box-shadow: none; color: #fff; filter: none; line-height: 22px; outline: medium none; padding: 9px 20px; text-shadow: none; transition: background 0.2s linear 0s, color 0.2s linear 0s; white-space: normal; cursor: pointer; display: inline-block; font-size: 14px; font-weight: normal; margin-top: 20px; }' . '</style>' . '<body>';
$html .= '<div id="top-box">Habitos Saludables</div>';
$html .= '<div id="content">' . $this->__('If you want to automatically repeat this purchases, please select the type of profiles you want:');
$html .= $recurring->toHtml();
$html .= '</div>';
$html .= '<script type="text/javascript">document.getElementById("none").checked = true;</script>';
$html .= '<style>.field-row{ display:block; } .field-row input { float: left;white-space:nowrap;}</style>';
$html .= '</body></html>';
echo $html;
}
}
示例10: _prepareForm
protected function _prepareForm()
{
if (!Mage::getSingleton('admin/session')->isAllowed('meigee/thememanager/add_or_clone')) {
return parent::_prepareLayout();
}
$helper = Mage::helper('thememanager');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'name' => 'edit_form', 'action' => $this->getUrl('*/*/getNewConfig'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
if ($this->getRequest()->getParam('saveConfig')) {
$form->addField('saveConfig', 'hidden', array('name' => 'saveConfig', 'value' => 1, 'after_element_html' => $this->getReloadFormJs()));
} else {
$name = '';
$save_btn_name = 'Save';
if (Mage::app()->getRequest()->getParam('clone')) {
$theme_id = (int) Mage::app()->getRequest()->getParam('theme_id');
if ($theme_id) {
$theme = Mage::getModel('thememanager/themes')->load($theme_id);
$name = $theme->getName() . " CLONE";
$save_btn_name = 'Clone';
$form->addField('cloneConfigId', 'hidden', array('name' => 'cloneConfigId', 'value' => $theme->getId()));
}
}
$fieldset = $form->addFieldset('addConfigFormFieldset', array());
// $fieldset = $form->addFieldset('addConfigFormFieldset', array('legend'=>Mage::helper('adminhtml')->__('Confirm Parameters')));
$fieldset->addField('name', 'text', array('label' => $helper->__('Name'), 'required' => true, 'name' => 'name', 'value' => $name));
$fieldset->addField('themenamespace', 'hidden', array('name' => 'themenamespace', 'value' => $helper->getThemeNamespace()));
$stores = $helper->getStoresForm();
$installed_thems = $helper->getUsedThems();
foreach ($stores as $key => $store) {
if (!isset($installed_thems[$store['value']]) || $helper->getThemeNamespace() != $installed_thems[$store['value']]) {
unset($stores[$key]);
}
}
$fieldset->addField('store_id', 'select', array('label' => $helper->__('Select Store'), 'name' => 'store_id', 'values' => $stores, 'note' => 'If you do not see your store above, please activate theme for it by clicking Install demo button', 'onchange' => 'showStoreTypes(this);'));
$all_types = Mage::getModel('thememanager/pageTypeConfigs_instance')->getInstance()->getAllTypes();
$all_types_form = array();
$selected_store = false;
foreach ($stores as $store) {
$selected_store = !$selected_store ? $store['value'] : $selected_store;
foreach ($all_types as $type) {
$type['attributes'] = array('data-store' => $store['value'], 'class' => 'data_store_option' . ($store['value'] == $selected_store ? '' : ' hided_element'));
$all_types_form[$type['value'] . '-' . $store['value']] = $type;
}
}
$collection_themes = Mage::getModel('thememanager/themes')->getThemesCollection()->load();
foreach ($collection_themes as $theme) {
$key = $theme->getType() . '-' . $theme->getStoreId();
if (isset($all_types_form[$key]) && ($all_types_form[$key]['is_single'] || !$all_types_form[$key]['visible'])) {
unset($all_types_form[$key]);
}
}
$fieldset->addType('custom_select', 'Meigee_Thememanager_Block_Adminhtml_Thems_AddConfigForm_Select');
$fieldset->addField('type', 'custom_select', array('label' => $helper->__('Type'), 'name' => 'type', 'values' => $all_types_form));
$form->addField('saveConfig', 'hidden', array('name' => 'saveConfig', 'value' => 1));
$fieldset->addField('submit', 'submit', array('name' => 'confirm', 'disabled' => false, 'class' => 'form-button', 'value' => $helper->__($save_btn_name), 'after_element_html' => $this->getFormJs()));
}
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
开发者ID:kiutisuperking,项目名称:eatsmartboxdev,代码行数:59,代码来源:Meigee_Thememanager_Block_Adminhtml_Thems_AddConfigForm.php
示例11: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form(array('id' => 'import_form', 'action' => $this->getUrl('*/*/upload'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
$form->addField('xls', 'file', array('name' => 'xls'));
$form->addField('submit', 'submit', array('name' => 'test', 'value' => 'Upload File', '' => true));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例12: _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();
}
示例13: _toHtml
protected function _toHtml()
{
$form = new Varien_Data_Form();
$form->setAction($this->getTargetURL())->setId($this->getFormId())->setName($this->getFormId())->setMethod($this->getMethod())->setUseContainer(true);
foreach ($this->_getFormFields() as $field => $value) {
$form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
}
//*******************************************
// BEGIN PAP TRACKING EDITS
//*******************************************
$config = Mage::getSingleton('pap/config');
// we'll need this
// Add a special field to hold the affiliate cookie data
$form->addField('pap_ab78y5t4a', 'hidden', array('name' => 'pap-cookie-data', 'id' => 'pap_ab78y5t4a', 'value' => ''));
//*******************************************
// END PAP TRACKING EDITS
//*******************************************
$html = $form->toHtml();
//*******************************************
// BEGIN PAP TRACKING EDITS
//*******************************************
ob_start();
?>
<script type="text/javascript">
(function () {
var papDomain = (("https:" == document.location.protocol) ? "https://":"http://");papDomain+="<?php
echo preg_replace('~^(https?://)?~', '', $config->getRemotePath());
?>
";
var papId = 'pap_x2s6df8d';
// adjust the ID iff it would conflict with an existing element
if ((function(elementId){var nodes=new Array();var tmpNode=document.getElementById(elementId);while(tmpNode){nodes.push(tmpNode);tmpNode.id="";tmpNode=document.getElementById(elementId);for(var x=0;x<nodes.length;x++){if(nodes[x]==tmpNode){tmpNode=false;}}}})('pap_x2s6df8d')) {papId += '_salestrack';}
document.write(unescape("%3Cscript id='pap_x2s6df8d' src='" + papDomain + "/scripts/<?php
echo $config->getTracksalescript();
?>
' type='text/javascript'%3E%3C/script%3E"));
})();
</script>
<?php
$script_block = ob_get_clean();
// Append the script to make the affiliate tracking work
$html .= $script_block;
$html .= '<script type="text/javascript">';
// Write the tracking data to the form, rather than registering the sale immediately
$html .= 'PostAffTracker.writeCookieToCustomField(\'pap_ab78y5t4a\');';
$html .= '</script>';
//*******************************************
// END PAP TRACKING EDITS
//*******************************************
$html .= '<script type="text/javascript">document.getElementById("' . $this->getFormId() . '").submit();</script>';
return $html;
}
示例14: _toHtml
protected function _toHtml()
{
$liqpay = Mage::getModel('pbliqpay/liqpay');
$form = new Varien_Data_Form();
$form->setAction($liqpay->getLiqPayUrl())->setId('pbliqpay_liqpay_checkout')->setName('pbliqpay_liqpay_checkout')->setMethod('POST')->setUseContainer(true);
$form->addField('operation_xml', 'hidden', array('name' => 'operation_xml', 'value' => $liqpay->getEncodedXml()));
$form->addField('signature', 'hidden', array('name' => 'signature', 'value' => $liqpay->getSign()));
$html = '<html><body>';
$html .= iconv('UTF-8', 'windows-1251', $this->__('You will be redirected to LiqPay payment interface in a few seconds.'));
$html .= $form->toHtml();
$html .= '<script type="text/javascript">document.getElementById("pbliqpay_liqpay_checkout").submit();</script>';
$html .= '</body></html>';
return $html;
}
示例15: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form(array('id' => 'bulk_form', 'action' => $this->getUrl('*/*/bulkassign'), 'method' => 'post'));
$attributeCodes = array();
$attributeCodes[''] = '- No Brand Attribute -';
foreach ($this->availableAttributes() as $key => $value) {
$attributeCodes[$key] = $value;
}
$form->addField('bulkassign_attribute', 'select', array('label' => Mage::helper('remarketing')->__('Attribute'), 'name' => 'bulkassign_attribute', 'values' => $attributeCodes));
$form->addField('bulkassign_submit', 'button', array('class' => 'form-button', 'value' => Mage::helper('remarketing')->__('Set')));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}