Skip to content

Commit

Permalink
#1678 Define theme features in JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Studio384 committed Jun 17, 2018
1 parent dcbbe05 commit dd9860a
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 388 deletions.
12 changes: 6 additions & 6 deletions backstage/appearance.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@
<div class="col-sm-9">
<select class="form-control" name="form[default_style]">
<?php
$styles = forum_list_styles();

foreach ($styles as $temp) {
if ($luna_config['o_default_style'] == $temp) {
echo "\t\t\t\t\t\t\t\t\t\t\t" . '<option value="' . $temp . '" selected="selected">' . str_replace('_', ' ', $temp) . '</option>' . "\n";
$styles = forum_list_themes();

foreach ($styles as &$style) {
if ($luna_config['o_default_style'] == $style['id']) {
echo '<option value="'.$style['id'].'" selected="selected">'.str_replace('_', ' ', $style['name']).' v'.$style['version'].'</option>';
} else {
echo "\t\t\t\t\t\t\t\t\t\t\t" . '<option value="' . $temp . '">' . str_replace('_', ' ', $temp) . '</option>' . "\n";
echo '<option value="'.$temp.'">'.str_replace('_', ' ', $style['name']).' v'.$style['version'].'</option>';
}

}

?>
Expand Down
674 changes: 295 additions & 379 deletions include/functions.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static function validate_config($username, $password1, $password2, $email
$alerts[] = __('The default language chosen doesn\'t seem to exist.', 'luna');
}

$styles = forum_list_styles();
$styles = forum_list_themes();
if (!in_array($default_style, $styles)) {
$alerts[] = __('The default style chosen doesn\'t seem to exist.', 'luna');
}
Expand Down
2 changes: 1 addition & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ function process_form(the_form) {
<select id="req_default_style" class="form-control" name="req_default_style">
<?php

$styles = forum_list_styles();
$styles = forum_list_themes();
foreach ($styles as $temp) {
if ($temp == $default_style) {
echo "\t\t\t\t\t\t\t\t\t" . '<option value="' . $temp . '" selected>' . str_replace('_', ' ', $temp) . '</option>' . "\n";
Expand Down
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@

// Make sure we got a valid style string
if (isset($_POST['form']['style'])) {
$styles = forum_list_styles();
$styles = forum_list_themes();
$form['style'] = luna_trim($_POST['form']['style']);
if (!in_array($form['style'], $styles))
message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna'), false, '404 Not Found');
Expand Down
9 changes: 9 additions & 0 deletions themes/Fifteen/theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "fifteen",
"name": "Fifteen",
"developer": "Studio 384",
"date": "14 June 2018",
"version": "2.1-alpha.2",
"minversion": "2.0.0",
"maxversion": "2.1-alpha.2"
}
11 changes: 11 additions & 0 deletions themes/Sunrise/theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

{
"id": "sunrise",
"name": "Sunrise",
"developer": "Studio 384",
"date": "14 June 2018",
"version": "3.1-alpha.2",
"minversion": "2.0.0",
"maxversion": "3.1-alpha.2",
"parent": "fifteen"
}

0 comments on commit dd9860a

Please sign in to comment.