Browse code

Codingstyle PSR12 + array syntax

Hanno Böck authored on 30/10/2021 21:18:17
Showing 1 changed files
... ...
@@ -18,7 +18,7 @@ function show_page($path = null)
18 18
 {
19 19
     global $prefix, $go, $title, $headline, $output, $module, $page, $html_header, $footnotes;
20 20
 
21
-    $styles = array();
21
+    $styles = [];
22 22
     if (file_exists("modules/{$module}/style.css")) {
23 23
         $styles[] = "modules/{$module}/style.css";
24 24
     }
... ...
@@ -33,7 +33,7 @@ function show_page($path = null)
33 33
         $theme = 'default';
34 34
     }
35 35
     $theme_path = "themes/$theme/";
36
-    $candidates = array();
36
+    $candidates = [];
37 37
     if ($page) {
38 38
         $candidates[] = "{$theme_path}page-$module-$page.tpl.php";
39 39
     }
Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on 26/06/2018 13:58:19
Showing 1 changed files
... ...
@@ -8,63 +8,66 @@ Written 2008-2018 by schokokeks.org Hosting, namely
8 8
 
9 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 10
 
11
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12 12
 http://creativecommons.org/publicdomain/zero/1.0/
13 13
 
14 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 15
 */
16 16
 
17
-function show_page($path = NULL) 
17
+function show_page($path = null)
18 18
 {
19
-  global $prefix, $go, $title, $headline, $output, $module, $page, $html_header, $footnotes;
19
+    global $prefix, $go, $title, $headline, $output, $module, $page, $html_header, $footnotes;
20 20
 
21
-  $styles = array();
22
-  if (file_exists("modules/{$module}/style.css")) {
23
-      $styles[] = "modules/{$module}/style.css";
24
-  }
25
-  foreach ($styles as $style) {
26
-      html_header('<link rel="stylesheet" href="'.$prefix.$style.'" type="text/css" />'."\n");
27
-  }
28
-  if ($path) {
29
-  	$module = $path;
30
-  }
31
-  $theme = config('theme');
32
-  if (! $theme)
33
-    $theme = 'default';
34
-  $theme_path = "themes/$theme/";
35
-  $candidates = array();
36
-  if ($page) {
37
-    $candidates[] = "{$theme_path}page-$module-$page.tpl.php";
38
-  }
39
-  $candidates[] = "{$theme_path}page-$module.tpl.php";
40
-  $candidates[] = "{$theme_path}page.tpl.php";
41
-  if ($page) {
42
-    $candidates[] = "modules/{$module}/theme/page-$page.tpl.php";
43
-  }
44
-  $candidates[] = "modules/{$module}/theme/page.tpl.php";
45
-  if ($page) {
46
-    $candidates[] = "themes/default/page-$module-$page.tpl.php";
47
-  }
48
-  $candidates[] = "themes/default/page-$module.tpl.php";
49
-  $candidates[] = "themes/default/page.tpl.php";
21
+    $styles = array();
22
+    if (file_exists("modules/{$module}/style.css")) {
23
+        $styles[] = "modules/{$module}/style.css";
24
+    }
25
+    foreach ($styles as $style) {
26
+        html_header('<link rel="stylesheet" href="'.$prefix.$style.'" type="text/css" />'."\n");
27
+    }
28
+    if ($path) {
29
+        $module = $path;
30
+    }
31
+    $theme = config('theme');
32
+    if (! $theme) {
33
+        $theme = 'default';
34
+    }
35
+    $theme_path = "themes/$theme/";
36
+    $candidates = array();
37
+    if ($page) {
38
+        $candidates[] = "{$theme_path}page-$module-$page.tpl.php";
39
+    }
40
+    $candidates[] = "{$theme_path}page-$module.tpl.php";
41
+    $candidates[] = "{$theme_path}page.tpl.php";
42
+    if ($page) {
43
+        $candidates[] = "modules/{$module}/theme/page-$page.tpl.php";
44
+    }
45
+    $candidates[] = "modules/{$module}/theme/page.tpl.php";
46
+    if ($page) {
47
+        $candidates[] = "themes/default/page-$module-$page.tpl.php";
48
+    }
49
+    $candidates[] = "themes/default/page-$module.tpl.php";
50
+    $candidates[] = "themes/default/page.tpl.php";
50 51
 
51
-  $theme_file = NULL;
52
-  foreach ($candidates AS $c) {
53
-  	if (file_exists($c)) {
54
-		$theme_file = $c;
55
-		break;
56
-	}
57
-  }
58
-  if (! file_exists($theme_file))
59
-    die("cannot get any theme file");
52
+    $theme_file = null;
53
+    foreach ($candidates as $c) {
54
+        if (file_exists($c)) {
55
+            $theme_file = $c;
56
+            break;
57
+        }
58
+    }
59
+    if (! file_exists($theme_file)) {
60
+        die("cannot get any theme file");
61
+    }
60 62
 
61
-  include('inc/top.php');
62
-  if (!isset($title))
63
-    $title = '';
64
-  if (!isset($headline))
65
-    $headline = $title;
66
-  $content = $output;
63
+    include('inc/top.php');
64
+    if (!isset($title)) {
65
+        $title = '';
66
+    }
67
+    if (!isset($headline)) {
68
+        $headline = $title;
69
+    }
70
+    $content = $output;
67 71
 
68
-  include($theme_file);
72
+    include($theme_file);
69 73
 }
70
-
Browse code

Binde style.css von Modulen automatisch ein wenn vorhanden

Bernd Wurst authored on 19/01/2018 20:46:12
Showing 1 changed files
... ...
@@ -16,7 +16,15 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
16 16
 
17 17
 function show_page($path = NULL) 
18 18
 {
19
-  global $go, $title, $headline, $output, $module, $page, $html_header, $footnotes;
19
+  global $prefix, $go, $title, $headline, $output, $module, $page, $html_header, $footnotes;
20
+
21
+  $styles = array();
22
+  if (file_exists("modules/{$module}/style.css")) {
23
+      $styles[] = "modules/{$module}/style.css";
24
+  }
25
+  foreach ($styles as $style) {
26
+      html_header('<link rel="stylesheet" href="'.$prefix.$style.'" type="text/css" />'."\n");
27
+  }
20 28
   if ($path) {
21 29
   	$module = $path;
22 30
   }
Browse code

Copyright year update

Bernd Wurst authored on 13/01/2018 06:07:05
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Funktion für Fußnoten eingebaut (Theme-Änderung nötig!)

Bernd Wurst authored on 12/01/2018 11:47:35
Showing 1 changed files
... ...
@@ -16,7 +16,7 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
16 16
 
17 17
 function show_page($path = NULL) 
18 18
 {
19
-  global $go, $title, $headline, $output, $module, $page, $html_header;
19
+  global $go, $title, $headline, $output, $module, $page, $html_header, $footnotes;
20 20
   if ($path) {
21 21
   	$module = $path;
22 22
   }
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on 08/02/2014 05:45:07
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2013 by schokokeks.org Hosting, namely
5
+Written 2008-2014 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Updated copyright notice (2012 => 2013)

Bernd Wurst authored on 19/01/2013 10:49:50
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2012 by schokokeks.org Hosting, namely
5
+Written 2008-2013 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Added license tags for CC0, README and COPYING

Bernd Wurst authored on 11/03/2012 15:40:04
Showing 1 changed files
... ...
@@ -1,4 +1,18 @@
1 1
 <?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2012 by schokokeks.org Hosting, namely
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
+
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
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
+*/
2 16
 
3 17
 function show_page($path = NULL) 
4 18
 {
Browse code

Auch $html_header muss dem Theme zur Verfügung stehen

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1815 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 19/09/2010 10:05:40
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 
3 3
 function show_page($path = NULL) 
4 4
 {
5
-  global $go, $title, $headline, $output, $module, $page;
5
+  global $go, $title, $headline, $output, $module, $page, $html_header;
6 6
   if ($path) {
7 7
   	$module = $path;
8 8
   }
Browse code

Setze "default" als Standard-Theme

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1813 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 18/09/2010 13:49:26
Showing 1 changed files
... ...
@@ -7,6 +7,8 @@ function show_page($path = NULL)
7 7
   	$module = $path;
8 8
   }
9 9
   $theme = config('theme');
10
+  if (! $theme)
11
+    $theme = 'default';
10 12
   $theme_path = "themes/$theme/";
11 13
   $candidates = array();
12 14
   if ($page) {
Browse code

Benutze überall title() statt output("<h3>...</h3>")

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1812 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 18/09/2010 13:35:15
Showing 1 changed files
... ...
@@ -37,6 +37,8 @@ function show_page($path = NULL)
37 37
   include('inc/top.php');
38 38
   if (!isset($title))
39 39
     $title = '';
40
+  if (!isset($headline))
41
+    $headline = $title;
40 42
   $content = $output;
41 43
 
42 44
   include($theme_file);
Browse code

Umstellung auf Theme-Support (Frei nach phptemplate)

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1811 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 18/09/2010 13:35:10
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,44 @@
1
+<?php
2
+
3
+function show_page($path = NULL) 
4
+{
5
+  global $go, $title, $headline, $output, $module, $page;
6
+  if ($path) {
7
+  	$module = $path;
8
+  }
9
+  $theme = config('theme');
10
+  $theme_path = "themes/$theme/";
11
+  $candidates = array();
12
+  if ($page) {
13
+    $candidates[] = "{$theme_path}page-$module-$page.tpl.php";
14
+  }
15
+  $candidates[] = "{$theme_path}page-$module.tpl.php";
16
+  $candidates[] = "{$theme_path}page.tpl.php";
17
+  if ($page) {
18
+    $candidates[] = "modules/{$module}/theme/page-$page.tpl.php";
19
+  }
20
+  $candidates[] = "modules/{$module}/theme/page.tpl.php";
21
+  if ($page) {
22
+    $candidates[] = "themes/default/page-$module-$page.tpl.php";
23
+  }
24
+  $candidates[] = "themes/default/page-$module.tpl.php";
25
+  $candidates[] = "themes/default/page.tpl.php";
26
+
27
+  $theme_file = NULL;
28
+  foreach ($candidates AS $c) {
29
+  	if (file_exists($c)) {
30
+		$theme_file = $c;
31
+		break;
32
+	}
33
+  }
34
+  if (! file_exists($theme_file))
35
+    die("cannot get any theme file");
36
+
37
+  include('inc/top.php');
38
+  if (!isset($title))
39
+    $title = '';
40
+  $content = $output;
41
+
42
+  include($theme_file);
43
+}
44
+