欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

克隆一個(gè)新項(xiàng)目的快捷方式

 更新時(shí)間:2013年04月10日 09:07:38   作者:  
本文小編為大家介紹,克隆或者說另存為一個(gè)新項(xiàng)目的快捷方式。有需要的朋友可以參考一下

有沒想過最土的項(xiàng)目如何快速復(fù)制出一個(gè)來,然后改改就成新的團(tuán)購項(xiàng)目了?

或者說編輯一個(gè)老項(xiàng)目的時(shí)候想把他另存為一個(gè)新項(xiàng)目而不是保存,

看下圖 紅色部分

zuituclone

具體開發(fā)代碼(非細(xì)節(jié)),如下

修改模板,加入按鈕

include/template/manage_team_edit.html

<input type=”submit” value=”保存為新項(xiàng)目” name=”commit” id=”leader-submit” class=”formbutton” style=”margin:10px 0 0 120px;” onclick=”cloneteam()”/>

加js 處理cloneteam函數(shù)

function cloneteam()
{
document.getElementById(‘-user-form').action=”/manage/team/edit.php?clone=1″;
document.getElementById(‘-user-form').submit();
}

注意 clone=1

另外修改模板加了幾處隱藏的hidden 內(nèi)容,目的是為了復(fù)制老項(xiàng)目中的image image1 image2 字段

<!–{if $team['image']}–><span class=”hint”><input type='hidden' name=”hidden_team_image” value=”{$team['image']}”></span><!–{/if}–>

<!–{if $team['image1']}–><span class=”hint”><input type='hidden' name=”hidden_team_image1″ value=”{$team['image1']}”></span><!–{/if}–>

<!–{if $team['image2']}–><span class=”hint”><input type='hidden' name=”hidden_team_image2″ value=”{$team['image2']}”></span><!–{/if}–>

修改 manage/team/edit.php

原來代碼是這樣的

zuit-clone-team1

現(xiàn)在代碼是這樣的

zuit-clone-team2

相關(guān)文章

最新評論