Subversion Repositories wimsdev

Rev

Rev 12569 | Rev 15590 | 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
29
  !if $pickglossary=$[$glossarytot+1]
30
    !set iglosstitle=!singlespace $new_glossary
12595 bpr 31
    !set idesc=!singlespace $new_glossarydesc
12569 bpr 32
    !appendfile $gloss_dir/.glossary$pickglossary :$iniparm\
33
$ititle
34
    !appendfile $gloss_dir/.glossaryindex :0\
12595 bpr 35
$iglosstitle\
36
$idesc
12569 bpr 37
  !else
38
  !!!! FIXME mettre dans l'ordre alphabetique des titres. Cela évitera
39
  !!!! de proposer de changer l'ordre !
40
  !!! on peut supposer qu'ils le sont quand on en ajoute un
41
  !!! mais pas quand on modifie
42
    sh=!record $pickglossary of wimshome/log/classes/$wims_class/tool/.glossaryindex
43
    glosscnt=!recordcnt $gloss_dir/.glossary$pickglossary
44
    !if $glosscnt>=$max_glossary
45
      error=too_many_gloss
46
      !exit
47
    !endif
48
    !for i=1 to $glosscnt
49
      e=!record $i of $gloss_dir/.glossary$pickglossary
50
      !distribute lines $e into wdi,win
51
      !if $iniparm=$wdi
52
        test=$pickglossary
53
        error=already_exist
54
        !exit
55
      !endif
56
    !next i
57
    !appendfile $gloss_dir/.glossary$pickglossary :$iniparm\
58
$ititle
59
  !endif
60
 
61
  wims_module_log=class $class: add No$glosscnt to glossary $pickglossary
62
!endif