s4

changeset 797:56adb6e5ee68 feature-world

Add world-links to Grps entry of topmenu
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 14 Jun 2020 11:15:45 +0900
parents 8646ec4bd6fc
children 91016ff5edb3
files examples/common/default/html.m4.html s4-funcs.sh s4-world.sh
diffstat 3 files changed, 13 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/examples/common/default/html.m4.html	Sun Jun 14 10:14:12 2020 +0900
     1.2 +++ b/examples/common/default/html.m4.html	Sun Jun 14 11:15:45 2020 +0900
     1.3 @@ -23,8 +23,8 @@
     1.4   <!-- <li><a href="?blog">話題作成</a></li> -->
     1.5   <li><a href="?mems" accesskey="2" title="Shortcut: 2
     1.6  Members">参加者一覧</a></li>
     1.7 - <li><a href="?grps" accesskey="3" title="Shortcut: 3
     1.8 -Groups">グループ一覧</a></li>
     1.9 + <li class="casmenu"><a href="?grps" accesskey="3" title="Shortcut: 3
    1.10 +Groups">グループ一覧</a>ifdef(`_S4WORLDGRPS_',`_S4WORLDGRPS_')</li>
    1.11  ifdef(`_S4WORLDNAME_',`',
    1.12  ` <li><a href="?invite" accesskey="4" title="Shortcut: 4
    1.13  Invite">招待</a></li>')dnl
     2.1 --- a/s4-funcs.sh	Sun Jun 14 10:14:12 2020 +0900
     2.2 +++ b/s4-funcs.sh	Sun Jun 14 11:15:45 2020 +0900
     2.3 @@ -99,9 +99,9 @@
     2.4  if [ -n "$S4WORLDLIST" ]; then
     2.5    . ./s4-world.sh 2>> tmp/debug.out
     2.6    # Variables set in s4-world.sh
     2.7 -  #	$S4WORLDS, $S4WROLDNAME
     2.8 +  #	$S4WORLDS, $S4WROLDNAME, $S4WORLDGRPS
     2.9    # Files created in s4-world.sh
    2.10 -  #	$worldlistfile, $worldoptionfile, $worldnamefile
    2.11 +  #	$worldlistfile, $worldoptionfile, $worldnamefile, $worldgrpfile
    2.12    err S4WORLDS set to $S4WORLDS -----
    2.13  fi
    2.14  
    2.15 @@ -461,7 +461,9 @@
    2.16  _m4() {
    2.17    #S4NAME=f,f,f
    2.18    m4 ${S4NAME:+"-D_S4NAME_=${S4NAME}"} ${S4CSS:+-D_S4CSS_="$S4CSS"} \
    2.19 +     ${S4WORLD:+-D_S4WORLD_="$S4WORLD"} \
    2.20       ${S4WORLDNAME:+-D_S4WORLDNAME_="$S4WORLDNAME"} \
    2.21 +     ${S4WORLDGRPS:+-D_S4WORLDGRPS_="$S4WORLDGRPS"} \
    2.22       ${S4WORLDS:+-D_S4WORLDS_="$S4WORLDS"} "$@"
    2.23  }
    2.24  ismember() {
     3.1 --- a/s4-world.sh	Sun Jun 14 10:14:12 2020 +0900
     3.2 +++ b/s4-world.sh	Sun Jun 14 11:15:45 2020 +0900
     3.3 @@ -5,6 +5,7 @@
     3.4    case "$S4WORLDLIST" in
     3.5      *:*:*)
     3.6        worldlistfile=cache/worldlist
     3.7 +      worldgrpfile=cache/worldgrps
     3.8        worldoptionfile=cache/worldoption
     3.9        worldnamefile=cache/worldname
    3.10        if [ ! -e $worldlistfile -o $worldlistfile -ot s4-config.sh \
    3.11 @@ -13,7 +14,7 @@
    3.12        then
    3.13  	echo S4MASTERURL=$S4MASTERURL >> tmp/debug.out
    3.14  	cat <<-EOF > $worldlistfile
    3.15 -	 ▼<div><table>
    3.16 +	<div><table>
    3.17  	 <tr><th>World List</th></tr>
    3.18  	 <tr><td title="Base World$nl拠点となるWorldです">&rArr;
    3.19  	  <a href="${S4MASTERURL:-$URL}">Base</a></td></tr>
    3.20 @@ -36,14 +37,18 @@
    3.21  	if [ -s "$worldoptionfile" ]; then
    3.22  	  echo "<option value=\"s4-config.sh\">Base</option>" >> $worldoptionfile
    3.23  	  echo "</table>$nl</div>" >> $worldlistfile
    3.24 +	  sed 's/href="\([^>]*\)"/href="\1?grps"/' $worldlistfile \
    3.25 +	      > $worldgrpfile
    3.26  	else
    3.27  	  true > $worldoptionfile; true > $worldlistfile	# Remove contents
    3.28  	  rm -f ${worldnamefile}.*
    3.29  	fi
    3.30        fi
    3.31        if [ -s "$worldlistfile" ]; then
    3.32 -	S4WORLDS=": spaste(\`$worldlistfile')"
    3.33 +	S4WORLDS="▼spaste(\`$worldlistfile')"
    3.34  	S4WORLDNAME=${S4WORLD:+`cat $worldnamefile.$S4WORLD`}
    3.35 +	S4WORLDGRPS="▼spaste(\`$worldgrpfile')"
    3.36 +	err S4WORLDGRPS=$S4WORLDGRPS
    3.37        fi
    3.38        ;;
    3.39    esac