1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607:
| <?php
/*
Plugin Name: Custom Admin Branding
Plugin URI: http://redlettersstudio.com/wordpress-custom-admin-branding/
Description: Allows you to brand your WordPress install for clients. Display custom images and styles for the login screen, admin header and footer.
Author: Josh Byers
Version: 2.0
Author URI: http://www.redlettersstudio.com
*/
add_action('admin_menu', 'mt_add_pages');
add_action('admin_init', 'admin_branding_options_init' );
// Init plugin options to white list our options
function admin_branding_options_init(){
register_setting( 'admin_branding_options', 'admin_branding_link' );
}
// Add menu page
function mt_add_pages() {
$custombranding_admin = add_options_page('Custom Admin Branding', 'Custom Admin Branding', 8, 'brandingoptions', 'admin_branding_options_page');
//add help instructions for WordPress sliding help menu
$admin_branding_help = "
<style>
h6 {
font-size:0.85em;
border-bottom:1px solid #d1d1d1;
padding-bottom:3px;
margin:2.33em 0 10px;}
ul.help_list {
margin-top:10px;}
ul.help_list li {
list-style-type:disc;
margin-left:20px;}
</style>
<p>Well, you obviously have the plugin activated so thats out of the way. Now on to the customization of your WordPress Admin.</p>
<p>Nearly every visual feature in the login screen, header section, and footer section can be modified to fit your custom color and image scheme.</p>
<h6>Changing Colors</h6>
<p>The options that support color change have a swatch next to the form field. You can either click the color swatch or click into the form field. Doing so will bring up a palette of color options. You are not restricited by the choices in the palette. You can enter any 6 figure hexidecimal color code. You must however precede your code with the pound sign (#).</p>
<h6>Customizing Images</h6>
There are five images that you can customize:
<ul class='help_list'>
<li>Login Form Background</li>
<li>Login Form Login Button Background</li>
<li>Admin Header Logo</li>
<li>Favorite Actions Button Background</li>
<li>Footer Logo</li>
</ul>
<p>All of the default images are in the images folder which is in the custom-admin-branding plugin folder.
To change an image:</p>
<ol>
<li>Create your custom images with the provided Photoshop templates. (They are in the psd_image_templates folder)</li>
<li>Upload your custom image(s) to the images folder.</li>
<li>Enter the file name of the image you wish to use in the proper form field in the options page.</li>
<li>Click the save changes button at the bottom of options page and you will see your changes immediately.</li>
</ol>
<p>*********Important***********</p>
To avoid having your custom images overwritten when you upgrade the plugin, you'll need to name them something different than the default names which are:
<ul class='help_list'>
<li>wordpress_blue.jpg</li>
<li>button-grad.png</li>
<li>logo_wordpress_gray.png</li>
<li>fav.png</li>
<li>footer_wordpress_gray.png</li>
</ul>
<h6>Advanced Header Customization</h6>
<p>The form field for the Admin Header Background Color will accept a full css properties for the background selector. So if you wanted to have a repeating image for your admin header you would enter in:<br />
<blockquote>transparent url(http://yoursitename.com/wp-content/plugins/custom-admin-branding/images/header_bg_wordpress_gray.png) repeat-x</blockquote></p>
<h6>Changing the Admin Footer Link</h6>
<p>You can have the image in the footer link back to your site, another site, or no site if you wish. Just fill in full url in the Footer Link form field.</p>
"
;
add_contextual_help($custombranding_admin, $admin_branding_help);
}
function on_load_page() {
//ensure, that the needed javascripts been loaded to allow drag/drop, expand/collapse and hide/show of boxes
wp_enqueue_script('common');
wp_enqueue_script('wp-lists');
wp_enqueue_script('postbox');
}
// admin_branding_options_page() displays the page content for the Admin Branding Options submenu
function admin_branding_options_page() {
$options = get_option('admin_branding_link');
// default options to be loaded on plugin activation
$options['top_page_border_show'] = 'normal';
$options['top_page_border_color'] = '#464646';
$options['back_to_blog_color'] = '#cccccc';
$options['back_to_blog_hover_color'] = '#ffffff';
$options['login_form_bg'] = 'login_wordpress_gray.jpg';
$options['login_form_label'] = '#999999';
$options['input_text_color'] = '#555555';
$options['footer_link'] = 'http://wordpress.org';
$options['login_button_color'] = '#21759B';
$options['login_button_background'] = 'button-grad.png';
$options['login_border_color'] = '#298CBA';
$options['login_border_hover_color'] = '#13455b';
$options['login_text_color'] = '#eaf2a';
$options['admin_header_bg_img'] = '';
$options['admin_header_bg_clr'] = '#464646';
$options['admin_header_logo'] = 'logo_wordpress_gray.png';
$options['fav_actions_btn_color'] = '#797979';
$options['fav_actions_btn_background'] = 'fav.png';
$options['fav_actions_bdr'] = '#777777';
$options['user_info_txt'] = '#999999';
$options['user_info_lnk'] = '#cccccc';
$options['user_info_lnk_hvr'] = '#ffffff';
$options['admin_footer_logo'] = 'footer_wordpress_gray.png';
$options['lost_password_color'] = '#21759B';
$options['lost_password_hover_color'] = '#D54E21';
add_option( 'admin_branding_link', $options );
?>
<?php
// calls and variables to be loaded in WordPress admin for Live Login Preview
$options = get_option('admin_branding_link');
$top_page_border_show = $options['top_page_border_show'];
$top_page_border_color = $options['top_page_border_color'];
$back_to_blog_color = $options['back_to_blog_color'];
$back_to_blog_hover_color = $options['back_to_blog_hover_color'];
$login_form_bg = $options['login_form_bg'];
$login_form_label = $options['login_form_label'];
$input_text_color = $options['input_text_color'];
$login_button_color = $options['login_button_color'];
$login_button_background = $options['login_button_background'];
$login_border_color = $options['login_border_color'];
$login_border_hover_color = $options['login_border_hover_color'];
$login_text_color = $options['login_text_color'];
$lost_password_color = $options['lost_password_color'];
$lost_password_hover_color = $options['lost_password_hover_color'];
?>
<style >
#ColorPickerDiv {
display: block;
display: none;
position: relative;
border: 1px solid #777;
background: #fff}
#ColorPickerDiv TD.color {
cursor: pointer;
font-size: xx-small;
font-family: 'Arial' , 'Microsoft Sans Serif';}
#ColorPickerDiv TD.color label{
cursor: pointer;}
.ColorPickerDivSample {
margin: 0px 0px 0px 4px;
border: solid 1px #000;
padding: 0px 10px;
position: relative;
cursor: pointer;}
input.wide {
width:308px;}
</style>
<script type="text/javascript" src="<?php echo $site_url; ?>/wp-content/plugins/custom-admin-branding/js/ColorPicker.js"></script>
<script type="text/javascript">
jQuery(function($) {
$(".vtrColorPicker").attachColorPicker();
});
</script>
<div id="howto-metaboxes-general" class="wrap">
<?php screen_icon('options-general'); ?>
<h2>Custom Admin Branding Options</h2>
<div class="left_side" style="width:540px;float:left;margin-right:20px;">
<div class="metabox-holder" >
<div class="postbox">
<h3 class="hndle"><span>Login Screen Options</span></h3>
<div class="inside">
<form method="post" action="options.php">
<?php settings_fields('admin_branding_options');?>
<?php $options = get_option('admin_branding_link');?>
<? $site_url = get_settings('siteurl'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row">Top Page Border</th>
<td>Show: <input name="admin_branding_link[top_page_border_show]" type="radio" value="normal" <?php checked('normal', $options['top_page_border_show']); ?> />
Hide: <input name="admin_branding_link[top_page_border_show]" type="radio" value="none" <?php checked('none', $options['top_page_border_show']); ?> />
<br />Color:<br /><input type="text" class="vtrColorPicker" name="admin_branding_link[top_page_border_color]" value="<?php echo $options['top_page_border_color']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Back to Blog Link</th>
<td>Link Color:<br /><input type="text" class="vtrColorPicker" name="admin_branding_link[back_to_blog_color]" value="<?php echo $options['back_to_blog_color']; ?>" /><br />Hover Color:<br /><input type="text" class="vtrColorPicker" name="admin_branding_link[back_to_blog_hover_color]" value="<?php echo $options['back_to_blog_hover_color']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Form Background</th>
<td><input type="text" class="wide" name="admin_branding_link[login_form_bg]" value="<?php echo $options['login_form_bg']; ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row">Input Label Color</th>
<td><input class="vtrColorPicker" type="text" name="admin_branding_link[login_form_label]" value="<?php echo $options['login_form_label']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Input Text Color</th>
<td><input class="vtrColorPicker" type="text" name="admin_branding_link[input_text_color]" value="<?php echo $options['input_text_color']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Login Button Background</th>
<td><input type="text" class="wide" name="admin_branding_link[login_button_background]" value="<?php echo $options['login_button_background']; ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row">Login Button Border Color</th>
<td><input type="text" class="vtrColorPicker" name="admin_branding_link[login_button_color]" value="<?php echo $options['login_button_color']; ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row">Login Button Hover Color</th>
<td><input type="text" class="vtrColorPicker" name="admin_branding_link[login_border_hover_color]" value="<?php echo $options['login_border_hover_color']; ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row">Login Button Text Color</th>
<td><input type="text" class="vtrColorPicker" name="admin_branding_link[login_text_color]" value="<?php echo $options['login_text_color']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Lost Your Password Link</th>
<td>Link Color:<br /><input type="text" class="vtrColorPicker" name="admin_branding_link[lost_password_color]" value="<?php echo $options['lost_password_color']; ?>" /><br />Hover Color:<br /><input type="text" class="vtrColorPicker" name="admin_branding_link[lost_password_hover_color]" value="<?php echo $options['lost_password_hover_color']; ?>" /></td>
</tr>
</table>
</div>
</div>
</div>
<div class="metabox-holder">
<div class="postbox">
<h3 class="hndle"><span>Admin Header Options</span></h3>
<div class="inside">
<table class="form-table">
<tr valign="top">
<th scope="row">Admin Header Logo</th>
<td><input type="text" class="wide" name="admin_branding_link[admin_header_logo]" value="<?php echo $options['admin_header_logo']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Admin Header Background Color</th>
<td><input type="text" class="vtrColorPicker" name="admin_branding_link[admin_header_bg_clr]" value="<?php echo $options['admin_header_bg_clr']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Favorite Actions Button Color</th>
<td><input type="text" class="vtrColorPicker" name="admin_branding_link[fav_actions_btn_color]" value="<?php echo $options['fav_actions_btn_color']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Favorite Actions Button Background</th>
<td><input type="text" class="wide" name="admin_branding_link[fav_actions_btn_background]" value="<?php echo $options['fav_actions_btn_background']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Favorite Actions Button Border Color</th>
<td><input type="text" class="vtrColorPicker" name="admin_branding_link[fav_actions_bdr]" value="<?php echo $options['fav_actions_bdr']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">User Info Text Color</th>
<td><input type="text" class="vtrColorPicker" name="admin_branding_link[user_info_txt]" value="<?php echo $options['user_info_txt']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">User Info Link Color</th>
<td>Link Color:<br /><input class="vtrColorPicker" type="text" name="admin_branding_link[user_info_lnk]" value="<?php echo $options['user_info_lnk']; ?>" /><br />Hover Color:<br /><input class="vtrColorPicker" type="text" name="admin_branding_link[user_info_lnk_hvr]" value="<?php echo $options['user_info_lnk_hvr']; ?>" /></td>
</tr>
</table>
</div>
</div>
</div>
<div class="metabox-holder">
<div class="postbox">
<h3 class="hndle"><span>Admin Footer Options</span></h3>
<div class="inside">
<table class="form-table">
<tr valign="top">
<th scope="row">Admin Footer Logo</th>
<td><input type="text" class="wide" name="admin_branding_link[admin_footer_logo]" value="<?php echo $options['admin_footer_logo']; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Footer Link <br /><em>(use full url)</em></th>
<td><input type="text" class="wide" name="admin_branding_link[footer_link]" value="<?php echo $options['footer_link']; ?>" /></td>
</tr>
</table>
</div>
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>
</div><!-- end .left_side -->
<div class="right_side" style="float:left;width:362px;"
<div class="metabox-holder">
<div class="postbox">
<h3 class="hndle"><span>Login Screen Preview</span></h3>
<div class="inside" style="padding:20px;">
<style>
p.backtoblog {
background-color:<?php echo $top_page_border_color; ?>;
height:20px;
display:<?php echo $top_page_border_show; ?>;
-moz-border-radius-bottomleft:6px;
-moz-border-radius-bottomright:6px;
-moz-border-radius-topleft:6px;
-moz-border-radius-topright:6px;
width:310px;
margin-left:5px;}
p.backtoblog a {
color:<?php echo $back_to_blog_color; ?>;
padding:1px 0 0 11px;
display:block;
text-decoration:none;}
p.backtoblog a:hover {
color:<?php echo $back_to_blog_hover_color; ?>;}
#loginform {
padding-top:90px;
background:transparent url(<?php get_settings('siteurl'); ?>/wp-content/plugins/custom-admin-branding/images/<?php echo $login_form_bg; ?>) center top no-repeat;}
.loginform {
padding: 16px 16px 59px}
#loginform p {
margin-bottom: 0;}
.form_lables {
font-size:13px;
font-family:'Lucida Grande',Verdana,Arial,'Bitstream Vera Sans',sans-serif;
color:<?php echo $login_form_label; ?>;}
#loginform input.input {
border:1px solid #E5E5E5;
font-size:24px;
width:97%;
margin:0;
color:<?php echo $input_text_color; ?>;}
p.forgetmenot {
float:left;
line-height:19px;
padding-top:14px;}
p.forgetmenot .form_lables {
font-size:11px;}
p.submit preview {
float:right;
padding:12px 0;}
#loginform p.submit input {
background:<?php echo $login_button_color; ?> url(<?php get_settings('siteurl'); ?>/wp-content/plugins/custom-admin-branding/images/<?php echo $login_button_background; ?> ) repeat-x scroll left top;
color:<?php echo $login_text_color; ?> !important;
border-color:<?php echo $login_border_color; ?>; }
#loginform p.submit input:hover {
border-color:<?php echo $login_border_hover_color; ?>;
color:<?php echo $login_text_color; ?> !important;}
p.lost_password {
font-size:11px;
padding-left:10px;}
p.lost_password a {
color:<?php echo $lost_password_color; ?>;}
p.lost_password a:hover {
color:<?php echo $lost_password_hover_color; ?>;}
</style>
<div id="login" style="width:320px;">
<p class="backtoblog"><a href="http://redlettersstudio.com/" title="Are you lost?">← Back to <?php echo get_settings('blogname'); ?></a></p>
<form name="loginform" id="loginform" class="loginform" action="http://redlettersstudio.com/wp-login.php" method="post">
<p>
<label class="form_lables">Username<br />
<input type="text" name="log" id="user_login" class="input" value="admin" size="20" tabindex="10" /></label>
</p>
<p>
<label class="form_lables">Password<br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
</p>
<p class="forgetmenot"><label class="form_lables"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
<p class="submit preview">
<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
<input type="hidden" name="redirect_to" value="http://redlettersstudio.com/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
<p id="nav" class="lost_password">
<a href="http://redlettersstudio.com/wp-login.php?action=lostpassword" title="Password Lost and Found">Lost your password?</a>
</p>
</div><!-- end #login -->
</div>
</div>
<!--<div class="metabox-holder">
<div class="postbox">
<h3 class="hndle"><span>Please Donate</span></h3>
<div class="inside" style="padding:10px;">
<p>If you have found this plugin useful please consider donating to keep the development and support current. Thanks.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="2058369">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form></p>
</div>
</div>
</div> -->
</div>
</div>
<?php
}
/*This is the function that displays the custom login screen.*/
function custom_login() {
$options = get_option('admin_branding_link');
$top_page_border_show = $options['top_page_border_show'];
$top_page_border_color = $options['top_page_border_color'];
$back_to_blog_color = $options['back_to_blog_color'];
$back_to_blog_hover_color = $options['back_to_blog_hover_color'];
$login_form_bg = $options['login_form_bg'];
$login_form_label = $options['login_form_label'];
$input_text_color = $options['input_text_color'];
$login_button_color = $options['login_button_color'];
$login_button_background = $options['login_button_background'];
$login_border_color = $options['login_border_color'];
$login_border_hover_color = $options['login_border_hover_color'];
$login_text_color = $options['login_text_color'];
$lost_password_color = $options['lost_password_color'];
$lost_password_hover_color = $options['lost_password_hover_color'];
echo '
<style>
/* Diplays the custom graphics for the login screen*/
p#backtoblog {
display:'.$top_page_border_show.';}
.login #backtoblog a {
color:'.$back_to_blog_color.'}
.login #backtoblog a:hover {
color:'.$back_to_blog_hover_color.'}
body.login {
border:'.$top_page_border_show.';
border-top-color:'.$top_page_border_color.';}
#login form {
background:transparent url(' . get_settings('siteurl') . '/wp-content/plugins/custom-admin-branding/images/'.$login_form_bg.' ) center top no-repeat;
padding-top:100px;}
label {
color:'.$login_form_label.'}
input {
color:'.$input_text_color.'}
input.button-primary {
background:'.$login_button_color.' url(' . get_settings('siteurl') . '/wp-content/plugins/custom-admin-branding/images/'.$login_button_background.' ) repeat-x scroll left top;
color:'.$login_text_color.' !important;}
p.submit input:hover {
border-color:'.$login_border_hover_color.';}
.login #nav a {
color:'.$lost_password_color.' !important;}
.login #nav a:hover {
color:'.$lost_password_hover_color.' !important;}
/* Hides the default Wordpress Login content*/
#login form {
-moz-border-radius: 11px;
-khtml-border-radius: 0;
-webkit-border-radius: 0;
-moz-box-shadow:none;
-webkit-box-shadow: none;
-khtml-box-shadow: none;
box-shadow: none;
border-radius: 0px;
border: none;}
#login h1 {
display:none;}
</style>
';
}
add_action('login_head', 'custom_login');
/*This function places the custom header graphic at the top of every WordPress Admin page.*/
function custom_header() {
$options = get_option('admin_branding_link');
$admin_header_bg_img = $options['admin_header_bg_img'];
$admin_header_bg_clr = $options['admin_header_bg_clr'];
$admin_header_logo = $options['admin_header_logo'];
$fav_actions_btn_color = $options['fav_actions_btn_color'];
$fav_actions_btn_background = $options['fav_actions_btn_background'];
$fav_actions_bdr = $options['fav_actions_bdr'];
$user_info_txt = $options['user_info_txt'];
$user_info_lnk = $options['user_info_lnk'];
$user_info_lnk_hvr = $options['user_info_lnk_hvr'];
echo '
<style>
/* Hides the default WordPress Admin header content*/
#wphead {
display:none;}
/*Custom classes for the WordPress Admin header*/
#wphead_custom {
background:'.$admin_header_bg_clr.';
height:60px;}
#wphead-info {
padding-top:5px;}
#header-logo_custom {
float: left;
margin-top: 5px;}
#favorite-first {
background:'.$fav_actions_btn_color.' url(' . get_settings('siteurl') . '/wp-content/plugins/custom-admin-branding/images/'.$fav_actions_btn_background.' ) repeat-x scroll left center;
border-color:'.$fav_actions_bdr.'}
#user_info p {
color:'.$user_info_txt.';}
#user_info a:link {
color:'.$user_info_lnk.';}
#user_info a:hover {
color:'.$user_info_lnk_hvr.';}
</style>
<div id="wphead_custom">
<a href="' . get_settings('siteurl') . '"><img id="header-logo_custom" src="' . get_settings('siteurl') . '/wp-content/plugins/custom-admin-branding/images/'.$admin_header_logo.'"</a>
<div id="wphead-info">
<div id="user_info">
<p>Howdy, <a href="'. get_settings('siteurl') . '/wp-admin/profile.php">';
global $current_user;
if (isset($current_user->user_firstname)){
get_currentuserinfo(); echo($current_user->user_firstname);
} else {
get_currentuserinfo(); echo($current_user->user_login);
}
echo '</a> | <a href="'. get_settings('siteurl') . '/wp-admin/tools.php">Turbo</a> | <a href="'. wp_logout_url().'">Log Out</a>
</p>
</div>';
echo favorite_actions();
echo '
</div>
</div>';
}
add_action('admin_head', 'custom_header', 11);
/*This function places the custom footer at the bottom of every WordPress Admin page. Change the file in the images folder to replace. You will also want to change the link (in the code below) that the footer image is pointing to.*/
function custom_footer() {
$options = get_option('admin_branding_link');
$footer_link = $options["footer_link"];
$admin_footer_logo = $options['admin_footer_logo'];
echo '
<style>
/* Hides the default WordPress Admin footer content*/
#footer {
display:none;}
/*Custom classes for the WordPress Admin footer*/
#footer_custom {
clear: both;
text-align: center;
width: 500px;
margin: auto;}
#footer_custom .docs {
padding-top: 0px;
line-height: 100%;}
#footer_image {
border:none;}
</style>
<div id="footer_custom">
<p><a href="'.$footer_link.'" id="footer_image"><img src="' . get_settings('siteurl') . '/wp-content/plugins/custom-admin-branding/images/'.$admin_footer_logo.'" alt="'.$footer_link.'" /></a>
</p>
</div>';
}
add_action('admin_footer', 'custom_footer');
?> |