• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mage_Adminhtml_Block_Catalog_Form类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _prepareLayout

 /**
  * Load Wysiwyg on demand and prepare layout
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     if (Mage::helper('catalog')->isModuleEnabled('Mage_Cms') && Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
         $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
     }
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:10,代码来源:Attributes.php


示例2: _prepareLayout

 /**
  * Load Wysiwyg on demand and Prepare layout
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     if (Mage::helper('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Cms')) {
         if (Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Config')->isEnabled()) {
             $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
         }
     }
 }
开发者ID:relue,项目名称:magento2,代码行数:12,代码来源:Attributes.php


示例3: _prepareLayout

 public function _prepareLayout()
 {
     parent::_prepareLayout();
     $form = new Varien_Data_Form();
     $form->setDataObject($this->getCategory());
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => AO::helper('catalog')->__('Custom Design')));
     $this->_setFieldset($this->getCategory()->getDesignAttributes(), $fieldset);
     $form->addValues($this->getCategory()->getData());
     $form->setFieldNameSuffix('general');
     $this->setForm($form);
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:11,代码来源:Catalog_Category_Tab_Design.php


示例4: _prepareForm

 /**
  * Create the form
  *
  * @return Smile_VirtualCategories_Block_Adminhtml_Catalog_Category_Tab_Product
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('virtual_');
     $this->_prepareCategoryTypeSelector($form)->_prepareVirtualRuleFieldset($form)->_prepareLegacyProductSelector($form);
     $form->setFieldNameSuffix('general');
     $form->addValues($this->getCategory()->getData());
     $this->setForm($form);
     $this->setTemplate('smile/virtualcategories/category/product_select_form.phtml');
     return parent::_prepareForm();
 }
开发者ID:manueltoniato,项目名称:smile-magento-elasticsearch,代码行数:16,代码来源:Product.php


示例5: _prepareLayout

 public function _prepareLayout()
 {
     parent::_prepareLayout();
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('_general');
     $form->setDataObject($this->getCategory());
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('catalog')->__('General Information')));
     $this->_setFieldset($this->getCategory()->getAttributes(true), $fieldset);
     if (!$this->getCategory()->getId()) {
         $fieldset->addField('path', 'select', array('name' => 'path', 'label' => Mage::helper('catalog')->__('Parent Category'), 'value' => base64_decode($this->getRequest()->getParam('parent')), 'values' => $this->_getParentCategoryOptions()), 'name');
     }
     $form->addValues($this->getCategory()->getData());
     $form->setFieldNameSuffix('general');
     $this->setForm($form);
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:15,代码来源:General.php


示例6: _prepareForm

 /**
  * Prepare form before rendering HTML
  *
  * @return Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('group_mep');
     $form->setDataObject($this->getCategory());
     $fieldset = $form->addFieldset('fieldset_group_mep', array('legend' => Mage::helper('mep')->__('MEP Mappings'), 'class' => 'fieldset-wide'));
     /* @var $collection Flagbit_MEP_Model_Mysql4_Attribute_Mapping_Collection */
     $collection = Mage::getModel('mep/attribute_mapping')->getCollection()->addFieldToFilter('source_attribute_code', 'category');
     foreach ($collection as $mapping) {
         $fieldset->addField('mapping_' . $mapping->getId(), 'text', array('label' => $mapping->getName(), 'name' => 'mapping_' . $mapping->getId(), 'note' => $this->getHintByType($mapping->getCategoryType()) . ', ' . Mage::helper('mep')->__('Attribute Code: %s', $mapping->getAttributeCode())));
     }
     $form->addValues($this->_getValuesByMappingCollection($collection, $this->getCategory()->getStoreId()));
     $form->setFieldNameSuffix('mep');
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:tschifftner,项目名称:Magento-MEP,代码行数:21,代码来源:Mapping.php


示例7: _prepareLayout

    public function _prepareLayout()
    {
        parent::_prepareLayout();
        $form = new Varien_Data_Form();
        $form->setDataObject($this->getCategory());
        $model = new Varien_Object();
        $attributes = $this->getCategory()->getAttributes();
        /*********** CATEGORY *************/
        $fieldset = $form->addFieldset('category', array('legend' => Mage::helper('seo')->__('SEO of Nested (Child) Categories')));
        $fieldset->addField('category_meta_title_tpl', 'text', array('label' => Mage::helper('seo')->__('Meta Title'), 'name' => 'category_meta_title_tpl', 'value' => $model->getCategoryMetaTitleTpl(), 'note' => ''))->setEntityAttribute($attributes['category_meta_title_tpl']);
        $fieldset->addField('category_meta_description_tpl', 'textarea', array('label' => Mage::helper('seo')->__('Meta Description'), 'name' => 'category_meta_description_tpl', 'value' => $model->getCategoryMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['category_meta_description_tpl']);
        $fieldset->addField('category_meta_keywords_tpl', 'textarea', array('label' => Mage::helper('seo')->__('Meta Keywords'), 'name' => 'category_meta_keywords_tpl', 'value' => $model->getCategoryMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['category_meta_keywords_tpl']);
        $fieldset->addField('category_title_tpl', 'text', array('label' => Mage::helper('seo')->__('H1'), 'name' => 'category_title_tpl', 'value' => $model->getCategoryMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['category_title_tpl']);
        $fieldset->addField('category_description_tpl', 'textarea', array('label' => Mage::helper('seo')->__('SEO description'), 'name' => 'category_description_tpl', 'value' => $model->getCategoryMetaDescriptionTpl(), 'note' => '<b>Template variables</b><br>
[category_name], [category_description], [category_url], [category_parent_name], [category_parent_url], [category_parent_parent_name], [category_page_title], [store_name], [store_url], [store_address], [store_phone], [store_email]'))->setEntityAttribute($attributes['category_description_tpl']);
        /*********** FILTER *************/
        $fieldset = $form->addFieldset('filter', array('legend' => Mage::helper('seo')->__('SEO of Nested (Child) Layered Navigation')));
        $fieldset->addField('filter_meta_title_tpl', 'text', array('label' => Mage::helper('seo')->__('Meta Title'), 'name' => 'filter_meta_title_tpl', 'value' => $model->getFilterMetaTitleTpl(), 'note' => ''))->setEntityAttribute($attributes['filter_meta_title_tpl']);
        $fieldset->addField('filter_meta_description_tpl', 'textarea', array('label' => Mage::helper('seo')->__('Meta Description'), 'name' => 'filter_meta_description_tpl', 'value' => $model->getFilterMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['filter_meta_description_tpl']);
        $fieldset->addField('filter_meta_keywords_tpl', 'textarea', array('label' => Mage::helper('seo')->__('Meta Keywords'), 'name' => 'filter_meta_keywords_tpl', 'value' => $model->getFilterMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['filter_meta_keywords_tpl']);
        $fieldset->addField('filter_title_tpl', 'text', array('label' => Mage::helper('seo')->__('H1'), 'name' => 'filter_title_tpl', 'value' => $model->getFilterMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['filter_title_tpl']);
        $fieldset->addField('filter_description_tpl', 'textarea', array('label' => Mage::helper('seo')->__('SEO description'), 'name' => 'filter_description_tpl', 'value' => $model->getFilterMetaDescriptionTpl(), 'note' => '<b>Template variables</b><br>
[category_name],  [category_description], [category_url], [category_parent_name], [category_parent_url], <br>
[filter_selected_options], [filter_named_selected_options]<br>
[store_name], [store_url], [store_address], [store_phone], [store_email]'))->setEntityAttribute($attributes['filter_description_tpl']);
        /*********** PRODUCT *************/
        $fieldset = $form->addFieldset('product', array('legend' => Mage::helper('seo')->__('SEO of Nested (Child) Products')));
        $fieldset->addField('product_meta_title_tpl', 'text', array('label' => Mage::helper('seo')->__('Meta Title'), 'name' => 'product_meta_title_tpl', 'value' => $model->getProductMetaTitleTpl(), 'note' => ''))->setEntityAttribute($attributes['product_meta_title_tpl']);
        $fieldset->addField('product_meta_description_tpl', 'textarea', array('label' => Mage::helper('seo')->__('Meta Description'), 'name' => 'product_meta_description_tpl', 'value' => $model->getProductMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['product_meta_description_tpl']);
        $fieldset->addField('product_meta_keywords_tpl', 'textarea', array('label' => Mage::helper('seo')->__('Meta Keywords'), 'name' => 'product_meta_keywords_tpl', 'value' => $model->getProductMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['product_meta_keywords_tpl']);
        $fieldset->addField('product_title_tpl', 'text', array('label' => Mage::helper('seo')->__('H1'), 'name' => 'product_title_tpl', 'value' => $model->getProductMetaDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['product_title_tpl']);
        $fieldset->addField('product_short_description_tpl', 'textarea', array('label' => Mage::helper('seo')->__('ShortDescription'), 'name' => 'product_short_description_tpl', 'value' => $model->getProductShortDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['product_short_description_tpl']);
        $fieldset->addField('product_full_description_tpl', 'textarea', array('label' => Mage::helper('seo')->__('Description'), 'name' => 'product_full_description_tpl', 'value' => $model->getProductFullDescriptionTpl(), 'note' => ''))->setEntityAttribute($attributes['product_full_description_tpl']);
        $fieldset->addField('product_description_tpl', 'textarea', array('label' => Mage::helper('seo')->__('SEO description'), 'name' => 'product_description_tpl', 'value' => $model->getProductMetaDescriptionTpl(), 'note' => '<b>Template variables</b><br>
[product_&lt;product field or attribute&gt;] (e.g. [product_name], [product_price], [product_color]) <br>
[category_name], [category_description], [category_url], [category_parent_name], [category_parent_url], <br>
[store_name], [store_url], [store_address], [store_phone], [store_email]'))->setEntityAttribute($attributes['product_description_tpl']);
        $form->addValues($this->getCategory()->getData());
        $form->setFieldNameSuffix('general');
        $this->setForm($form);
    }
开发者ID:technomagegithub,项目名称:olgo.nl,代码行数:41,代码来源:Seo.php


示例8: _prepareLayout

 public function _prepareLayout()
 {
     parent::_prepareLayout();
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('_general');
     $form->setDataObject($this->getCategory());
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('catalog')->__('General Information')));
     if (!$this->getCategory()->getId()) {
         //            $fieldset->addField('path', 'select', array(
         //                'name'  => 'path',
         //                'label' => Mage::helper('catalog')->__('Parent Category'),
         //                'value' => base64_decode($this->getRequest()->getParam('parent')),
         //                'values'=> $this->_getParentCategoryOptions(),
         //                //'required' => true,
         //                //'class' => 'required-entry'
         //                ),
         //                'name'
         //            );
         if ($this->getRequest()->getParam('parent')) {
             $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => $this->getRequest()->getParam('parent')));
         } else {
             $storeId = (int) $this->getRequest()->getParam('store');
             $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => 1));
         }
     } else {
         $fieldset->addField('id', 'hidden', array('name' => 'id', 'value' => $this->getCategory()->getId()));
         $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => $this->getCategory()->getPath()));
     }
     $this->_setFieldset($this->getCategory()->getAttributes(true), $fieldset);
     if ($this->getCategory()->getId()) {
         if ($this->getCategory()->getLevel() == 1) {
             $fieldset->removeField('url_key');
             $fieldset->addField('url_key', 'hidden', array('name' => 'url_key', 'value' => $this->getCategory()->getUrlKey()));
         }
     }
     $form->addValues($this->getCategory()->getData());
     $form->setFieldNameSuffix('general');
     $this->setForm($form);
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:39,代码来源:General.php


示例9: _toHtml

 protected function _toHtml()
 {
     parent::_toHtml();
     return $this->getForm()->getElement('group_fields')->getChildrenHtml();
 }
开发者ID:hirentricore,项目名称:devmagento,代码行数:5,代码来源:Attributes.php


示例10: _prepareForm

 /**
  * Prepare form before rendering HTML
  *
  * @return Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes
  */
 protected function _prepareForm()
 {
     $group = $this->getGroup();
     $attributes = $this->getAttributes();
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('group_' . $group->getId());
     $form->setDataObject($this->getCategory());
     $fieldset = $form->addFieldset('fieldset_group_' . $group->getId(), array('legend' => Mage::helper('catalog')->__($group->getAttributeGroupName()), 'class' => 'fieldset-wide'));
     if ($this->getAddHiddenFields()) {
         if (!$this->getCategory()->getId()) {
             // path
             if ($this->getRequest()->getParam('parent')) {
                 $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => $this->getRequest()->getParam('parent')));
             } else {
                 $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => 1));
             }
         } else {
             $fieldset->addField('id', 'hidden', array('name' => 'id', 'value' => $this->getCategory()->getId()));
             $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => $this->getCategory()->getPath()));
         }
     }
     $this->_setFieldset($attributes, $fieldset);
     foreach ($attributes as $attribute) {
         /* @var $attribute Mage_Eav_Model_Entity_Attribute */
         if ($attribute->getAttributeCode() == 'url_key') {
             if ($this->getCategory()->getLevel() == 1) {
                 $fieldset->removeField('url_key');
                 $fieldset->addField('url_key', 'hidden', array('name' => 'url_key', 'value' => $this->getCategory()->getUrlKey()));
             }
         }
     }
     if ($this->getCategory()->hasLockedAttributes()) {
         foreach ($this->getCategory()->getLockedAttributes() as $attribute) {
             if ($element = $form->getElement($attribute)) {
                 $element->setReadonly(true, true);
             }
         }
     }
     $form->addValues($this->getCategory()->getData());
     $form->setFieldNameSuffix('general');
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:48,代码来源:Attributes.php


示例11: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $fieldset = $form->addFieldset('googleoptimizer_fields', array('legend' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Google Optimizer Scripts')));
     if ($this->getProduct()->getStoreId() == '0') {
         Mage::helper('Mage_GoogleOptimizer_Helper_Data')->setStoreId(Mage::app()->getDefaultStoreView());
     } else {
         Mage::helper('Mage_GoogleOptimizer_Helper_Data')->setStoreId($this->getProduct()->getStoreId());
     }
     $disabledScriptsFields = false;
     $values = array();
     if ($this->getGoogleOptimizer() && $this->getGoogleOptimizer()->getData()) {
         $disabledScriptsFields = true;
         $values = $this->getGoogleOptimizer()->getData();
         $checkedUseDefault = true;
         if ($this->getGoogleOptimizer()->getStoreId() == $this->getProduct()->getStoreId()) {
             $checkedUseDefault = false;
             $disabledScriptsFields = false;
             $fieldset->addField('code_id', 'hidden', array('name' => 'code_id'));
         }
         // show 'use default' checkbox if store different for default and product has scripts for default store
         if ($this->getProduct()->getStoreId() != '0') {
             $fieldset->addField('store_flag', 'checkbox', array('name' => 'store_flag', 'value' => '1', 'label' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Use Default Values'), 'class' => 'checkbox', 'required' => false, 'onchange' => 'googleOptimizerScopeAction()'))->setIsChecked($checkedUseDefault);
         }
     }
     $fieldset->addField('conversion_page', 'select', array('name' => 'conversion_page', 'label' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Conversion Page'), 'values' => Mage::getModel('Mage_GoogleOptimizer_Model_Adminhtml_System_Config_Source_Googleoptimizer_Conversionpages')->toOptionArray(), 'class' => 'select googleoptimizer validate-googleoptimizer', 'required' => false, 'onchange' => 'googleOptimizerConversionPageAction(this)'));
     if ($this->getProduct()->getStoreId() == '0' && !Mage::app()->hasSingleStore()) {
         $fieldset->addField('conversion_page_url', 'note', array('name' => 'conversion_page_url', 'label' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Conversion Page URL'), 'text' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Please select store view to see the URL.')));
     } else {
         $fieldset->addField('conversion_page_url', 'text', array('name' => 'conversion_page_url', 'label' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Conversion Page URL'), 'class' => 'input-text', 'readonly' => 'readonly', 'required' => false, 'note' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Please copy and paste this value to experiment edit form.')));
     }
     $fieldset->addField('export_controls', 'text', array('name' => 'export_controls'));
     $fieldset->addField('control_script', 'textarea', array('name' => 'control_script', 'label' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Control Script'), 'class' => 'textarea googleoptimizer validate-googleoptimizer', 'required' => false));
     $fieldset->addField('tracking_script', 'textarea', array('name' => 'tracking_script', 'label' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Tracking Script'), 'class' => 'textarea googleoptimizer validate-googleoptimizer', 'required' => false));
     $fieldset->addField('conversion_script', 'textarea', array('name' => 'conversion_script', 'label' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Conversion Script'), 'class' => 'textarea googleoptimizer validate-googleoptimizer', 'required' => false));
     $attributes = Mage::helper('Mage_GoogleOptimizer_Helper_Data')->getProductAttributes($this->getProduct());
     $fieldset->addField('attributes', 'multiselect', array('name' => 'attributes', 'label' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('Attributes'), 'class' => 'googleoptimizer validate-googleoptimizer validate-googleoptimizer-attributes', 'values' => $attributes, 'required' => false, 'onchange' => 'googleOptimizerAttributesCheckAction(this)', 'note' => Mage::helper('Mage_GoogleOptimizer_Helper_Data')->__('The limit is 8 attributes only.')));
     if (Mage::helper('Mage_GoogleOptimizer_Helper_Data')->getConversionPagesUrl() && $this->getGoogleOptimizer() && $this->getGoogleOptimizer()->getConversionPage()) {
         $form->getElement('conversion_page_url')->setValue(Mage::helper('Mage_GoogleOptimizer_Helper_Data')->getConversionPagesUrl()->getData($this->getGoogleOptimizer()->getConversionPage()));
     }
     if ($disabledScriptsFields) {
         foreach ($fieldset->getElements() as $element) {
             if ($element->getType() == 'textarea' || $element->getType() == 'select') {
                 $element->setDisabled($disabledScriptsFields);
             }
         }
         $form->getElement('export_controls')->setDisabled($disabledScriptsFields);
     }
     $fakeEntityAttribute = Mage::getModel('Mage_Catalog_Model_Resource_Eav_Attribute');
     foreach ($fieldset->getElements() as $element) {
         if ($element->getId() != 'store_flag') {
             $element->setEntityAttribute($fakeEntityAttribute);
         }
     }
     $form->getElement('export_controls')->setRenderer($this->getLayout()->createBlock('Mage_GoogleOptimizer_Block_Adminhtml_Catalog_Form_Renderer_Import'));
     $form->addValues($values);
     $form->setFieldNameSuffix('googleoptimizer');
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:natxetee,项目名称:magento2,代码行数:60,代码来源:Googleoptimizer.php


示例12: _construct

 protected function _construct()
 {
     parent::_construct();
     $this->setShowGlobalIcon(true);
 }
开发者ID:par-orillonsoft,项目名称:app,代码行数:5,代码来源:Attributes.php


示例13: _toHtml

 /**
  * Render block HTML
  *
  * @return string
  */
 protected function _toHtml()
 {
     $accordion = $this->getLayout()->createBlock('adminhtml/widget_accordion')->setId('packageInfo');
     $accordion->addItem('samples', array('title' => Mage::helper('adminhtml')->__('Samples'), 'content' => $this->getLayout()->createBlock('package/adminhtml_catalog_product_edit_tab_package_samples')->toHtml(), 'open' => true));
     $accordion->addItem('links', array('title' => Mage::helper('adminhtml')->__('Links'), 'content' => $this->getLayout()->createBlock('package/adminhtml_catalog_product_edit_tab_package_links')->toHtml(), 'open' => true));
     $this->setChild('accordion', $accordion);
     return parent::_toHtml();
 }
开发者ID:BGCX067,项目名称:faett-package-svn-to-git,代码行数:13,代码来源:Package.php


示例14: _prepareLayout

 public function _prepareLayout()
 {
     $form = new Varien_Data_Form();
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('googleoptimizer')->__('Google Optimizer Scripts')));
     if ($this->getCategory()->getStoreId() == '0') {
         Mage::helper('googleoptimizer')->setStoreId(Mage::app()->getDefaultStoreView());
     } else {
         Mage::helper('googleoptimizer')->setStoreId($this->getCategory()->getStoreId());
     }
     $disabledScriptsFields = false;
     $values = array();
     if ($this->getGoogleOptimizer() && $this->getGoogleOptimizer()->getData()) {
         $disabledScriptsFields = true;
         $values = $this->getGoogleOptimizer()->getData();
         $checkedUseDefault = true;
         if ($this->getGoogleOptimizer()->getStoreId() == $this->getCategory()->getStoreId()) {
             $checkedUseDefault = false;
             $disabledScriptsFields = false;
             $fieldset->addField('code_id', 'hidden', array('name' => 'code_id'));
         }
         // show 'use default' checkbox if store different for default and product has scripts for default store
         if ($this->getCategory()->getStoreId() != '0') {
             $fieldset->addField('store_flag', 'checkbox', array('name' => 'store_flag', 'value' => '1', 'label' => Mage::helper('googleoptimizer')->__('Use Default'), 'class' => 'checkbox', 'required' => false, 'onchange' => 'googleOptimizerScopeAction()'))->setIsChecked($checkedUseDefault);
         }
     }
     $fieldset->addField('conversion_page', 'select', array('name' => 'conversion_page', 'label' => Mage::helper('googleoptimizer')->__('Conversion Page'), 'values' => Mage::getModel('googleoptimizer/adminhtml_system_config_source_googleoptimizer_conversionpages')->toOptionArray(), 'class' => 'select googleoptimizer validate-googleoptimizer', 'required' => false, 'onchange' => 'googleOptimizerConversionPageAction(this)'));
     //Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL)
     if ($this->getCategory()->getStoreId() == '0' && !Mage::app()->isSingleStoreMode()) {
         $fieldset->addField('conversion_page_url', 'note', array('name' => 'conversion_page_url', 'label' => Mage::helper('googleoptimizer')->__('Conversion Page URL'), 'text' => Mage::helper('googleoptimizer')->__('Please select store view to see the URL')));
     } else {
         $fieldset->addField('conversion_page_url', 'text', array('name' => 'conversion_page_url', 'label' => Mage::helper('googleoptimizer')->__('Conversion Page URL'), 'class' => 'input-text', 'readonly' => 'readonly', 'required' => false, 'note' => Mage::helper('googleoptimizer')->__('Please copy and paste this value to experiment edit form')));
     }
     $fieldset->addField('export_controls', 'text', array('name' => 'export_controls'));
     $fieldset->addField('control_script', 'textarea', array('name' => 'control_script', 'label' => Mage::helper('googleoptimizer')->__('Control Script'), 'class' => 'textarea googleoptimizer validate-googleoptimizer', 'required' => false));
     $fieldset->addField('tracking_script', 'textarea', array('name' => 'tracking_script', 'label' => Mage::helper('googleoptimizer')->__('Tracking Script'), 'class' => 'textarea googleoptimizer validate-googleoptimizer', 'required' => false));
     $fieldset->addField('conversion_script', 'textarea', array('name' => 'conversion_script', 'label' => Mage::helper('googleoptimizer')->__('Conversion Script'), 'class' => 'textarea googleoptimizer validate-googleoptimizer', 'required' => false));
     if (Mage::helper('googleoptimizer')->getConversionPagesUrl() && $this->getGoogleOptimizer() && $this->getGoogleOptimizer()->getConversionPage()) {
         $form->getElement('conversion_page_url')->setValue(Mage::helper('googleoptimizer')->getConversionPagesUrl()->getData($this->getGoogleOptimizer()->getConversionPage()));
     }
     if ($disabledScriptsFields) {
         foreach ($fieldset->getElements() as $element) {
             if ($element->getType() == 'textarea' || $element->getType() == 'select') {
                 $element->setDisabled($disabledScriptsFields);
             }
         }
     }
     $fakeEntityAttribute = Mage::getModel('catalog/resource_eav_attribute');
     $readonly = $this->getCategory()->getOptimizationReadonly();
     foreach ($fieldset->getElements() as $element) {
         $element->setDisabled($readonly);
         if ($element->getId() != 'store_flag') {
             $element->setEntityAttribute($fakeEntityAttribute);
         }
     }
     $form->getElement('export_controls')->setRenderer($this->getLayout()->createBlock('adminhtml/catalog_form_renderer_googleoptimizer_import'));
     $form->addValues($values);
     $form->setFieldNameSuffix('googleoptimizer');
     $this->setForm($form);
     return parent::_prepareLayout();
 }
开发者ID:Airmal,项目名称:Magento-Em,代码行数:60,代码来源:Googleoptimizer.php


示例15: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setShowGlobalIcon(true);
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:5,代码来源:Attributes.php


示例16: _prepareForm

 /**
  * Prepare form before rendering HTML
  *
  * @return Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes
  */
 protected function _prepareForm()
 {
     $group = $this->getGroup();
     $attributes = $this->getAttributes();
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('group_' . $group->getId());
     $form->setDataObject($this->getCategory());
     $fieldset = $form->addFieldset('fieldset_group_' . $group->getId(), array('legend' => Mage::helper('catalog')->__($group->getAttributeGroupName()), 'class' => 'fieldset-wide'));
     if ($this->getAddHiddenFields()) {
         if (!$this->getCategory()->getId()) {
             // path
             if ($this->getRequest()->getParam('parent')) {
                 $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => $this->getRequest()->getParam('parent')));
             } else {
                 $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => 1));
             }
         } else {
             $fieldset->addField('id', 'hidden', array('name' => 'id', 'value' => $this->getCategory()->getId()));
             $fieldset->addField('path', 'hidden', array('name' => 'path', 'value' => $this->getCategory()->getPath()));
         }
     }
     $this->_setFieldset($attributes, $fieldset);
     foreach ($attributes as $attribute) {
         $rootId = Mage_Catalog_Model_Category::TREE_ROOT_ID;
         /* @var $attribute Mage_Eav_Model_Entity_Attribute */
         if ($attribute->getAttributeCode() == 'url_key') {
             if (!$this->getCategory()->getId() && $this->getRequest()->getParam('parent', $rootId) == $rootId || $this->getCategory()->getParentId() == $rootId) {
                 $fieldset->removeField('url_key');
             } else {
                 $form->getElement('url_key')->setRenderer($this->getLayout()->createBlock('adminhtml/catalog_form_renderer_attribute_urlkey'));
             }
         }
     }
     if ($this->getCategory()->getLevel() == 1) {
         $fieldset->removeField('custom_use_parent_settings');
     } else {
         if ($this->getCategory()->getCustomUseParentSettings()) {
             foreach ($this->getCategory()->getDesignAttributes() as $attribute) {
                 if ($element = $form->getElement($attribute->getAttributeCode())) {
                     $element->setDisabled(true);
                 }
             }
         }
         if ($element = $form->getElement('custom_use_parent_settings')) {
             $element->setData('onchange', 'onCustomUseParentChanged(this)');
         }
     }
     if ($this->getCategory()->hasLockedAttributes()) {
         foreach ($this->getCategory()->getLockedAttributes() as $attribute) {
             if ($element = $form->getElement($attribute)) {
                 $element->setReadonly(true, true);
             }
         }
     }
     if (!$this->getCategory()->getId()) {
         $this->getCategory()->setIncludeInMenu(1);
     }
     $form->addValues($this->getCategory()->getData());
     Mage::dispatchEvent('adminhtml_catalog_category_edit_prepare_form', array('form' => $form));
     $form->setFieldNameSuffix('general');
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:68,代码来源:Attributes.php


示例17: _construct

 /**
  * Instantiate a recurring payment subscription to use it as a helper
  */
 protected function _construct()
 {
     $this->_subscription = Mage::getSingleton('customweb_subscription/subscription');
     return parent::_construct();
 }
开发者ID:xiaoguizhidao,项目名称:extensiongsd,代码行数:8,代码来源:Form.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap