Subversion Repositories wimsdev

Rev

Rev 12595 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
12569 bpr 1
!! add glose in a glossary
2
max_glossary=!defof MAX_SHEETS in wimshome/public_html/bases/sys/define.conf
3
title_limit=50
4
desc_limit=25
5
!if $cmd=new or $cmd=resume
6
  glossary=
7
  !for i=1 to $glossarytot
8
    gl=!record $i of wimshome/log/classes/$wims_class/tool/.glossaryindex
9
    !distribute lines $gl into a_,t_
10
    glossarys=!append line $i,$t_ to $glossarys
11
  !next i
12
!endif
13
!if $cmd=reply
14
  !if $pickglossary=$empty
15
    error=no_pick
16
    !exit
17
  !endif
18
  !if $iniparm=$empty
19
    error=no_parm
20
    !exit
21
  !endif
22
  pickglossary=$[floor($pickglossary)]
23
  !if $pickglossary=NaN or $pickglossary<1 or $pickglossary>min($max_glossary,$glossarytot+1)
24
    error=bad_glossary
25
    !exit
26
  !endif
27
  ititle=!singlespace $title
28
  ititle=!char 1 to $title_limit of $ititle
15590 bpr 29
  tmp=!checkallpar $ititle
30
  !if $tmp=no
31
    ititle=!translate internal (){}[] to ------ in $ititle
32
  !endif
12569 bpr 33
  !if $pickglossary=$[$glossarytot+1]
34
    !set iglosstitle=!singlespace $new_glossary
12595 bpr 35
    !set idesc=!singlespace $new_glossarydesc
12569 bpr 36
    !appendfile $gloss_dir/.glossary$pickglossary :$iniparm\
37
$ititle
38
    !appendfile $gloss_dir/.glossaryindex :0\
12595 bpr 39
$iglosstitle\
40
$idesc
12569 bpr 41
  !else
42
  !!!! FIXME mettre dans l'ordre alphabetique des titres. Cela évitera
43
  !!!! de proposer de changer l'ordre !
44
  !!! on peut supposer qu'ils le sont quand on en ajoute un
45
  !!! mais pas quand on modifie
46
    sh=!record $pickglossary of wimshome/log/classes/$wims_class/tool/.glossaryindex
47
    glosscnt=!recordcnt $gloss_dir/.glossary$pickglossary
48
    !if $glosscnt>=$max_glossary
49
      error=too_many_gloss
50
      !exit
51
    !endif
52
    !for i=1 to $glosscnt
53
      e=!record $i of $gloss_dir/.glossary$pickglossary
54
      !distribute lines $e into wdi,win
55
      !if $iniparm=$wdi
56
        test=$pickglossary
57
        error=already_exist
58
        !exit
59
      !endif
60
    !next i
61
    !appendfile $gloss_dir/.glossary$pickglossary :$iniparm\
62
$ititle
63
  !endif
64
 
65
  wims_module_log=class $class: add No$glosscnt to glossary $pickglossary
66
!endif