| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Theme switcher template | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Displays available themes and allows the user to switch between them. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |  * @var array $themes List of available themes with their data | 
					
						
							|  |  |  |  *   - name: Display name | 
					
						
							|  |  |  |  *   - screenshotUrl: URL to the screenshot (or null if not available) | 
					
						
							|  |  |  |  *   - isActive: Whether this is the current theme | 
					
						
							| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | ?>
 | 
					
						
							|  |  |  |                 <div class="container mt-4"> | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |                     <h2>Theme switcher</h2> | 
					
						
							| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  |                     <p class="text-muted">Select a theme to change the appearance of the application.</p> | 
					
						
							|  |  |  |                     <div class="row mt-4"> | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |                         <?php foreach ($themes as $themeId => $theme): ?>
 | 
					
						
							| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  |                         <div class="col-md-4 mb-4"> | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |                             <div class="card h-100 <?= $theme['isActive'] ? 'border-primary' : '' ?>"> | 
					
						
							|  |  |  |                                 <!-- Theme screenshot --> | 
					
						
							|  |  |  |                                 <div class="theme-screenshot" style="height: 150px; background-size: cover; background-position: center; background-color: #f8f9fa; <?= $theme['screenshotUrl'] ? 'background-image: url(' . htmlspecialchars($theme['screenshotUrl']) . ')' : '' ?>"> | 
					
						
							|  |  |  |                                     <?php if (!$theme['screenshotUrl']): ?>
 | 
					
						
							|  |  |  |                                         <div class="h-100 d-flex align-items-center justify-content-center text-muted">No preview available</div> | 
					
						
							|  |  |  |                                     <?php endif; ?>
 | 
					
						
							|  |  |  |                                 </div> | 
					
						
							|  |  |  |                                 <?php if ($theme['isActive']): ?>
 | 
					
						
							|  |  |  |                                 <div class="card-header bg-primary text-white">Current theme</div> | 
					
						
							|  |  |  |                                 <?php endif; ?>
 | 
					
						
							| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  |                                 <div class="card-body d-flex flex-column"> | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |                                     <h5 class="card-title"><?= htmlspecialchars($theme['name']) ?></h5>
 | 
					
						
							| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  |                                     <p class="card-text text-muted">Theme ID: <code><?= htmlspecialchars($themeId) ?></code></p>
 | 
					
						
							|  |  |  |                                     <div class="mt-auto"> | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |                                         <?php if (!$theme['isActive']): ?>
 | 
					
						
							| 
									
										
										
										
											2025-06-03 08:01:14 +00:00
										 |  |  |                                         <a href="?page=theme&switch_to=<?= urlencode($themeId) ?>&csrf_token=<?= $csrf_token ?>" class="btn btn-primary">Switch to this theme</a> | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |                                         <?php else: ?>
 | 
					
						
							| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  |                                         <button class="btn btn-outline-secondary" disabled>Currently active</button> | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |                                         <?php endif; ?>
 | 
					
						
							| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  |                                     </div> | 
					
						
							|  |  |  |                                 </div> | 
					
						
							|  |  |  |                             </div> | 
					
						
							|  |  |  |                         </div> | 
					
						
							| 
									
										
										
										
											2025-06-23 11:01:29 +00:00
										 |  |  |                         <?php endforeach; ?>
 | 
					
						
							| 
									
										
										
										
											2025-05-22 11:33:54 +00:00
										 |  |  |                     </div> | 
					
						
							|  |  |  |                 </div> |