Beispiel #1
0
/**
 * Merges style.css, settings stylesheet and custom.css, then minifies it into
 * one minified.css file. Also creates individual beautified settings stylesheet
 * so they are in sync, and attempts to create custom stylesheet if it doesn't
 * exist.
 *
 * @author Gary Jones
 * @since 0.9.7
 * @version 1.0
 */
function premise_create_stylesheets()
{
    premise_make_stylesheet_path_writable();
    global $premise_design_settings, $premise_base;
    $styles = $premise_design_settings->get_settings();
    $base_css = file_get_contents($premise_base->get_theme_directory() . '/style.css');
    $css_prefix = '/* ' . __('This file is auto-generated from the style.css, the settings page and custom.css. Any direct edits here will be lost if the settings page is saved', 'premise') . ' */' . "\n";
    foreach ($styles as $key => $style) {
        $css = $base_css . premise_prepare_settings_stylesheet($key);
        if (premise_is_custom_stylesheet_used()) {
            $css .= file_get_contents(premise_get_custom_stylesheet_path());
        }
        $css = $css_prefix . premise_minify_css($css);
        $handle = @fopen(premise_get_minified_stylesheet_path($key), 'w');
        @fwrite($handle, $css);
        @fclose($handle);
        premise_create_settings_stylesheet($key);
        premise_create_custom_stylesheet($key);
    }
}
Beispiel #2
0
 /**
  * Add notices to the top of the page when certain actions take place.
  *
  * Add default notices via parent::notices() as well as a few custom ones.
  *
  * @since 1.5.0
  *
  */
 function notices()
 {
     /** Check to verify we're on the right page */
     if (!accesspress_is_menu_page($this->page_id)) {
         return;
     }
     /** Show error if can't write to server */
     if (!premise_make_stylesheet_path_writable()) {
         if (!is_multisite() || is_super_admin()) {
             $message = __('The %s folder does not exist or is not writeable. Please create it or <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a> to 777.', 'premise');
         } else {
             $message = __('The %s folder does not exist or is not writeable. Please contact your network administrator.', 'premise');
         }
         $css_path = premise_get_stylesheet_location('path');
         echo '<div id="message-unwritable" class="error"><p><strong>' . sprintf($message, _get_template_edit_filename($css_path, dirname($css_path))) . '</strong></p></div>';
     }
     /** Genesis_Admin notices */
     parent::notices();
 }