edit.vm
来自「一个简单的blog系统」· VM 代码 · 共 82 行
VM
82 行
##
## 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.
##
## edit a diary
##
###############################################################################
#parse("/wml/_sub/_global.vm")
#set($PAGE_SIZE = 10)
#set($page_title="编辑日记")
#set($log_id = $dlog.param("log_id",-1))
#set($log = $DIARY_tool.diary($g_site, $g_user, $log_id))
#set($catalogs = $DIARY_tool.catalogs($g_site, $g_user, true))
<p>
#if($messages.exist())<b>$messages.getAll()</b>#end
网站:<a href="$dlog.root()/wml/?sid=$g_site_id">$text.html(${g_site.friendlyName})</a> <a href="$dlog.root()/wml/diary/?sid=$g_site_id">$text.diary($g_site)</a><br/>
##显示已上传得附件
#set($files = $DIARY_tool.attachments($g_user, $dlog.dlog_session_id($request)))
#if($files.size()>0)
已上传附件:<br/>==========<br/>
#foreach($file in $files)
${velocityCount}.<a href="$dlog.root()/wml/showimg.vm?sid=$g_site_id&uri=$link.encodeURL(${file.uri})">$dlog.file_name(${file.savePath})</a> <a href="$link.setAction("wml/diary")?sid=$g_site_id&file_id=${file.id}&eventSubmit_DeleteAttachement=${file.id}">删除</a><br/>
#end
#end
<a href="$dlog.root()/wml/diary/upload.vm?sid=$g_site_id"><插入图片></a><br/>
分类:<select name="catalogId">
#foreach($cat in $catalogs)
<option value="${cat.id}">$text.html(${cat.name})</option>
#end
</select><br/>
标题:<input type="text" name="title" value="$text.html($!{log.title})"/><br/>
作者:<input type="text" name="author" value="$text.html($!{log.author})"/><br/>
内容:<input type="text" name="content" value="$text.html($!{log.content})"/><br/>
#set($weathers = ["sunny","ptcloudy","cloudy","showers","rain","storms","snow","flurries","ice","dark"])
天气:<select name="weather">
#foreach($w in $weathers)
<option value="$w">$w</option>
#end
</select>
#if($log.status==5)
<anchor>发布
<go href="$link.setAction("wml/diary")" method="post">
<postfield name="sid" value="$g_site_id"/>
<postfield name="id" value="$log_id" />
<postfield name="log_id" value="$log_id" />
<postfield name="catalogId" value="$(catalogId)"/>
<postfield name="title" value="$(title)"/>
<postfield name="author" value="$(author)"/>
<postfield name="content" value="$(content)"/>
<postfield name="weather" value="$(weather)"/>
<postfield name="__ClientId" value="$dlog.gen_client_id()"/>
<postfield name="eventSubmit_PublishDraft" value="WML"/>
</go>
</anchor>
#end
<anchor>保存
<go href="$link.setAction("wml/diary")" method="post">
<postfield name="sid" value="$g_site_id"/>
<postfield name="id" value="$log_id" />
<postfield name="log_id" value="$log_id" />
<postfield name="catalogId" value="$(catalogId)"/>
<postfield name="title" value="$(title)"/>
<postfield name="author" value="$(author)"/>
<postfield name="content" value="$(content)"/>
<postfield name="weather" value="$(weather)"/>
<postfield name="__ClientId" value="$dlog.gen_client_id()"/>
<postfield name="eventSubmit_UpdateLog" value="WML"/>
</go>
</anchor>
</p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?