function xtreme_backend_header() { $str = ''; $child = function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme(); if ($child !== 'Xtreme One') { $str = sprintf(__('and %s.', XF_TEXTDOMAIN), $child); } else { $str = __('without any child theme (not recommended).', XF_TEXTDOMAIN); } ?> <div class="xtreme-header"> <a href="https://github.com/xtreme-themes/xtreme-one" title="Xtreme Premium WordPress Themes"> <img src="<?php echo XF_ADMIN_URL; ?> /images/xtreme-logo.png" alt="Xtreme One Logo" class="alignleft logo"/> </a> <ul> <li class="home"><a href="https://github.com/xtreme-themes/xtreme-one" title="<?php _e('Theme Homepage', XF_TEXTDOMAIN); ?> "><?php _e('Theme Homepage', XF_TEXTDOMAIN); ?> </a></li> <li class="docu"><a href="<?php echo _x('https://github.com/xtreme-themes/xtreme-one/wiki', 'Documentation Link for Xtreme', XF_TEXTDOMAIN); ?> " title="<?php _e('Documentation', XF_TEXTDOMAIN); ?> "><?php _e('Documentation', XF_TEXTDOMAIN); ?> </a></li> <li class="version"></li> </ul> </div> <h4 class="version"><?php printf(__('You are using Xtreme One Version %1s %2s', XF_TEXTDOMAIN), XF_VERSION, esc_attr($str)); ?> </h4> <?php $version = xtreme_get_production_stylesheet_version(); if ($version !== '') { echo "<p><em>"; printf(__('Your Caching-File was regenerated at %s', XF_TEXTDOMAIN), date('d.m.Y h:i', $version)); echo "</em></p>"; } ?> <br class="clear" /> <?php }
/** * Detects if the production-min.css is outdated and prints an admin-notice * * @return Void */ function detect_outdated_production_stylesheet() { $outdated = false; $output = ''; $stylesheets = array(XF_CHILD_THEME_DIR . '/css/screen/theme.css', XF_CHILD_THEME_DIR . '/css/screen/theme.responsive.css'); $current_version = xtreme_get_production_stylesheet_version(); if ($current_version === '') { return; } foreach ($stylesheets as $stylesheet) { if (file_exists($stylesheet)) { $file_version = filemtime($stylesheet); if ($file_version > $current_version) { $outdated = true; $output .= '<li>»<code>' . basename($stylesheet) . '</code> (' . date('d.m.Y h:i', $file_version) . ')</li>'; } } } if ($outdated) { echo '<div class="updated">'; echo '<p>'; printf(__(' Following Stylesheets are newer than your <code>production-min.css</code> (%s):', XF_TEXTDOMAIN), date('d.m.Y h:i', $current_version)); echo '</p>'; echo '<ul>' . $output . '</ul>'; echo '<p>' . __('Please regenerate your Theme to see the changes.', XF_TEXTDOMAIN) . '</p>'; echo '</div>'; } }