Update theme.blade.php

This commit is contained in:
Julian Prieber 2022-11-25 17:41:00 +01:00
parent b8259b2d88
commit 1287fae1f4

View File

@ -30,14 +30,14 @@
} }
if($page->theme != $entry){echo '<option value="'; print_r($entry); echo '">'; echo $themeName; echo '</option>'; }}}} ?> if($page->theme != $entry){echo '<option value="'; print_r($entry); echo '">'; echo $themeName; echo '</option>'; }}}} ?>
<?php <?php
if($page->theme != "default"){ if($page->theme != "default" and $page->theme != ""){
if(file_exists(base_path('themes') . '/' . $page->theme . '/readme.md')){ if(file_exists(base_path('themes') . '/' . $page->theme . '/readme.md')){
$text = file_get_contents(base_path('themes') . '/' . $page->theme . '/readme.md'); $text = file_get_contents(base_path('themes') . '/' . $page->theme . '/readme.md');
$pattern = '/Theme Name:.*/'; $pattern = '/Theme Name:.*/';
preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE); preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE);
$themeName = substr($matches[0][0],12);} $themeName = substr($matches[0][0],12);}
echo '<option value="'.$page->theme.'" selected>'.$themeName.'</option>';} ?> echo '<option value="'.$page->theme.'" selected>'.$themeName.'</option>';} ?>
<?php echo '<option value="default"'; if($page->theme == "default"){echo 'selected';} echo '>Default</option>'; ?> <?php echo '<option value="default"'; if($page->theme == "default" or $page->theme == ""){echo 'selected';} echo '>Default</option>'; ?>
</select> </select>
</div> </div>
<div class="col"> <div class="col">