本文整理汇总了PHP中Varien_Data_Form::setFieldsetElementRenderer方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::setFieldsetElementRenderer方法的具体用法?PHP Varien_Data_Form::setFieldsetElementRenderer怎么用?PHP Varien_Data_Form::setFieldsetElementRenderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::setFieldsetElementRenderer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareLayout
/**
* Preparing global layout
*
* You can redefine this method in child classes for changin layout
*
* @return Mage_Core_Block_Abstract
*/
protected function _prepareLayout()
{
Varien_Data_Form::setElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_element'));
Varien_Data_Form::setFieldsetRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset'));
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element'));
return parent::_prepareLayout();
}
示例2: _prepareLayout
/**
* Preparing global layout
*
* You can redefine this method in child classes for changin layout
*
* @return Ced_CsMarketplace_Block_Vendor_Abstract
*/
protected function _prepareLayout()
{
Varien_Data_Form::setElementRenderer($this->getLayout()->createBlock('csmarketplace/widget_form_renderer_element'));
Varien_Data_Form::setFieldsetRenderer($this->getLayout()->createBlock('csmarketplace/widget_form_renderer_fieldset'));
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('csmarketplace/vpayments_view_element'));
return parent::_prepareLayout();
}
示例3: _prepareLayout
/**
* Block Layout Preparation
*/
protected function _prepareLayout()
{
$regionData = Mage::getModel('directory/region_api')->items($this->getRequest()->getParam('id'));
Varien_Data_Form::setElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_element'));
Varien_Data_Form::setFieldsetRenderer($this->getLayout()->createBlock('pixcountries/adminhtml_pixcountries_edit_renderer_fieldset')->setRegionData($regionData));
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element'));
}
示例4: _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);
}
示例5: _prepareLayout
/**
* Preparing global layout
*
* You can redefine this method in child classes for changin layout
*
* @return Mage_Core_Block_Abstract
*/
protected function _prepareLayout()
{
Varien_Data_Form::setElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_element'));
Varien_Data_Form::setFieldsetRenderer($this->getLayout()->createBlock('enterprise_rma/adminhtml_rma_edit_item_renderer_fieldset'));
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element'));
return $this;
}
示例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: _prepareLayout
/**
* Preparing global layout
*
* You can redefine this method in child classes for changing layout
*
* @return Mage_Core_Block_Abstract
*/
protected function _prepareLayout()
{
Varien_Data_Form::setElementRenderer($this->getLayout()->createBlock('Mage_Backend_Block_Widget_Form_Renderer_Element', $this->getNameInLayout() . '_element'));
Varien_Data_Form::setFieldsetRenderer($this->getLayout()->createBlock('Mage_Backend_Block_Widget_Form_Renderer_Fieldset', $this->getNameInLayout() . '_fieldset'));
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('Mage_Backend_Block_Widget_Form_Renderer_Fieldset_Element', $this->getNameInLayout() . '_fieldset_element'));
return parent::_prepareLayout();
}
示例8: _prepareForm
protected function _prepareForm()
{
$model = Mage::getModel('webforms/webforms');
$form = new Varien_Data_Form();
$renderer = $this->getLayout()->createBlock('webforms/adminhtml_element_field');
$form->setFieldsetElementRenderer($renderer);
$form->setFieldNameSuffix('field');
$form->setDataObject(Mage::registry('field'));
$this->setForm($form);
$fieldset = $form->addFieldset('webforms_form', array('legend' => Mage::helper('webforms')->__('Validation')));
$fieldset->addField('validate_length_min', 'text', array('label' => Mage::helper('webforms')->__('Minimum length'), 'class' => 'validate-number', 'name' => 'validate_length_min'));
$fieldset->addField('validate_length_max', 'text', array('label' => Mage::helper('webforms')->__('Maximum length'), 'class' => 'validate-number', 'name' => 'validate_length_max'));
$fieldset->addField('validate_regex', 'text', array('label' => Mage::helper('webforms')->__('Validation RegEx'), 'name' => 'validate_regex', 'note' => Mage::helper('webforms')->__('Validate with custom regular expression')));
$fieldset->addField('validate_message', 'textarea', array('label' => Mage::helper('webforms')->__('Validation error message'), 'name' => 'validate_message', 'note' => Mage::helper('webforms')->__('Displayed error message text if regex validation fails')));
Mage::dispatchEvent('webforms_adminhtml_fields_edit_tab_design_prepare_form', array('form' => $form, 'fieldset' => $fieldset));
if (Mage::registry('field')->getData('validate_length_min') == 0) {
Mage::registry('field')->setData('validate_length_min', '');
}
if (Mage::registry('field')->getData('validate_length_max') == 0) {
Mage::registry('field')->setData('validate_length_max', '');
}
if (Mage::getSingleton('adminhtml/session')->getWebFormsData()) {
$form->setValues(Mage::getSingleton('adminhtml/session')->getWebFormsData());
Mage::getSingleton('adminhtml/session')->setWebFormsData(null);
} elseif (Mage::registry('field')) {
$form->setValues(Mage::registry('field')->getData());
}
return parent::_prepareForm();
}
示例9: _toHtml
protected function _toHtml()
{
$_form = new Varien_Data_Form();
$_form->setElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_element'));
$_form->setFieldsetRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset'));
$_form->setFieldsetElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element'));
$_fieldset = $_form->addFieldset('types_data_fset', array('legend' => $this->__('Representation settings')));
$_fieldset->setFieldsetContainerId('awf_types_settings');
$type = Mage::getSingleton('awfeatured/representations_config')->getRepresentation($this->getData('type'));
foreach ($type->getOptions() as $key => $options) {
$_field = $_fieldset->addField($key, $options['input_type'], array('label' => $this->__($options['label']), 'name' => 'type_data[' . $key . ']'));
if ($_field) {
if (isset($options['default'])) {
$_field->setValue($options['default']);
}
if ($options['input_type'] == 'select' && isset($options['source_model'])) {
$_field->setValues(Mage::getModel($options['source_model'])->toOptionArray());
}
if (isset($options['required'])) {
$_field->setRequired($options['required']);
}
}
}
if ($this->getData('is_init')) {
$_data = Mage::getSingleton('adminhtml/session')->getData(AW_Featured_Helper_Data::FORM_DATA_KEY);
$_data = isset($_data['type_data']) ? $_data['type_data'] : null;
if ($_data) {
$_form->setValues($_data);
}
}
return $_form->getHtml();
}
示例10: _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);
$generalFieldset = $form->addFieldset('aw_hdu3_priority_form', array('legend' => $this->__('General Details')));
$_cfg = array('label' => $this->__('Status'), 'name' => 'status', 'values' => AW_Helpdesk3_Model_Source_Status::toOptionArray());
/**
* @var $currentPriority AW_Helpdesk3_Model_Ticket_Priority
*/
$currentPriority = Mage::registry('current_priority');
if ($currentPriority->getIsSystem()) {
$_cfg['note'] = $this->__('System Priority cannot be disabled or deleted');
if ($currentPriority->isEnabled()) {
$_cfg['disabled'] = true;
}
}
$generalFieldset->addField('status', 'select', $_cfg);
$generalFieldset->addField('font_color', 'text', array('label' => $this->__('Font Color'), 'name' => 'font_color'));
$generalFieldset->addField('background_color', 'text', array('label' => $this->__('Background Color'), 'name' => 'background_color'));
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('aw_hdu3/adminhtml_form_fieldset_renderer_labelElement', '', array('label_values' => Mage::registry('current_priority')->getLabelValues())));
$titlesFieldset = $form->addFieldset('aw_hdu3_priority_form_titles', array('legend' => $this->__('Manage Titles')));
$titlesFieldset->addField('id', 'hidden', array('name' => 'id'));
$form->setValues(Mage::registry('current_priority')->getData());
return parent::_prepareForm();
}
示例11: _prepareLayout
protected function _prepareLayout()
{
$return = parent::_prepareLayout();
$inGrid = $this->getEditedInGrid();
$required = $this->getIsRequiredValueEdit();
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('customgrid/widget_grid_form_renderer_product_fieldset_element')->setEditedInGrid($inGrid)->setIsRequiredValueEdit($required));
return $return;
}
示例12: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
Varien_Data_Form::setElementRenderer($this->getLayout()->createBlock($this->rendererPrefix . '_element'));
Varien_Data_Form::setFieldsetRenderer($this->getLayout()->createBlock($this->rendererPrefix . '_fieldset'));
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock($this->rendererPrefix . '_fieldset_element'));
return $this;
}
示例13: _prepareLayout
/**
* Preparing global layout
*
* @return Mage_Core_Block_Abstract
*/
protected function _prepareLayout()
{
$result = parent::_prepareLayout();
$renderer = $this->getLayout()->getBlock('fieldset_element_renderer');
if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) {
Varien_Data_Form::setFieldsetElementRenderer($renderer);
}
return $result;
}
示例14: _prepareForm
protected function _prepareForm()
{
$model = Mage::getModel('webforms/webforms');
$form = new Varien_Data_Form();
$renderer = $this->getLayout()->createBlock('webforms/adminhtml_element_field');
$form->setFieldsetElementRenderer($renderer);
$form->setFieldNameSuffix('form');
$form->setDataObject(Mage::registry('webforms_data'));
$this->setForm($form);
$fieldset = $form->addFieldset('webforms_form', array('legend' => Mage::helper('webforms')->__('Form Information')));
$fieldset->addField('name', 'text', array('label' => Mage::helper('webforms')->__('Name'), 'class' => 'required-entry', 'required' => true, 'name' => 'name'));
$fieldset->addField('code', 'text', array('label' => Mage::helper('webforms')->__('Code'), 'name' => 'code', 'note' => Mage::helper('webforms')->__('Code is used to help identify this web-form in scripts')));
$editor_type = 'textarea';
$style = '';
$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;
$wysiwygConfig->setData("plugins", array());
$editor_type = 'editor';
$style = 'height:20em; width:50em;';
$config = $wysiwygConfig;
}
$descField = $fieldset->addField('description', $editor_type, array('label' => Mage::helper('webforms')->__('Description'), 'required' => false, 'name' => 'description', 'style' => $style, 'note' => Mage::helper('webforms')->__('This text will appear under the form name'), 'wysiwyg' => true, 'config' => $config));
$succField = $fieldset->addField('success_text', $editor_type, array('label' => Mage::helper('webforms')->__('Success text'), 'required' => false, 'name' => 'success_text', 'style' => $style, 'note' => Mage::helper('webforms')->__('This text will be displayed after the form completion'), 'wysiwyg' => true, 'config' => $config));
if (isset($renderer)) {
$descField->setRenderer($renderer);
$succField->setRenderer($renderer);
}
$fieldset->addField('submit_button_text', 'text', array('label' => Mage::helper('webforms')->__('Submit button text'), 'name' => 'submit_button_text', 'note' => Mage::helper('webforms')->__('Set text for the submit button of the form. If empty the default value "Submit" will be used')));
$fieldset->addField('menu', 'select', array('label' => Mage::helper('webforms')->__('Display in menu'), 'title' => Mage::helper('webforms')->__('Display in menu'), 'name' => 'menu', 'note' => Mage::helper('webforms')->__('Show web-form in admin backend menu'), 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray()));
$fieldset->addField('is_active', 'select', array('label' => Mage::helper('webforms')->__('Status'), 'title' => Mage::helper('webforms')->__('Status'), 'name' => 'is_active', 'required' => false, 'options' => $model->getAvailableStatuses()));
Mage::dispatchEvent('webforms_adminhtml_webforms_edit_tab_information_prepare_form', array('form' => $form, 'fieldset' => $fieldset));
if (!Mage::registry('webforms_data')->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('webforms_data')) {
$form->setValues(Mage::registry('webforms_data')->getData());
}
return parent::_prepareForm();
}
开发者ID:monarcmoso,项目名称:beta2,代码行数:49,代码来源:VladimirPopov_WebForms_Block_Adminhtml_Webforms_Edit_Tab_Information.php
示例15: _beforeToHtml
protected function _beforeToHtml()
{
parent::_beforeToHtml();
if (!Mage::registry('url_store')) {
$this->_unregUrlStore = true;
Mage::register('url_store', Mage::app()->getStore());
}
$this->_oldStoreId = Mage::app()->getStore()->getId();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$this->_oldFieldsetRenderer = Varien_Data_Form::getFieldsetRenderer();
$this->_oldFieldsetElementRenderer = Varien_Data_Form::getFieldsetElementRenderer();
Varien_Data_Form::setFieldsetRenderer($this->getLayout()->createBlock('udprod/vendor_product_renderer_fieldset'));
Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('udprod/vendor_product_renderer_fieldsetElement'));
return $this;
}