@if(auth()->user()->role == 'admin')
@if(env('ENABLE_THEME_UPDATER') == 'true')
{{__('messages.Theme name')}} |
{{__('messages.Update status')}} |
{{__('messages.Version')}} |
0) {
$verNr = substr($matches[0][0],15);
}
}
$themeVe = NULL;
if(!isset($verNr)){$verNr = "error";};
if ($entry != "." && $entry != "..") {
echo '';
echo ''; print_r(ucfirst($entry));
echo ' | ';
echo '';
if(file_exists(base_path('themes') . '/' . $entry . '/readme.md')){
if(!strpos(file_get_contents(base_path('themes') . '/' . $entry . '/readme.md'), 'Source code:')){$hasSource = false;}else{
$hasSource = true;
$text = file_get_contents(base_path('themes') . '/' . $entry . '/readme.md');
$pattern = '/Source code:.*/';
preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE);
$sourceURL = substr($matches[0][0],13);
$replaced = str_replace("https://github.com/", "https://raw.githubusercontent.com/", trim($sourceURL));
$replaced = $replaced . "/main/readme.md";
if (strpos($sourceURL, 'github.com')){
ini_set('user_agent', 'Mozilla/4.0 (compatible; MSIE 6.0)');
try{
$textGit = external_file_get_contents($replaced);
$patternGit = '/Theme Version:.*/';
preg_match($patternGit, $textGit, $matches, PREG_OFFSET_CAPTURE);
$sourceURLGit = substr($matches[0][0],15);
$Vgitt = 'v' . $sourceURLGit;
$verNrv = 'v' . $verNr;
}catch(Exception $ex){
$themeVe = "error";
$Vgitt = NULL;
$verNrv = NULL;
}
if(trim($Vgitt) > trim($verNrv)){
$updateAv = true;
$GLOBALS['updateAv'] = true;
} else {
$updateAv = false;
}
} else {$themeVe = "error";}
}
}
if ($themeVe == "error") {
echo ''.__('messages.Error').'';
} elseif ($hasSource == false) {
echo ''.__('messages.Update manually').'';
} elseif($updateAv == true) {
echo ''.__('messages.Update available').'';
} else {
echo ''.__('messages.Up to date').'';
}
echo ' | ';
echo '' . $verNr . ' | ';
echo '
';}
} } ?>
{{__('messages.Update all themes')}}
'.__('messages.Update available').'';
}catch(Exception $ex){}
?>
@endif
@endif