Mercurial > hg > mgallery
annotate mgallery.inc.php @ 266:92ce2185bbb3
Bump version.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 16 Dec 2018 17:46:47 +0200 |
parents | c95fdce46842 |
children | 108b354ea2ea |
rev | line source |
---|---|
0 | 1 <?php |
2 // | |
3 // Yet Another Image Gallery | |
69
7777887bc515
Update header/copyright blurbs.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
4 // -- Common functions and data include |
7777887bc515
Update header/copyright blurbs.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
5 // Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> |
161 | 6 // (C) Copyright 2015-2018 Tecnic Software productions (TNSP) |
0 | 7 // |
8 | |
266 | 9 $mgProgVersion = "v0.9.8"; |
0 | 10 $mgProgInfo = "Programmed by Matti 'ccr' Hamalainen"; |
11 $mgProgEmail = "<ccr@tnsp.org>"; | |
161 | 12 $mgProgCopyright = "2015-2018 Tecnic Software productions (TNSP)"; |
0 | 13 |
14 | |
15 // | |
106
a3b8cd4183e6
Change {album,image}_navigation setting to *_flags.
Matti Hamalainen <ccr@tnsp.org>
parents:
105
diff
changeset
|
16 // Navigation control defines |
a3b8cd4183e6
Change {album,image}_navigation setting to *_flags.
Matti Hamalainen <ccr@tnsp.org>
parents:
105
diff
changeset
|
17 // |
136 | 18 define("MGF_JAVASCRIPT" , 0x01); |
19 define("MGF_BREADCRUMBS" , 0x10); | |
20 define("MGF_CAPTIONS" , 0x20); | |
106
a3b8cd4183e6
Change {album,image}_navigation setting to *_flags.
Matti Hamalainen <ccr@tnsp.org>
parents:
105
diff
changeset
|
21 |
a3b8cd4183e6
Change {album,image}_navigation setting to *_flags.
Matti Hamalainen <ccr@tnsp.org>
parents:
105
diff
changeset
|
22 // |
0 | 23 // Constants for different value types |
24 // | |
136 | 25 define("MG_STR" , 1); |
26 define("MG_INT" , 2); | |
27 define("MG_DVA" , 3); | |
28 define("MG_BOOL" , 4); | |
29 define("MG_FLAGS" , 5); | |
30 define("MG_DATE" , 6); | |
0 | 31 |
32 | |
136 | 33 define("yes" , 1); |
34 define("no" , 0); | |
0 | 35 |
36 | |
114
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
37 $mgGFlags = [ |
136 | 38 "javascript" => MGF_JAVASCRIPT, |
39 "breadcrumbs" => MGF_BREADCRUMBS, | |
40 "captions" => MGF_CAPTIONS, | |
114
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
41 ]; |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
42 |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
43 |
0 | 44 function mgPathName($path) |
45 { | |
46 $tmp = mgCleanPathArray(TRUE, 0, func_num_args(), func_get_args()); | |
47 if (count($tmp) > 0) | |
48 return implode("/", array_splice($tmp, 0, -1))."/"; | |
49 else | |
50 return $path; | |
51 } | |
52 | |
53 // | |
54 // Configuration settings and their default values | |
55 // | |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
56 $mgDefaults = [ |
130
f825d644cf7a
Implement new config setting "timezone" for specifying the timezone used for date/timestamp interpretation.
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
57 "timezone" => [MG_STR, NULL], |
0 | 58 |
141
18061527d1cd
Reorder some settings in configuration data.
Matti Hamalainen <ccr@tnsp.org>
parents:
137
diff
changeset
|
59 "clean_urls" => [MG_BOOL, FALSE], |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
60 "base_path" => [MG_STR, mgPathName(mgRealPath($_SERVER["SCRIPT_FILENAME"]))], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
61 "base_url" => [MG_STR, mgPathName($_SERVER["PHP_SELF"])], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
62 "image_url" => [MG_STR, mgPathName($_SERVER["PHP_SELF"])], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
63 "mgallery_php" => [MG_STR, "mgallery.php"], |
250
3af3b3f50cb0
Add settings for med_format and tn_format (currently allowed values are
Matti Hamalainen <ccr@tnsp.org>
parents:
241
diff
changeset
|
64 "format_exts" => [MG_STR, "\.jpg|\.png|\.gif|\.jpeg|\.webp"], |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
65 "captions_file" => [MG_STR, "captions.txt"], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
66 "header_file" => [MG_STR, "header.txt"], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
67 "info_file" => [MG_STR, "gallery.info"], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
68 "cache_file" => [MG_STR, ".mgallery.cache"], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
69 |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
70 "cover_images" => [MG_BOOL, TRUE], |
141
18061527d1cd
Reorder some settings in configuration data.
Matti Hamalainen <ccr@tnsp.org>
parents:
137
diff
changeset
|
71 "album_icon" => [MG_STR, "album_sm.png"], |
18061527d1cd
Reorder some settings in configuration data.
Matti Hamalainen <ccr@tnsp.org>
parents:
137
diff
changeset
|
72 |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
73 "title_prefix" => [MG_STR, ""], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
74 "title_sep" => [MG_STR, " - "], |
224 | 75 "page_info" => [MG_STR, "Powered by <b>MGallery ".$mgProgVersion."</b> © Copyright ".$mgProgCopyright], |
151
4e25150aa868
Change js_path configuration setting to js_file.
Matti Hamalainen <ccr@tnsp.org>
parents:
150
diff
changeset
|
76 |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
77 "css" => [MG_STR, NULL], |
151
4e25150aa868
Change js_path configuration setting to js_file.
Matti Hamalainen <ccr@tnsp.org>
parents:
150
diff
changeset
|
78 "js_file" => [MG_STR, NULL], |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
79 "urchin_file" => [MG_STR, FALSE], |
0 | 80 |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
81 "global_flags" => [MG_FLAGS, MGF_JAVASCRIPT | MGF_BREADCRUMBS | MGF_CAPTIONS, &$mgGFlags], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
82 "image_flags" => [MG_FLAGS, MGF_JAVASCRIPT | MGF_BREADCRUMBS, &$mgGFlags], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
83 "album_flags" => [MG_FLAGS, MGF_JAVASCRIPT | MGF_BREADCRUMBS, &$mgGFlags], |
0 | 84 |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
85 "tn_path" => [MG_STR, "tn/"], |
185
cb7019690a73
Separate medium image and thumbnail directories / handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
171
diff
changeset
|
86 "med_path" => [MG_STR, "med/"], |
0 | 87 |
250
3af3b3f50cb0
Add settings for med_format and tn_format (currently allowed values are
Matti Hamalainen <ccr@tnsp.org>
parents:
241
diff
changeset
|
88 "tn_format" => [MG_STR, "jpeg"], |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
89 "tn_width" => [MG_INT, 140], // In pixels, applies as bounding box for w/h |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
90 "tn_height" => [MG_INT, 100], |
162
3c2674dbd185
Increase the generated mid- and thumbnail images JPEG quality slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
161
diff
changeset
|
91 "tn_quality" => [MG_INT, 85], // JPEG quality percent |
0 | 92 |
250
3af3b3f50cb0
Add settings for med_format and tn_format (currently allowed values are
Matti Hamalainen <ccr@tnsp.org>
parents:
241
diff
changeset
|
93 "med_format" => [MG_STR, "jpeg"], |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
94 "med_width" => [MG_INT, 960], |
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
95 "med_height" => [MG_INT, 640], |
162
3c2674dbd185
Increase the generated mid- and thumbnail images JPEG quality slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
161
diff
changeset
|
96 "med_quality" => [MG_INT, 90], |
195 | 97 |
98 "debug" => [MG_BOOL, FALSE], | |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
99 ]; |
0 | 100 |
101 | |
102 function mgDebug($msg) | |
103 { | |
104 // echo "MGAL[debug]: ".$msg; | |
105 } | |
106 | |
107 | |
108 function mgFatal($msg) | |
109 { | |
110 die("MGAL[fatal]: ".$msg); | |
111 } | |
112 | |
113 | |
114 function mgError($msg) | |
115 { | |
116 echo "MGAL[error]: ".$msg; | |
117 return FALSE; | |
118 } | |
119 | |
120 | |
121 function mgCArg($index, $clip = FALSE) | |
122 { | |
123 global $argc, $argv; | |
124 if ($index < $argc) | |
125 { | |
126 $str = $argv[$index]; | |
127 return ($clip !== FALSE) ? substr($str, 0, $clip) : $str; | |
128 } | |
129 else | |
130 return FALSE; | |
131 } | |
132 | |
133 | |
134 function mgCArgLC($index, $clip = FALSE) | |
135 { | |
136 global $argc, $argv; | |
137 if ($index < $argc) | |
138 { | |
139 $str = strtolower($argv[$index]); | |
140 return ($clip !== FALSE) ? substr($str, 0, $clip) : $str; | |
141 } | |
142 else | |
143 return FALSE; | |
144 } | |
145 | |
146 | |
147 function mgGetSetting($key, $default = NULL) | |
148 { | |
149 global $mgSettings, $mgDefaults; | |
150 | |
151 if (!array_key_exists($key, $mgDefaults)) | |
152 mgFatal("Setting '".$key."' does not exist.\n"); | |
153 | |
154 if (array_key_exists($key, $mgSettings)) | |
155 $val = $mgSettings[$key]; | |
156 else | |
157 $val = $mgDefaults[$key][1]; | |
158 | |
159 if (!isset($val) || $val === NULL) | |
160 { | |
161 if ($default !== NULL) | |
162 $val = $default; | |
163 else | |
164 mgFatal("Setting '".$key."' is not set, but is required to be configured.\n"); | |
165 } | |
166 | |
114
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
167 switch ($mgDefaults[$key][0]) |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
168 { |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
169 case MG_FLAGS: |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
170 if (is_string($val)) |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
171 { |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
172 $flags = $mgDefaults[$key][2]; |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
173 $cval = preg_split("/\s*[,|]\s*/", strtolower($val), -1, PREG_SPLIT_NO_EMPTY); |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
174 $nval = 0; |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
175 foreach ($cval as $qval) |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
176 { |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
177 if (array_key_exists($qval, $flags)) |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
178 $nval |= $flags[$qval]; |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
179 else |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
180 mgFatal("Invalid flag value for '".$key."': '".$qval."'."); |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
181 } |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
182 } |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
183 break; |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
184 } |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
185 |
0 | 186 return $val; |
187 } | |
188 | |
189 | |
190 function mgGetPath($path, $key) | |
191 { | |
192 $val = mgGetSetting($key); | |
193 return ($val !== FALSE) ? $path."/".$val : FALSE; | |
194 } | |
195 | |
196 | |
197 function mgReadSettings($filename = "mgallery.cfg") | |
198 { | |
199 global $mgSettings, $mgDefaults; | |
200 | |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
201 $spaths = []; |
0 | 202 $spaths[] = getcwd()."/"; |
203 if (($tmp = getenv("HOME")) !== FALSE && strlen($tmp) > 0) | |
204 { | |
205 $spaths[] = $tmp."/.config/mgallery/"; | |
206 $spaths[] = $tmp."/."; | |
207 } | |
208 else | |
209 { | |
210 $data = posix_getpwuid(posix_getuid()); | |
211 if ($data !== FALSE && isset($data["dir"])) | |
212 { | |
213 $tmp = $data["dir"]; | |
214 $spaths[] = $tmp."/.config/mgallery/"; | |
215 $spaths[] = $tmp."/."; | |
216 } | |
217 } | |
218 $spaths[] = dirname(__FILE__)."/"; | |
219 | |
220 foreach (array_unique($spaths) as $path) | |
221 { | |
222 $file = $path.$filename; | |
223 mgDebug("Checking '".$file."' for configuration ..\n"); | |
224 if (file_exists($file) && | |
225 ($mgSettings = parse_ini_file($file, FALSE)) !== FALSE) | |
226 { | |
227 mgDebug("Found '".$file."' config.\n"); | |
228 | |
229 // Validate settings | |
230 $ok = TRUE; | |
231 foreach ($mgSettings as $setting => $val) | |
232 { | |
233 if (!array_key_exists($setting, $mgDefaults)) | |
234 { | |
235 mgError("Setting '".$setting."' does not exist.\n"); | |
236 $ok = FALSE; | |
237 } | |
238 } | |
239 return $ok; | |
240 } | |
241 } | |
242 | |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
243 $mgSettings = []; |
0 | 244 return FALSE; |
245 } | |
246 | |
247 | |
248 function mgRealPath($path) | |
249 { | |
250 return realpath($path); | |
251 } | |
252 | |
253 | |
254 function mgCleanPathArray($refs, $start, $argc, $argv) | |
255 { | |
127
3ee66c432081
Use modern PHP array syntax.
Matti Hamalainen <ccr@tnsp.org>
parents:
124
diff
changeset
|
256 $path = []; |
0 | 257 $first = TRUE; |
258 for ($n = $start; $n < $argc; $n++) | |
259 { | |
260 foreach (explode("/", $argv[$n]) as $piece) | |
261 { | |
262 switch ($piece) | |
263 { | |
264 case ".": | |
265 case "": | |
266 if ($first) | |
267 $path[] = $piece; | |
268 break; | |
269 | |
270 case "..": | |
271 if ($refs && count($path) > 0) | |
272 array_pop($path); | |
273 break; | |
274 | |
275 default: | |
276 $path[] = $piece; | |
277 break; | |
278 } | |
279 $first = FALSE; | |
280 } | |
281 } | |
282 return $path; | |
283 } | |
284 | |
285 | |
286 function mgCleanPath($refs) | |
287 { | |
288 return implode("/", mgCleanPathArray($refs, 1, func_num_args(), func_get_args())); | |
289 } | |
290 | |
291 | |
292 function mgGetArr($data, $skeys, $sfmt1 = "%1", $sfmt2 = "", $func = NULL) | |
293 { | |
47
1e2b55775a84
Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents:
36
diff
changeset
|
294 global $pageLang; |
1e2b55775a84
Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents:
36
diff
changeset
|
295 |
0 | 296 if (!is_array($skeys)) |
297 $skeys = array($skeys); | |
298 | |
299 foreach ($skeys as $skey) | |
300 if (!array_key_exists($skey, $data)) | |
301 return $sfmt2; | |
302 | |
303 $str = $sfmt1; | |
304 for ($i = 1; $i <= sizeof($skeys); $i++) | |
305 { | |
306 $val = $data[$skeys[$i - 1]]; | |
47
1e2b55775a84
Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents:
36
diff
changeset
|
307 if (is_array($val)) |
1e2b55775a84
Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents:
36
diff
changeset
|
308 $vtmp = array_key_exists($pageLang, $val) ? $val[$pageLang] : reset($val); |
1e2b55775a84
Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents:
36
diff
changeset
|
309 else |
1e2b55775a84
Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents:
36
diff
changeset
|
310 $vtmp = $val; |
0 | 311 |
312 if (is_callable($func)) | |
77
fcfd635d7abf
Oops, fix format string callback functions ..
Matti Hamalainen <ccr@tnsp.org>
parents:
70
diff
changeset
|
313 $vtmp = call_user_func($func, $vtmp); |
0 | 314 |
47
1e2b55775a84
Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents:
36
diff
changeset
|
315 $str = str_replace("%".$i, $vtmp, $str); |
0 | 316 } |
317 | |
318 return $str; | |
319 } | |
320 | |
321 | |
114
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
322 function mgGetDValStr($mdef, $val) |
0 | 323 { |
114
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
324 switch ($mdef[0]) |
0 | 325 { |
326 case MG_STR : return "\"".$val."\""; | |
327 case MG_BOOL : return $val ? "yes" : "no"; | |
114
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
328 case MG_FLAGS: |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
329 { |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
330 $mstr = []; |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
331 foreach ($mdef[2] as $vkey => $vval) |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
332 { |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
333 if ($val & $vval) |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
334 $mstr[] = $vkey; |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
335 } |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
336 return implode($mstr, " | "); |
c803235bd0f9
Implement flag config option type.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
337 } |
0 | 338 case MG_INT : |
339 default : return (string) $val; | |
340 } | |
341 } | |
342 | |
343 ?> |