For my company I m working on a custom translation module for Magento. On the form for translating an existing string, I would like to change the behaviour of the "Save And Continue"-button to a "Save And Next"-button. With which I mean that instead of still editing thesame string, you get the next one in line.
我曾试图篡改“拯救继续”所呼吁的联系:
Original:
[save-link] + "/back/edit/"
To:
[save-link] + "/back/edit/id/[id]/"
但没有结果。 我希望有人能够把我置于正确的方向。
ed形法未变:
<?php
class Phpro_Advancedtranslate_Block_Adminhtml_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
public function __construct()
{
parent::__construct();
$this->_objectId = id ;
$this->_blockGroup = advancedtranslate ;
$this->_controller = adminhtml ;
$this->_updateButton( save , label , Mage::helper( advancedtranslate )->__( Save Item ));
$this->_updateButton( delete , label , Mage::helper( advancedtranslate )->__( Delete Item ));
$this->_addButton( saveandcontinue , array(
label => Mage::helper( adminhtml )->__( Save And Next ),
onclick => saveAndContinueEdit() ,
class => save ,
), -100);
$currentId = Mage::getSIngleton( adminhtml/session )->getTranslateId();
$strings = Mage::getModel("advancedtranslate/advancedtranslate")->getCollection();
foreach ($strings as $string) {
$id = $string->getId();
if ($id != $currentId && $id < $nextId) {
$nextId = $id;
}
}
$this->_formScripts[] = "
function toggleEditor() {
if (tinyMCE.getInstanceById( advancedtranslate_content ) == null) {
tinyMCE.execCommand( mceAddControl , false, advancedtranslate_content );
} else {
tinyMCE.execCommand( mceRemoveControl , false, advancedtranslate_content );
}
}
function saveAndContinueEdit(){
editForm.submit($( edit_form ).action+ back/edit/ );
}
";
}
public function getHeaderText()
{
return Mage::helper( advancedtranslate )->__("Edit Item %s ", test );
}
}