Rev 7867 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5181 | guerimand | 1 | !read adm/language lang/names.phtml |
23 | reyssat | 2 | wims_prefix=class user tmp |
3 | !if robot isin $session |
||
4 | !exit |
||
5 | !endif |
||
49 | bpr | 6 | !sh cd $wims_home/$wims_sesdir ; mkdir -p latex2wims |
7 | !sh mkdir -p $wims_home/$wims_sesdir/getfile/ ; cp modules/$module/latex2wimsdoc.pdf $wims_home/$wims_sesdir/getfile/ |
||
8 | |||
9 | |||
23 | reyssat | 10 | !if $wims_developer!=$empty |
11 | !goto debut |
||
12 | !endif |
||
13 | !read auth |
||
14 | !if $wims_developer=$empty |
||
15 | !exit |
||
16 | !endif |
||
17 | |||
18 | :debut |
||
10176 | bpr | 19 | !set wims_ariane_self=no |
20 | |||
21 | !default execut=0 |
||
23 | reyssat | 22 | !if / isin $wims_deposit or .. isin $wims_deposit |
23 | !exit |
||
24 | !endif |
||
7867 | bpr | 25 | !sh cp modules/$module/fichier_test.tex $wims_home/$wims_sesdir/getfile/ ; \ |
26 | cp modules/$module/style.css $wims_home/$wims_sesdir/getfile/ ;\ |
||
27 | cp modules/$module/wims.sty $wims_home/$wims_sesdir/getfile/ |
||
7269 | bpr | 28 | |
23 | reyssat | 29 | !if $wims_deposit!=noname.file and $wims_deposit!=$empty |
30 | !sh cd $wims_home/$wims_sesdir\ |
||
31 | mkdir -p latex2wims\ |
||
32 | mkdir -p getfile\ |
||
33 | mv user-deposit latex2wims/$wims_deposit |
||
34 | !endif |
||
35 | |||
36 | !ifval $exemple=1 |
||
7867 | bpr | 37 | !sh cp modules/$module/fichier_test.tex $wims_home/$wims_sesdir/latex2wims/ ; \ |
38 | cp modules/$module/style.css $wims_home/$wims_sesdir/latex2wims/ ;\ |
||
39 | cp modules/$module/wims.sty $wims_home/$wims_sesdir/latex2wims/ |
||
23 | reyssat | 40 | !!!reset exemple |
41 | !endif |
||
42 | |||
43 | # Enregistrer |
||
44 | wims_module_log=$httpd_REMOTE_ADDR depose $wims_deposit |
||
45 | |||
46 | # Quels sont les fichiers existants ? |
||
47 | test=!sh cd $wims_home; find $wims_sesdir/latex2wims -type f |
||
48 | fichiers=!replace internal / by , in $test |
||
49 | fichiers=!column -1 of $fichiers |
||
50 | |||
51 | Fichiers=!replace internal , by $ $ in $fichiers |
||
52 | cnt_fichier=!itemcnt $fichiers |
||
7269 | bpr | 53 | !if $cnt_fichier >0 |
54 | date=!sh cd $wims_home/$wims_sesdir/latex2wims; ls -al $Fichiers | awk '{ print $$6 " " $$7 " " $$8 }' |
||
55 | date=!trim $date |
||
23 | reyssat | 56 | date= !lines2items $date |
7269 | bpr | 57 | !endif |
23 | reyssat | 58 | |
59 | !if $cnt_fichier=1 |
||
60 | principal=1 |
||
61 | !endif |
||
62 | |||
63 | |||
64 | !if $execut=2 and $cnt_fichier=0 |
||
65 | error=$error fichier |
||
66 | execut=1 |
||
7269 | bpr | 67 | !endif |
23 | reyssat | 68 | |
69 | !if $execut=2 and $principal=$empty |
||
70 | error = $error principal |
||
71 | execut=1 |
||
72 | !endif |
||
73 | !if $execut=2 and ($document=$empty or $document=$choix) |
||
74 | error = $error document |
||
75 | execut=1 |
||
76 | !endif |
||
77 | |||
78 | !if $error!=$empty |
||
79 | !exit |
||
80 | !endif |
||
10176 | bpr | 81 | |
23 | reyssat | 82 | Document dans le compte Modtool |
83 | |||
84 | !if $wims_developer!=$empty |
||
85 | list_mod=!sh ls $wims_home/public_html/modules/devel/$wims_developer |
||
86 | list_mod=!words2items $list_mod |
||
87 | list_module= |
||
88 | !for a in $list_mod |
||
89 | category = !module category devel/$wims_developer/$a |
||
90 | !if document isin $category |
||
91 | list_module=!append item $a to $list_module |
||
92 | !endif |
||
93 | !next |
||
94 | !if $list_module=$empty |
||
95 | error = $error documentempty |
||
96 | !endif |
||
97 | !endif |
||
98 | !if $principal!=$empty and ($execut=2 or $execut=3) and $document!=$empty and $document!=$choix |
||
7269 | bpr | 99 | !default subdoc=1 |
23 | reyssat | 100 | execut=3 |
7269 | bpr | 101 | !if $confirm=0 |
23 | reyssat | 102 | auth_name1=!word 2 of $auth_name |
103 | fichier_p=!item $principal of $fichiers |
||
104 | !!!mexec dos2unix $fichier_p |
||
49 | bpr | 105 | docdir=$wims_home/public_html/modules/devel/$wims_developer/$document |
7269 | bpr | 106 | docdirw=wimshome/public_html/modules/devel/$wims_developer/$document |
107 | ###common_files ? |
||
108 | !read $docdir/.def |
||
109 | !if $common_files=yes |
||
110 | docfile=doc/files |
||
111 | !else |
||
112 | docfile=doc/$subdoc/files |
||
113 | !endif |
||
114 | !sh rm -r $docdir/doc/$subdoc/* ; mkdir -p $docdir/doc/$subdoc/src; mkdir -p $docdir/doc/srctex |
||
7867 | bpr | 115 | !! inutile de passer par le repertoire provisoire - latex2wims envoyait directement des ficiers dans |
7269 | bpr | 116 | |
23 | reyssat | 117 | dir=$wims_home/$wims_sesdir/latex2wims/ |
7269 | bpr | 118 | !!!forget about that by using just src2def : --author=$auth_name1 --email=$auth_email --verbose=1 |
119 | !!!mexec latex2wims.pl --subdir=$subdoc --dir=$dir --docdir=$docdir --author=$auth_name1 --email=$auth_email --worksheet=$wksheet --verbose=1 $fichier_p |
||
120 | !sh cp $dir/* $docdir/doc/srctex/ |
||
121 | !! create the file OIndex in srctex |
||
122 | Oindex= |
||
123 | Oindex=!append line $subdoc $fichier_p to $Oindex |
||
124 | Oindex=!replace internal .tex by in $Oindex |
||
125 | !filewrite $docdirw/doc/srctex/0index $Oindex |
||
126 | |||
23 | reyssat | 127 | images=!sh cd $wims_home\ |
128 | ls $wims_sesdir/latex2wims/* |
||
129 | images=!replace internal / by , in $images |
||
130 | images=!column -1 of $images |
||
131 | cnt_images=!itemcnt $images |
||
132 | !for i = 1 to $cnt_images |
||
133 | !if .css isin $(images[$i]) or .sty isin $(images[$i]) or .tex isin $(images[$i]) |
||
134 | images=!replace item number $i by in $images |
||
135 | !endif |
||
136 | !next |
||
7269 | bpr | 137 | !!image transfer |
23 | reyssat | 138 | images=!items2words $images |
139 | images=!trim $images |
||
140 | images=!singlespace $images |
||
7269 | bpr | 141 | !sh mkdir -p $docdir/doc/$subdoc/$docfiles\ |
142 | for a in $images ; do cp $wims_home/$wims_sesdir/latex2wims/$$a $docdir/doc/$doc/$docfiles/$$a ; done |
||
7867 | bpr | 143 | !!now src2def make latex2wims |
7269 | bpr | 144 | !sh cd $docdir \ |
145 | src2def 2>/dev/null |
||
23 | reyssat | 146 | !else |
147 | !if $confirm=1 |
||
148 | execut=1 |
||
149 | !reset confirm |
||
150 | !else |
||
151 | execut=3 |
||
152 | !endif |
||
153 | !endif |
||
154 | !endif |
||
155 | |||
10176 | bpr | 156 | !set wims_ariane=!append line modtool,1,module=adm/modtool\ |
157 | to $wims_ariane |
||
158 | !if $execut>0 |
||
159 | !set wims_ariane=!append line latex2wims,1,module=adm/latex2wims&execut=0\ |
||
160 | to $wims_ariane |
||
161 | !endif |
||
162 | |||
163 | !if $wims_theme=default |
||
164 | !set wims_ariane=!append line $wims_ariane to $wims_menu_items |
||
165 | !reset wims_ariane |
||
166 | !endif |
||
167 |