source: www/www/_new/kernel/units/data_uni.php@ 1

Last change on this file since 1 was 1, checked in by george, 18 years ago

Prvotní import všeho

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1<?php
2/******************************************************************************/
3/* PHP-MWS: Module Web Site V.1.01.001 (http://mws.zde.cz) - units */
4/* Copyright 2002 (C) BOMI software group (http://bomi.zde.cz, bomi@zde.cz) */
5/******************************************************************************/
6
7// Distributed as free software under GNU/GPL v.2 license!
8// file: data_cfg.php, ver: 1.000, date: 2003-01-14
9// PHP-MWS Basic kernel - read ".info.php" for more info
10
11// Jednotka pro práci s daty - databáze
12if (!function_exists('import')) exit;
13 // Naètení dat do pole
14function dt_uniget($input) {
15 $lst=array();
16 if (@$input['path']) $input['path'].='/';
17 include '../'.@$input['group'].'/'.@$input['path'].$input['name'].'.lst'._EXT;
18 return $lst;
19}
20
21function dt_uniupdate($input) {
22 systemunit('getline');
23 if ($input['path']) $input['path'].='/';
24 $fl=@fopen('../'.$input['group'].'/'.$input['path'].$input['name'].'.lst'._EXT,'r');
25 unset($desc);
26 if ($fl) {
27 $desc=getline($fl);
28 fclose($fl);
29 if (!$desc) { if ($input['desc']) { $desc=$input['desc']; } else $desc=_BEGSTR; }
30 $fl=@fopen('../'.$input['group'].'/'.$input['path'].$input['name'].'.lst'._EXT,'w');
31 if ($fl) {
32 putline($fl, $desc);
33 $value=&$input['data'];
34 if (is_array($value)) {
35 reset($value);
36 while (list($index, $item)=each($value)) {
37 $item=$value[$index];
38 $line="lst[$index]=";
39 if (is_array($item)) {
40 $line.='array(';
41 reset($item);
42 while (list($key, $val)=each($item)) {
43 if ($line[0]=='$') { $line.=', '; } else $line='$'.$line;
44 $line.="'$key'=>'$val'";
45 }
46 putline($fl,$line.');');
47 } else if ($item) {
48 $line.="'$item';";
49 putline($fl,'$'.$line);
50 }
51 }
52 putline($fl,_ENDSTR);
53 return 1;
54 } else return 2;
55 @fclose($fl);
56 } else return 3;
57 } else return 4;
58}
59?>
Note: See TracBrowser for help on using the repository browser.