source: www/www/_new/kernel/units/pg.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: 4.0 KB
Line 
1<?php
2/******************************************************************************/
3/* PHP-MWS: Module Web Site V.1.01.001 (http://mws.zde.cz) - themes */
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: pg.php, ver: 1.000, date: 2003-01-14
9// PHP-MWS Basic kernel - read ".info.php" for more info
10
11// Generátor stránky
12if (!function_exists('import')) exit;
13
14function prepend($input) {
15 $style = @$GLOBALS['style'];
16 if (!$style) $style = 'default';
17 if (!is_array($input)) $input=func_get_args();
18 $i=0;
19 while (@$input[$i]) {
20 if (!function_exists('theme_'.$style.'_'.$input[$i])) {
21 if (!include '../themes/'.$style.'/pg/'.$input[$i]._EXT) { goerror('prepend - '.@$style.':'.$input[$i],5); }
22 }
23 $i++;
24 }
25}
26
27function dopg($input) {
28 $style = @$GLOBALS['style'];
29 $out = '';
30 if (!$style) $style = 'default';
31 $i=0;
32 while (isset($input[$i])) {
33 if (is_array($input[$i])) {
34 $item = $input[$i];
35 $my = array_shift($item);
36 prepend($my);
37 $my_func = 'theme_'.$style.'_'.$my;
38 $out.=$my_func($item);
39 } else { $out.=$input[$i]; }
40 $i++;
41 }
42 return $out;
43}
44
45function pg() {
46 return dopg(func_get_args());
47}
48
49// Vlo¾ení vlastností tagu analýzou parametrù
50function paramins($check,$input) {
51 if (!@is_array($input)) {
52 unset($input);
53 $input=func_get_args();
54 array_shift($input);
55 }
56 $index=0;
57 $out = '';
58 while (@$input[$index]) {
59 if (@$check[$input[$index]]) $out.=' '.@$input[$index].'="'.@$check[$input[$index]].'"';
60 $index++;
61 }
62 return $out;
63}
64
65// Vlo¾ení konstantní vlastností analýzou logických hodnot
66function paramref($check,$input) {
67 $out = '';
68 if (!is_array($input)) {
69 unset($input);
70 $input=func_get_args();
71 array_shift($input);
72 }
73 $index=0;
74 while (@$input[$index]) {
75 if (@$check[$input[$index]]) $out.=' '.@$input[$index].'="'.$input[$index].'"';
76 $index++;
77 }
78 return $out;
79}
80
81function paramalt($check,$input) {
82 if (!is_array($input)) {
83 unset($input);
84 $input=func_get_args();
85 array_shift($input);
86 }
87 $index=0;
88 while ((@$input[$input[$index]])&&(@$input[$input[$index+1]])) {
89 $out.=' '.$input[$index].'="';
90 if ($check[$input[$index]]) { $out.=$input[$input[$index]].'"'; } else
91 $out.=$input[$input[$index]+1].'"';
92 $index+=2;
93 }
94 return $out;
95}
96
97function setempty($input,$count) {
98 $i=0;
99 while ($i<$count) {
100 if (!isset($input[$i])) {
101 $input[$i]='';
102 }
103 $i++;
104 }
105 return $input;
106}
107
108function pgcall($inc, $op) {
109 $optemp=$GLOBALS['op'];
110 $GLOBALS['op']=$op;
111 include $inc;
112 $GLOBALS['op']=$optemp;
113}
114
115 // Spojení souborù
116function pgmerge($input) {
117 $index=1;
118 while ($input[$index]) {
119 $work=$input[$index];
120 if ($work['include']) { pg_call($work['include'],$work['use']); } else include $input['page'];
121 if ($work['table']) pg_call($work['table'],$work['use']);
122 $index++;
123 }
124}
125
126 // Standardní tabulka
127function pgscheme($input) {
128 $index=1;
129 if ($input[1]) {
130 echo '<table border="0" cellpadding="0" cellspacing="0" width="100%"';
131 if ($input['color']) { echo ' bgcolor="'.$input['color'].'"'; }
132 echo '>'._CR.' <tr>';
133 while ($input[$index]) {
134 $work=$input[$index];
135 echo '<td';
136 echo paramins($work,'width','height','colspan','rowspan','valign');
137 if ($work['color']) { echo ' bgcolor="'.$work['color'].'"'; }
138 echo '>'._CR;
139 if ($work['text']) { echo $work['text']; } else {
140 if ($work['include']) { pg_call(gendir($work['include']),$work['op']);
141 } else {
142 $work['op']=$GLOBALS['op'];
143 pg_call(gendir($input['page']),$work['op']);
144 }
145 }
146 echo ' </td>';
147 if ($work['nextrow']) echo '</tr>'._CR.' <tr>';
148 $index++;
149 }
150 echo'</tr>'._CR.'</table>'._CR;
151 }
152}
153
154prepend('page');
155?>
Note: See TracBrowser for help on using the repository browser.