Mercurial > hgrepos > hgweb.cgi > s4
diff s4-blog.sh @ 587:1e40019d1bb1
Indicate notification mode in submit button
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Fri, 16 Aug 2019 14:01:43 +0900 |
parents | a03bfd5d242a |
children | a50e83239b51 |
line wrap: on
line diff
--- a/s4-blog.sh Fri Aug 16 09:48:19 2019 +0900 +++ b/s4-blog.sh Fri Aug 16 14:01:43 2019 +0900 @@ -27,6 +27,15 @@ # $1=articleid $2=user mode=`getgroupattr $grp regmode` } +blog_getteam() { + # $1=rowid of blog + blogid="${1%%[!A-Z0-9a-z_]*}" + # team cannot get `getvalbyid blog team "$blogid"` because it's not + # defined in blog.def. Yes, it is Illegal USE!! + query "SELECT val FROM blog_s + WHERE id=(SELECT id FROM blog WHERE rowid=$blogid) + AND key='team';" +} blog_notify_reply() ( # $1=blogid $2=ReplyingUser $3=WrittenText $4(optional)=Action blogid="${1%%[!A-Z0-9a-z_]*}" @@ -50,11 +59,8 @@ fi ;; no) emails="" ;; - *) team=`query "SELECT val FROM blog_s - WHERE id=(SELECT id FROM blog WHERE rowid=$blogid) - AND key='team';"` - # team cannot get `getvalbyid blog team "$blogid"` because it's not - # defined in blog.def. Yes, it is Illegal USE!! + *) team=`blog_getteam "$blogid"` + # team cannot get by `getvalbyid blog team "$blogid"` emails=`TEAM=$team collectemail $blogowner` ;; esac ## 2017-0210 Respond to the direct reply mark such as: >#1234 @@ -159,8 +165,10 @@ else # if writable isgrpowner "$user" "$blogowner" && isgrpadmin=true # (*1) fi - case `getvalbyid blog notify "$rowid"` in # "all", "admin" or "no" (or NULL) - admin) notifyto=1 ;; + blog_notify=`getvalbyid blog notify "$rowid"` + blog_team=`blog_getteam "$rowid"` + case "$blog_notify" in # "all", "admin" or "no" (or NULL) + admin) notifyto=adm ;; *) notifyto="" ;; esac case `getvalbyid blog mode "$rowid"` in @@ -221,7 +229,7 @@ echo "クイズモードは本人と管理者の書き込みのみが表示されます。" ;; esac | html p 'class="warn"' - echo '<table class="blog_replies">' + echo '<table class="blog_replies"> <!-- blog:blog_showentry() main table -->' if [ x"$blogtype" = x"クイズ" ]; then if $isgroup; then if ! isgrpowner "$user" "$blogowner"; then @@ -436,6 +444,7 @@ touchhelp="${touchpanel:+<p class=\"help\">$help</p>}" filehelp="《添付の注意》 $file_accept_help" + ntmode="通知モード=$blog_notify${blog_team:+ (team=$blog_team)}" textform='<div class="fold"> <input type="checkbox" id="cmt" checked><label accesskey="c" title="C" for="cmt">コメントする</label><div> @@ -445,7 +454,7 @@ <tr><td>添付ファイル(${filesize_max_MB}以下):"' <input type="file" name="image"'" $file_accept title=\"$filehelp\" multiple></td></tr>"' </table> -<input type="submit" value="送信"> +<input type="submit" value="送信"'" class=\"$blog_notify\" title=\"$ntmode\""'> <input type="reset" value="リセット"></div></div> ' cat<<-EOF