Subversion Repositories wimsdev

Rev

Rev 13306 | Rev 13975 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
#! /bin/sh
2
 
3
cd `dirname $0`
3799 bpr 4
cd ..
5
WIMS_HOME=`pwd`
7355 bpr 6
if [ -f ../../log/wims.conf ] ; then
7
 language=`awk -F= '$1=="site_languages" {print $2;exit}' ../../log/wims.conf`
8774 bpr 8
fi
8846 bpr 9
if [ -z "$language" ] ; then
7355 bpr 10
 language="en fr nl it es cn ca si"
11
fi
3799 bpr 12
cd $WIMS_HOME/slib
20 reyssat 13
 
14
cat <<@ >index.phtml
15
!! This file is automatically generated! Do not edit it.
16
!! Edit the script 'mkindex'.
17
 
1310 bpr 18
!if adm/createxo isin \$module
1103 bpr 19
  !set slib_cmd=help
20
!endif
1915 bpr 21
!read tabletheme
3757 bpr 22
!read lang/slib.phtml.\$lang
23
!if \$slib_lang_exists!=yes
24
  !read lang/slib.phtml.en
25
!endif
1103 bpr 26
!default slib_cmd=resume
20 reyssat 27
!default slib_detname=special_cmd
28
!set slib_detail=\$(\$slib_detname)
6275 bpr 29
 
20 reyssat 30
!if \$slib_detail!=\$empty
13919 bpr 31
  !readproc slib/\$slib_detail slib_header
32
  !reset slib_lang_exists_tmp
33
  !readproc help/\$lang/slib/\$slib_detail
34
  !if \$slib_lang_exists_tmp!=yes
35
    !readproc help/en/slib/\$slib_detail
36
  !endif
37
  !distribute lines \$slib_parms into slpcnt,slp1,slp2,slp3,slp4,slp5,slp6,slp7,slp8,slp9,slp10,slp11,slp12
38
  !for i=1 to \$slpcnt
39
    !set slpdflt\$i=!item 1 of \$(slp\$i)
40
    !set slp\$i=!item 2 to -1 of \$(slp\$i)
41
  !next i
42
  !readproc namewriting.phtml \$slib_author
43
  !set slib_author=\$script_out
44
  !reset table_center
1915 bpr 45
 \$table_header
3757 bpr 46
 <caption>\$wims_name_slib</caption>
6675 bpr 47
 \$table_tr<th>\$wims_name_name</th><td class="tt">\$slib_detail</td></tr>
3757 bpr 48
 \$table_tr<th>\$wims_name_title</th><td>\$slib_title</td></tr>
4349 bpr 49
 \$table_tr<th>\$wims_name_Author</th><td>\$slib_author</td></tr>
13292 obado 50
 \$table_tr<th>\$wims_name_call1</th><td><code>!readproc slib/\$slib_detail [parameters]</code>
51
 <br />(\$wims_name_result <span class="tt">slib_out</span>)</td></tr>
52
 \$table_tr<th>\$wims_name_call2</th><td><code>slib(\$slib_detail [parameters])</code></td></tr>
3757 bpr 53
 \$table_tr<th>\$wims_name_Parameters</th><td>
13919 bpr 54
  !if \$slpcnt>1
55
    !if + isin \$slpcnt
56
      \$wims_name_variable_list
57
    !else
58
    \$wims_name_upto
59
    !endif
20 reyssat 60
  !else
13919 bpr 61
    \$slpcnt
20 reyssat 62
  !endif
13919 bpr 63
  </td></tr>
64
  !for i=1 to \$slpcnt
65
    \$table_tr<th>\$wims_name_Parameter \$i
66
    !ifval \$i=\$slpcnt and + isin \$slpcnt
67
      and up
68
    !endif
69
    </th>
70
    <td>\$(slp\$i)
71
    !if \$(slpdflt\$i)!=\$empty
72
      <div class="param_default"><em>(\$wims_name_default: <span class="tt">\$(slpdflt\$i)</span>)</em></div>
73
    !endif
74
    </td></tr>
75
  !next i
76
  \$table_tr<th>\$wims_name_Output</th><td>\$slib_out</td></tr>
77
  !if \$slib_comment!=\$empty
78
    \$table_tr<th>\$wims_name_comment</th><td>\$slib_comment</td></tr>
20 reyssat 79
  !endif
13919 bpr 80
  !if \$slib_require!=\$empty
81
    \$table_tr<th>\$wims_name_Required_Software</th><td class="tt">\$slib_require</td></tr>
20 reyssat 82
  !endif
13919 bpr 83
  !if \$slib_example!=\$empty
84
    !set excnt=!linecnt \$slib_example
85
    \$table_tr<th>\$wims_name_Example OEF </th><td>
86
    !for i=1 to \$excnt
87
      !set slib_exemple=!line \$i of \$slib_example
88
      <hr />
89
      <code>\text{A=slib(\$slib_detail \$slib_exemple)}</code>
90
      !set slib_wims_backslash=\$wims_backslash_insmath
91
      !set wims_backslash_insmath=yes
92
      !readproc slib/\$slib_detail \$slib_exemple
93
      <p>\$wims_name_Output:</p>
94
      !if table notin \$slib_out and object notin \$slib_out and bubble notin \$slib_out and geogebra notin \$slib_detail
95
        <pre>\$slib_out</pre>
96
      !else
97
        \$slib_out
98
      !endif
99
      !set wims_backslash_insmath=\$slib_wims_backslash
100
      !reset slib_wims_backslash
101
      !next i
102
      !reset slib_exemple
103
      </td></tr>
104
    !endif
4170 bpr 105
 
13919 bpr 106
    \$table_end
107
    !reset \$slib_detname
108
  !exit
20 reyssat 109
!endif
3757 bpr 110
\$wims_name_instruction
20 reyssat 111
 
3799 bpr 112
!read slib/index.phtml.\$lang
113
@
7355 bpr 114
for ll in $language
3799 bpr 115
do
13919 bpr 116
  echo "!! This file is automatically generated! Do not edit it.
3799 bpr 117
!! Edit the script 'mkindex'.
118
 
5936 bpr 119
!reset table_center
8835 obado 120
<h2>\$wims_name_listslib</h2>
121
<div id='listslib'>
122
   <ul>" > index.phtml.$ll
13919 bpr 123
  echo "" > index.phtml.temp
8835 obado 124
  cnt_slib_tot=0
8846 bpr 125
 
8847 bpr 126
  for categorie in `find . -maxdepth 1 -type d | sed 's!^\./!!g' |  egrep -v '\/\.svn\/'  | sort`
8846 bpr 127
  do
8835 obado 128
    if [ "$categorie" = "." ];then
129
      cat_name="\$wims_name_All"
130
    else
131
      cat_name="$categorie"
132
    fi
133
    cat <<@ >>index.phtml.temp
134
    <div id="content_$categorie">
135
    \$table_header
136
    <caption>$cat_name</caption>
137
    \$table_tr<th>\$wims_name_name</th><th>\$wims_name_Output</th></tr>
138
@
139
    cnt_slib=0
140
    for f in `find ./$categorie -type f | sed 's!^\./!!g' | sed 's!^\./!!g' | grep ./ |  egrep -v '\/\.svn\/' |  egrep -v '\.html'| sort`
141
    do
142
      if [ -f "$WIMS_HOME/help/$ll/slib/$f" ]; then
143
        tit=`awk -F= '$1=="slib_title" {print $2; exit}' $WIMS_HOME/help/$ll/slib/$f`
144
      fi
145
      if [ -z "$tit" ]; then
146
        if [ -f "$WIMS_HOME/help/en/slib/$f" ]; then
147
          tit=`awk -F= '$1=="slib_title" {print $2; exit}' $WIMS_HOME/help/en/slib/$f`
148
        else
149
         tit=`awk -F= '$1=="slib_title" {print $2; exit}' $f`
150
        fi
151
      fi
152
      if [ -n "$tit" ]; then
153
        #echo $f
154
        cnt_slib=`expr $cnt_slib + 1`
8847 bpr 155
        if [ $cnt_slib -ge 1 ]; then
8835 obado 156
        cat <<@ >>index.phtml.temp
157
        \$table_tr<td class="tt wims_code_words">$f</td><td>$tit
158
        !href cmd=\$slib_cmd&special_parm=slib&\$slib_detname=$f\$slib_detailanchor [\$wims_name_detail]
159
        </td></tr>
160
@
8847 bpr 161
        fi;
8835 obado 162
        tit=''
163
      fi
164
    done
165
    echo "'$cat_name' done ($cnt_slib)"
166
    cat <<@ >>index.phtml.temp
167
    \$table_end
168
    </div>
169
@
170
 
3799 bpr 171
  cat <<@ >>index.phtml.$ll
8835 obado 172
      <li>
173
       <a href="#content_$categorie">
174
         $cat_name ($cnt_slib)</a>
175
      </li>
20 reyssat 176
@
8835 obado 177
  cnt_slib_tot=`expr $cnt_slib_tot + $cnt_slib`
178
  done
8846 bpr 179
 
8835 obado 180
  cat <<@ >>index.phtml.$ll
181
      </ul>
20 reyssat 182
@
8835 obado 183
 
184
  cat index.phtml.temp >>index.phtml.$ll
185
  cat <<@ >>index.phtml.$ll
186
      </div>
187
      !!# Si les librairies Jquery sont chargées, on affiche des onglets.
188
      !if \$jquery_defined=yes
13306 obado 189
        <script>
8835 obado 190
          /*<![CDATA[*/ jQuery(function(jq) {
8857 obado 191
            jq( "#listslib" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );
8835 obado 192
            jq( "#listslib li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
8857 obado 193
            jq( "#listslib li a" ).click(function() {
194
              //get the top offset of the target anchor
195
              var target_offset = jq("#listslib").offset();
196
              var target_top = target_offset.top;
197
              //goto that anchor by setting the body scroll top to anchor top
198
              jq('html, body').animate({scrollTop:target_top});
199
            });
8835 obado 200
          }); /*]]>*/
201
        </script>
13919 bpr 202
        <style>
11288 bpr 203
         /*<![CDATA[*/\
8835 obado 204
          /*.ui-tabs-vertical { width: 55em; }*/
8857 obado 205
          .ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; /*width: 12em;*/ }
8835 obado 206
          .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
207
          .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
208
          .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
209
          .ui-tabs-vertical .ui-tabs-panel { margin-left: 1em; float: left; width: 70%;}
210
          .ui-tabs-vertical .ui-tabs-panel .wimstable { width: 100%;}
11288 bpr 211
          /*]]>*/\
212
         </style>
8835 obado 213
      !endif
214
@
215
 
216
  echo "*** '$ll' done ($cnt_slib_tot)"
217
  echo
3799 bpr 218
done
20 reyssat 219
echo
8835 obado 220
echo Indexed $cnt_slib_tot scripts.
20 reyssat 221
echo
222