d0416d23b70a701e7c12b884bd947d4c670cc50e
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
bernd webinterface => /webinterface

bernd authored 17 years ago

16) 
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

17) require_once('class/database.php');
bernd add a function to handle re...

bernd authored 14 years ago

18) require_once('inc/debug.php');
bernd sql-abfragen abstrahiert

bernd authored 16 years ago

19) 
schokokeks.org web services Ermögliche Socket-Angabe fü...

schokokeks.org web services authored 10 years ago

20) function config($key, $localonly = false)
bernd Mehr config-optionen und co...

bernd authored 14 years ago

21) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

22)     global $config;
23) 
24)     if ($key == "modules") {
25)         // Stelle sicher, dass das "index"-Modul immer aktiv ist!
26)         if (! in_array("index", $config['modules'])) {
27)             $config['modules'][] = "index";
28)         }
29)         // Stelle sicher, dass das "about"-Modul immer aktiv ist!
30)         if (! in_array("about", $config['modules'])) {
31)             $config['modules'][] = "about";
32)         }
Bernd Wurst Lizenzinfos in eigenes Modu...

Bernd Wurst authored 10 years ago

33)     }
34) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

35)     if ($key == 'modules' && isset($_SESSION['restrict_modules'])) {
36)         $modules = array();
37)         foreach ($config['modules'] as $mod) {
38)             if (in_array($mod, $_SESSION['restrict_modules'])) {
39)                 $modules[] = $mod;
40)             }
41)         }
42)         return $modules;
bernd Erlaube subusers, die nur Z...

bernd authored 13 years ago

43)     }
44) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

45)     if (array_key_exists($key, $config)) {
46)         return $config[$key];
47)     }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

48) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

49)     if ($localonly) {
50)         return null;
51)     }
schokokeks.org web services Ermögliche Socket-Angabe fü...

schokokeks.org web services authored 10 years ago

52) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

53)     /* read configuration from database */
54)     $result = db_query("SELECT `key`, value FROM misc.config");
Hanno remove whitespace in empty...

Hanno authored 5 years ago

55) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

56)     while ($object = $result->fetch()) {
57)         if (!array_key_exists($object['key'], $config)) {
58)             $config[$object['key']]=$object['value'];
59)         }
60)     }
61)     // Sonst wird das Passwort des webadmin-Users mit ausgegeben
62)     $debug_config = $config;
63)     unset($debug_config['db_pass']);
64)     DEBUG($debug_config);
65)     if (array_key_exists($key, $config)) {
66)         return $config[$key];
67)     } else {
68)         logger(LOG_ERR, "inc/base", "config", "Request to read nonexistant config option »{$key}«.");
69)     }
70)     return null;
bernd Mehr config-optionen und co...

bernd authored 14 years ago

71) }
72) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

73) function have_role($role)
74) {
Bernd Wurst Blende Aktionen aus, wenn d...

Bernd Wurst authored 6 years ago

75)     $have = $_SESSION['role'] & $role;
76)     if ($have) {
77)         DEBUG("Current user has role ".$role);
78)     } else {
79)         DEBUG("Current user does not have role ".$role);
80)     }
81)     return $have;
82) }
83) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

84) function get_server_by_id($id)
85) {
86)     $id = (int) $id;
87)     $result = db_query("SELECT hostname FROM system.servers WHERE id=?", array($id));
88)     $ret = $result->fetch();
89)     return $ret['hostname'];
bernd Info-Seite über Mail-Login-...

bernd authored 13 years ago

90) }
91) 
bernd Mehr config-optionen und co...

bernd authored 14 years ago

92) 
bernd add a function to handle re...

bernd authored 14 years ago

93) function redirect($target)
94) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

95)     global $debugmode;
96)     if ($target == '') {
97)         $target = $_SERVER['REQUEST_URI'];
98)     }
99)     if (! $debugmode) {
100)         header("Location: {$target}");
101)     } else {
102)         if (strpos($target, '?') === false) {
103)             print 'REDIRECT: '.internal_link($target, $target);
104)         } else {
105)             list($file, $qs) = explode('?', $target, 2);
106)             print 'REDIRECT: '.internal_link($file, $target, $qs);
107)         }
108)     }
109)     die();
bernd add a function to handle re...

bernd authored 14 years ago

110) }
111) 
112) 
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

113) function my_server_id()
114) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

115)     $uid = (int) $_SESSION['userinfo']['uid'];
116)     $result = db_query("SELECT server FROM system.useraccounts WHERE uid=?", array($uid));
117)     $r = $result->fetch();
118)     DEBUG($r);
119)     return $r['server'];
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

120) }
121) 
122) 
123) function additional_servers()
124) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

125)     $uid = (int) $_SESSION['userinfo']['uid'];
126)     $result = db_query("SELECT server FROM system.user_server WHERE uid=?", array($uid));
127)     $servers = array();
128)     while ($s = $result->fetch()) {
129)         $servers[] = $s['server'];
130)     }
131)     DEBUG($servers);
132)     return $servers;
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

133) }
134) 
135) 
136) function server_names()
137) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

138)     $result = db_query("SELECT id, hostname FROM system.servers");
139)     $servers = array();
140)     while ($s = $result->fetch()) {
141)         $servers[$s['id']] = $s['hostname'];
142)     }
143)     DEBUG($servers);
144)     return $servers;
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

145) }
146) 
147) 
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

148) function maybe_null($value)
149) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

150)     if (! $value) {
151)         return null;
152)     }
bernd maybe_null behandelt jetzt...

bernd authored 14 years ago

153) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

154)     if (strlen((string) $value) > 0) {
155)         return (string) $value;
156)     } else {
157)         return null;
158)     }
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

159) }
160) 
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

161) 
bernd Logger mit Logleveln

bernd authored 14 years ago

162) #define('LOG_ERR', 3);
163) #define('LOG_WARNING', 4);
164) #define('LOG_INFO', 6);
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

165) 
bernd Logger mit Logleveln

bernd authored 14 years ago

166) function logger($severity, $scriptname, $scope, $message)
bernd Logging aktiviert

bernd authored 16 years ago

167) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

168)     if (config('logging') < $severity) {
169)         DEBUG("NOT LOGGING $scriptname:$scope:$message");
170)         return;
171)     }
172) 
173)     DEBUG("LOGGING $scriptname:$scope:$message");
174)     $user = null;
175)     if (array_key_exists("role", $_SESSION)) {
176)         if ($_SESSION['role'] & ROLE_SYSTEMUSER) {
177)             $user = $_SESSION['userinfo']['username'];
178)         } elseif ($_SESSION['role'] & ROLE_CUSTOMER) {
179)             $user = $_SESSION['customerinfo']['customerno'];
180)         }
181)     }
182) 
183)     $args = array(":user" => $user,
Bernd Wurst * Weitere Module auf prepar...

Bernd Wurst authored 10 years ago

184)                 ":remote" => $_SERVER['REMOTE_ADDR'],
185)                 ":scriptname" => $scriptname,
186)                 ":scope" => $scope,
187)                 ":message" => $message);
bernd Logging aktiviert

bernd authored 16 years ago

188) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

189)     db_query("INSERT INTO misc.scriptlog (remote, user,scriptname,scope,message) VALUES (:remote, :user, :scriptname, :scope, :message)", $args);
bernd Logging aktiviert

bernd authored 16 years ago

190) }
191) 
bernd Allow Header entries and AJAX

bernd authored 15 years ago

192) function html_header($arg)
193) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

194)     global $html_header;
195)     $html_header .= $arg;
bernd Allow Header entries and AJAX

bernd authored 15 years ago

196) }
bernd Logging aktiviert

bernd authored 16 years ago

197) 
bernd Umstellung auf Theme-Suppor...

bernd authored 13 years ago

198) function title($arg)
199) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

200)     global $title;
201)     $title = $arg;
bernd Umstellung auf Theme-Suppor...

bernd authored 13 years ago

202) }
203) 
204) function headline($arg)
205) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

206)     global $headline;
207)     $headline = $arg;
bernd Umstellung auf Theme-Suppor...

bernd authored 13 years ago

208) }
209) 
bernd webinterface => /webinterface

bernd authored 17 years ago

210) function output($arg)
211) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

212)     global $output;
213)     $output .= $arg;
bernd webinterface => /webinterface

bernd authored 17 years ago

214) }
215) 
Bernd Wurst Funktion für Fußnoten einge...

Bernd Wurst authored 6 years ago

216) function footnote($explaination)
217) {
218)     global $footnotes;
219)     if (!isset($footnotes) || !is_array($footnotes)) {
220)         $footnotes = array();
221)     }
222)     $fnid = array_search($explaination, $footnotes);
Bernd Wurst Bugfix für Fußnoten

Bernd Wurst authored 6 years ago

223)     DEBUG($footnotes);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

224)     if ($fnid === false) {
Bernd Wurst Bugfix für Fußnoten

Bernd Wurst authored 6 years ago

225)         DEBUG("Footnote »{$explaination}« is not in footnotes!");
Bernd Wurst Funktion für Fußnoten einge...

Bernd Wurst authored 6 years ago

226)         $footnotes[] = $explaination;
227)     }
228)     $fnid = array_search($explaination, $footnotes);
229)     return str_repeat('*', ($fnid+1));
230) }
bernd webinterface => /webinterface

bernd authored 17 years ago

231) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

232) function random_string($len)
Bernd Wurst random_string() verwendet u...

Bernd Wurst authored 7 years ago

233) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

234)     $s = str_replace('+', '.', base64_encode(random_bytes(ceil($len*3/4))));
235)     return substr($s, 0, $len);
Bernd Wurst random_string() verwendet u...

Bernd Wurst authored 7 years ago

236) }
bernd webinterface => /webinterface

bernd authored 17 years ago

237) 
238) 
239) function are_you_sure($query_string, $question)
240) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

241)     $query_string = encode_querystring($query_string);
242)     $token = random_string(20);
243)     $_SESSION['are_you_sure_token'] = $token;
244)     title('Sicherheitsabfrage');
245)     output("
bernd * alle internen Links sinnv...

bernd authored 15 years ago

246)     <form action=\"{$query_string}\" method=\"post\">
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

247)     <div class=\"confirmation\">
248)       <div class=\"question\">{$question}</div>
249)       <p class=\"buttons\">
250)         <input type=\"hidden\" name=\"random_token\" value=\"{$token}\" />
251)         <input type=\"submit\" name=\"really\" value=\"Ja\" />
bernd Entities repariert

bernd authored 16 years ago

252)         &#160; &#160;
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

253)         <input type=\"submit\" name=\"not_really\" value=\"Nein\" />
254)       </p>
255)     </div>");
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

256)     output("</form>\n");
bernd webinterface => /webinterface

bernd authored 17 years ago

257) }
258) 
259) 
260) function user_is_sure()
261) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

262)     if (isset($_POST['really'])) {
Hanno avoid undefined index

Hanno authored 5 years ago

263)         if (array_key_exists('random_token', $_POST) &&
264)             ($_POST['random_token'] == $_SESSION['are_you_sure_token'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

265)             return true;
266)         } else {
267)             system_failure("Possible Cross-site-request-forgery detected!");
268)         }
269)     } elseif (isset($_POST['not_really'])) {
270)         return false;
271)     } else {
272)         return null;
273)     }
bernd webinterface => /webinterface

bernd authored 17 years ago

274) }
275) 
276) 
277) 
bernd XSRF-kram fixed

bernd authored 16 years ago

278) function generate_form_token($form_id)
279) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

280)     require_once("inc/debug.php");
281)     $sessid = session_id();
282)     if ($sessid == "") {
283)         DEBUG("Uh? Session not running? Wtf?");
284)         system_failure("Internal error!");
285)     }
286)     if (! isset($_SESSION['session_token'])) {
287)         $_SESSION['session_token'] = random_string(10);
288)     }
289)     return hash('sha256', $sessid.$form_id.$_SESSION['session_token']);
bernd XSRF-kram fixed

bernd authored 16 years ago

290) }
291) 
292) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

293) function check_form_token($form_id, $formtoken = null)
bernd XSRF-kram fixed

bernd authored 16 years ago

294) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

295)     if ($formtoken == null) {
296)         $formtoken = $_REQUEST['formtoken'];
297)     }
298)     $sessid = session_id();
299)     if ($sessid == "") {
300)         DEBUG("Uh? Session not running? Wtf?");
301)         system_failure("Internal error! (Session not running)");
302)     }
303) 
Bernd Wurst Erzeuge Session-Token, fall...

Bernd Wurst authored 5 years ago

304)     if (! isset($_SESSION['session_token'])) {
305)         $_SESSION['session_token'] = random_string(10);
306)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

307)     $correct_formtoken = hash('sha256', $sessid.$form_id.$_SESSION['session_token']);
308) 
309)     if (! ($formtoken == $correct_formtoken)) {
310)         system_failure("Possible cross-site-request-forgery!");
311)     }
bernd XSRF-kram fixed

bernd authored 16 years ago

312) }
313) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

314) 
bernd Zeige Links auf dem Startse...

bernd authored 14 years ago

315) function have_module($modname)
316) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

317)     return in_array($modname, config('modules'));
bernd Zeige Links auf dem Startse...

bernd authored 14 years ago

318) }
319) 
320) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

321) function use_module($modname)
Bernd Wurst Rudimentäre Adressauswahl/D...

Bernd Wurst authored 6 years ago

322) {
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

323)     global $prefix, $needed_modules;
324)     if (! isset($needed_modules)) {
325)         $needed_modules = array();
326)     }
327)     if (in_array($modname, $needed_modules)) {
328)         return;
329)     }
330)     $needed_modules[] = $modname;
Bernd Wurst Rudimentäre Adressauswahl/D...

Bernd Wurst authored 6 years ago

331)     if (! have_module($modname)) {
332)         system_failure("Soll nicht verfügbares Modul laden!");
333)     }
334)     /* setup module include path */
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

335)     ini_set('include_path', ini_get('include_path').':./modules/'.$modname.'/include:');
Bernd Wurst Rudimentäre Adressauswahl/D...

Bernd Wurst authored 6 years ago

336)     $style = 'modules/'.$modname.'/style.css';
337)     if (file_exists($style)) {
338)         html_header('<link rel="stylesheet" href="'.$prefix.$style.'" type="text/css" />'."\n");
339)     }
340) }
341) 
342) 
bernd * alle internen Links sinnv...

bernd authored 15 years ago

343) function encode_querystring($querystring)
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

344) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

345)     global $debugmode;
346)     if ($debugmode) {
347)         $querystring = 'debug&'.$querystring;
348)     }
349)     $query = explode('&', $querystring);
350)     $new_query = array();
351)     foreach ($query as $item) {
352)         if ($item != '') {
353)             $split = explode('=', $item, 2);
354)             if (count($split) == 1) {
355)                 $new_query[] = $split[0];
356)             } else {
357)                 $new_query[] = $split[0].'='.urlencode($split[1]);
358)             }
359)         }
360)     }
361)     $querystring = implode('&amp;', $new_query);
362)     if ($querystring) {
363)         $querystring = '?'.$querystring;
364)     }
365)     return $querystring;
bernd * alle internen Links sinnv...

bernd authored 15 years ago

366) }
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

367) 
bernd * alle internen Links sinnv...

bernd authored 15 years ago

368) 
Bernd Wurst Beta-Hinweis eingefügt

Bernd Wurst authored 6 years ago

369) function beta_notice()
370) {
371)     output('<div class="beta"><h4>Achtung: Testbetrieb</h4><p>Diese Funktion ist im Testbetrieb. Bei Fehlfunktionen, Unklarheiten oder Verbesserungsvorschlägen bitten wir um kurze Nachricht an <a href="mailto:root@schokokeks.org">root@schokokeks.org</a></p></div>');
372) }
373) 
374) 
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

375) function addnew($file, $label, $querystring = '', $attribs = '')
bernd addnew() eingeführt

bernd authored 14 years ago

376) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

377)     output('<p class="addnew">'.internal_link($file, $label, $querystring, $attribs).'</p>');
bernd addnew() eingeführt

bernd authored 14 years ago

378) }
379) 
bernd * alle internen Links sinnv...

bernd authored 15 years ago

380) 
381) function internal_link($file, $label, $querystring = '', $attribs = '')
382) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

383)     global $prefix;
384)     if (strpos($file, '/') === 0) {
385)         $file = $prefix.substr($file, 1);
386)     }
387)     $querystring = encode_querystring($querystring);
388)     return "<a href=\"{$file}{$querystring}\" {$attribs} >{$label}</a>";
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

389) }
390) 
391) 
392) function html_form($form_id, $scriptname, $querystring, $content)
393) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

394)     $querystring = encode_querystring($querystring);
395)     $ret = '';
396)     $ret .= '<form id="'.$form_id.'" action="'.$scriptname.$querystring.'" method="post">'."\n";
397)     $ret .= '<p style="display: none;"><input type="hidden" name="formtoken" value="'.generate_form_token($form_id).'" /></p>'."\n";
398)     $ret .= $content;
399)     $ret .= '</form>';
400)     return $ret;
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

401) }
402) 
403) 
bernd * wie viele Reihen wurden a...

bernd authored 15 years ago

404) function html_select($name, $options, $default='', $free='')
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

405) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

406)     require_once('inc/security.php');
407)     $ret = "<select name=\"{$name}\" id=\"{$name}\" size=\"1\" {$free} >\n";
408)     foreach ($options as $key => $value) {
409)         $selected = '';
410)         if ($default == $key) {
411)             $selected = ' selected="selected" ';
412)         }
413)         $key = filter_input_general($key);
414)         $value = filter_input_general($value);
415)         $ret .= "  <option value=\"{$key}\"{$selected}>{$value}</option>\n";
416)     }
417)     $ret .= '</select>';
418)     return $ret;
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

419) }
420) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

421) 
bernd Neue Funktion zur Anzeige e...

bernd authored 12 years ago

422) function html_datepicker($nameprefix, $timestamp)
423) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

424)     $valid_days = array( 1 =>  1,  2 =>  2,  3 =>  3,  4 =>  4,  5 =>  5,
bernd Neue Funktion zur Anzeige e...

bernd authored 12 years ago

425)                        6 =>  6,  7 =>  7,  8 =>  8,  9 =>  9, 10 => 10,
426)                       11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15,
427)                       16 => 16, 17 => 17, 18 => 18, 19 => 19, 20 => 20,
428)                       21 => 21, 22 => 22, 23 => 23, 24 => 24, 25 => 25,
429)                       26 => 26, 27 => 27, 28 => 28, 29 => 29, 30 => 30,
430)                       31 => 31);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

431)     $valid_months = array( 1 =>  1,  2 =>  2,  3 =>  3,  4 =>  4,  5 =>  5,
bernd Neue Funktion zur Anzeige e...

bernd authored 12 years ago

432)                          6 =>  6,  7 =>  7,  8 =>  8,  9 =>  9, 10 => 10,
433)                         11 => 11, 12 => 12);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

434)     $current_year = (int) date('Y');
435)     $valid_years = array($current_year => $current_year,
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

436)                        $current_year+1 => $current_year+1,
437)                        $current_year+2 => $current_year+2,
438)                        $current_year+3 => $current_year+3,
439)                        $current_year+4 => $current_year+4);
Hanno remove whitespace in empty...

Hanno authored 5 years ago

440) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

441)     $selected_day = date('d', $timestamp);
442)     $selected_month = date('m', $timestamp);
443)     $selected_year = date('Y', $timestamp);
444)     $ret = '';
445)     $ret .= html_select($nameprefix.'_day', $valid_days, $selected_day, 'style="text-align: right;"').". ";
446)     $ret .= html_select($nameprefix.'_month', $valid_months, $selected_month, 'style="text-align: right;"').". ";
447)     $ret .= html_select($nameprefix.'_year', $valid_years, $selected_year);
448)     return $ret;
bernd Neue Funktion zur Anzeige e...

bernd authored 12 years ago

449) }
450) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

451) function get_modules_info()
bernd Index-Blöcke werden jetzt v...

bernd authored 12 years ago

452) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

453)     $modules = config('modules');
454)     $modconfig = array();
455)     foreach ($modules as $name) {
456)         $modconfig[$name] = null;
457)         if (file_exists('modules/'.$name.'/module.info')) {
458)             $modconfig[$name] = parse_ini_file('modules/'.$name.'/module.info');
459)         }
460)     }
461)     return $modconfig;