Rev 2503 | Rev 7269 | 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 |
||
27 | !filewrite getfile/wims.sty $wims |
||
28 | !filewrite getfile/fichier_test.tex $fichier_test |
||
29 | |||
30 | |||
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 |
||
42 | !filewrite wimshome/$wims_sesdir/latex2wims/style.css $style |
||
43 | !filewrite wimshome/$wims_sesdir/latex2wims/wims.sty $wims |
||
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 |
||
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 |
||
61 | date= !lines2items $date |
||
62 | !endif |
||
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 |
||
72 | !endif |
||
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 |
||
103 | execut=3 |
||
104 | !if $confirm=0 |
||
105 | auth_name1=!word 2 of $auth_name |
||
106 | fichier_p=!item $principal of $fichiers |
||
107 | !!!mexec dos2unix $fichier_p |
||
49 | bpr | 108 | docdir=$wims_home/public_html/modules/devel/$wims_developer/$document |
23 | reyssat | 109 | !sh rm -r $docdir/doc/1/* ; mkdir -p $docdir/doc/1/src |
110 | dir=$wims_home/$wims_sesdir/latex2wims/ |
||
111 | !mexec latex2wims.pl --dir=$dir --docdir=$docdir --author=$auth_name1 --email=$auth_email --worksheet=$wksheet --verbose=1 $fichier_p |
||
112 | |||
113 | |||
114 | images=!sh cd $wims_home\ |
||
115 | ls $wims_sesdir/latex2wims/* |
||
116 | images=!replace internal / by , in $images |
||
117 | images=!column -1 of $images |
||
118 | cnt_images=!itemcnt $images |
||
119 | !for i = 1 to $cnt_images |
||
120 | !if .css isin $(images[$i]) or .sty isin $(images[$i]) or .tex isin $(images[$i]) |
||
121 | images=!replace item number $i by in $images |
||
122 | !endif |
||
123 | !next |
||
124 | |||
125 | images=!items2words $images |
||
126 | images=!trim $images |
||
127 | images=!singlespace $images |
||
128 | !sh mkdir -p $docdir/doc/1/files\ |
||
129 | for a in $images ; do cp $wims_home/$wims_sesdir/latex2wims/$$a $docdir/doc/1/files/$$a ; done\ |
||
130 | cd $docdir \ |
||
131 | src2def 2>/dev/null |
||
132 | !else |
||
133 | !if $confirm=1 |
||
134 | execut=1 |
||
135 | !reset confirm |
||
136 | !else |
||
137 | execut=3 |
||
138 | !endif |
||
139 | !endif |
||
140 | !endif |
||
141 |