fix allow setting a default schema for the hub (issue #797) and allow selecting of focus (hubzilla default) schema if a default is set.
This commit is contained in:
parent
47d55694a4
commit
58b5c4cc16
@ -5,10 +5,20 @@ namespace Zotlabs\Theme;
|
|||||||
class RedbasicConfig {
|
class RedbasicConfig {
|
||||||
|
|
||||||
function get_schemas() {
|
function get_schemas() {
|
||||||
$scheme_choices = array();
|
|
||||||
$scheme_choices["---"] = t("Focus (Hubzilla default)");
|
|
||||||
$files = glob('view/theme/redbasic/schema/*.php');
|
$files = glob('view/theme/redbasic/schema/*.php');
|
||||||
|
|
||||||
|
$scheme_choices = [];
|
||||||
|
|
||||||
if($files) {
|
if($files) {
|
||||||
|
|
||||||
|
if(in_array('view/theme/redbasic/schema/default.php', $files)) {
|
||||||
|
$scheme_choices['---'] = t('Default');
|
||||||
|
$scheme_choices['focus'] = t('Focus (Hubzilla default)');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$scheme_choices['---'] = t('Focus (Hubzilla default)');
|
||||||
|
}
|
||||||
|
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
$f = basename($file, ".php");
|
$f = basename($file, ".php");
|
||||||
if($f != 'default') {
|
if($f != 'default') {
|
||||||
@ -17,6 +27,7 @@ class RedbasicConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $scheme_choices;
|
return $scheme_choices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,10 +56,9 @@ if (($schema) && ($schema != '---')) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we haven't got a schema, load the default. We shouldn't touch this - we
|
// Allow admins to set a default schema for the hub.
|
||||||
// should leave it for admins to define for themselves.
|
// default.php and default.css MUST be symlinks to existing schema files in view/theme/redbasic/schema
|
||||||
// default.php and default.css MUST be symlinks to existing schema files.
|
if ((!$schema) || ($schema == '---')) {
|
||||||
if (! $schema) {
|
|
||||||
|
|
||||||
if(file_exists('view/theme/redbasic/schema/default.php')) {
|
if(file_exists('view/theme/redbasic/schema/default.php')) {
|
||||||
$schemefile = 'view/theme/redbasic/schema/default.php';
|
$schemefile = 'view/theme/redbasic/schema/default.php';
|
||||||
|
Reference in New Issue
Block a user