Admin bits

This commit is contained in:
Mike Jolley 2011-11-23 10:08:48 +00:00
parent 9112df283b
commit 4d6a9750fb
4 changed files with 33 additions and 52 deletions

View File

@ -252,9 +252,9 @@ function woocommerce_admin_fields($options) {
$country = $country_setting;
$state = '*';
endif;
?><tr valign="top" class="multi_select_countries">
?><tr valign="top">
<th scope="rpw" class="titledesc"><?php echo $value['name'] ?></th>
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" style="width:350px;" data-placeholder="<?php _e('Choose a country&hellip;', 'woothemes'); ?>" title="Country" class="chosen_select">
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" data-placeholder="<?php _e('Choose a country&hellip;', 'woothemes'); ?>" title="Country" class="chosen_select">
<?php echo $woocommerce->countries->country_dropdown_options($country, $state); ?>
</select> <span class="description"><?php echo $value['desc'] ?></span>
</td>
@ -264,18 +264,16 @@ function woocommerce_admin_fields($options) {
$countries = $woocommerce->countries->countries;
asort($countries);
$selections = (array) get_option($value['id']);
?><tr valign="top" class="multi_select_countries">
?><tr valign="top">
<th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
<td class="forminp">
<div class="multi_select_countries"><ul><?php
if ($countries) foreach ($countries as $key=>$val) :
echo '<li><label><input type="checkbox" name="'. $value['id'] .'[]" value="'. $key .'" ';
if (in_array($key, $selections)) echo 'checked="checked"';
echo ' />'. $val .'</label></li>';
endforeach;
?></ul></div>
<select multiple="multiple" name="<?php echo esc_attr( $value['id'] ); ?>[]" style="width:450px;" data-placeholder="<?php _e('Choose countries&hellip;', 'woothemes'); ?>" title="Country" class="chosen_select">
<?php
if ($countries) foreach ($countries as $key=>$val) :
echo '<option value="'.$key.'" '.selected( in_array($key, $selections), true, false ).'>'.$val.'</option>';
endforeach;
?>
</select>
</td>
</tr><?php
break;

View File

@ -23,7 +23,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'name' => __( 'Base Country/Region', 'woothemes' ),
'desc' => __( 'This is the base country for your business. Tax rates will be based on this country.', 'woothemes' ),
'id' => 'woocommerce_default_country',
'css' => 'min-width:175px;',
'css' => 'min-width:300px;',
'std' => 'GB',
'type' => 'single_select_country'
),
@ -33,7 +33,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'desc' => __("This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.", 'woothemes' ),
'tip' => '',
'id' => 'woocommerce_currency',
'css' => 'min-width:175px;',
'css' => 'min-width:300px;',
'std' => 'GBP',
'type' => 'select',
'class' => 'chosen_select',
@ -70,9 +70,10 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'name' => __( 'Allowed Countries', 'woothemes' ),
'desc' => __( 'These are countries that you are willing to ship to.', 'woothemes' ),
'id' => 'woocommerce_allowed_countries',
'css' => 'min-width:175px;',
'css' => 'min-width:300px;',
'std' => 'all',
'type' => 'select',
'class' => 'chosen_select',
'options' => array(
'all' => __( 'All Countries', 'woothemes' ),
'specific' => __( 'Specific Countries', 'woothemes' )
@ -204,7 +205,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'id' => 'woocommerce_sharethis',
'type' => 'text',
'std' => '',
'css' => ''
'css' => 'min-width:300px;',
),
array( 'type' => 'sectionend', 'id' => 'share_this'),
@ -216,7 +217,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'desc' => __('Log into your google analytics account to find your ID. e.g. <code>UA-XXXXX-X</code>', 'woothemes'),
'id' => 'woocommerce_ga_id',
'type' => 'text',
'css' => ''
'css' => 'min-width:300px;',
),
array(
@ -1034,9 +1035,9 @@ function woocommerce_settings() {
// Countries
jQuery('select#woocommerce_allowed_countries').change(function(){
if (jQuery(this).val()=="specific") {
jQuery(this).parent().parent().next('tr.multi_select_countries').show();
jQuery(this).parent().parent().next('tr').show();
} else {
jQuery(this).parent().parent().next('tr.multi_select_countries').hide();
jQuery(this).parent().parent().next('tr').hide();
}
}).change();
@ -1083,9 +1084,7 @@ function woocommerce_settings() {
// Chosen selects
jQuery(function(){
jQuery("select.chosen_select").chosen();
});
jQuery("select.chosen_select").chosen();
</script>

View File

@ -153,10 +153,6 @@ div.multi_select_products_wrapper-alt{float:right;}
.multi_select_products_target_upsell,.multi_select_products_target_crosssell{margin:20px 0;}
.multi_select_products.loading{background:#ffffff url(../images/ajax-loader.gif) no-repeat center;}
.multi_select_products li{padding:7px 9px;margin:0 !important;line-height:2em;border:1px solid #ececec;border-bottom:0;}
div.multi_select_countries{border:1px solid #ececec;height:200px;overflow:auto;width:100%;float:left;}
.multi_select_countries li{padding:3px 9px;margin:0;line-height:2em;border-bottom:1px dotted #ececec;}
.multi_select_countries li label{display:block;}
.multi_select_countries li label input{margin:0 4px 0 0;}
.multi_select_products button{float:right;vertical-align:middle;}
.multi_select_products .product_search input{width:100%;}
#woocommerce-product-data input.dp-applied{float:left;}
@ -219,16 +215,17 @@ table.bar_chart tbody td span.alt{clear:both;background:#47a03e;margin-top:6px;}
.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label a{display:block;padding:3px;margin:1px 0;text-decoration:none;}
.ui-multiselect-checkboxes li.ui-multiselect-optgroup-last{border-bottom:1px solid;}
* html .ui-multiselect-checkboxes label{border:none;}
#woocommerce_allowed_countries_chzn .chzn-search{display:none;}
.chzn-container{font-size:13px;position:relative;display:inline-block;zoom:1;*display:inline;margin-right:5px;}
.chzn-container .chzn-drop{background:#fff;border:1px solid #aaa;border-top:0;position:absolute;top:29px;left:0;-webkit-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);-o-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);z-index:999;}
.chzn-container-single .chzn-single{background-color:#fff;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));background-image:-webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);background-image:-moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);background-image:-o-linear-gradient(top, #eeeeee 0%, #ffffff 50%);background-image:-ms-linear-gradient(top, #eeeeee 0%, #ffffff 50%);background-image:linear-gradient(top, #eeeeee 0%, #ffffff 50%);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #aaa;display:block;overflow:hidden;white-space:nowrap;position:relative;height:26px;line-height:26px;padding:0 0 0 8px;color:#444;text-decoration:none;}
.chzn-container-single .chzn-single{background-color:#fff;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));background-image:-webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);background-image:-moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);background-image:-o-linear-gradient(top, #eeeeee 0%, #ffffff 50%);background-image:-ms-linear-gradient(top, #eeeeee 0%, #ffffff 50%);background-image:linear-gradient(top, #eeeeee 0%, #ffffff 50%);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #aaa;display:block;overflow:hidden;white-space:nowrap;position:relative;height:23px;line-height:23px;padding:0 0 0 8px;color:#444;text-decoration:none;}
.chzn-container-single .chzn-single span{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;text-overflow:ellipsis;}
.chzn-container-single .chzn-single abbr{display:block;position:absolute;right:26px;top:8px;width:12px;height:13px;font-size:1px;background:url(../images/chosen-sprite.png) right top no-repeat;}
.chzn-container-single .chzn-single abbr:hover{background-position:right -11px;}
.chzn-container-single .chzn-single div{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;background:#ccc;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #cccccc), color-stop(0.6, #eeeeee));background-image:-webkit-linear-gradient(center bottom, #cccccc 0%, #eeeeee 60%);background-image:-moz-linear-gradient(center bottom, #cccccc 0%, #eeeeee 60%);background-image:-o-linear-gradient(bottom, #cccccc 0%, #eeeeee 60%);background-image:-ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);background-image:linear-gradient(top, #cccccc 0%, #eeeeee 60%);border-left:1px solid #aaa;position:absolute;right:0;top:0;display:block;height:100%;width:18px;}
.chzn-container-single .chzn-single div b{background:url('../images/chosen-sprite.png') no-repeat 0 1px;display:block;width:100%;height:100%;}
.chzn-container-single .chzn-single div b{background:url('../images/chosen-sprite.png') no-repeat 0 0;display:block;width:100%;height:100%;}
.chzn-container-single .chzn-search{padding:3px 4px;position:relative;margin:0;white-space:nowrap;z-index:1010;}
.chzn-container-single .chzn-search input{background:#ffffff url('../images/chosen-sprite.png') no-repeat 100% -22px;background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-o-linear-gradient(bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,linear-gradient(top, #ffffff 85%, #eeeeee 99%);margin:1px 0;padding:4px 20px 4px 5px;outline:0;border:1px solid #aaa;font-family:sans-serif;font-size:1em;}
.chzn-container-single .chzn-search input{background:#ffffff url('../images/chosen-sprite.png') no-repeat 100% -22px;background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-o-linear-gradient(bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,linear-gradient(top, #ffffff 85%, #eeeeee 99%);margin:1px 0;padding:4px 20px 4px 5px;outline:0;border:1px solid #aaa;font-family:sans-serif;font-size:1em;width:100% !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
.chzn-container-single .chzn-drop{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;}
.chzn-container-single-nosearch .chzn-search input{position:absolute;left:-9000px;}
.chzn-container-multi .chzn-choices{background-color:#fff;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));background-image:-webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);background-image:-moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);background-image:-o-linear-gradient(bottom, white 85%, #eeeeee 99%);background-image:-ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);background-image:linear-gradient(top, #ffffff 85%, #eeeeee 99%);border:1px solid #aaa;margin:0;padding:0;cursor:text;overflow:hidden;height:auto !important;height:1%;position:relative;}

View File

@ -843,25 +843,6 @@ div.multi_select_products_wrapper-alt {
border-bottom: 0;
}
div.multi_select_countries {
border: 1px solid #ececec;
height: 200px;
overflow: auto;
width: 100%;
float: left;
}
.multi_select_countries li {
padding: 3px 9px;
margin: 0;
line-height: 2em;
border-bottom: 1px dotted #ececec;
}
.multi_select_countries li label {
display: block;
}
.multi_select_countries li label input {
margin: 0 4px 0 0;
}
.multi_select_products button {
float: right;
vertical-align: middle;
@ -1178,7 +1159,9 @@ table.bar_chart {
#woocommerce_allowed_countries_chzn .chzn-search {
display: none;
}
/* @group Base */
.chzn-container {
@ -1224,8 +1207,8 @@ table.bar_chart {
overflow: hidden;
white-space: nowrap;
position: relative;
height: 26px;
line-height: 26px;
height: 23px;
line-height: 23px;
padding: 0 0 0 8px;
color: #444;
text-decoration: none;
@ -1275,7 +1258,7 @@ table.bar_chart {
width: 18px;
}
.chzn-container-single .chzn-single div b {
background: url('../images/chosen-sprite.png') no-repeat 0 1px;
background: url('../images/chosen-sprite.png') no-repeat 0 0;
display: block;
width: 100%;
height: 100%;
@ -1301,6 +1284,10 @@ table.bar_chart {
border: 1px solid #aaa;
font-family: sans-serif;
font-size: 1em;
width: 100% !important;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
.chzn-container-single .chzn-drop {
-webkit-border-radius: 0 0 4px 4px;