Properties SourceCde
txt
1
*&---------------------------------------------------------------------*
2
*&  Include           ZSOFTCOPY_HTML_LINKS                             *
3
*&                                                                     *
4
*&---------------------------------------------------------------------*
5
*&                                                                     *
6
*& This file is part of ZSOFTCOPY.                                     *
7
*&                                                                     *
8
*& ZSOFTCOPY is free software: you can redistribute it and/or modify   *
9
*& it under the terms of the GNU General Public License as published   *
10
*& by the Free Software Foundation, either version 3 of the License,   *
11
*& or any later version.                                               *
12
*&                                                                     *
13
*& ZSOFTCOPY is distributed in the hope that it will be useful,        *
14
*& but WITHOUT ANY WARRANTY; without even the implied warranty of      *
15
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
16
*& GNU General Public License for more details.                        *
17
*&                                                                     *
18
*& You should have received a copy of the GNU General Public License   *
19
*& along with ZDOWNLOAD. If not, see <http://www.gnu.org/licenses/>.   *
20
*&                                                                     *
21
*&---------------------------------------------------------------------*
22
*&                                                                     *
23
*&  Author:     Ruediger von Creytz     ruediger.creytz@globalbit.net  *
24
*&  Copyright:  globalBIT, LLC          http://www.globalbit.net       *
25
*&                                                                     *
26
*&---------------------------------------------------------------------*
27
 
28
 
29
*-----------------------------------------------------------------------
30
* html_links_leaf
31
*-----------------------------------------------------------------------
32
FORM html_links_leaf
33
  USING
34
    value(i_id)
35
    value(i_sub_id)
36
    value(i_name)
37
    value(i_descript)
38
  CHANGING
39
    ct_html TYPE it_string.
40
 
41
  PERFORM html_links_leaf_filename
42
    USING
43
      i_id
44
      i_sub_id
45
      i_name
46
      i_name
47
      i_descript
48
    CHANGING
49
      ct_html.
50
ENDFORM.                    "html_links_leaf
51
 
52
 
53
*-----------------------------------------------------------------------
54
* html_links_leaf_filename
55
*-----------------------------------------------------------------------
56
FORM html_links_leaf_filename
57
  USING
58
    value(i_id)
59
    value(i_sub_id)
60
    value(i_name)
61
    value(i_filename)
62
    value(i_descript)
63
  CHANGING
64
    ct_html TYPE it_string.
65
 
66
  DATA:
67
  ls_html TYPE string,
68
  l_text TYPE string,
69
  l_title TYPE string,
70
  l_fname TYPE string.
71
 
72
  l_text = i_name.
73
  l_title = i_descript.
74
  PERFORM encode_html CHANGING l_text.
75
  PERFORM encode_html CHANGING l_title.
76
 
77
  l_fname = i_filename.
78
  SHIFT l_fname LEFT DELETING LEADING '/'.
79
  PERFORM replace_all
80
    USING '<' '-'
81
    CHANGING l_fname.
82
  PERFORM replace_all
83
    USING '>' '-'
84
    CHANGING l_fname.
85
  PERFORM encode_uri
86
    CHANGING l_fname.
87
 
88
  ADD 1 TO g_cnt_link_leaves.
89
 
90
  CONCATENATE
91
      '<li class="leaf">'
92
        '<a class="leafLink"'
93
        ' href="' i_id '/' l_fname '.' gc_extension_htm '"'
94
        ' id="' i_id '_' i_sub_id '_' g_cnt_link_leaves '"'
95
        ' onclick="showObject(''' i_id ''',''' l_fname ''');'
96
            'return false" title="' l_title '">'
97
          l_text
98
        '</a>'
99
      '</li>'
100
      INTO ls_html.
101
  APPEND ls_html TO ct_html.
102
ENDFORM.                    "html_links_leaf_filename
103
 
104
 
105
*-----------------------------------------------------------------------
106
* html_links_leaf_mime
107
*-----------------------------------------------------------------------
108
FORM html_links_leaf_mime
109
  USING
110
    value(i_id)
111
    value(i_name)
112
    value(i_filename)
113
    value(i_descript)
114
  CHANGING
115
    ct_html TYPE it_string.
116
 
117
  DATA:
118
  ls_html TYPE string,
119
  l_text TYPE string,
120
  l_title TYPE string,
121
  l_fname TYPE string.
122
 
123
  l_text = i_name.
124
  l_title = i_descript.
125
  PERFORM encode_html CHANGING l_text.
126
  PERFORM encode_html CHANGING l_title.
127
 
128
  l_fname = i_filename.
129
  SHIFT l_fname LEFT DELETING LEADING '/'.
130
  PERFORM replace_all
131
    USING '<' '-'
132
    CHANGING l_fname.
133
  PERFORM replace_all
134
    USING '>' '-'
135
    CHANGING l_fname.
136
  PERFORM encode_uri
137
    CHANGING l_fname.
138
 
139
  CONCATENATE
140
      '<li class="leaf">'
141
        '<a class="leafLink" href="' i_id '/' l_fname '"'
142
        ' onclick="window.open(''' i_id '/' l_fname ''');'
143
            'return false" title="' l_title '">'
144
          l_text
145
        '</a>'
146
      '</li>'
147
      INTO ls_html.
148
  APPEND ls_html TO ct_html.
149
ENDFORM.                    "html_links_leaf_mime
150
 
151
 
152
*-----------------------------------------------------------------------
153
* html_links_leaf_popup
154
*-----------------------------------------------------------------------
155
FORM html_links_leaf_popup
156
  USING
157
    value(i_id)
158
    value(i_name)
159
    value(i_filename)
160
    value(i_descript)
161
    value(i_caption)
162
  CHANGING
163
    ct_html TYPE it_string.
164
 
165
  DATA:
166
  ls_html TYPE string,
167
  l_text TYPE string,
168
  l_title TYPE string,
169
  l_fname TYPE string.
170
 
171
  l_text = i_name.
172
  l_title = i_descript.
173
  PERFORM encode_html CHANGING l_text.
174
  PERFORM encode_html CHANGING l_title.
175
 
176
  l_fname = i_filename.
177
  SHIFT l_fname LEFT DELETING LEADING '/'.
178
  PERFORM replace_all
179
    USING '<' '-'
180
    CHANGING l_fname.
181
  PERFORM replace_all
182
    USING '>' '-'
183
    CHANGING l_fname.
184
  PERFORM encode_uri
185
    CHANGING l_fname.
186
 
187
  CONCATENATE
188
      '<li class="leaf">'
189
        '<a class="leafLink" href="' i_id '/' l_fname '"'
190
        ' onclick="parent.parent.showObject(''' i_id '/' l_fname
191
            ''', ''' i_caption ''');'
192
            'return false" title="' l_title '">'
193
          l_text
194
        '</a>'
195
      '</li>'
196
      INTO ls_html.
197
  APPEND ls_html TO ct_html.
198
ENDFORM.                    "html_links_leaf_popup
199
 
200
 
201
*-----------------------------------------------------------------------
202
* html_links_node_end
203
*-----------------------------------------------------------------------
204
FORM html_links_node_end
205
  CHANGING
206
    ct_html TYPE it_string.
207
 
208
  APPEND '</ul></li>' TO ct_html.
209
ENDFORM.                    "html_links_node_end
210
 
211
 
212
*-----------------------------------------------------------------------
213
* html_links_node_start
214
*-----------------------------------------------------------------------
215
FORM html_links_node_start
216
  USING
217
    value(i_id)
218
    value(i_text)
219
    value(i_filename)
220
    value(i_descript)
221
  CHANGING
222
    ct_html TYPE it_string.
223
 
224
  DATA:
225
  ls_html TYPE string,
226
  l_dir TYPE string,
227
  l_suffix TYPE string,
228
  l_title TYPE string,
229
  l_fname TYPE string,
230
  l_dblclick TYPE string,
231
  l_info TYPE string.
232
 
233
  l_title = i_descript.
234
  PERFORM encode_html CHANGING l_title.
235
 
236
  SPLIT i_id AT '__' INTO l_dir l_suffix.
237
 
238
  IF NOT i_filename IS INITIAL.
239
    l_fname = i_filename.
240
    SHIFT l_fname LEFT DELETING LEADING '/'.
241
    PERFORM replace_all
242
      USING '<' '-'
243
      CHANGING l_fname.
244
    PERFORM replace_all
245
      USING '>' '-'
246
      CHANGING l_fname.
247
    PERFORM encode_uri
248
      CHANGING l_fname.
249
 
250
    CONCATENATE
251
        ' ondblclick="showObject(''' l_dir ''',''' l_fname ''','
252
        '''POPUP'',''' txt_info ''');return false"'
253
        INTO l_dblclick.
254
    CONCATENATE
255
        '&#160;<a class="info"'
256
        ' href="' l_dir '/' l_fname '.' gc_extension_htm '"'
257
        ' onclick="showObject(''' l_dir ''',''' l_fname ''','
258
        '''POPUP'',''' txt_info ''');return false">*</a>'
259
        INTO l_info.
260
  ENDIF.
261
 
262
  CONCATENATE
263
      '<li class="node">'
264
        '<a class="nodeLink" href="#"'
265
        ' onclick="toggleVisibility(''' i_id ''');return false"'
266
        l_dblclick
267
        ' title="' l_title '">'
268
          i_text
269
        '</a>'
270
        l_info
271
        '<ul id="' i_id '">'
272
      INTO ls_html.
273
  APPEND ls_html TO ct_html.
274
ENDFORM.                    "html_links_node_start