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