get($key, $default); } /** * Generate site logo HTML */ function siteLogo($type = 'main', $class = '', $alt = null) { return getBranding()->getLogo($type, $class, $alt); } /** * Generate badge HTML */ function badge($type, $text = null, $class = '') { return getBranding()->getBadge($type, $text, $class); } /** * Get site information array */ function siteInfo() { return getBranding()->getSiteInfo(); } /** * Generate dynamic CSS link tag */ function dynamicCSSLink() { $timestamp = time(); // For cache busting return ""; } /** * Generate inline CSS variables for quick access */ function inlineCSSVariables() { $branding = getBranding(); $css = "\n"; return $css; } /** * Generate meta tags for branding */ function brandingMetaTags() { $siteInfo = siteInfo(); $meta = "\n"; $meta .= "\n"; $meta .= "\n"; $meta .= "\n"; $meta .= "\n"; return $meta; } /** * Generate header HTML with branding */ function brandedHeader($includeNav = true) { $siteInfo = siteInfo(); $branding = getBranding(); $html = "
get('color_bg_header', '#ffffff') . ";\">\n"; $html .= "
\n"; $html .= "
\n"; $html .= "
\n"; $html .= " " . siteLogo('main', 'main-logo') . "\n"; $html .= " " . htmlspecialchars($siteInfo['name']) . "\n"; $html .= "
\n"; if ($includeNav) { $html .= " \n"; } $html .= "
\n"; $html .= "
\n"; $html .= "
\n"; return $html; } /** * Generate footer HTML with branding */ function brandedFooter() { $siteInfo = siteInfo(); $branding = getBranding(); $html = "\n"; return $html; } /** * Generate video card HTML with branding */ function videoCard($video, $showBadges = true) { $branding = getBranding(); $html = "
\n"; $html .= "
\n"; $html .= " \""\n"; if ($showBadges && isset($video['badges'])) { $html .= "
\n"; foreach ($video['badges'] as $badgeType) { $html .= " " . badge($badgeType) . "\n"; } $html .= "
\n"; } $html .= "
\n"; $html .= "
\n"; $html .= "

" . htmlspecialchars($video['title']) . "

\n"; $html .= "

" . htmlspecialchars($video['author'] ?? 'Unknown') . "

\n"; $html .= "
\n"; $html .= " " . number_format($video['views'] ?? 0) . " views\n"; $html .= " " . htmlspecialchars($video['date'] ?? '') . "\n"; $html .= "
\n"; $html .= "
\n"; $html .= "
\n"; return $html; } /** * Generate user avatar with branding */ function userAvatar($user, $size = 'medium', $showBadges = true) { $branding = getBranding(); $sizes = ['small' => 32, 'medium' => 48, 'large' => 64]; $pixelSize = $sizes[$size] ?? 48; $avatar = $user['avatar'] ?? brandingGet('default_avatar'); $html = "
\n"; $html .= " \""\n"; if ($showBadges && isset($user['verified']) && $user['verified']) { $html .= " " . badge('verified') . "\n"; } if ($showBadges && isset($user['premium']) && $user['premium']) { $html .= " " . badge('premium') . "\n"; } $html .= "
\n"; return $html; } /** * Generate notification HTML with branding */ function notification($message, $type = 'info', $dismissible = true) { $typeClasses = [ 'success' => 'notification-success', 'error' => 'notification-error', 'warning' => 'notification-warning', 'info' => 'notification-info' ]; $class = $typeClasses[$type] ?? 'notification-info'; $html = "
\n"; $html .= "
\n"; $html .= " " . htmlspecialchars($message) . "\n"; $html .= "
\n"; if ($dismissible) { $html .= " \n"; } $html .= "
\n"; return $html; } /** * Generate button HTML with branding */ function button($text, $type = 'primary', $href = null, $attributes = []) { $tag = $href ? 'a' : 'button'; $class = "btn btn-$type"; if (isset($attributes['class'])) { $class .= ' ' . $attributes['class']; unset($attributes['class']); } $attrs = ''; foreach ($attributes as $key => $value) { $attrs .= " $key=\"" . htmlspecialchars($value) . "\""; } if ($href) { $attrs .= " href=\"" . htmlspecialchars($href) . "\""; } return "<$tag class=\"$class\"$attrs>" . htmlspecialchars($text) . ""; } /** * Generate form input with branding */ function formInput($name, $type = 'text', $value = '', $attributes = []) { $class = 'form-input'; if (isset($attributes['class'])) { $class .= ' ' . $attributes['class']; unset($attributes['class']); } $attrs = "class=\"$class\" name=\"" . htmlspecialchars($name) . "\" type=\"$type\""; if ($value) { $attrs .= " value=\"" . htmlspecialchars($value) . "\""; } foreach ($attributes as $key => $val) { $attrs .= " $key=\"" . htmlspecialchars($val) . "\""; } return ""; } /** * Check if dark mode is enabled */ function isDarkMode() { return brandingGet('enable_dark_mode', true); } /** * Get current theme preset name */ function getCurrentTheme() { // This could be enhanced to track the current active theme return brandingGet('current_theme', 'Default Blue'); } /** * Generate theme switcher HTML */ function themeSwitcher() { if (!isDarkMode()) { return ''; } $html = "
\n"; $html .= " \n"; $html .= "
\n"; $html .= "\n"; return $html; } ?>