English 中文(简体)
Magento Save And Next
原标题:Magento Save And Next

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 );

    }
}
最佳回答

这一功能必须在处理该员额的管理人员中实现。 将“直接”改为下一个项目。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签