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


PHP Varien_Data_Form::addFieldset方法代码示例

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


在下文中一共展示了Varien_Data_Form::addFieldset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'), 'store' => (int) $this->getRequest()->getParam('store'))), 'method' => 'post', 'enctype' => 'multipart/form-data'));
     /** @var Mirasvit_Helpdesk_Model_Department $department */
     $department = Mage::registry('current_department');
     $fieldset = $form->addFieldset('edit_fieldset', array('legend' => Mage::helper('helpdesk')->__('General Information')));
     if ($department->getId()) {
         $fieldset->addField('department_id', 'hidden', array('name' => 'department_id', 'value' => $department->getId()));
     }
     $fieldset->addField('store_id', 'hidden', array('name' => 'store_id', 'value' => (int) $this->getRequest()->getParam('store')));
     $fieldset->addField('name', 'text', array('label' => Mage::helper('helpdesk')->__('Title'), 'name' => 'name', 'value' => $department->getName(), 'after_element_html' => ' [STORE VIEW]'));
     $fieldset->addField('is_active', 'select', array('label' => Mage::helper('helpdesk')->__('Is Active'), 'name' => 'is_active', 'value' => $department->getIsActive(), 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray()));
     $fieldset->addField('sort_order', 'text', array('label' => Mage::helper('helpdesk')->__('Sort Order'), 'name' => 'sort_order', 'value' => $department->getSortOrder()));
     $fieldset->addField('sender_email', 'select', array('label' => Mage::helper('helpdesk')->__('Sender Email'), 'name' => 'sender_email', 'value' => $department->getSenderEmail(), 'values' => Mage::getSingleton('adminhtml/system_config_source_email_identity')->toOptionArray()));
     $fieldset->addField('user_ids', 'multiselect', array('label' => Mage::helper('helpdesk')->__('Members of Department'), 'required' => true, 'name' => 'user_ids[]', 'value' => $department->getUserIds(), 'values' => Mage::helper('helpdesk')->toAdminUserOptionArray()));
     // $fieldset->addField('signature', 'textarea', array(
     //     'label'     => Mage::helper('helpdesk')->__('Signature'),
     //     'name'      => 'signature',
     //     'value'     => $department->getSignature(),
     // ));
     $fieldset = $form->addFieldset('notification_fieldset', array('legend' => Mage::helper('helpdesk')->__('Notification')));
     $fieldset->addField('is_members_notification_enabled', 'select', array('label' => Mage::helper('helpdesk')->__('If ticket is unassigned, send notifications to all department members'), 'name' => 'is_members_notification_enabled', 'value' => $department->getIsMembersNotificationEnabled(), 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray()));
     $fieldset->addField('notification_email', 'text', array('label' => Mage::helper('helpdesk')->__('If ticket is unassigned, send notifications to email'), 'name' => 'notification_email', 'value' => $department->getNotificationEmail(), 'after_element_html' => ' [STORE VIEW]'));
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:27,代码来源:Form.php

示例2: _prepareRegularForm

 protected function _prepareRegularForm()
 {
     $hlp = Mage::helper('amshopby');
     $yesno = array(Mage::helper('catalog')->__('No'), Mage::helper('catalog')->__('Yes'));
     $fldSet = $this->_form->addFieldset('amshopby_general', array('legend' => $hlp->__('Display Properties')));
     $fldSet->addField('block_pos', 'select', array('label' => $hlp->__('Show in the Block'), 'name' => 'block_pos', 'values' => array('left' => $hlp->__('Sidebar'), 'top' => $hlp->__('Top'))));
     $model = Mage::registry('amshopby_filter');
     if ($model && $model->getBackendType() == 'decimal') {
         $fldSet->addField('display_type', 'select', array('label' => $hlp->__('Display Type'), 'name' => 'display_type', 'values' => array($hlp->__('Default'), $hlp->__('Dropdown'), $hlp->__('From-To Only'), $hlp->__('Slider'))));
         $fldSet->addField('slider_type', 'select', array('label' => $hlp->__('Slider Type'), 'name' => 'slider_type', 'values' => array($hlp->__('Default'), $hlp->__('With ranges')), 'note' => $hlp->__('Works only when "Display Type" setting is set as "Slider"')));
         $fldSet->addField('range', 'text', array('label' => $hlp->__('Range Step'), 'name' => 'range', 'note' => $hlp->__('Set 10 to get ranges 10-20,20-30, etc. Custom value improves pages speed. Leave empty to get default ranges.')));
         $fldSet->addField('value_label', 'text', array('label' => $hlp->__('Units label'), 'name' => 'value_label', 'note' => $hlp->__('Specify attribute units, like inch., MB, px, ft etc.')));
     } else {
         $fldSet->addField('display_type', 'select', array('label' => $hlp->__('Display Type'), 'name' => 'display_type', 'values' => array($hlp->__('Labels Only'), $hlp->__('Images Only'), $hlp->__('Images and Labels'), $hlp->__('Drop-down List'), $hlp->__('Labels in 2 columns'))));
         $fldSet->addField('max_options', 'text', array('label' => $hlp->__('Number of unfolded options'), 'name' => 'max_options', 'note' => $hlp->__('Applicable for `Labels Only`, `Images only` and `Labels and Images` display types. Zero means all options are unfolded')));
     }
     $fldSet->addField('hide_counts', 'select', array('label' => $hlp->__('Hide quantities'), 'name' => 'hide_counts', 'values' => $yesno));
     $fldSet->addField('sort_by', 'select', array('label' => $hlp->__('Sort Options By'), 'name' => 'sort_by', 'values' => array(array('value' => 0, 'label' => $hlp->__('Position')), array('value' => 1, 'label' => $hlp->__('Name')), array('value' => 2, 'label' => $hlp->__('Product Quatities')))));
     $fldSet->addField('collapsed', 'select', array('label' => $hlp->__('Collapsed'), 'name' => 'collapsed', 'values' => $yesno, 'note' => $hlp->__('Will be collapsed until customer select any filter option')));
     $fldSet->addField('comment', 'text', array('label' => $hlp->__('Tooltip'), 'name' => 'comment'));
     $fldSet2 = $this->_form->addFieldset('amshopby_blocks', array('legend' => $hlp->__('Additional Blocks')));
     $fldSet2->addField('show_on_list', 'select', array('label' => $hlp->__('Show on List'), 'name' => 'show_on_list', 'values' => $yesno, 'note' => $hlp->__('Show option description and image above product listing')));
     $fldSet2->addField('show_on_view', 'select', array('label' => $hlp->__('Show on Product'), 'name' => 'show_on_view', 'values' => $yesno, 'note' => $hlp->__('Show options images block on product view page')));
     $fldSet3 = $this->_form->addFieldset('amshopby_seo', array('legend' => $hlp->__('Search Engines Optimization')));
     $fldSet3->addField('seo_nofollow', 'select', array('label' => $hlp->__('Robots NoFollow Tag'), 'name' => 'seo_nofollow', 'values' => $yesno));
     $fldSet3->addField('seo_noindex', 'select', array('label' => $hlp->__('Robots NoIndex Tag'), 'name' => 'seo_noindex', 'values' => $yesno));
     $fldSet3->addField('seo_rel', 'select', array('label' => $hlp->__('Rel NoFollow'), 'name' => 'seo_rel', 'values' => $yesno, 'note' => $hlp->__('For the links in the left navigation')));
     $fldSet4 = $this->_form->addFieldset('amshopby_special', array('legend' => $hlp->__('Special Cases')));
     $fldSet4->addField('exclude_from', 'text', array('label' => $hlp->__('Exclude From Categories'), 'name' => 'exclude_from', 'note' => $hlp->__('Comma separated list of the categories IDs like 17,4,25')));
     $fldSet4->addField('single_choice', 'select', array('label' => $hlp->__('Single Choice Only'), 'name' => 'single_choice', 'values' => $yesno, 'note' => $hlp->__('Disables multiple selection')));
     $fldSet4->addField('depend_on', 'text', array('label' => $hlp->__('Show only when one of the following options are selected'), 'name' => 'depend_on', 'note' => $hlp->__('Comma separated list of the option IDs')));
     $fldSet4->addField('depend_on_attribute', 'text', array('label' => $hlp->__('Show only when any options of attributes below is selected'), 'name' => 'depend_on_attribute', 'note' => $hlp->__('Comma separated list of the attribute codes like color, brand etc')));
 }
开发者ID:jokusafet,项目名称:MagentoSource,代码行数:33,代码来源:General.php

示例3: _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);
 }
开发者ID:monarcmoso,项目名称:beta2,代码行数:34,代码来源:Form.php

示例4: _prepareForm

 protected function _prepareForm()
 {
     /* @var $card Allopass_Hipay_Model_Card */
     $card = Mage::registry('current_card');
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/card/save'), 'method' => 'post'));
     $fieldset = $form->addFieldset('card_form', array('legend' => Mage::helper('hipay')->__('Card Hipay')));
     if ($card->getCardId()) {
         $fieldset->addField('card_id', 'hidden', array('name' => 'card_id'));
         $fieldset->addField('customer_id', 'hidden', array('name' => 'customer_id'));
     }
     $fieldset->addField('name', 'text', array('label' => Mage::helper('hipay')->__('Card #'), 'title' => Mage::helper('hipay')->__('Card #'), 'class' => 'required-entry', 'required' => true, 'name' => 'name'));
     $fieldset->addField('is_default', 'select', array('label' => Mage::helper('hipay')->__('Is default'), 'title' => Mage::helper('hipay')->__('Is default'), 'name' => 'is_default', 'values' => array(Mage::helper('sales')->__('No'), Mage::helper('adminhtml')->__('Yes'))));
     $statues = array(Allopass_Hipay_Model_Card::STATUS_ENABLED => $this->__('Enabled'), Allopass_Hipay_Model_Card::STATUS_DISABLED => $this->__('Disabled'));
     $fieldset->addField('cc_status', 'select', array('label' => Mage::helper('hipay')->__('Status'), 'title' => Mage::helper('hipay')->__('Status'), 'name' => 'cc_status', 'values' => $statues));
     $fieldset_info = $form->addFieldset('card_info', array('legend' => Mage::helper('hipay')->__('Informations')));
     $fieldset_info->addField('cc_type', 'text', array('label' => Mage::helper('payment')->__('Card type'), 'title' => Mage::helper('payment')->__('Card type'), 'name' => 'cc_type', 'readonly' => true));
     $fieldset_info->addField('cc_number_enc', 'text', array('label' => Mage::helper('payment')->__('Card number'), 'title' => Mage::helper('payment')->__('Card number'), 'name' => 'cc_number_enc', 'readonly' => true));
     $fieldset_info->addField('cc_exp_month', 'text', array('label' => Mage::helper('payment')->__('Card Exp. month'), 'title' => Mage::helper('payment')->__('Card Exp. month'), 'name' => 'cc_exp_month', 'readonly' => true));
     $fieldset_info->addField('cc_exp_year', 'text', array('label' => Mage::helper('payment')->__('Card Exp. year'), 'title' => Mage::helper('payment')->__('Card Exp. year'), 'name' => 'cc_exp_year', 'readonly' => true));
     $fieldset_info->addField('cc_token', 'text', array('label' => Mage::helper('hipay')->__('Card Token'), 'title' => Mage::helper('hipay')->__('Card Token'), 'readonly' => true, 'name' => 'cc_token'));
     $form->setUseContainer(true);
     $form->setValues($card->getData());
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:hipay,项目名称:hipay-fullservice-sdk-magento1,代码行数:25,代码来源:Form.php

示例5: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form(array('id' => 'stuntcoders_slideshow', 'name' => 'stuntcoders_slideshow', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post', 'enctype' => 'multipart/form-data'));
     if (Mage::registry('stuntcoders_slideshow')) {
         $data = Mage::registry('stuntcoders_slideshow')->getData();
     } else {
         $data = array();
     }
     $fieldset = $form->addFieldset('stuntcoders_slideshow_form', array('legend' => Mage::helper('stuntcoders_slideshow')->__('Slideshow Information')));
     $fieldset->addField('name', 'text', array('label' => Mage::helper('stuntcoders_slideshow')->__('Name'), 'name' => 'name'));
     $fieldset->addField('code', 'text', array('label' => Mage::helper('stuntcoders_slideshow')->__('Code'), 'name' => 'code'));
     $fieldset->addField('is_enabled', 'select', array('label' => Mage::helper('stuntcoders_slideshow')->__('Enabled'), 'name' => 'is_enabled', 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray()));
     $fieldset->addField('image', 'image', array('label' => Mage::helper('stuntcoders_slideshow')->__('Add images'), 'name' => 'images[]', 'multiple' => 'multiple', 'mulitple' => true));
     $fieldset = $form->addFieldset('stuntcoders_slideshow_options_form', array('legend' => Mage::helper('stuntcoders_slideshow')->__('Slideshow Options')));
     $configData = isset($data['config']) ? json_decode($data['config'], true) : array();
     $data['autoplay'] = isset($configData['autoplay']) && $configData['autoplay'] ? 1 : 0;
     $data['direction'] = isset($configData['vertical']) && $configData['vertical'] ? 1 : 0;
     $data['animation'] = isset($configData['fade']) && $configData['fade'] ? 1 : 0;
     $data['dots'] = isset($configData['dots']) && $configData['dots'] ? 1 : 0;
     $fieldset->addField('autoplay', 'select', array('label' => Mage::helper('stuntcoders_slideshow')->__('Auto play'), 'name' => 'autoplay', 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray()));
     $fieldset->addField('direction', 'select', array('label' => Mage::helper('stuntcoders_slideshow')->__('Slideshow direction'), 'name' => 'direction', 'values' => array(array('value' => 0, 'label' => Mage::helper('adminhtml')->__('Horizontal')), array('value' => 1, 'label' => Mage::helper('adminhtml')->__('Vertical')))));
     $fieldset->addField('animation', 'select', array('label' => Mage::helper('stuntcoders_slideshow')->__('Animation type'), 'name' => 'animation', 'values' => array(array('value' => 0, 'label' => Mage::helper('adminhtml')->__('Slide')), array('value' => 1, 'label' => Mage::helper('adminhtml')->__('Fade')))));
     $fieldset->addField('dots', 'select', array('label' => Mage::helper('stuntcoders_slideshow')->__('Show dots'), 'name' => 'dots', 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray()));
     $fieldset = $form->addFieldset('stuntcoders_slideshow_images_form', array('legend' => Mage::helper('stuntcoders_slideshow')->__('Slideshow Images')));
     $fieldset->addType('stuntcoders_slideshow_image', 'Stuntcoders_Slideshow_Block_Adminhtml_Slideshow_Form_Image');
     if (Mage::registry('stuntcoders_slideshow')) {
         foreach (Mage::registry('stuntcoders_slideshow')->getImagesCollection() as $image) {
             $fieldset->addField("slideshow_image_{$image->getId()}", 'stuntcoders_slideshow_image', array('image' => $image));
         }
     }
     $form->setValues($data);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:stuntcoders,项目名称:stunt_mage_slick_slideshow,代码行数:35,代码来源:Form.php

示例6: _prepareForm

 protected function _prepareForm()
 {
     $model = Mage::registry('sagepaysuite_directrefund');
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('directrefund_');
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('sagepaysuite')->__('Mandatory fields')));
     $fieldset->addField('amount', 'text', array('name' => 'refund[amount]', 'label' => Mage::helper('sagepaysuite')->__('Amount'), 'id' => 'amount', 'title' => Mage::helper('sagepaysuite')->__('Amount'), 'required' => true, 'note' => 'The amount to refund, from 0.01 to 100,000.00.'));
     $fieldset->addField('currency', 'select', array('name' => 'refund[currency]', 'label' => Mage::helper('sagepaysuite')->__('Currency'), 'id' => 'currency', 'title' => Mage::helper('sagepaysuite')->__('Currency'), 'required' => true, 'options' => Mage::helper('sagepaysuite')->currenciesToOptions(), 'note' => 'The currency must be supported by one of your Sage Pay merchant accounts or the transaction will be rejected.'));
     $fieldset->addField('description', 'text', array('name' => 'refund[description]', 'label' => Mage::helper('sagepaysuite')->__('Description'), 'id' => 'description', 'title' => Mage::helper('sagepaysuite')->__('Description'), 'required' => true, 'note' => 'Maximum characters: 100.'));
     $fieldset->addField('vendor', 'text', array('name' => 'refund[vendor]', 'label' => Mage::helper('sagepaysuite')->__('Vendor'), 'id' => 'vendor', 'title' => Mage::helper('sagepaysuite')->__('Sage Pay Vendor'), 'required' => true, 'note' => 'Maximum characters: 15.'));
     $fieldset->addField('mode', 'select', array('name' => 'refund[mode]', 'label' => Mage::helper('sagepaysuite')->__('Mode'), 'id' => 'mode', 'title' => Mage::helper('sagepaysuite')->__('Sage Pay Mode'), 'required' => true, 'options' => Mage::getModel('sagepaysuite/sagepaysuite_source_paymentMode')->toOptions()));
     $fieldset->addField('accounttype', 'hidden', array('name' => 'refund[accounttype]'));
     $fieldsetToken = $form->addFieldset('cc_token_fieldset', array('legend' => Mage::helper('sagepaysuite')->__('Token information')));
     $fieldsetToken->addField('token', 'text', array('name' => 'refund[token]', 'label' => Mage::helper('sagepaysuite')->__('Token Card'), 'id' => 'token', 'title' => Mage::helper('sagepaysuite')->__('Token Card'), 'note' => 'Use either Token Card or enter all Credit Card data below.'));
     $fieldsetCc = $form->addFieldset('cc_fieldset', array('legend' => Mage::helper('sagepaysuite')->__('Credit card information')));
     $fieldsetCc->addField('cardholder', 'text', array('name' => 'refund[cardholder]', 'label' => Mage::helper('sagepaysuite')->__('Card Holder'), 'id' => 'cardholder', 'title' => Mage::helper('sagepaysuite')->__('Card Holder'), 'note' => 'This should be the name displayed on the card'));
     $fieldsetCc->addField('cardtype', 'select', array('name' => 'refund[cardtype]', 'label' => Mage::helper('sagepaysuite')->__('Card Type'), 'id' => 'cardtype', 'title' => Mage::helper('sagepaysuite')->__('Card Type'), 'options' => $this->_getCardTypes()));
     $fieldsetCc->addField('cardnumber', 'text', array('name' => 'refund[cardnumber]', 'label' => Mage::helper('sagepaysuite')->__('Card Number'), 'id' => 'cardnumber', 'title' => Mage::helper('sagepaysuite')->__('Card Number'), 'note' => 'The full card number is required.'));
     $fieldsetCc->addField('expirydate', 'text', array('name' => 'refund[expirydate]', 'label' => Mage::helper('sagepaysuite')->__('Expiry Date'), 'id' => 'expirydate', 'title' => Mage::helper('sagepaysuite')->__('Expiry Date'), 'note' => 'The expiry date MUST be in MMYY format i.e. 1206 for December 2006. No / or – characters should be included..'));
     $fieldsetCc->addField('startdate', 'text', array('name' => 'refund[startdate]', 'label' => Mage::helper('sagepaysuite')->__('Start Date'), 'id' => 'startdate', 'title' => Mage::helper('sagepaysuite')->__('Start Date'), 'note' => 'The start date MUST be in MMYY format i.e. 0699 for June 1999. No / or – characters should be included.'));
     $fieldsetCc->addField('issuenumber', 'text', array('name' => 'refund[issuenumber]', 'label' => Mage::helper('sagepaysuite')->__('Issue Number'), 'id' => 'issuenumber', 'title' => Mage::helper('sagepaysuite')->__('Issue Number'), 'note' => 'The issue number MUST be entered EXACTLY as it appears on the card. e.g. some cards have Issue Number "4", others have "04".'));
     $data = $model->getData();
     $form->setValues($data);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:GaynorH,项目名称:prestigedrinks,代码行数:26,代码来源:Main.php

示例7: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $installment = Mage::registry('current_installment_payment');
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('installment')->__('Original Installment Payment')));
     $fieldset->addField('order_id', 'text', array('name' => 'order_id', 'label' => Mage::helper('installment')->__('Order Id'), 'title' => Mage::helper('installment')->__('Order Id'), 'readonly' => true));
     $fieldset->addField('installment_master_sequence_number', 'text', array('name' => 'sequence_number', 'label' => Mage::helper('installment')->__('Sequence Number'), 'title' => Mage::helper('installment')->__('Sequence Number'), 'readonly' => true));
     $fieldset->addField('installment_master_amount_due', 'text', array('name' => 'amount_due', 'label' => Mage::helper('installment')->__('Amount Due'), 'title' => Mage::helper('installment')->__('Amount Due'), 'required' => true));
     $outputFormat = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
     $fieldset->addField('installment_master_amount_due_date', 'date', array('name' => 'amount_due_date', 'label' => Mage::helper('installment')->__('Amount Due Date'), 'title' => Mage::helper('installment')->__('Amount Due Date'), 'class' => 'validate-date', 'time' => true, 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'input_format' => Varien_Date::DATETIME_INTERNAL_FORMAT, 'format' => $outputFormat, 'required' => true));
     if (!is_null($installment->getId())) {
         // If edit add id
         $form->addField('id', 'hidden', array('name' => 'id', 'value' => $installment->getId()));
     }
     $fieldset = $form->addFieldset('new_installment_fieldset', array('legend' => Mage::helper('installment')->__('New Installment Payment')));
     $fieldset->addField('new_order_id', 'text', array('name' => 'order_id', 'label' => Mage::helper('installment')->__('Order Id'), 'title' => Mage::helper('installment')->__('Order Id'), 'readonly' => true, 'value' => $installment->getOrderId()));
     $fieldset->addField('new_installment_master_amount_due', 'text', array('name' => 'new_amount_due', 'label' => Mage::helper('installment')->__('Amount Due'), 'title' => Mage::helper('installment')->__('Amount Due'), 'required' => true));
     $outputFormat = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
     $fieldset->addField('new_installment_master_amount_due_date', 'date', array('name' => 'new_amount_due_date', 'label' => Mage::helper('installment')->__('Amount Due Date'), 'title' => Mage::helper('installment')->__('Amount Due Date'), 'class' => 'validate-date', 'time' => true, 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'input_format' => Varien_Date::DATETIME_INTERNAL_FORMAT, 'format' => $outputFormat, 'required' => true));
     if (Mage::getSingleton('adminhtml/session')->getInstallmentPaymentData()) {
         $form->addValues(Mage::getSingleton('adminhtml/session')->getInstallmentPaymentData());
         Mage::getSingleton('adminhtml/session')->setInstallmentPaymentData(null);
     } else {
         $form->addValues($installment->getData());
     }
     $form->setUseContainer(true);
     $form->setId('edit_form');
     $form->setAction($this->getUrl('*/*/split'));
     $form->setPost(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:32,代码来源:Form.php

示例8: _prepareForm

 protected function _prepareForm()
 {
     $model = Mage::registry('current_status');
     $labels = $model ? $model->getStoreLabels() : array();
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('sales')->__('Quote Status Information')));
     $fieldset->addField('is_new', 'hidden', array('name' => 'is_new', 'value' => 1));
     $fieldset->addField('status', 'text', array('name' => 'status', 'label' => Mage::helper('request4quote')->__('Status Code'), 'class' => 'required-entry validate-code', 'required' => true));
     $fieldset->addField('label', 'text', array('name' => 'label', 'label' => Mage::helper('request4quote')->__('Status Label'), 'class' => 'required-entry', 'required' => true));
     $checked = is_object($model) ? $model->getAllowviewcheckout() : false;
     $fieldset->addField('allowviewcheckout', 'checkbox', array('name' => 'allowviewcheckout', 'label' => Mage::helper('request4quote')->__('Allow customer to view price and add to cart?'), 'checked' => $checked));
     $fieldset = $form->addFieldset('store_labels_fieldset', array('legend' => Mage::helper('sales')->__('Store View Specific Labels'), 'table_class' => 'form-list stores-tree'));
     $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset');
     $fieldset->setRenderer($renderer);
     foreach (Mage::app()->getWebsites() as $website) {
         $fieldset->addField("w_{$website->getId()}_label", 'note', array('label' => $website->getName(), 'fieldset_html_class' => 'website'));
         foreach ($website->getGroups() as $group) {
             $stores = $group->getStores();
             if (count($stores) == 0) {
                 continue;
             }
             $fieldset->addField("sg_{$group->getId()}_label", 'note', array('label' => $group->getName(), 'fieldset_html_class' => 'store-group'));
             foreach ($stores as $store) {
                 $fieldset->addField("store_label_{$store->getId()}", 'text', array('name' => 'store_labels[' . $store->getId() . ']', 'required' => false, 'label' => $store->getName(), 'value' => isset($labels[$store->getId()]) ? $labels[$store->getId()] : '', 'fieldset_html_class' => 'store'));
             }
         }
     }
     if ($model) {
         $form->addValues($model->getData());
     }
     $form->setAction($this->getUrl('*/quote_status/save'));
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:VinuWebtech,项目名称:production267,代码行数:35,代码来源:Form.php

示例9: _prepareForm

 protected function _prepareForm()
 {
     $rule = Mage::getModel('rewardpoints/rules');
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
     $fieldset = $form->addFieldset('rule_details', array('legend' => Mage::helper('rewardpoints')->__('Rule details')));
     $fieldset->addField('rewardpoints_rule_name', 'text', array('label' => Mage::helper('rewardpoints')->__('Rule Name'), 'class' => 'input-text', 'required' => true, 'name' => 'rewardpoints_rule_name', 'required' => true));
     $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
     $fieldset->addField('rewardpoints_rule_start', 'date', array('name' => 'rewardpoints_rule_start', 'label' => Mage::helper('catalogrule')->__('From Date'), 'title' => Mage::helper('catalogrule')->__('From Date'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT, 'format' => $dateFormatIso, 'required' => true));
     $fieldset->addField('rewardpoints_rule_end', 'date', array('name' => 'rewardpoints_rule_end', 'title' => Mage::helper('rewardpoints')->__('To Date'), 'label' => Mage::helper('rewardpoints')->__('To Date'), 'image' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . '/adminhtml/default/default/images/grid-cal.gif', 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), 'required' => true));
     $fieldset->addField('rewardpoints_rule_type', 'select', array('label' => Mage::helper('rewardpoints')->__('Type of rule'), 'name' => 'rewardpoints_rule_type', 'values' => $rule->targetsToOptionArray(), 'onchange' => 'checkTarget()', 'after_element_html' => '', 'required' => true));
     $fieldset = $form->addFieldset('rule_action', array('legend' => Mage::helper('rewardpoints')->__('Rule condition')));
     $fieldset->addField('rewardpoints_rule_operator', 'select', array('label' => Mage::helper('rewardpoints')->__('Operator'), 'name' => 'rewardpoints_rule_operator', 'values' => $rule->operatorToOptionArray(), 'onchange' => 'changeOperator()', 'after_element_html' => '', 'required' => true));
     $fieldset->addField('rewardpoints_rule_test', 'text', array('label' => Mage::helper('rewardpoints')->__('Test value'), 'class' => 'input-text', 'required' => true, 'name' => 'rewardpoints_rule_test', 'required' => true));
     $fieldset->addField('rewardpoints_rule_points', 'text', array('label' => Mage::helper('rewardpoints')->__('Points to be earned'), 'class' => 'validate-greater-than-zero', 'required' => true, 'name' => 'rewardpoints_rule_points', 'required' => true));
     $fieldset->addField('rewardpoints_rule_extra', 'select', array('label' => Mage::helper('rewardpoints')->__('Overload existing configuration'), 'name' => 'rewardpoints_rule_extra', 'values' => $rule->activatedToOptionArray(), 'after_element_html' => '', 'required' => true));
     if (!Mage::app()->isSingleStoreMode()) {
         $fieldset->addField('website_ids', 'multiselect', array('name' => 'website_ids[]', 'label' => Mage::helper('catalogrule')->__('Websites'), 'title' => Mage::helper('catalogrule')->__('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()));
         //$model->setWebsiteIds(Mage::app()->getStore(true)->getWebsiteId());
     }
     $fieldset->addField('rewardpoints_rule_activated', 'select', array('label' => Mage::helper('rewardpoints')->__('Status'), 'name' => 'rewardpoints_rule_activated', 'values' => $rule->activatedToOptionArray(), 'after_element_html' => '', 'required' => true));
     if (Mage::getSingleton('adminhtml/session')->getRulesData()) {
         $form->setValues(Mage::getSingleton('adminhtml/session')->getRulesData());
         Mage::getSingleton('adminhtml/session')->setRulesData(null);
     } elseif (Mage::registry('pointrules_data')) {
         $form->setValues(Mage::registry('pointrules_data')->getData());
     }
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:32,代码来源:Form.php

示例10: _prepareForm

 protected function _prepareForm()
 {
     //Création du formulaire et assignation au block
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post'));
     //On cree un fieldset auquel on va rajouter tous les champs
     $fieldset = $form->addFieldset('edit_rule_id', array('legend' => $this->__('Customer AutoGroups Rule')));
     $fieldset->addField('name', 'text', array('name' => 'name', 'label' => $this->__('Name'), 'required' => true, 'validate' => 'required-entry'));
     $fieldset->addField('description', 'textarea', array('name' => 'description', 'label' => $this->__('Description'), 'required' => false, 'validate' => 'required-entry'));
     $renderer = Mage::getBlockSingleton('adminhtml/widget_form_renderer_fieldset')->setTemplate('promo/fieldset.phtml')->setNewChildUrl($this->getUrl('*/promo_quote/newConditionHtml/form/rule_conditions_fieldset'));
     $fieldset2 = $form->addFieldset('conditions_fieldset', array('legend' => $this->__('Select Customer Properties')))->setRenderer($renderer);
     if (Mage::registry('autogroup_rule')) {
         $model = Mage::registry('autogroup_rule');
     } else {
         $model = Mage::getModel('hhennes_autogroups/rule');
     }
     $fieldset2->addField('conditions', 'text', array('name' => 'conditions', 'label' => $this->__('Conditions'), 'title' => $this->__('Conditions')))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/conditions'));
     //Récupération des groupes clients @ToDO voir pour utiliser les fonctions magento
     $groups = Mage::helper('hhennes_autogroups')->getGroupList();
     //Groupe de destination
     $fieldset->addField('group_id', 'select', array('name' => 'group_id', 'label' => $this->__('Group'), 'required' => true, 'validate' => 'required-entry', 'options' => $groups));
     $fieldset->addField('active', 'select', array('name' => 'active', 'label' => $this->__('Active'), 'required' => true, 'validate' => 'required-entry', 'options' => array('1' => $this->__('Yes'), '0' => $this->__('No'))));
     $priority = Mage::helper('hhennes_autogroups')->getPrioritiesList();
     $fieldset->addField('priority', 'select', array('name' => 'priority', 'label' => $this->__('priority'), 'required' => true, 'validate' => 'required-entry', 'options' => $priority));
     $fieldset->addField('stop_processing', 'select', array('name' => 'stop_processing', 'label' => $this->__('Stop Processing'), 'required' => true, 'validate' => 'required-entry', 'options' => array('1' => $this->__('Yes'), '0' => $this->__('No'))));
     if (Mage::registry('autogroup_rule')) {
         $form->setValues(Mage::registry('autogroup_rule')->getData());
     }
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:nenes25,项目名称:magento_customerautogroups,代码行数:31,代码来源:Form.php

示例11: _prepareForm

 protected function _prepareForm()
 {
     $model = Mage::registry('global_manage_special_rule');
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('rule_');
     $fieldset = $form->addFieldset('trigger_fieldset', array('legend' => Mage::helper('salesrule')->__('Triggers')));
     $points_conditions_field = $fieldset->addField('points_conditions', 'select', array('label' => Mage::helper('salesrule')->__('Customer Action or Event'), 'name' => 'points_conditions', 'options' => Mage::getSingleton('rewards/special_action')->getOptionsArray(), 'required' => true));
     Mage::getSingleton('rewards/wikihints')->addWikiHint($fieldset, "Customer Behavior Rule - Triggers");
     $fieldset = $form->addFieldset('conditions_fieldset', array('legend' => Mage::helper('salesrule')->__('Conditions')));
     Mage::getSingleton('rewards/wikihints')->addWikiHint($fieldset, "Customer Behavior Rule - Conditions");
     $customerGroups = Mage::getResourceModel('customer/group_collection')->load()->toOptionArray();
     foreach ($customerGroups as $group) {
         if ($group['value'] == 0) {
             //Removes the "Not Logged In" option, becasue its redundant for special rules
             array_shift($customerGroups);
         }
     }
     $fieldset->addField('customer_group_ids', 'multiselect', array('name' => 'customer_group_ids[]', 'label' => Mage::helper('salesrule')->__('Customer Group Is'), 'title' => Mage::helper('salesrule')->__('Customer Group Is'), 'required' => true, 'values' => $customerGroups));
     $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
     $fieldset->addField('from_date', 'date', array('name' => 'from_date', 'label' => Mage::helper('salesrule')->__('Date is on or After'), 'title' => Mage::helper('salesrule')->__('Date is on or After'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT, 'format' => $dateFormatIso));
     $fieldset->addField('to_date', 'date', array('name' => 'to_date', 'label' => Mage::helper('salesrule')->__('Date is Before'), 'title' => Mage::helper('salesrule')->__('Date is Before'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT, 'format' => $dateFormatIso));
     Mage::getSingleton('rewards/special_action')->visitAdminConditions($fieldset);
     $form->setValues($model->getData());
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:26,代码来源:Conditions.php

示例12: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
     $nfRequest = Mage::registry('nfe_data');
     if ($nfRequest->getId()) {
         /**
          * get encripted request
          */
         $request = Zend_Json::decode($nfRequest->getRequest());
         $form->addField('id', 'hidden', array('name' => 'id', 'value' => $nfRequest->getId()));
         /**
          * build form fieldsets
          */
         $fieldsetEmit = $form->addFieldset('nfe_emit', array('legend' => Mage::helper('nfe')->__('Grupo de identificação do emitente da NF-e')));
         $this->getFields($fieldsetEmit, $request['nfe.NFe']['nfe.infNFe']['nfe.emit'], 'nfe.NFe[nfe.infNFe][nfe.emit]');
         $fieldsetDest = $form->addFieldset('nfe_dest', array('legend' => Mage::helper('nfe')->__('Grupo de identificação do destinatário da NF-e')));
         $this->getFields($fieldsetDest, $request['nfe.NFe']['nfe.infNFe']['nfe.dest'], 'nfe.NFe[nfe.infNFe][nfe.dest]');
         if ($request['nfe.NFe']['nfe.infNFe']['nfe.det']) {
             foreach ($request['nfe.NFe']['nfe.infNFe']['nfe.det'] as $key => $items) {
                 $fieldsetDet[$key] = $form->addFieldset('nfe_det' . $key, array('legend' => Mage::helper('nfe')->__('Item -' . $items['@nItem'])));
                 $this->getFields($fieldsetDet[$key], $request['nfe.NFe']['nfe.infNFe']['nfe.det'][$key], 'nfe.NFe[nfe.infNFe][nfe.det][' . $key . ']');
             }
         }
         $fieldsetTotal = $form->addFieldset('nfe_total', array('legend' => Mage::helper('nfe')->__('Grupo de Valores Totais da NF-e')));
         $this->getFields($fieldsetTotal, $request['nfe.NFe']['nfe.infNFe']['nfe.total'], 'nfe.NFe[nfe.infNFe][nfe.total]');
         $fieldsetComp = $form->addFieldset('nfe_complemento', array('legend' => Mage::helper('nfe')->__('Informações Adicionais')));
         $fieldsetComp->addField('nfe.NFe[nfe.infNFe][nfe.infAdic][nfe.infCpl]', 'textarea', array('name' => 'nfe.NFe[nfe.infNFe][nfe.infAdic][nfe.infCpl]', 'value' => $request['nfe.NFe']['nfe.infNFe']['nfe.infAdic']['nfe.infCpl'], 'label' => Mage::helper('nfe')->__('[nfe.infAdic][nfe.infCpl]')));
     }
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:andrebellafronte,项目名称:magento-easy-nfe-module,代码行数:32,代码来源:Form.php

示例13: _prepareForm

 protected function _prepareForm()
 {
     /* @var $model Compta_customer_Model_Customer */
     $model = Mage::registry('current_customer');
     /*
      * Checking if user have permissions to save information
      */
     $isElementDisabled = false;
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('customer_');
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('compta_customer')->__('Information')));
     if ($model->getCustomerId()) {
         $fieldset->addField('customer_id', 'hidden', array('name' => 'customer_id'));
     }
     $fieldset->addField('nom', 'text', array('name' => 'nom', 'label' => Mage::helper('compta_customer')->__('Nom'), 'required' => true, 'disabled' => $isElementDisabled));
     $fieldset->addField('street', 'text', array('name' => 'street', 'label' => Mage::helper('compta_customer')->__('Adresse'), 'required' => true, 'disabled' => $isElementDisabled));
     $fieldset->addField('city', 'text', array('name' => 'city', 'label' => Mage::helper('compta_customer')->__('Ville'), 'required' => true, 'disabled' => $isElementDisabled));
     $fieldset->addField('postcode', 'text', array('name' => 'postcode', 'label' => Mage::helper('compta_customer')->__('Code postal'), 'required' => true, 'disabled' => $isElementDisabled));
     $fieldset->addField('phone', 'text', array('name' => 'phone', 'label' => Mage::helper('compta_customer')->__('Téléphone'), 'required' => true, 'disabled' => $isElementDisabled));
     $fieldset->addField('email', 'text', array('name' => 'email', 'label' => Mage::helper('compta_customer')->__('Email'), 'required' => true, 'disabled' => $isElementDisabled));
     $fieldset = $form->addFieldset('more_fieldset', array('legend' => Mage::helper('compta_customer')->__('Complément')));
     $fieldset->addField('thm', 'text', array('name' => 'thm', 'label' => Mage::helper('compta_customer')->__('Taux horaire HT'), 'required' => false, 'disabled' => $isElementDisabled));
     $fieldset->addField('paiement_delay', 'text', array('name' => 'paiement_delay', 'label' => Mage::helper('compta_customer')->__('Délais de paiement (moyen)'), 'required' => false, 'disabled' => $isElementDisabled));
     $fieldset->addField('color', 'text', array('name' => 'color', 'label' => Mage::helper('compta_customer')->__('Couleur (calendrier)'), 'required' => false, 'disabled' => $isElementDisabled));
     Mage::dispatchEvent('compta_customer_adminhtml_customer_edit_tab_main_prepare_form', array('form' => $form));
     $model->setAuthorId(Mage::getSingleton('admin/session')->getUser()->getUserId());
     $form->setValues($model->getData());
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:nverhoye,项目名称:mage-compta,代码行数:30,代码来源:Main.php

示例14: _prepareForm

 protected function _prepareForm()
 {
     $this->setTemplate('urlrewrite/form.phtml');
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
     $fieldset = $form->addFieldset('add_urlrewrite_form', array('legend' => Mage::helper('adminhtml')->__('General Information')));
     $fieldset->addField('product_id', 'hidden', array('name' => 'product_id'));
     $fieldset->addField('category_id', 'hidden', array('name' => 'category_id'));
     $fieldset->addField('product_name', 'note', array('label' => Mage::helper('adminhtml')->__('Product'), 'text' => 'product_name'));
     $fieldset->addField('category_name', 'note', array('label' => Mage::helper('adminhtml')->__('Category'), 'text' => 'category_name'));
     if (!Mage::app()->isSingleStoreMode()) {
         $fieldset->addField('store_id', 'select', array('label' => $this->__('Store'), 'title' => $this->__('Store'), 'name' => 'store_id', 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()));
     } else {
         $fieldset->addField('store_id', 'select', array('name' => 'store_id', 'label' => $this->__('Store'), 'title' => $this->__('Store'), 'required' => true, 'value' => Mage::app()->getStore(true)->getId(), 'options' => array('' => '', Mage::app()->getStore(true)->getId() => Mage::app()->getStore(true)->getName())));
     }
     $fieldset->addField('id_path', 'text', array('label' => Mage::helper('adminhtml')->__('ID Path'), 'title' => Mage::helper('adminhtml')->__('ID Path'), 'name' => 'id_path', 'required' => true));
     $fieldset->addField('request_path', 'text', array('label' => Mage::helper('adminhtml')->__('Request Path'), 'title' => Mage::helper('adminhtml')->__('Request Path'), 'name' => 'request_path', 'required' => true));
     $fieldset->addField('target_path', 'text', array('label' => Mage::helper('adminhtml')->__('Target Path'), 'title' => Mage::helper('adminhtml')->__('Target Path'), 'name' => 'target_path', 'required' => true));
     $fieldset->addField('options', 'select', array('label' => Mage::helper('adminhtml')->__('Redirect'), 'title' => Mage::helper('adminhtml')->__('Redirect'), 'name' => 'options', 'options' => array('' => Mage::helper('adminhtml')->__('No'), 'R' => Mage::helper('adminhtml')->__('Yes'))));
     $fieldset->addField('description', 'textarea', array('label' => Mage::helper('adminhtml')->__('Description'), 'title' => Mage::helper('adminhtml')->__('Description'), 'name' => 'description', 'cols' => 20, 'rows' => 5, 'wrap' => 'soft'));
     $gridFieldset = $form->addFieldset('add_urlrewrite_grid', array('legend' => Mage::helper('adminhtml')->__('Please select a product')));
     $gridFieldset->addField('products_grid', 'note', array('text' => $this->getLayout()->createBlock('adminhtml/urlrewrite_product_grid')->toHtml(), 'disabled' => true));
     $gridFieldset = $form->addFieldset('add_urlrewrite_category', array('legend' => Mage::helper('adminhtml')->__('Please select a category')));
     $gridFieldset->addField('category_tree', 'note', array('text' => $this->getLayout()->createBlock('adminhtml/urlrewrite_category_tree')->toHtml(), 'disabled' => true));
     $gridFieldset = $form->addFieldset('add_urlrewrite_type', array('legend' => Mage::helper('adminhtml')->__('Please select a type')));
     $gridFieldset->addField('type', 'select', array('label' => Mage::helper('adminhtml')->__('Type'), 'title' => Mage::helper('adminhtml')->__('Type'), 'name' => 'type', 'required' => true, 'options' => array('' => '', Mage_Core_Model_Url_Rewrite::TYPE_CATEGORY => Mage::helper('adminhtml')->__('Category'), Mage_Core_Model_Url_Rewrite::TYPE_PRODUCT => Mage::helper('adminhtml')->__('Product'), Mage_Core_Model_Url_Rewrite::TYPE_CUSTOM => Mage::helper('adminhtml')->__('Custom'))));
     $form->setUseContainer(true);
     $form->setAction($form->getAction() . 'ret/' . $this->getRequest()->getParam('ret'));
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:30,代码来源:Form.php

示例15: _prepareForm

 protected function _prepareForm()
 {
     $model = Mage::registry('current_onsale_rule');
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('rule_');
     $fieldset = $form->addFieldset('category_page_label', array('legend' => Mage::helper('onsale')->__('Category Page Label')));
     $fieldset->addField('category_page_show', 'select', array('name' => 'category_page_show', 'label' => Mage::helper('onsale')->__('Display'), 'title' => Mage::helper('onsale')->__('Display'), 'values' => array(0 => Mage::helper('onsale')->__('No'), 1 => Mage::helper('onsale')->__('Yes'))));
     $renderer = new AW_Onsale_Block_System_Config_Form_Element_Position();
     $values = Mage::getModel('onsale/system_config_source_position')->toOptionArray();
     $fieldset->addField('category_page_position', 'select', array('name' => 'category_page_position', 'label' => Mage::helper('onsale')->__('Position'), 'title' => Mage::helper('onsale')->__('Position'), 'values' => $values, 'value' => isset($values[0]['value']) ? $values[0]['value'] : ''))->setRenderer($renderer);
     $fieldset->addField('category_page_image', 'image', array('name' => 'category_page_image', 'label' => Mage::helper('onsale')->__('Image')));
     $fieldset->addField('category_page_img_path', 'text', array('name' => 'category_page_img_path', 'label' => Mage::helper('onsale')->__('Image Path'), 'after_element_html' => '<p class="note"><span>' . Mage::helper('onsale')->__('/img/image.png or http://domain.com/img/image.png') . '</span></p>'));
     $fieldset->addField('category_page_text', 'text', array('name' => 'category_page_text', 'label' => Mage::helper('onsale')->__('Text'), 'after_element_html' => '<p class="note"><span>' . Mage::helper('onsale')->__('You can use predefined values in this field. Please refer to extension manual.') . '</span></p>'));
     /* product page */
     $fieldset = $form->addFieldset('product_page_label', array('legend' => Mage::helper('onsale')->__('Product Page Label')));
     $fieldset->addField('product_page_show', 'select', array('name' => 'product_page_show', 'label' => Mage::helper('onsale')->__('Display'), 'title' => Mage::helper('onsale')->__('Display'), 'values' => array(0 => Mage::helper('onsale')->__('No'), 1 => Mage::helper('onsale')->__('Yes'))));
     $renderer = new AW_Onsale_Block_System_Config_Form_Element_Position();
     $values = Mage::getModel('onsale/system_config_source_position')->toOptionArray();
     $fieldset->addField('product_page_position', 'select', array('name' => 'product_page_position', 'label' => Mage::helper('onsale')->__('Position'), 'title' => Mage::helper('onsale')->__('Position'), 'values' => $values, 'value' => isset($values[0]['value']) ? $values[0]['value'] : ''))->setRenderer($renderer);
     $fieldset->addField('product_page_image', 'image', array('name' => 'product_page_image', 'label' => Mage::helper('onsale')->__('Image')));
     $fieldset->addField('product_page_img_path', 'text', array('name' => 'product_page_img_path', 'label' => Mage::helper('onsale')->__('Image Path'), 'after_element_html' => '<p class="note"><span>' . Mage::helper('onsale')->__('/img/image.png or http://domain.com/img/image.png') . '</span></p>'));
     $fieldset->addField('product_page_text', 'text', array('name' => 'product_page_text', 'label' => Mage::helper('onsale')->__('Text'), 'after_element_html' => '<p class="note"><span>' . Mage::helper('onsale')->__('You can use predefined values in this field. Please refer to extension manual.') . '</span></p>'));
     $form->setValues($model->getData());
     //$form->setUseContainer(true);
     if ($model->isReadonly()) {
         foreach ($fieldset->getElements() as $element) {
             $element->setReadonly(true, true);
         }
     }
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:32,代码来源:Actions.php


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