Subversion Repositories wimsdev

Rev

Rev 11551 | Rev 12559 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11551 Rev 12498
Line 2... Line 2...
2
 
2
 
3
!if $modreq!=$empty
3
!if $modreq!=$empty
4
modreq=!word 1 of $modreq
4
  modreq=!word 1 of $modreq
5
!if $wims_developer!=$empty
5
  !if $wims_developer!=$empty
6
  !set modreq=!replace internal devel/$wims_developer/ by in $modreq
6
    !set modreq=!replace internal devel/$wims_developer/ by in $modreq
7
!endif
7
  !endif
8
!if / isin $modreq or .. isin $modreq
8
  !if / isin $modreq or .. isin $modreq
9
 modreq=
9
  modreq=
10
!endif
10
!endif
11
mtest=!filelist $devdir/$modreq
11
mtest=!filelist $devdir/$modreq
12
!if $mtest=$empty and ($modreq!=.new or $inddef=$empty)
12
!if $mtest=$empty and ($modreq!=.new or $inddef=$empty)
13
 modreq=
13
  modreq=
14
!endif
14
!endif
15
!if $modreq=$empty
15
!if $modreq=$empty
16
 job=modname
16
  job=modname
17
 !changeto $job.proc
17
  !changeto $job.proc
18
!endif
18
!endif
19
 
19
 
20
!read scripts/getindex $modreq
20
!read scripts/getindex $modreq
21
!if $title=$empty and $inddef=$empty
21
!if $title=$empty and $inddef=$empty
22
 job=modname
22
  job=modname
23
 modreq=
23
  modreq=
24
 !changeto $job.proc
24
  !changeto $job.proc
25
!endif
25
!endif
26
 
26
 
27
mod=$modreq
27
mod=$modreq
28
 
28
 
29
!if $inddef!=$empty
29
!if $inddef!=$empty
30
 inddef=
30
  inddef=
31
 !if $mod=.new
31
  !if $mod=.new
32
  !read scripts/target
32
    !read scripts/target
33
  !if $error!=$empty or $target=$empty
33
    !if $error!=$empty or $target=$empty
34
   job=create
34
      job=create
35
   !distribute item $target1,$t2,$t3,$target4 into o1,o2,o3,o4
35
      !distribute item $target1,$t2,$t3,$target4 into o1,o2,o3,o4
36
   !changeto create.proc
36
      !changeto create.proc
37
  !endif
37
    !endif
38
  mod=$target
38
    mod=$target
39
 !endif
-
 
40
 !for i in title, description, category
-
 
41
  i_$i=!trim $(i_$i)
-
 
42
  !if $(i_$i)=$empty
-
 
43
   error=empty_data
-
 
44
   empty_data=$i
-
 
45
   job=index
-
 
46
   mod=
-
 
47
   !exit
-
 
48
  !endif
39
  !endif
-
 
40
  !for i in title, description, category
-
 
41
    i_$i=!trim $(i_$i)
-
 
42
    !if $(i_$i)=$empty
-
 
43
      error=empty_data
-
 
44
      empty_data=$i
-
 
45
      job=index
-
 
46
      mod=
-
 
47
      !exit
-
 
48
    !endif
49
 !next i
49
 !next i
50
 !if exercise isitemof $i_category or oef isitemof $i_category or\
50
 !if exercise isitemof $i_category or oef isitemof $i_category or\
51
	deductio isitemof $i_category
51
	    deductio isitemof $i_category
52
  !if exercise notitemof $i_category
52
    !if exercise notitemof $i_category
53
   i_category=$i_category, exercise
53
      i_category=$i_category, exercise
-
 
54
    !endif
-
 
55
    !if oef isitemof $i_category or $deductio isitemof $i_category
-
 
56
      default=yes
-
 
57
    !else
-
 
58
      default=no
-
 
59
    !endif
-
 
60
    !bound i_scoring within yes, no default $default
-
 
61
  !else
-
 
62
    i_scoring=no
-
 
63
  !endif
-
 
64
  !if deductio isitemof $i_category
-
 
65
   i_vardef=deduc/var.def
54
  !endif
66
  !endif
55
  !if oef isitemof $i_category or $deductio isitemof $i_category
67
  !if oef isitemof $i_category
56
   default=yes
68
   i_vardef=oef/var.def
57
  !else
69
  !endif
-
 
70
  !if document isitemof $i_category
58
   default=no
71
   i_vardef=docu/var.def
59
  !endif
72
  !endif
60
  !bound i_scoring within yes, no default $default
-
 
61
 !else
-
 
62
  i_scoring=no
-
 
63
 !endif
-
 
64
 !if deductio isitemof $i_category
-
 
65
  i_vardef=deduc/var.def
-
 
66
 !endif
-
 
67
 !if oef isitemof $i_category
-
 
68
  i_vardef=oef/var.def
-
 
69
 !endif
-
 
70
 !if document isitemof $i_category
-
 
71
  i_vardef=docu/var.def
-
 
72
 !endif
-
 
73
 
-
 
74
 c=!char 1 of $i_description
-
 
75
 c=!lower $c
-
 
76
 i_description=!replace char number 1 by $c in $i_description
-
 
77
 c=!char -1 of $i_description
-
 
78
 !if $c!=.
-
 
79
  i_description=$i_description.
-
 
80
 !endif
-
 
81
 !if $i_translation_language!=$empty
-
 
82
   !for l_ in $i_translation_language
-
 
83
     c=!char 1 of $(i_description_$l_)
-
 
84
     c=!lower $c
-
 
85
     i_description_$l_=!replace char number 1 by $c in $(i_description_$l_)
-
 
86
     c=!char -1 of $(i_description_$l_)
-
 
87
     !if $c!=. and $(i_description_$l_)!= $empty
-
 
88
       i_description_$l_=$(i_description_$l_).
-
 
89
     !endif
-
 
90
   !next
-
 
91
 !endif
-
 
92
 
73
 
-
 
74
  c=!char 1 of $i_description
-
 
75
  c=!lower $c
93
 !bound i_language within $langlist default $module_language
76
  i_description=!replace char number 1 by $c in $i_description
-
 
77
  c=!char -1 of $i_description
-
 
78
  !if $c!=.
-
 
79
   i_description=$i_description.
-
 
80
  !endif
94
 i_level=!listintersect $i_level and $levellist
81
  !if $i_translation_language!=$empty
95
 i_level_cnt=!itemcnt $i_level
82
    !for l_ in $i_translation_language
-
 
83
      c=!char 1 of $(i_description_$l_)
-
 
84
      c=!lower $c
-
 
85
      i_description_$l_=!replace char number 1 by $c in $(i_description_$l_)
-
 
86
      c=!char -1 of $(i_description_$l_)
96
 !if $i_level issametext $levellist or $i_level_cnt >= 10
87
      !if $c!=. and $(i_description_$l_)!= $empty
-
 
88
        i_description_$l_=$(i_description_$l_).
97
   !reset i_level
89
      !endif
-
 
90
    !next
98
 !endif
91
 !endif
-
 
92
 
-
 
93
  !bound i_language within $langlist default $module_language
-
 
94
  i_level=!listintersect $i_level and $levellist
-
 
95
  i_level_cnt=!itemcnt $i_level
-
 
96
  !if $i_level issametext $levellist or $i_level_cnt >= 10
-
 
97
    !reset i_level
-
 
98
  !endif
99
 level_def=!replace internal ~ by , in $modreq
99
  level_def=!replace internal ~ by , in $modreq
100
 !default i_level=!listintersect $(level_def[1]) and $levellist
100
  !default i_level=!listintersect $(level_def[1]) and $levellist
101
 i_copyright=$copyright
101
  i_copyright=$copyright
102
 !default i_copyright=$gnu
102
  !default i_copyright=$gnu
103
 i_copyright=!replace internal \COPYING\> by "COPYING"> in $i_copyright
103
  i_copyright=!replace internal \COPYING\> by "COPYING"> in $i_copyright
104
 !if $year notwordof $i_copyright
104
  !if $year notwordof $i_copyright
105
  i_copyright=$i_copyright $year
105
    i_copyright=$i_copyright $year
106
 !endif
106
 !endif
107
 i_require=!listintersect $i_require and $swlist
107
 i_require=!listintersect $i_require and $swlist
108
 !default i_author=$auth_name
108
 !default i_author=$auth_name
109
 i_author=!char 1 to 100 of $i_author
109
 i_author=!char 1 to 100 of $i_author
110
 !if , notin in $i_author
110
 !if , notin in $i_author
111
   author1=!word 1 of $i_author
111
   author1=!word 1 of $i_author
112
   author2=!word 2 to -1 of $i_author
112
   author2=!word 2 to -1 of $i_author
113
   i_author=$author1, $author2
113
   i_author=$author1, $author2
114
!endif
114
!endif
115
 !default i_address=$auth_email
115
!default i_address=$auth_email
116
 i_address=!items2words $i_address
116
i_address=!items2words $i_address
117
 !!i_address=!word 1 of $i_address
117
!!i_address=!word 1 of $i_address
118
 i_address=!words2items $i_address
118
i_address=!words2items $i_address
119
 i_address=!text select ;,$mailchar in $i_address
119
i_address=!text select ;,$mailchar in $i_address
120
 i_translator=!char 1 to 100 of $i_translator
120
i_translator=!char 1 to 100 of $i_translator
121
 i_translator_address=!word 1 of $i_translator_address
121
i_translator_address=!word 1 of $i_translator_address
122
 i_translator_address=!text select $mailchar in $i_translator_address
122
i_translator_address=!text select $mailchar in $i_translator_address
-
 
123
 
-
 
124
!if $i_translation_language!=$empty
-
 
125
  !for l_ in $i_translation_language
-
 
126
    i_translator_$l_=!char 1 to 100 of $(i_translator_$l_)
-
 
127
    i_translator_address_$l_=!word 1 of $(i_translator_address_$l_)
-
 
128
    i_translator_address_$l_=!text select $mailchar in $(i_translator_address_$l_)
-
 
129
  !next
-
 
130
!endif
-
 
131
i_version=!word 1 of $i_version
-
 
132
i_wims_version=!word 1 of $i_wims_version
-
 
133
!default i_version=1.00
-
 
134
!default i_wims_version=$wims_version
-
 
135
 
-
 
136
!for l in $deflist1
-
 
137
  i_$l=$(i_$l)
-
 
138
!next
-
 
139
i_translation_language=!items2words $i_translation_language
-
 
140
###add fields not accessible by the interface for the moment
-
 
141
### will be useful in case of translation in the module itself
-
 
142
i_mod_related=!words2items $i_mod_related
-
 
143
i_mod_related=!text select _.-/,$alnum in $i_mod_related
-
 
144
!default i_mod_related=$mod_related
-
 
145
!if .. isin $i_mod_related
-
 
146
  i_mod_related=
-
 
147
!endif
123
 
148
 
124
 !if $i_translation_language!=$empty
-
 
125
   !for l_ in $i_translation_language
-
 
126
     i_translator_$l_=!char 1 to 100 of $(i_translator_$l_)
-
 
127
     i_translator_address_$l_=!word 1 of $(i_translator_address_$l_)
-
 
128
     i_translator_address_$l_=!text select $mailchar in $(i_translator_address_$l_)
-
 
129
   !next
-
 
130
 !endif
-
 
131
 i_version=!word 1 of $i_version
-
 
132
 i_wims_version=!word 1 of $i_wims_version
-
 
133
 !default i_version=1.00
-
 
134
 !default i_wims_version=$wims_version
-
 
135
 
-
 
136
 !for l in $deflist1
-
 
137
   i_$l=$(i_$l)
-
 
138
 !next
-
 
139
 i_translation_language=!items2words $i_translation_language
-
 
140
 ###add fields not accessible by the interface for the moment
-
 
141
 ### will be useful in case of translation in the module itself
-
 
142
 i_mod_related=!words2items $i_mod_related
-
 
143
 i_mod_related=!text select _.-/,$alnum in $i_mod_related
-
 
144
 !default i_mod_related=$mod_related
-
 
145
 !if .. isin $i_mod_related
-
 
146
   i_mod_related=
-
 
147
 !endif
-
 
148
 
-
 
149
 !default i_data=$data
149
!default i_data=$data
150
 !if .. isin $i_data
150
!if .. isin $i_data
151
  i_data=
151
  i_data=
152
 !endif
152
!endif
153
 ind=# This file is automatically generated by $module_title $module_version.\
153
ind=# This file is automatically generated by $module_title $module_version.\
154
# Do not edit by hand.\
154
# Do not edit by hand.\
155
\
155
\
156
 
156
 
157
!if dialog isitemof $category
157
!if dialog isitemof $category
158
  i_category=exercise,dialog
158
  i_category=exercise,dialog
159
!endif
159
!endif
160
!if scenario isitemof $category
160
!if scenario isitemof $category
161
  i_category=exercise,scenario
161
  i_category=exercise,scenario
162
!endif
162
!endif
163
 cat1=!item 1 of $i_category
163
cat1=!item 1 of $i_category
164
 !if document isin $i_category
164
!if document isin $i_category
165
  i_category=document
165
  i_category=document
166
  cat1=doc
166
  cat1=doc
167
 !endif
167
!endif
168
 
168
 
169
 !for i in $deflist,$deflist1
169
!for i in $deflist,$deflist1
170
  ind=$ind$i=$(i_$i)\
170
  ind=$ind$i=$(i_$i)\
171
 
171
 
172
 !next i
172
!next i
173
 !if $cat1=exercise and , isin $i_category
173
!if $cat1=exercise and , isin $i_category
174
  cat1=!item 2 of $i_category
174
  cat1=!item 2 of $i_category
175
 !endif
175
!endif
176
 !if $cat1=recreation
176
!if $cat1=recreation
177
  cat1=exercise
177
  cat1=exercise
178
 !endif
178
!endif
179
 dest=$devdir/$mod
179
dest=$devdir/$mod
180
 src=modules/template/$cat1.$i_language
180
src=modules/template/$cat1.$i_language
181
 ind=!replace " by \\" in $ind
181
ind=!replace " by \\" in $ind
182
 !sh if [ ! -e "$dest" ]; then\
182
!sh if [ ! -e "$dest" ]; then\
183
   mkdir -p $dest\
183
  mkdir -p $dest\
184
   cp -pR $src/* $dest\
184
  cp -pR $src/* $dest\
185
   if [ "$cat1" = "doc" ]; then\
185
  if [ "$cat1" = "doc" ]; then\
186
    echo '*' >$dest/doc/1/.code\
186
   echo '*' >$dest/doc/1/.code\
187
    cat >$dest/doc/1/.def <<@\
187
   cat >$dest/doc/1/.def <<@\
188
tit=$i_title\
188
tit=$i_title\
189
author=$i_author\
189
author=$i_author\
190
email=$i_address\
190
email=$i_address\
191
copyright=gnu\
191
copyright=gnu\
192
dlang=$i_language\
192
dlang=$i_language\
Line 198... Line 198...
198
  echo "$ind" >$dest/INDEX
198
  echo "$ind" >$dest/INDEX
199
  !if $i_common_images=yes
199
  !if $i_common_images=yes
200
    !sh sed -i.bak 's/common_images=no/common_images=yes/g' $dest/var.proc\
200
    !sh sed -i.bak 's/common_images=no/common_images=yes/g' $dest/var.proc\
201
    sed -i.bak 's/class_importation=yes/class_importation=no/g' $dest/var.proc\
201
    sed -i.bak 's/class_importation=yes/class_importation=no/g' $dest/var.proc\
202
    rm $dest/var.proc.bak
202
    rm $dest/var.proc.bak
203
 !endif
203
  !endif
204
 !read scripts/getindex $mod
204
  !read scripts/getindex $mod
205
 wims_module_log=$mod/INDEX
205
  wims_module_log=$mod/INDEX
206
!endif
206
!endif
207
 
207
 
208
!read files
208
!read files
209
!default useropts1=2
209
!default useropts1=2
210
!default useropts2=1
210
!default useropts2=1