Install message

This commit is contained in:
Mike Jolley 2012-02-15 23:45:55 +00:00
parent b934c40794
commit bf13ba4a8b
3 changed files with 37 additions and 18 deletions

View File

@ -39,7 +39,7 @@ function woocommerce_admin_menu() {
*/ */
add_action( "admin_print_styles", 'woocommerce_admin_notices_styles' ); add_action( "admin_print_styles", 'woocommerce_admin_notices_styles' );
function woocommerce_admin_notices() { function woocommerce_admin_install_notice() {
?> ?>
<div id="message" class="updated woocommerce-message wc-connect"> <div id="message" class="updated woocommerce-message wc-connect">
<div class="squeezer"> <div class="squeezer">
@ -50,10 +50,16 @@ function woocommerce_admin_notices() {
<?php <?php
} }
function woocommerce_admin_notices_styles() { function woocommerce_admin_notices_styles() {
if (get_option('woocommerce_installed')!=1 || get_option('skip_install_woocommerce_pages')==1 || woocommerce_get_page_id('shop')>0 || isset($_GET['install_woocommerce_pages']) || isset($_GET['skip_install_woocommerce_pages'])) return;
add_action( 'admin_notices', 'woocommerce_admin_notices' ); if ( get_option('woocommerce_installed')==1 ) {
wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/wc-activation.css', dirname( __FILE__ ) ) );
wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/wc-activation.css', dirname( __FILE__ ) ) );
if (get_option('skip_install_woocommerce_pages')!=1 && woocommerce_get_page_id('shop')<1 && !isset($_GET['install_woocommerce_pages']) && !isset($_GET['skip_install_woocommerce_pages'])) {
add_action( 'admin_notices', 'woocommerce_admin_install_notice' );
}
}
} }

View File

@ -1075,10 +1075,15 @@ function woocommerce_settings() {
update_option('woocommerce_installed', 0); update_option('woocommerce_installed', 0);
echo '<div id="message" class="updated fade"> ?>
<p style="float:right;">' . __( 'Like WooCommerce? <a href="http://wordpress.org/extend/plugins/woocommerce/">Support us by leaving a rating!</a>', 'woocommerce' ) . '</p> <div id="message" class="updated woocommerce-message wc-connect">
<p><strong>' . __( 'WooCommerce has been installed and setup. Enjoy :)', 'woocommerce' ) . '</strong></p> <div class="squeezer">
</div>'; <h4><?php _e( '<strong>Congratulations!</strong> &#8211; WooCommerce has been installed and setup. Enjoy :)', 'woocommerce' ); ?></h4>
<p><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/woocommerce/" data-text="An open-source #ecommerce plugin for #wordpress that helps you sell anything. Beautifully." data-via="woothemes" data-size="large" data-hashtags="woocommerce">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></p>
</div>
</div>
<?php
flush_rewrite_rules( false ); flush_rewrite_rules( false );

View File

@ -9,20 +9,20 @@
-moz-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); -moz-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 );
box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 );
overflow: hidden; overflow: hidden;
line-height: 180%; padding: 10px 0 10px !important;
padding: 10px 0 5px !important;
background: #cc99c2 url(../images/message.png) no-repeat right bottom !important; background: #cc99c2 url(../images/message.png) no-repeat right bottom !important;
} }
.woocommerce-message .squeezer { .woocommerce-message .squeezer {
max-width: 940px; max-width: 940px;
margin: 0 0 2px; margin: 0;
padding: 0 10px; padding: 0 10px;
text-align: left; text-align: left;
overflow: hidden; overflow: hidden;
} }
.woocommerce-message h4 { .woocommerce-message h4 {
margin: 0 10px 10px 0; margin: 0 10px 0 0;
font-size: 18px; font-size: 18px;
line-height: 36px;
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
font-weight: normal; font-weight: normal;
color: #fff; color: #fff;
@ -30,17 +30,22 @@
-moz-border-radius: 5px; -moz-border-radius: 5px;
-webkit-border-radius: 5px; -webkit-border-radius: 5px;
border-radius: 5px; border-radius: 5px;
display: inline-block; float: left;
vertical-align: middle;
} }
.woocommerce-message p { .woocommerce-message p {
margin: -1px 0 0 0 !important; margin: 0 !important;
padding: 0; padding: 2px 0 !important;
display: inline-block; float: left;
line-height: 32px;
vertical-align: middle;
} }
.woocommerce-message p a.button-primary { .woocommerce-message p a.button-primary {
font-size: 16px !important; font-size: 16px !important;
display: inline-block; line-height: 16px !important;
padding: 8px 15px; margin: 0 5px 0 0;
padding: 6px 15px;
vertical-align: middle;
color: #fff; color: #fff;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
@ -67,4 +72,7 @@
} }
.woocommerce-message p a.skip { .woocommerce-message p a.skip {
opacity: 0.5; opacity: 0.5;
}
.woocommerce-message .twitter-share-button {
vertical-align: middle;
} }