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