69881011cd24843de4ab7059745126804864e745.php 1.74 KB
<?php

$themes = explode(",",env('themes'));

if($userCurrentTheme != ""){
	if(!in_array($userCurrentTheme, $themes)){$userCurrentTheme = "Default";}
}else{ $userCurrentTheme = "Default"; }

?>

<?php if(isset($response)): ?>
	<script>
		simpleNotification("<?php echo e($response['type']); ?>","topRight","<?php echo e($response['message']); ?>");
		<?php if($response['type'] == "success"): ?>
			setTimeout(function(){ window.location.reload(); }, 1000);
		<?php endif; ?>
	</script>
<?php endif; ?>

<h4>Select Theme <span class="pull-right"><small>Current Theme - </small><?php echo e($userCurrentTheme); ?></span></h4>
<hr style="margin-bottom: 10px;">

<div class="row">
	<?php foreach($themes as $theme): ?>
	<div class="col-sm-3">
		<div class="themeBox" style="<?php echo e($theme == $userCurrentTheme ? 'border:1px solid #f30;background-color: #ffe9e9' : ''); ?>">
			<h4><?php echo e($theme); ?>

				<?php if($theme == $userCurrentTheme): ?>
					<span class="pull-right label label-primary btn-xs">Current Theme</span>
				<?php else: ?>
					<button class="pull-right btn btn-success btn-xs" onclick="changeTheme('<?php echo e($theme); ?>');return false;">Select Theme</button>
				<?php endif; ?>
			</h4>
			<hr style="margin-top: 10px;margin-bottom: 5px;">
			<div class="text-center">
				<img src="<?php echo e(URL::to('assets/themes/'.$theme.'.png')); ?>" class="img-responsive" alt="" />		
			</div>
		</div>
	</div>
	<?php endforeach; ?>
</div>

<style>
	.themeBox{margin: 10px;padding: 10px !important;border:1px solid #eee;border-radius: 5px;}
	.themeBox:hover{background-color: #eee;}
</style>

<script type="text/javascript">
	function changeTheme(value){
		doAjax('setting/theme?name='+value,'','settingThemeArea','','singlethis','GET');
	}
</script>