2014-12-31 2 views
0

저는 저장소를위한 맞춤 Magento 모듈을 쓰고 있는데, 한 가지 형태로 필드 세트에 이상한 문제가 있습니다. 양식은 탭에 지정되지만 필드 세트는 컨테이너 아래쪽에서 시작하지 않고 시작됩니다. Desired FieldsetMagento Form with Tabs Fieldset Issue

이 모듈은 어떠한 수정없이 젠토 1.9.0.1에 바로 데모 데이터를 개발되고있다 : 나는 것처럼 표시 할 이미지가 Problematic fieldset

를 첨부 참조하시기 바랍니다.

class Koala_Socialmanager_Block_Twitter_DirectTweet_Tweet extends Mage_Adminhtml_Block_Widget_Form_Container { 
public function __construct() 
{ 
    $this->_blockGroup = 'koala_socialmanager'; 
    $this->_controller = 'twitter_directTweet'; 
    $this->_headerText = Mage::helper('koala_socialmanager')->__('Direct Tweets'); 
    parent::__construct(); 
    $this->_updateButton('save', 'label', Mage::helper('adminhtml')->__('Tweet Now!')); 
} 

}

탭 : 왼쪽 열

class Koala_Socialmanager_Adminhtml_TwitterController extends Mage_Adminhtml_Controller_Action { 
public function directTweetAction(){ 
    $this->loadLayout(); 
    $this->_addContent($this->getLayout()->createBlock('koala_socialmanager/twitter_directTweet_tweet','directTweet')) 
     ->_addLeft($this->getLayout()->createBlock('koala_socialmanager/twitter_directTweet_edit_tabs')); 
    $this->renderLayout(); 

폼 컨테이너 첨가 형태 용기 및 탭 : 컨트롤러 : 이하

는 모든 클래스 코드

class Koala_Socialmanager_Block_Twitter_DirectTweet_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs{ 
public function __construct(){ 
    parent::__construct(); 
    $this->setId('tweetTabs'); 
    $this->setDestinationElementId('edit_form'); 
    $this->setTitle(Mage::helper('koala_socialmanager')->__('Twitter')); 
} 
public function _beforeToHtml(){ 
    $this->addTab('form_section_form',array(
     'label' => Mage::helper('koala_socialmanager')->__("Tweet"), 
     'title' => Mage::helper('koala_socialmanager')->__("Tweet"), 
     'content' => $this->getLayout()->createBlock('koala_socialmanager/twitter_directTweet_edit_tabs_form')->initForm()->toHtml(), 
     'active' => true 
    )); 

    $this->addTab('form_section_external_media',array(
     'label' => Mage::helper('koala_socialmanager')->__("External Media"), 
     'title' => Mage::helper('koala_socialmanager')->__("External Media"), 
     'content' => $this->getLayout()->createBlock('koala_socialmanager/twitter_directTweet_edit_tabs_externalMedia')->initForm()->toHtml() 
    )); 
    $this->addTab('form_section_magento_media',array(
     'label' => Mage::helper('koala_socialmanager')->__("Magento Product Media"), 
     'title' => Mage::helper('koala_socialmanager')->__("Magento Product Media"), 
     'content' => $this->getLayout()->createBlock('koala_socialmanager/twitter_directTweet_edit_tabs_magentoProductMedia')->toHtml() 
    )); 
    return parent::_beforeToHtml(); 
} 
FIELDSET와

}

그리고 형태 :

class Koala_Socialmanager_Block_Twitter_DirectTweet_Edit_Tabs_Form extends Mage_Adminhtml_Block_Widget_Form { 
public function __construct() 
{ 
    parent::__construct(); 
} 
public function initForm(){ 
    $form = new Varien_Data_Form(); 
    $this->setForm($form); 
    $form->setHtmlIdPrefix('socialmanager'); 


    $helper = Mage::helper('koala_socialmanager'); 
    $fieldset = $form->addFieldset('base_fieldset', array(
     'legend' => Mage::helper('koala_socialmanager')->__('Tweeter Message') 
    )); 
    $fieldset->addField('statusUpdate', 'textarea', array(
     'name'=>'tweet', 
     'label'=>$helper->__("Tweet this Message:"), 
     'after_element_html'=>'<div class="characterCounter">0</div>' 
    )); 
    Mage::helper('koala_socialmanager')->getTwitterFormScript(); 
    return $this; 

내가 바보 뭔가를 누락 생각합니다. 어떤 도움을 주셔서 감사합니다.

건배 폴

답변

0

나는 여전히하지만 원인을 알 수없는 문제를 해결했습니다. 나는 단순히 클래스 이름을 변경하는 다른 폴더에 모든 것을 다시 작성하고, testAction이라는 컨트롤러에서 또 다른 액션을 만들었습니다. DirectTweet 폴더의 모든 파일은 Message 폴더에 있으며, 무엇을 추측 할 수 있습니까? 내가 DirectTweet 폴더에서 이전 양식을 표시 할 때 testActoin에서 해당 양식을 표시 할 때 작동해야합니다. 즉, fieldset이 손상되었습니다.

항상 magento 캐시를 사용할 수 없도록 설정했는데 모든 tmp, 캐시, 세션 폴더를 지우고 브라우저 캐시를 지우고 해결할 수있는 행운이 없었기 때문에 새로운 "버전"이 왜 작동하는지 궁금합니다. 코스메틱 코드를 ​​변경하지 않고 (빈 줄을 제거하거나 레이블/헤더의 텍스트를 변경).

필자는 지난 20 분 동안 phpstorm에서 파일별로 파일을 비교했으며 클래스 이름과 텍스트를 제외하고는 별다른 차이가 없었습니다 ... 더 이상 생각하지 않으려 고합니다. 원하는 출력 :

새해 폴

enter image description here

을 아래