aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/redbasic/php/theme.php
blob: b7e08705c36b7d531da14a752ed3bb04f9e425c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

/**
 *   * Name: Redbasic
 *   * Description: Hubzilla standard theme
 *   * Version: 2.2
 *   * MinVersion: 8.0
 *   * MaxVersion: 9.0
 *   * Author: Fabrixxm
 *   * Maintainer: Mike Macgirvin
 *   * Maintainer: Mario Vavti
 *   * Theme_Color: rgb(248, 249, 250)
 *   * Background_Color: rgb(254,254,254)
 */


function redbasic_init(&$a) {

	$mode = '';
	$navbar_mode = '';

	if (local_channel()) {
		$mode = ((get_pconfig(local_channel(), 'redbasic', 'dark_mode')) ? 'dark' : 'light');
		$navbar_mode = ((get_pconfig(local_channel(), 'redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
	}

	if (App::$profile_uid) {
		$mode = ((get_pconfig(App::$profile_uid, 'redbasic', 'dark_mode')) ? 'dark' : 'light');
		$navbar_mode = ((get_pconfig(App::$profile_uid, 'redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
	}

	if (!$mode) {
		$mode = ((get_config('redbasic', 'dark_mode')) ? 'dark' : 'light');
		$navbar_mode = ((get_config('redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
	}

	App::$page['color_mode'] = 'data-bs-theme="' . $mode . '"';
	App::$page['navbar_color_mode'] = (($navbar_mode === 'dark') ? 'data-bs-theme="' . $navbar_mode . '"' : '');
}