Subversion Repositories wimsdev

Rev

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