mbox_add.vm

来自「一个简单的blog系统」· VM 代码 · 共 124 行

VM
124
字号
##
##  This program is free software; you can redistribute it and/or modify
##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation; either version 2 of the License, or
##  (at your option) any later version.
##
##  This program is distributed in the hope that it will be useful,
##  but WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##  GNU Library General Public License for more details.
##
##  You should have received a copy of the GNU General Public License
##  along with this program; if not, write to the Free Software
##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
##  add music box
##
###############################################################################
#parse("/html/_sub/_global.vm")
#select_layout("p_music.vm")
#set($page_title="创建音乐盒")
###############################################################################
#if(!$dlog.is_owner($g_site, $g_user))
#invoke("_illegal_access.vm")
#else
#show_error_msg()
<form action="$link.setAction("html/mbox")" method="post" onsubmit="return validateBoxForm(this);">
<input type="hidden" name="__ClientId" value="$dlog.gen_client_id()"/>
<input type="hidden" name="sid" value="$g_site_id"/>
<div class="page_top">
	<div class="pagecontent">
		<div class="pagecontent_left fleft">
			<b>创建音乐盒</b>
		</div>
		<div class="pagecontent_right fright">
			今天是: $date.get("MMMMM d, yyyy  EEEEE")
		</div>        
	</div>
	<div class="spacer_1"></div>
</div>
<div class="page_content">
	<div class="form">
		<div class="form_row">
    		<div class="form_row_title fleft">
				音乐盒名称
    		</div>
    		<div class="form_row_content">
				<input type="text" name="name"/>&nbsp;&nbsp;最多20个字
			</div>
    	</div>
		<div class="spacer_1"></div>
		<div class="form_row">
    		<div class="form_row_title fleft">
				音乐盒描述
    		</div>
    		<div class="form_row_content">
				&nbsp;&nbsp;最多100个字
			</div>
    	</div>
		<div class="spacer_1"></div>
		<div class="form_row">
			<div class="form_row_content">
				<div class="spacer_5"></div>
        		<textarea name="desc" style="width:80%;height:100px"></textarea>
    			<div class="spacer_5"></div>
			</div>
    	</div>
		#if($g_site.musicBoxes.size()>0)
		<div class="spacer_1"></div>
		<div class="form_row">
    		<div class="form_row_title fleft">
				分类位置
    		</div>
    		<div class="form_row_content">
				<select name="id">
                    #foreach($box in $g_site.musicBoxes)
                    <option value="$box.id">${box.name}</option>
                    #end
                </select>
                <select name="direction">
                	<option value="1">之前</option>
                	<option value="2">之后</option>
                </select>
			</div>
    	</div>
		#end
		<div class="spacer_1"></div>
		<div class="form_row">
			<div class="form_row_submit">
				<input type="submit" name="eventSubmit_Create" value="创建音乐盒"/>
                <input type="reset" value="清除"/>
                <input type="button" value="返回上页" onclick="history.go(-1)"/>
			</div>
    	</div>
	</div>
	<div class="spacer_1"></div>
</div>
<div class="page_bottom"></div>
</form>
<script type="text/javascript">
    window.onload = function()
    {
        var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('html')) ;    
        var oFCKeditor = new FCKeditor( 'desc' ) ;
        oFCKeditor.BasePath	= sBasePath ;
        oFCKeditor.Width = 500;
        oFCKeditor.Height = 120;
        oFCKeditor.ToolbarSet = "Basic";
        oFCKeditor.ReplaceTextarea() ;
    }
	
    function validateBoxForm(theForm)
    {
        with(theForm){
            if(is_empty(name.value)){
                alert("MusicBox name is required.");
                name.focus();
                return false;
            }
        }
        return true;
    }
</script>
#end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?