本文整理汇总了PHP中Varien_Data_Form::setUseContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::setUseContainer方法的具体用法?PHP Varien_Data_Form::setUseContainer怎么用?PHP Varien_Data_Form::setUseContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::setUseContainer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
/**
* Prepare form fields
*
* @return Mage_Adminhtml_Block_Catalog_Search_Edit_Form
*/
protected function _prepareForm()
{
$model = Mage::registry('current_catalog_search');
/* @var $model Mage_CatalogSearch_Model_Query */
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('catalog')->__('General Information')));
$yesno = array(array('value' => 0, 'label' => Mage::helper('catalog')->__('No')), array('value' => 1, 'label' => Mage::helper('catalog')->__('Yes')));
if ($model->getId()) {
$fieldset->addField('query_id', 'hidden', array('name' => 'query_id'));
}
$fieldset->addField('query_text', 'text', array('name' => 'query_text', 'label' => Mage::helper('catalog')->__('Search Query'), 'title' => Mage::helper('catalog')->__('Search Query'), 'required' => true));
if (!Mage::app()->isSingleStoreMode()) {
$fieldset->addField('store_id', 'select', array('name' => 'store_id', 'label' => Mage::helper('catalog')->__('Store'), 'title' => Mage::helper('catalog')->__('Store'), 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(true, false), 'required' => true));
} else {
$fieldset->addField('store_id', 'hidden', array('name' => 'store_id'));
$model->setStoreId(Mage::app()->getStore(true)->getId());
}
if ($model->getId()) {
$fieldset->addField('num_results', 'text', array('name' => 'num_results', 'label' => Mage::helper('catalog')->__('Number of results<br/>(For the last time placed)'), 'title' => Mage::helper('catalog')->__('Number of results<br/>(For the last time placed)'), 'required' => true));
$fieldset->addField('popularity', 'text', array('name' => 'popularity', 'label' => Mage::helper('catalog')->__('Number of Uses'), 'title' => Mage::helper('catalog')->__('Number of Uses'), 'required' => true));
}
$afterElementHtml = '<p class="nm"><small>' . Mage::helper('catalog')->__('(Will make search for the query above return results for this search.)') . '</small></p>';
$fieldset->addField('synonym_for', 'text', array('name' => 'synonym_for', 'label' => Mage::helper('catalog')->__('Synonym For'), 'title' => Mage::helper('catalog')->__('Synonym For'), 'after_element_html' => $afterElementHtml));
$afterElementHtml = '<p class="nm"><small>' . Mage::helper('catalog')->__('ex. http://domain.com') . '</small></p>';
$fieldset->addField('redirect', 'text', array('name' => 'redirect', 'label' => Mage::helper('catalog')->__('Redirect URL'), 'title' => Mage::helper('catalog')->__('Redirect URL'), 'class' => 'validate-url', 'after_element_html' => $afterElementHtml));
$fieldset->addField('display_in_terms', 'select', array('name' => 'display_in_terms', 'label' => Mage::helper('catalog')->__('Display in Suggested Terms'), 'title' => Mage::helper('catalog')->__('Display in Suggested Terms'), 'values' => $yesno));
$form->setValues($model->getData());
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例2: _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();
}
示例3: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form(array("id" => "edit_form", "action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))), "method" => "post"));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例4: _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);
}
示例5: _prepareForm
/**
* Prepare form
*
* @return Mage_Adminhtml_Block_Widget_Form
*/
protected function _prepareForm()
{
$model = Mage::registry('current_template');
if (!$model) {
$model = new Varien_Object();
}
$action = $this->getUrl('*/*/saveTemplate');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $action, 'method' => 'post', 'enctype' => 'multipart/form-data'));
$form->setHtmlIdPrefix('template_');
$fieldset = $form->addFieldset('edit_template', array('legend' => $this->__('Template')));
$this->_addElementTypes($fieldset);
if ($model->getId()) {
$fieldset->addField('id', 'hidden', array('name' => 'id'));
$fieldset->addField('template_id', 'hidden', array('name' => 'template_id'));
}
$fieldset->addField('application_id', 'select', array('name' => 'application_id', 'label' => $this->__('Application'), 'title' => $this->__('Application'), 'disabled' => $model->getId() || !$this->_fieldsEnabled ? true : false, 'values' => Mage::helper('xmlconnect')->getApplicationOptions(), 'note' => $this->__('Creating a Template is allowed only for applications which have device type iPhone.'), 'required' => true));
$fieldset->addField('name', 'text', array('name' => 'name', 'label' => $this->__('Template Name'), 'title' => $this->__('Template Name'), 'required' => true, 'disabled' => $model->getId() || !$this->_fieldsEnabled ? true : false, 'note' => $this->__('Maximum length is 255'), 'maxlength' => 255));
$fieldset->addField('push_title', 'text', array('name' => 'push_title', 'label' => $this->__('Push Title'), 'title' => $this->__('Push Title'), 'required' => true, 'disabled' => !$this->_fieldsEnabled ? true : false, 'note' => $this->__('Maximum length is 140'), 'maxlength' => 140));
$this->_dependentFields['message_title'] = $fieldset->addField('message_title', 'text', array('name' => 'message_title', 'label' => $this->__('Message Title'), 'title' => $this->__('Message Title'), 'required' => true, 'disabled' => !$this->_fieldsEnabled ? true : false, 'note' => $this->__('Maximum length is 255'), 'maxlength' => 255));
$widgetFilters = array('is_email_compatible' => 1);
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('widget_filters' => $widgetFilters));
$this->_dependentFields['content'] = $fieldset->addField('content', 'editor', array('label' => $this->__('Template Content'), 'title' => $this->__('Template Content'), 'name' => 'content', 'style' => 'height:30em;', 'state' => 'html', 'required' => true, 'disabled' => !$this->_fieldsEnabled ? true : false, 'config' => $wysiwygConfig));
$form->setValues($model->getData());
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例6: _prepareForm
protected function _prepareForm()
{
$model = Mage::registry('cms_block');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
$form->setHtmlIdPrefix('block_');
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('cms')->__('General Information'), 'class' => 'fieldset-wide'));
if ($model->getBlockId()) {
$fieldset->addField('block_id', 'hidden', array('name' => 'block_id'));
}
$fieldset->addField('title', 'text', array('name' => 'title', 'label' => Mage::helper('cms')->__('Block Title'), 'title' => Mage::helper('cms')->__('Block Title'), 'required' => true));
$fieldset->addField('identifier', 'text', array('name' => 'identifier', 'label' => Mage::helper('cms')->__('Identifier'), 'title' => Mage::helper('cms')->__('Identifier'), 'required' => true, 'class' => 'validate-xml-identifier'));
/**
* Check is single store mode
*/
if (!Mage::app()->isSingleStoreMode()) {
$field = $fieldset->addField('store_id', 'multiselect', array('name' => 'stores[]', 'label' => Mage::helper('cms')->__('Store View'), 'title' => Mage::helper('cms')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true)));
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$field->setRenderer($renderer);
} else {
$fieldset->addField('store_id', 'hidden', array('name' => 'stores[]', 'value' => Mage::app()->getStore(true)->getId()));
$model->setStoreId(Mage::app()->getStore(true)->getId());
}
$fieldset->addField('is_active', 'select', array('label' => Mage::helper('cms')->__('Status'), 'title' => Mage::helper('cms')->__('Status'), 'name' => 'is_active', 'required' => true, 'options' => array('1' => Mage::helper('cms')->__('Enabled'), '0' => Mage::helper('cms')->__('Disabled'))));
if (!$model->getId()) {
$model->setData('is_active', '1');
}
$fieldset->addField('content', 'editor', array('name' => 'content', 'label' => Mage::helper('cms')->__('Content'), 'title' => Mage::helper('cms')->__('Content'), 'style' => 'height:36em', 'required' => true, 'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig()));
$form->setValues($model->getData());
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例7: _prepareForm
protected function _prepareForm()
{
/* @var $profile Allopass_Hipay_Model_PaymentProfile */
$profile = Mage::registry('payment_profile');
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/paymentProfile/save'), 'method' => 'post'));
$fieldset = $form->addFieldset('paymentProfile_form', array('legend' => Mage::helper('hipay')->__('Payment Profile')));
if ($profile->getProfileId()) {
$fieldset->addField('profile_id', 'hidden', array('name' => 'profile_id'));
}
$fieldset->addField('name', 'text', array('label' => Mage::helper('hipay')->__('Name'), 'title' => Mage::helper('hipay')->__('Name'), 'class' => 'required-entry', 'required' => true, 'name' => 'name'));
$fieldset->addField('period_unit', 'select', array('label' => $profile->getFieldLabel('period_unit'), 'title' => $profile->getFieldLabel('period_unit'), 'class' => 'required-entry', 'name' => 'period_unit', 'values' => Mage::getSingleton('hipay/paymentProfile')->getAllPeriodUnits(), 'note' => $this->__('Unit for billing during the subscription period.')));
$fieldset->addField('period_frequency', 'text', array('label' => $profile->getFieldLabel('period_frequency'), 'title' => $profile->getFieldLabel('period_frequency'), 'class' => 'required-entry validate-number', 'required' => true, 'name' => 'period_frequency', 'note' => $this->__('Number of billing periods that make up one billing cycle.')));
$fieldset->addField('period_max_cycles', 'text', array('label' => $profile->getFieldLabel('period_max_cycles'), 'title' => $profile->getFieldLabel('period_max_cycles'), 'class' => 'required-entry validate-number', 'required' => true, 'name' => 'period_max_cycles', 'note' => $this->__('The number of billing cycles for payment period.')));
/*$fieldset->addField('payment_type', 'select', array(
'label' => $profile->getPaymentTypeLabel('payment_type'),
'title' => $profile->getPaymentTypeLabel('payment_type'),
'name' => 'payment_type',
'values' => $profile->getAllPaymentTypes(),
)
);*/
$fieldset->addField('payment_type', "hidden", array('name' => 'payment_type'));
$profile->setData('payment_type', "split_payment");
$form->setUseContainer(true);
$form->setValues($profile->getData());
$this->setForm($form);
return parent::_prepareForm();
}
示例8: _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);
}
示例9: _prepareForm
protected function _prepareForm()
{
$values = array();
if (!$this->getRule() || !$this->getRule()->getId()) {
$values = array('amount_from' => 0);
} else {
$values = $this->getRule()->getData();
}
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post'));
$fieldset = $form->addFieldset('msp_cashondelivery_', array('legend' => Mage::helper('msp_cashondelivery')->__('Cash on delivery fee')));
$fieldset->addField('amount_from', 'text', array('label' => Mage::helper('msp_cashondelivery')->__('Apply from amount'), 'required' => true, 'name' => 'amount_from'));
$fieldset->addField('fixed_fee', 'text', array('label' => Mage::helper('msp_cashondelivery')->__('Fixed Fee'), 'required' => false, 'name' => 'fixed_fee'));
$fieldset->addField('percent_fee', 'text', array('label' => Mage::helper('msp_cashondelivery')->__('Percentual Fee'), 'required' => false, 'name' => 'percent_fee'));
if (Mage::getSingleton('adminhtml/session')->getMspCashondeliveryData()) {
$form->setValues(Mage::getSingleton('adminhtml/session')->getMspCashondeliveryData());
Mage::getSingleton('adminhtml/session')->getMspCashondeliveryData(null);
} elseif (Mage::registry('msp_cashondelivery')) {
die("i dati ci sono!");
$form->setValues(Mage::registry('msp_cashondelivery_data')->getData());
}
$form->setValues($values);
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例10: _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();
}
示例11: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => Mage::helper('adminhtml')->getUrl('*/*/save'), 'method' => 'post'));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例12: _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
示例13: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form(array('id' => 'new_form', 'action' => $this->getUrl('*/*/createrequest'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
$form->setUseContainer(TRUE);
$this->setForm($form);
return parent::_prepareForm();
}
示例14: _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'))), 'method' => 'post'));
$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()));
$fieldset->addField('webform_id', 'hidden', array('name' => 'webform_id', 'value' => 1));
$fieldset->addField('saveandcontinue', 'hidden', array('name' => 'saveandcontinue'));
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);
}
示例15: _prepareForm
/**
* Prepare form before rendering HTML
* Setting Form Fieldsets and fields
*
* @return Mage_Adminhtml_Block_Widget_Form
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => Mage::getSingleton('Mage_Adminhtml_Model_Session')->getNewApplication() ? $this->getUrl('*/mobile/edit', array('_current' => true)) : $this->getUrl('*/mobile/save'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}