Example #1
0
function cfcp_child_theme_export()
{
    if (current_user_can('edit_theme_options') && isset($_GET['cf_action']) && $_GET['cf_action'] == 'cfcp_child_theme_export') {
        $settings = cf_colors_get_settings();
        if (!isset($settings['theme'])) {
            wp_die('Sorry, an error occured.');
        }
        header('Cache-Control: public');
        header('Content-Description: File Transfer');
        header('Content-Disposition: attachment; filename=style.css');
        header('Content-Type: application/zip');
        header('Content-type: text-css');
        echo '/*
Theme Name:     FavePersonal Child Theme (' . $settings['theme']['title'] . ')
Description:    Child theme for FavePersonal (based on <a href="' . $settings['theme']['link'] . '">' . $settings['theme']['title'] . '</a> by ' . $settings['theme']['author'] . ')
Author:         ' . get_bloginfo('name') . '
Author URI:     ' . home_url() . '
Template:       favepersonal
Version:        1.0
*/

/* Add your custom CSS styles here */




/* Your selected colors are below */
';
        echo cfcp_color_css() . "\n\n";
        die;
    }
}
Example #2
0
    function cf_colors_settings_form()
    {
        if ($settings = cf_colors_get_settings()) {
            $colors = $settings['colors'];
            $colors_html = cf_colors_colors_html($settings);
        } else {
            $colors = '';
            $colors_html = '';
        }
        $message = '';
        if (!empty($_GET['updated']) && $_GET['updated'] == true) {
            $message = '<div class="updated below-h2 fade cf-kuler-message-fade" id="message"><p>' . __('Settings updated.', 'cf-colors') . '</p></div>';
        }
        print '
<div class="wrap cf-kuler-wrap cf-clearfix">
	' . screen_icon() . '
	<h2>' . __('Color Settings', 'cf-colors') . '</h2>
	' . $message . '
	<div class="cfcp-section">
		<h3 id="selected-theme" class="cfcp-section-title"><span>' . __('My Colors', 'cf-colors') . '</span></h3>
		<div id="cf-kuler-swatch-selected" class="cf-clearfix">
			' . $colors_html . '
		</div>
		' . cf_colors_color_picker($colors_html) . '
		<form id="cf_colors_settings_form" name="cf_colors_settings_form" action="' . admin_url('themes.php') . '" method="post">
			<input type="hidden" name="cf_action" value="cf_colors_update_settings" />
			<input type="hidden" name="cf_colors_colors" id="cf_colors_colors" value="' . $colors . '" />
			<div id="cf-kuler-theme-info">
				';
        if (!empty($settings['theme'])) {
            echo cf_colors_theme_fields($settings['theme']);
        }
        print '
			</div>
			<p>
				<input type="button" name="preview_button" value="' . __('Preview', 'cf-colors') . '" class="button" id="preview-selected" />
				<input type="submit" name="submit_button" value="' . __('Save Settings', 'cf-colors') . '" class="button-primary" />
			</p>
		';
        wp_nonce_field('cf_colors_update_settings');
        print '
		</form>
	</div><!-- .cfcp-section -->

	<div class="cfcp-section" id="cf-colors-tabs">
		<h3 class="cfcp-section-title"><span>' . __('Browse Colors', 'cf-colors') . '</span></h3>
		<div class="cf-nav">
			<form action="#" id="cf-kuler-search-form" data-start="0" data-page="' . CF_COLORS_ITEMS_PER_PAGE . '">
				<input type="text" name="cf_colors_search" id="cf_colors_search" />
				<input type="submit" class="button" name="" value="' . __('Search Colors', 'cf-colors') . '" />
			</form>
			<ul id="cf-kuler-menu">
				<li><a href="#" data-request="get" data-listtype="popular" data-start="0" data-items="' . CF_COLORS_ITEMS_PER_PAGE . '">' . __('Popular', 'cf-colors') . '</a></li>
				<li><a href="#" data-request="get" data-listtype="recent" data-start="0" data-items="' . CF_COLORS_ITEMS_PER_PAGE . '">' . __('New', 'cf-colors') . '</a></li>
				<li><a href="#" data-request="get" data-listtype="random" data-start="0" data-items="' . CF_COLORS_ITEMS_PER_PAGE . '">' . __('Random', 'cf-colors') . '</a></li>
			</ul>
		</div>
		<div id="cf-kuler-swatch-selector">
		</div>
	</div><!-- .cfcp-section -->
</div>


<div id="cf-kuler-preview" class="cfp-popover" style="display: none;">
	<div class="cfp-popover-notch"></div>
	<div class="cfp-popover-inner">
		<div class="cfp-popover-content">
			<div class="cf-kuler-preview-page">
				<div class="cf-kuler-preview-header">
					<div class="cf-kuler-preview-logo"></div>
					<ul class="cf-kuler-preview-link">
						<li></li>
						<li></li>
						<li></li>
						<li></li>
					</ul>
				</div>
				<div class="cf-kuler-preview-masthead">
					<div class="cf-kuler-preview-featured"></div>
					<div class="cf-kuler-preview-featured"></div>
					<div class="cf-kuler-preview-featured"></div>
				</div>
				<div class="cf-kuler-preview-sidebar">
					<div class="cf-kuler-preview-bio"></div>
					<div class="cf-kuler-preview-widget"></div>
					<div class="cf-kuler-preview-widget"></div>
				</div>
				<div class="cf-kuler-preview-footer"></div>
			</div><!--.cf-kuler-preview-page-->		
		</div><!--.cfp-popover-content-->
	</div><!--.cfp-popover-inner-->
</div><!--#cf-kuler-preview-->
<script type="text/javascript">
	jQuery(function($) {
		$("#cf-kuler-menu li:first-child a").trigger("click");
	});
</script>
	';
    }