当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Adminhtml_Block_Widget_Form::_prepareForm方法代码示例

本文整理汇总了PHP中Mage_Adminhtml_Block_Widget_Form::_prepareForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget_Form::_prepareForm方法的具体用法?PHP Mage_Adminhtml_Block_Widget_Form::_prepareForm怎么用?PHP Mage_Adminhtml_Block_Widget_Form::_prepareForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Adminhtml_Block_Widget_Form的用法示例。


在下文中一共展示了Mage_Adminhtml_Block_Widget_Form::_prepareForm方法的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();
 }
开发者ID:jsiefer,项目名称:emarketing,代码行数:29,代码来源:Form.php

示例2: _prepareForm

 /**
  *
  * return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     $model = Mage::registry('checkout_agreement');
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('checkout')->__('Terms and Conditions Information'), 'class' => 'fieldset-wide'));
     if ($model->getId()) {
         $fieldset->addField('agreement_id', 'hidden', array('name' => 'agreement_id'));
     }
     $fieldset->addField('name', 'text', array('name' => 'name', 'label' => Mage::helper('checkout')->__('Condition Name'), 'title' => Mage::helper('checkout')->__('Condition Name'), 'required' => true));
     $fieldset->addField('is_active', 'select', array('label' => Mage::helper('checkout')->__('Status'), 'title' => Mage::helper('checkout')->__('Status'), 'name' => 'is_active', 'required' => true, 'options' => array('1' => Mage::helper('checkout')->__('Enabled'), '0' => Mage::helper('checkout')->__('Disabled'))));
     $fieldset->addField('is_html', 'select', array('label' => Mage::helper('checkout')->__('Show Content as'), 'title' => Mage::helper('checkout')->__('Show Content as'), 'name' => 'is_html', 'required' => true, 'options' => array(0 => Mage::helper('checkout')->__('Text'), 1 => Mage::helper('checkout')->__('HTML'))));
     if (!Mage::app()->isSingleStoreMode()) {
         $field = $fieldset->addField('store_id', 'multiselect', array('name' => 'stores[]', 'label' => Mage::helper('checkout')->__('Store View'), 'title' => Mage::helper('checkout')->__('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('checkbox_text', 'editor', array('name' => 'checkbox_text', 'label' => Mage::helper('checkout')->__('Checkbox Text'), 'title' => Mage::helper('checkout')->__('Checkbox Text'), 'rows' => '5', 'cols' => '30', 'wysiwyg' => false, 'required' => true));
     $fieldset->addField('content', 'editor', array('name' => 'content', 'label' => Mage::helper('checkout')->__('Content'), 'title' => Mage::helper('checkout')->__('Content'), 'style' => 'height:24em;', 'wysiwyg' => false, 'required' => true));
     $fieldset->addField('content_height', 'text', array('name' => 'content_height', 'label' => Mage::helper('checkout')->__('Content Height (css)'), 'title' => Mage::helper('checkout')->__('Content Height'), 'maxlength' => 25, 'class' => 'validate-css-length'));
     $form->setValues($model->getData());
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:31,代码来源:Form.php

示例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();
 }
开发者ID:Hospeed,项目名称:gamuza_freight-magento,代码行数:7,代码来源:Form.php

示例4: _prepareForm

 /**
  * Preparing default form elements for editing attribute
  *
  * @return Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract
  */
 protected function _prepareForm()
 {
     $attributeObject = $this->getAttributeObject();
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('eav')->__('Attribute Properties')));
     if ($attributeObject->getAttributeId()) {
         $fieldset->addField('attribute_id', 'hidden', array('name' => 'attribute_id'));
     }
     $this->_addElementTypes($fieldset);
     $yesno = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
     $validateClass = sprintf('validate-code validate-length maximum-length-%d', Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH);
     $fieldset->addField('attribute_code', 'text', array('name' => 'attribute_code', 'label' => Mage::helper('eav')->__('Attribute Code'), 'title' => Mage::helper('eav')->__('Attribute Code'), 'note' => Mage::helper('eav')->__('For internal use. Must be unique with no spaces. Maximum length of attribute code must be less then %s symbols', Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH), 'class' => $validateClass, 'required' => true));
     $inputTypes = Mage::getModel('eav/adminhtml_system_config_source_inputtype')->toOptionArray();
     $fieldset->addField('frontend_input', 'select', array('name' => 'frontend_input', 'label' => Mage::helper('eav')->__('Catalog Input Type for Store Owner'), 'title' => Mage::helper('eav')->__('Catalog Input Type for Store Owner'), 'value' => 'text', 'values' => $inputTypes));
     $fieldset->addField('default_value_text', 'text', array('name' => 'default_value_text', 'label' => Mage::helper('eav')->__('Default Value'), 'title' => Mage::helper('eav')->__('Default Value'), 'value' => $attributeObject->getDefaultValue()));
     $fieldset->addField('default_value_yesno', 'select', array('name' => 'default_value_yesno', 'label' => Mage::helper('eav')->__('Default Value'), 'title' => Mage::helper('eav')->__('Default Value'), 'values' => $yesno, 'value' => $attributeObject->getDefaultValue()));
     $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
     $fieldset->addField('default_value_date', 'date', array('name' => 'default_value_date', 'label' => Mage::helper('eav')->__('Default Value'), 'title' => Mage::helper('eav')->__('Default Value'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'value' => $attributeObject->getDefaultValue(), 'format' => $dateFormatIso));
     $fieldset->addField('default_value_textarea', 'textarea', array('name' => 'default_value_textarea', 'label' => Mage::helper('eav')->__('Default Value'), 'title' => Mage::helper('eav')->__('Default Value'), 'value' => $attributeObject->getDefaultValue()));
     $fieldset->addField('is_unique', 'select', array('name' => 'is_unique', 'label' => Mage::helper('eav')->__('Unique Value'), 'title' => Mage::helper('eav')->__('Unique Value (not shared with other products)'), 'note' => Mage::helper('eav')->__('Not shared with other products'), 'values' => $yesno));
     $fieldset->addField('is_required', 'select', array('name' => 'is_required', 'label' => Mage::helper('eav')->__('Values Required'), 'title' => Mage::helper('eav')->__('Values Required'), 'values' => $yesno));
     $fieldset->addField('frontend_class', 'select', array('name' => 'frontend_class', 'label' => Mage::helper('eav')->__('Input Validation for Store Owner'), 'title' => Mage::helper('eav')->__('Input Validation for Store Owner'), 'values' => Mage::helper('eav')->getFrontendClasses($attributeObject->getEntityType()->getEntityTypeCode())));
     if ($attributeObject->getId()) {
         $form->getElement('attribute_code')->setDisabled(1);
         $form->getElement('frontend_input')->setDisabled(1);
         if (!$attributeObject->getIsUserDefined()) {
             $form->getElement('is_unique')->setDisabled(1);
         }
     }
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:37,代码来源:Abstract.php

示例5: _prepareForm

 /**
  * Preparation of current form
  *
  * @return Inic_Faq_Block_Admin_Edit_Tab_Main Self
  */
 protected function _prepareForm()
 {
     $model = Mage::registry('faq');
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('faq_');
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('faq')->__('General information'), 'class' => 'fieldset-wide'));
     if ($model->getFaqId()) {
         $fieldset->addField('faq_id', 'hidden', array('name' => 'faq_id'));
     }
     $approveInfo = $fieldset->addField('question', 'text', array('name' => 'question', 'label' => Mage::helper('faq')->__('FAQ item question'), 'title' => Mage::helper('faq')->__('FAQ item question'), 'required' => true));
     /**
      * Check is single store mode
      */
     if (!Mage::app()->isSingleStoreMode()) {
         $store_id = $fieldset->addField('store_id', 'multiselect', array('name' => 'store_id[]', 'label' => Mage::helper('faq')->__('Store view'), 'title' => Mage::helper('faq')->__('Store view'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true)));
     } else {
         $store_id = $fieldset->addField('store_id', 'hidden', array('name' => 'store_id[]', 'value' => Mage::app()->getStore(true)->getId()));
         $model->setStoreId(Mage::app()->getStore(true)->getId());
     }
     $status = $fieldset->addField('is_active', 'select', array('label' => Mage::helper('faq')->__('Status'), 'title' => Mage::helper('faq')->__('Item status'), 'name' => 'is_active', 'required' => true, 'options' => array('1' => Mage::helper('faq')->__('Enabled'), '0' => Mage::helper('faq')->__('Disabled'))));
     $fieldset->addField('is_most_frequent', 'select', array('label' => Mage::helper('faq')->__('Is Most Frequent'), 'title' => Mage::helper('faq')->__('Is Most Frequent'), 'name' => 'is_most_frequent', 'required' => true, 'options' => array('1' => Mage::helper('faq')->__('Yes'), '0' => Mage::helper('faq')->__('No'))));
     $category_id = $fieldset->addField('category_id', 'multiselect', array('label' => Mage::helper('faq')->__('Category'), 'title' => Mage::helper('faq')->__('Category'), 'name' => 'category_id[]', 'required' => false, 'values' => Mage::getResourceSingleton('faq/category_collection')->toOptionArray()));
     $fieldset->addField('answer', 'editor', array('name' => 'answer', 'label' => Mage::helper('faq')->__('Content'), 'title' => Mage::helper('faq')->__('Content'), 'style' => 'height:36em;', 'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(), 'state' => 'html', 'required' => true));
     $data = $model->getData();
     if (!count($data)) {
         $data['store_id'] = 0;
     }
     $form->setValues($data);
     $this->setForm($form);
     $cat_id = $model->getData('category_id');
     $selected = $cat_id ? $cat_id : "";
     $this->setChild('form_after', $this->getLayout()->createBlock('faq/adminhtml_widget_form_element_selectdependence')->addFieldMap($store_id->getHtmlId(), $category_id->getHtmlId(), $selected));
     return parent::_prepareForm();
 }
开发者ID:xiaoguizhidao,项目名称:BumblebeeSite,代码行数:39,代码来源:Main.php

示例6: _prepareForm

 protected function _prepareForm()
 {
     $model = Mage::registry('permissions_user');
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('user_');
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('adminhtml')->__('Account Information')));
     if ($model->getUserId()) {
         $fieldset->addField('user_id', 'hidden', array('name' => 'user_id'));
     } else {
         if (!$model->hasData('is_active')) {
             $model->setIsActive(1);
         }
     }
     $fieldset->addField('username', 'text', array('name' => 'username', 'label' => Mage::helper('adminhtml')->__('User Name'), 'id' => 'username', 'title' => Mage::helper('adminhtml')->__('User Name'), 'required' => true));
     $fieldset->addField('firstname', 'text', array('name' => 'firstname', 'label' => Mage::helper('adminhtml')->__('First Name'), 'id' => 'firstname', 'title' => Mage::helper('adminhtml')->__('First Name'), 'required' => true));
     $fieldset->addField('lastname', 'text', array('name' => 'lastname', 'label' => Mage::helper('adminhtml')->__('Last Name'), 'id' => 'lastname', 'title' => Mage::helper('adminhtml')->__('Last Name'), 'required' => true));
     $fieldset->addField('email', 'text', array('name' => 'email', 'label' => Mage::helper('adminhtml')->__('Email'), 'id' => 'customer_email', 'title' => Mage::helper('adminhtml')->__('User Email'), 'class' => 'required-entry validate-email', 'required' => true));
     $fieldset->addField('current_password', 'obscure', array('name' => 'current_password', 'label' => Mage::helper('adminhtml')->__('Current Admin Password'), 'id' => 'current_password', 'title' => Mage::helper('adminhtml')->__('Current Admin Password'), 'class' => 'input-text', 'required' => true));
     if ($model->getUserId()) {
         $fieldset->addField('password', 'password', array('name' => 'new_password', 'label' => Mage::helper('adminhtml')->__('New Password'), 'id' => 'new_pass', 'title' => Mage::helper('adminhtml')->__('New Password'), 'class' => 'input-text validate-admin-password'));
         $fieldset->addField('confirmation', 'password', array('name' => 'password_confirmation', 'label' => Mage::helper('adminhtml')->__('Password Confirmation'), 'id' => 'confirmation', 'class' => 'input-text validate-cpassword'));
     } else {
         $fieldset->addField('password', 'password', array('name' => 'password', 'label' => Mage::helper('adminhtml')->__('Password'), 'id' => 'customer_pass', 'title' => Mage::helper('adminhtml')->__('Password'), 'class' => 'input-text required-entry validate-admin-password', 'required' => true));
         $fieldset->addField('confirmation', 'password', array('name' => 'password_confirmation', 'label' => Mage::helper('adminhtml')->__('Password Confirmation'), 'id' => 'confirmation', 'title' => Mage::helper('adminhtml')->__('Password Confirmation'), 'class' => 'input-text required-entry validate-cpassword', 'required' => true));
     }
     if (Mage::getSingleton('admin/session')->getUser()->getId() != $model->getUserId()) {
         $fieldset->addField('is_active', 'select', array('name' => 'is_active', 'label' => Mage::helper('adminhtml')->__('This account is'), 'id' => 'is_active', 'title' => Mage::helper('adminhtml')->__('Account Status'), 'class' => 'input-select', 'style' => 'width: 80px', 'options' => array('1' => Mage::helper('adminhtml')->__('Active'), '0' => Mage::helper('adminhtml')->__('Inactive'))));
     }
     $fieldset->addField('user_roles', 'hidden', array('name' => 'user_roles', 'id' => '_user_roles'));
     $data = $model->getData();
     unset($data['password']);
     $form->setValues($data);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:35,代码来源:Main.php

示例7: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $fieldset = $form->addFieldset('promotional_form', array('legend' => Mage::helper('promotional')->__('General')));
     $fieldset->addField('name', 'text', array('label' => Mage::helper('promotional')->__('Name'), 'name' => 'name', 'class' => 'required-entry', 'required' => true));
     $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
     $fieldset->addField('date_from', 'date', array('label' => Mage::helper('promotional')->__('Date From'), 'name' => 'date_from', 'required' => false, 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'format' => $dateFormatIso));
     $fieldset->addField('date_to', 'date', array('label' => Mage::helper('promotional')->__('Date To'), 'name' => 'date_to', 'required' => false, 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'format' => $dateFormatIso));
     if (!Mage::app()->isSingleStoreMode()) {
         $fieldset->addField('store_view', 'multiselect', array('label' => Mage::helper('promotional')->__('Store View'), 'name' => 'store_view', 'class' => 'required-entry', 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true)));
     }
     $fieldset->addField('page_type', 'multiselect', array('label' => Mage::helper('promotional')->__('Page Type'), 'name' => 'page_type', 'class' => 'required-entry', 'required' => true, 'values' => Mage::getModel('promotional/source_page')->toOptionArray()));
     $fieldset->addField('position', 'select', array('label' => Mage::helper('promotional')->__('Position'), 'name' => 'position', 'class' => 'required-entry', 'required' => true, 'values' => Mage::getModel('promotional/source_position')->toOptionArray()));
     $fieldset->addField('status', 'select', array('label' => Mage::helper('promotional')->__('Status'), 'name' => 'status', 'class' => 'required-entry', 'required' => true, 'values' => Mage::getModel('promotional/source_status')->toOptionArray()));
     $fieldset->addField('width', 'text', array('label' => Mage::helper('promotional')->__('Width, px'), 'name' => 'width', 'required' => false, 'note' => $this->__('Minimum width is 200px')));
     $fieldset->addField('height', 'text', array('label' => Mage::helper('promotional')->__('Height, px'), 'name' => 'height', 'required' => false, 'note' => $this->__('Miimum height is 300px')));
     if (Mage::getSingleton('adminhtml/session')->getPromotionalData()) {
         $form->setValues(Mage::getSingleton('adminhtml/session')->getPromotionalData());
         Mage::getSingleton('adminhtml/session')->setPromotionalData(null);
     } elseif (Mage::registry('promotional_data')) {
         $form->setValues(Mage::registry('promotional_data')->getData());
     }
     if (Mage::getSingleton('adminhtml/session')->getPromotionalData() == NULL && Mage::registry('promotional_data')->getData() == NULL) {
         $form->setValues(array('position' => Mage::helper('promotional')->getDefaultPosition()));
     }
     return parent::_prepareForm();
 }
开发者ID:xiaoguizhidao,项目名称:cupboardglasspipes.ecomitize.com,代码行数:28,代码来源:General.php

示例8: _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();
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:32,代码来源:Form.php

示例9: _prepareForm

 protected function _prepareForm()
 {
     $helper = Mage::helper('yanws');
     /** @var Emagedev_Yanws_Model_News $model */
     $model = Mage::registry('current_news');
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post', 'enctype' => 'multipart/form-data'));
     $entry = $model->getData();
     $this->setForm($form);
     $fieldset = $form->addFieldset('news_form', array('legend' => $helper->__('News Information')));
     $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('add_variables' => false, 'add_widgets' => false, 'add_images' => true, 'files_browser_window_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index'), 'files_browser_window_width' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width'), 'files_browser_window_height' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height')));
     $fieldset->addField('title', 'text', array('label' => $helper->__('Title'), 'required' => true, 'name' => 'title'));
     $fieldset->addField('article', 'editor', array('label' => $helper->__('Article'), 'wysiwyg' => true, 'style' => 'width:700px; height:400px;', 'config' => $wysiwygConfig, 'required' => true, 'name' => 'article'));
     $fieldset->addField('is_shorten', 'checkbox', array('label' => $helper->__('Use shorten'), 'required' => false, 'name' => 'is_shorten', 'value' => empty($entry) ? false : $model->getIsShorten(), 'checked' => empty($entry) ? false : $model->getIsShorten(), 'onclick' => 'this.value = this.checked ? 1 : 0;'));
     $fieldset->addField('shorten_article', 'editor', array('label' => $helper->__('Shorten article'), 'required' => false, 'style' => 'width:98%; height:600px;', 'wysiwyg' => true, 'config' => $wysiwygConfig, 'name' => 'shorten_article'));
     $fieldset->addField('url', 'text', array('label' => $helper->__('URL'), 'required' => false, 'after_element_html' => '
             <div id="url-view-helper">
                 <p>Пример ссылки: </p>
                 <span id="url-view-helper-url"></span>
             </div>
             ', 'name' => 'url'));
     $fieldset->addField('is_published', 'checkbox', array('label' => $helper->__('Is published'), 'required' => false, 'name' => 'is_published', 'value' => empty($entry) ? '1' : $model->isPublished(), 'onclick' => 'this.value = this.checked ? 1 : 0; '));
     $form->getElement('is_published')->setIsChecked(empty($entry) ? true : $model->isPublished());
     $form->setUseContainer(true);
     if ($data = Mage::getSingleton('adminhtml/session')->getFormData()) {
         $form->setValues($data);
     } else {
         $form->setValues($model->getData());
     }
     return parent::_prepareForm();
 }
开发者ID:Emagedev,项目名称:Yanws,代码行数:30,代码来源:Form.php

示例10: _prepareForm

 public function _prepareForm()
 {
     $hlp = Mage::helper('urapidflow');
     $source = Mage::getSingleton('urapidflow/source');
     $profile = Mage::registry('profile_data');
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $fieldset = $form->addFieldset('export_options_form', array('legend' => $this->__('Export Options')));
     $fieldset->addField('export_image_files', 'select', array('label' => $this->__('Auto-export image files'), 'name' => 'options[export][image_files]', 'values' => $source->setPath('yesno')->toOptionArray(), 'value' => $profile->getData('options/export/image_files')));
     $fieldset->addField('export_image_https', 'select', array('label' => $this->__('Export Image URLs as HTTPS'), 'name' => 'options[export][image_https]', 'values' => $source->setPath('yesno')->toOptionArray(), 'value' => $profile->getData('options/export/image_https')));
     $fieldset->addField('export_invalid_values', 'select', array('label' => $this->__('Export invalid values'), 'name' => 'options[export][invalid_values]', 'values' => $source->setPath('yesno')->toOptionArray(), 'value' => $profile->getData('options/export/invalid_values')));
     $fieldset->addField('export_internal_values', 'select', array('label' => $this->__('Export internal values'), 'name' => 'options[export][internal_values]', 'values' => $source->setPath('yesno')->toOptionArray(), 'value' => $profile->getData('options/export/internal_values')));
     $fieldset->addField('export_configurable_qty_as_sum', 'select', array('label' => $this->__('Calculate qty of configurable products as sum of subproducts'), 'name' => 'options[export][configurable_qty_as_sum]', 'values' => $source->setPath('yesno')->toOptionArray(), 'value' => $profile->getData('options/export/configurable_qty_as_sum')));
     $fieldset = $this->getForm()->addFieldset('export_price_form', array('legend' => $this->__('Price Options')));
     /*
     $fieldset->addField('export_use_final_price', 'select', array(
         'label'     => $this->__('Use Final Price'),
         'name'      => 'options[export][use_final_price]',
         'values'    => $source->setPath('yesno')->toOptionArray(),
         'value'     => $profile->getData('options/export/use_final_price'),
     ));
     $fieldset->addField('export_use_minimal_price', 'select', array(
         'label'     => $this->__('Use Minimal Price'),
         'name'      => 'options[export][use_minimal_price]',
         'values'    => $source->setPath('yesno')->toOptionArray(),
         'value'     => $profile->getData('options/export/use_minimal_price'),
     ));
     */
     $fieldset->addField('export_add_tax', 'select', array('label' => $this->__('Add Tax'), 'name' => 'options[export][add_tax]', 'values' => $source->setPath('yesno')->toOptionArray(), 'value' => $profile->getData('options/export/add_tax')));
     $fieldset->addField('export_markup', 'text', array('label' => $this->__('Add Markup (%)'), 'name' => 'options[export][markup]', 'value' => $profile->getData('options/export/markup')));
     return parent::_prepareForm();
 }
开发者ID:victorkho,项目名称:telor,代码行数:32,代码来源:Export.php

示例11: _prepareForm

 /**
  * prepare tab form's information
  *
  * @return Magestore_RewardPoints_Block_Adminhtml_Spending_Edit_Tab_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     if (Mage::getSingleton('adminhtml/session')->getFormData()) {
         $data = Mage::getSingleton('adminhtml/session')->getFormData();
         Mage::getSingleton('adminhtml/session')->setFormData(null);
     } elseif (Mage::registry('rate_data')) {
         $data = Mage::registry('rate_data')->getData();
     }
     $fieldset = $form->addFieldset('rewardpoints_form', array('legend' => Mage::helper('rewardpoints')->__('Rate information')));
     $dataObj = new Varien_Object($data);
     $data = $dataObj->getData();
     $fieldset->addField('points', 'text', array('label' => Mage::helper('rewardpoints')->__('Spending Point(s)'), 'title' => Mage::helper('rewardpoints')->__('Spending Point(s)'), 'required' => true, 'name' => 'points'));
     $fieldset->addField('money', 'text', array('name' => 'money', 'label' => Mage::helper('rewardpoints')->__('Discount received'), 'title' => Mage::helper('rewardpoints')->__('Discount received'), 'required' => true, 'after_element_html' => '<strong>[' . Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE) . ']</strong>', 'note' => Mage::helper('rewardpoints')->__('the equivalent value of points')));
     //Hai.Tran 12/11/2013 fix gioi han spend points
     $fieldset->addField('max_price_spended_type', 'select', array('label' => Mage::helper('rewardpoints')->__('Limit spending points based on'), 'title' => Mage::helper('rewardpoints')->__('Limit spending points based on'), 'name' => 'max_price_spended_type', 'options' => array('none' => Mage::helper('rewardpoints')->__('None'), 'by_price' => Mage::helper('rewardpoints')->__('A fixed amount of Total Order Value'), 'by_percent' => Mage::helper('rewardpoints')->__('A percentage of Total Order Value')), 'onchange' => 'toggleMaxPriceSpend()', 'note' => Mage::helper('rewardpoints')->__('Select the type to limit spending points')));
     $fieldset->addField('max_price_spended_value', 'text', array('label' => Mage::helper('rewardpoints')->__('Limit value allowed to spend points at'), 'title' => Mage::helper('rewardpoints')->__('Limit value allowed to spend points at'), 'name' => 'max_price_spended_value', 'note' => Mage::helper('rewardpoints')->__('If empty or zero, there is no limitation.')));
     //End Hai.Tran 12/11/2013
     if (!Mage::app()->isSingleStoreMode()) {
         $fieldset->addField('website_ids', 'multiselect', array('name' => 'website_ids[]', 'label' => Mage::helper('rewardpoints')->__('Websites'), 'title' => Mage::helper('rewardpoints')->__('Websites'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_config_source_website')->toOptionArray()));
     } else {
         $fieldset->addField('website_ids', 'hidden', array('name' => 'website_ids[]', 'value' => Mage::app()->getStore(true)->getWebsiteId()));
         $data['website_ids'] = Mage::app()->getStore(true)->getWebsiteId();
     }
     $fieldset->addField('customer_group_ids', 'multiselect', array('label' => Mage::helper('rewardpoints')->__('Customer groups'), 'title' => Mage::helper('rewardpoints')->__('Customer groups'), 'name' => 'customer_group_ids', 'required' => true, 'values' => Mage::getResourceModel('customer/group_collection')->addFieldToFilter('customer_group_id', array('gt' => 0))->load()->toOptionArray()));
     $fieldset->addField('sort_order', 'text', array('label' => Mage::helper('rewardpoints')->__('Priority'), 'label' => Mage::helper('rewardpoints')->__('Priority'), 'required' => false, 'name' => 'sort_order', 'note' => Mage::helper('rewardpoints')->__('Higher priority Rate will be applied first')));
     $form->setValues($data);
     $this->setForm($form);
     Mage::dispatchEvent('rewardpoints_adminhtml_spending_rate_form', array('tab_form' => $this, 'form' => $form, 'data' => $dataObj));
     return parent::_prepareForm();
 }
开发者ID:kanotest15,项目名称:cbmagento,代码行数:36,代码来源:Form.php

示例12: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $fieldset = $form->addFieldset('brand_form', array('legend' => Mage::helper('brand')->__('Brand information')));
     $fieldset->addField('title', 'text', array('label' => Mage::helper('brand')->__('Title'), 'class' => 'required-entry', 'required' => true, 'name' => 'title'));
     $fieldset->addField('filename', 'image', array('label' => Mage::helper('brand')->__('File'), 'required' => false, 'name' => 'filename'));
     $fieldset->addField('status', 'select', array('label' => Mage::helper('brand')->__('Status'), 'name' => 'status', 'values' => array(array('value' => 1, 'label' => Mage::helper('brand')->__('Enabled')), array('value' => 2, 'label' => Mage::helper('brand')->__('Disabled')))));
     $fieldset->addField('home_page', 'select', array('label' => Mage::helper('brand')->__('Home Page'), 'name' => 'home_page', 'values' => array(array('value' => 1, 'label' => Mage::helper('brand')->__('Enabled')), array('value' => 2, 'label' => Mage::helper('brand')->__('Disabled')))));
     /*$fieldset->addField('content', 'editor', array(
           'name'      => 'content',
           'label'     => Mage::helper('brand')->__('Content'),
           'title'     => Mage::helper('brand')->__('Content'),
           'style'     => 'width:700px; height:500px;',
           'wysiwyg'   => false,
           'required'  => true,
       ));*/
     if (Mage::getSingleton('adminhtml/session')->getBrandData()) {
         $form->setValues(Mage::getSingleton('adminhtml/session')->getBrandData());
         Mage::getSingleton('adminhtml/session')->setBrandData(null);
     } elseif (Mage::registry('brand_data')) {
         $form->setValues(Mage::registry('brand_data')->getData());
     }
     return parent::_prepareForm();
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:25,代码来源:Form.php

示例13: _prepareForm

 protected function _prepareForm()
 {
     $this->setTemplate('searchindex/form.phtml');
     $model = Mage::registry('current_model');
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
     $general = $form->addFieldset('general', array('legend' => __('General Information')));
     if ($model->getId()) {
         $general->addField('index_id', 'hidden', array('name' => 'index_id', 'value' => $model->getId()));
     }
     $general->addField('index_code', 'select', array('label' => __('Index'), 'required' => true, 'name' => 'index_code', 'value' => $model->getIndexCode(), 'values' => Mage::getSingleton('searchindex/system_config_source_index')->toOptionArray(), 'disabled' => $model->getIndexCode() ? true : false, 'note' => Mage::helper('searchindex/help')->field('index_code')));
     $general->addField('title', 'text', array('name' => 'title', 'label' => __('Title'), 'required' => true, 'value' => $model->getTitle(), 'note' => Mage::helper('searchindex/help')->field('title')));
     if (!$model->getId() || !$model->getIndexInstance()->isLocked()) {
         $general->addField('position', 'text', array('name' => 'position', 'label' => __('Position'), 'required' => true, 'value' => $model->getPosition(), 'note' => Mage::helper('searchindex/help')->field('position')));
         $general->addField('is_active', 'select', array('name' => 'is_active', 'label' => __('Active'), 'required' => true, 'value' => $model->getIsActive(), 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray(), 'note' => Mage::helper('searchindex/help')->field('is_active')));
     }
     if ($model->getId()) {
         // adding attribute fieldset
         $attributes = $form->addFieldset('attributes', array('legend' => __('Attributes')));
         $renderer = $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset')->setTemplate('searchindex/form/renderer/fieldset/attributes.phtml')->setAvailableAttributes($model->getIndexInstance()->getAvailableAttributes())->setAttributes($model->getAttributes());
         $attributes->setName('attributes')->setRenderer($renderer);
         // adding additional index fieldsets
         foreach ($model->getIndexInstance()->getFieldsets() as $code) {
             $class = "Mirasvit_SearchIndex_Block_Adminhtml_Index_Edit_Index_{$code}";
             $fieldset = new $class();
             $fieldset->setModel($model->getIndexInstance())->setId($class);
             $form->addElement($fieldset);
         }
     }
     $form->setAction($this->getUrl('*/*/save'));
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:guohuadeng,项目名称:aototechweb,代码行数:33,代码来源:Form.php

示例14: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $fieldset = $form->addFieldset('layeredlanding_form', array('legend' => Mage::helper('layeredlanding')->__('Landingpage Conditions'), 'class' => 'fieldset-wide'));
     $fieldset->addField('category_ids', 'multiselect', array('label' => Mage::helper('layeredlanding')->__('Categories'), 'class' => 'required-entry', 'required' => true, 'name' => 'category_ids', 'onchange' => '_estimate_product_count();', 'values' => Mage::getSingleton('layeredlanding/options_categories')->toOptionArray(), 'style' => 'width:80%'));
     /**
      * Check is single store mode
      */
     if (!Mage::app()->isSingleStoreMode()) {
         $field = $fieldset->addField('store_ids', 'multiselect', array('name' => 'store_ids', 'label' => Mage::helper('cms')->__('Store View'), 'title' => Mage::helper('cms')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true), 'onchange' => '_estimate_product_count();'));
         $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
         $field->setRenderer($renderer);
     } else {
         $fieldset->addField('store_ids', 'hidden', array('name' => 'store_ids', 'value' => Mage::app()->getStore(true)->getId(), 'onchange' => '_estimate_product_count();'));
     }
     $fieldset->addField('attributes', 'text', array('name' => 'attributes', 'label' => Mage::helper('layeredlanding')->__('Attributes'), 'required' => false));
     $attributes = $form->getElement('attributes');
     $attributes->setRenderer($this->getLayout()->createBlock('layeredlanding/adminhtml_layeredlanding_edit_renderer_attributes'));
     if (Mage::getSingleton('adminhtml/session')->getLayeredlandingData()) {
         $data = Mage::getSingleton('adminhtml/session')->getLayeredlandingData();
         Mage::getSingleton('adminhtml/session')->setLayeredlandingData(null);
     } elseif (Mage::registry('layeredlanding_data')) {
         $data = Mage::registry('layeredlanding_data')->getData();
     }
     // modify multiselect values
     $data['store_ids'] = explode(',', $data['store_ids']);
     $data['category_ids'] = explode(',', $data['category_ids']);
     $form->setValues($data);
     return parent::_prepareForm();
 }
开发者ID:Mohitsahu123,项目名称:layered-landing,代码行数:31,代码来源:Conditions.php

示例15: _prepareForm

 /**
  * Preparation of current form
  *
  * @return Flagbit_Faq_Block_Admin_Edit_Tab_Main Self
  */
 protected function _prepareForm()
 {
     $model = Mage::registry('faq');
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('faq_');
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('flagbit_faq')->__('General information'), 'class' => 'fieldset-wide'));
     if ($model->getFaqId()) {
         $fieldset->addField('faq_id', 'hidden', array('name' => 'faq_id'));
     }
     $fieldset->addField('question', 'text', array('name' => 'question', 'label' => Mage::helper('flagbit_faq')->__('FAQ item question'), 'title' => Mage::helper('flagbit_faq')->__('FAQ item question'), 'required' => true));
     /**
      * Check is single store mode
      */
     if (!Mage::app()->isSingleStoreMode()) {
         $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)));
     } 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('flagbit_faq')->__('Item status'), 'name' => 'is_active', 'required' => true, 'options' => array('1' => Mage::helper('cms')->__('Enabled'), '0' => Mage::helper('cms')->__('Disabled'))));
     $fieldset->addField('category_id', 'multiselect', array('label' => Mage::helper('flagbit_faq')->__('Category'), 'title' => Mage::helper('flagbit_faq')->__('Category'), 'name' => 'categories[]', 'required' => false, 'values' => Mage::getResourceSingleton('flagbit_faq/category_collection')->toOptionArray()));
     $fieldset->addField('answer', 'editor', array('name' => 'answer', 'label' => Mage::helper('flagbit_faq')->__('Content'), 'title' => Mage::helper('flagbit_faq')->__('Content'), 'style' => 'height:36em;', 'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(), 'required' => true));
     $fieldset->addField('answer_html', 'select', array('label' => Mage::helper('flagbit_faq')->__('HTML answer'), 'title' => Mage::helper('flagbit_faq')->__('HTML answer'), 'name' => 'answer_html', 'required' => true, 'options' => array('1' => Mage::helper('cms')->__('Enabled'), '0' => Mage::helper('cms')->__('Disabled'))));
     $form->setValues($model->getData());
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:ottonet,项目名称:Magento-Faq,代码行数:32,代码来源:Main.php


注:本文中的Mage_Adminhtml_Block_Widget_Form::_prepareForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。