'Loading...' )); } } add_action('admin_init', 'cfcp_admin_init'); // /* Let's load some styles that will be used on all theme setting pages */ // function cfcp_admin_css() { // $cfcp_admin_styles = get_bloginfo('template_url').'/plugins/cf-colors/css/admin.css'; // echo ''; // } function cf_kuler_color($key = 'text', $context = null) { $color = ''; if (!empty($context)) { $key = apply_filters('cf_kuler_'.$context, $key); } if ($colors = cf_kuler_get_colors()) { switch (strToLower($key)) { case 'links': $color = $colors[0]; break; case 'header': $color = $colors[1]; break; case 'navbar': $color = $colors[2]; break; } } return $color; } function cf_kuler_preset_panel() { $anno_presets = array(); $anno_presets['Default'] = array( 'Text' => '#0867ab', 'Header' => '#006b94', 'Navbar' => '#66a6bf' ); $anno_presets['Rust'] = array( 'Text' => '#b87546', 'Header' => '#753a2b', 'Navbar' => '#9e5a3b' ); $anno_presets['Grape'] = array( 'Text' => '#b8a3a7', 'Header' => '#574f7d', 'Navbar' => '#8b799e' ); $anno_presets['Forest'] = array( 'Text' => '#a3bf59', 'Header' => '#224732', 'Navbar' => '#4f8749' ); $html = ''; foreach($anno_presets as $scheme_label => $color_list) { $html.='
'; $html.=''.$scheme_label.''; $html.=''; $html.='
'; } return $html; } function cf_kuler_get_colors() { $settings = anno_colors_get_settings(); return apply_filters('cf-kuler-colors', $settings['colors']); } function anno_colors_get_settings() { return get_option(CF_ANNO_COLORS, array( 'colors' => array( '#0867ab', '#006b94', '#66a6bf' ), 'theme' => array( 'swatches' => '#0b1a0e,#3b3d35,#05ab4a,#65c752,#d0dec7' ) )); } function cf_kuler_colors_html($settings) { $colors = null; extract($settings); // extracts $colors & $theme $html = '
'.cf_kuler_colors_list($colors).'
'; return $html; } function cf_kuler_colors_list($colors) { $html = ' '; return $html; } function cf_kuler_theme_desc($theme, $modified = false) { return ($modified ? __('Based on', 'cf-kuler').' ' : '').''.$theme['title'].' '.__('by', 'cf-kuler').' '.$theme['author'].''; } function cf_kuler_request_handler() { if (!empty($_POST['cf_action'])) { switch ($_POST['cf_action']) { case 'cf_kuler_update_settings': check_admin_referer('cf_kuler_update_settings'); $colors = explode(',', stripslashes($_POST['cf_kuler_colors'])); $theme = array_map('stripslashes', $_POST['cf_kuler_theme']); update_option(CF_ANNO_COLORS, compact('colors','theme')); wp_redirect(admin_url('themes.php?page='.basename(__FILE__).'&updated=true')); die(); break; } } } add_action('admin_init', 'cf_kuler_request_handler'); function cf_kuler_admin_menu() { add_theme_page( __('Color Settings', 'cf-kuler'), __('Colors', 'cf-kuler'), 'manage_options', basename(__FILE__), 'cf_kuler_settings_form' ); } add_action('admin_menu', 'cf_kuler_admin_menu'); function cf_kuler_admin_bar() { global $wp_admin_bar; if (current_user_can('manage_options')) { $wp_admin_bar->add_menu(array( 'id' => 'cf-kuler', 'title' => __('Colors', 'cf-kuler'), 'href' => admin_url('themes.php?page='.basename(__FILE__)), 'parent' => 'appearance' )); } } add_action('wp_before_admin_bar_render', 'cf_kuler_admin_bar'); function cf_kuler_theme_fields($theme) { return ' '; } function cf_kuler_color_picker($colors_html) { return ' '; } function cf_kuler_settings_form() { if ($settings = anno_colors_get_settings()) { $colors = $settings['colors']; $colors_html = cf_kuler_colors_html($settings); } else { $colors = ''; $colors_html = ''; } $message = ''; if (!empty($_GET['updated']) && $_GET['updated'] == true) { $message = '

'.__('Settings updated.', 'cf-kuler').'

'; } print('
'.screen_icon().'

'.__('Color Settings', 'cf-kuler').'

'.$message.'

'.__('My Colors', 'cf-kuler').'

'.$colors_html.'
'.cf_kuler_color_picker($colors_html).'
'); if (!empty($settings['theme'])) { echo cf_kuler_theme_fields($settings['theme']); } print('

'); wp_nonce_field('cf_kuler_update_settings'); print('
'); print('

Preset Schemes

'.cf_kuler_preset_panel().'
'); print('
'); } function cf_kuler_update_settings() { if (!current_user_can('manage_options')) { return; } // update options } /* API endpoints rss/get.cfm?listType=[listType]&startIndex=[startIndex]&itemsPerPage=[itemsPerPage]&timeSpan=[timeSpan]&key=[key] Get highest-rated feeds http://kuler-api.adobe.com/rss/get.cfm?listtype=rating Get most popular feeds for the last 30 days http://kuler-api.adobe.com/rss/get.cfm?listtype=popular×pan=30 Get most recent feeds http://kuler-api.adobe.com/rss/get.cfm?listtype=recent rss/search.cfm?searchQuery=[searchQuery]&startIndex=[startIndex]&itemsPerPage=[itemsPerPage]&key=[key] Search for themes with the word "blue" in the name, tags, user name, etc. http://kuler-api.adobe.com/rss/search.cfm?searchQuery=blue Search for themes tagged as "sunset" http://kuler-api.adobe.com/rss/search.cfm?searchQuery=tag:sunset */ //a:23:{s:11:"plugin_name";N;s:10:"plugin_uri";N;s:18:"plugin_description";N;s:14:"plugin_version";N;s:6:"prefix";s:8:"cf_kuler";s:12:"localization";N;s:14:"settings_title";s:14:"Color Settings";s:13:"settings_link";s:6:"Colors";s:4:"init";b:0;s:7:"install";b:0;s:9:"post_edit";b:0;s:12:"comment_edit";b:0;s:6:"jquery";b:0;s:6:"wp_css";b:0;s:5:"wp_js";b:0;s:9:"admin_css";s:1:"1";s:8:"admin_js";s:1:"1";s:8:"meta_box";b:0;s:15:"request_handler";b:0;s:6:"snoopy";b:0;s:11:"setting_cat";b:0;s:14:"setting_author";b:0;s:11:"custom_urls";b:0;}