| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
$items = isset( $context['items'] ) && is_array( $context['items'] ) ? $context['items'] : array(); |
| 7 |
?> |
| 8 |
<div id="bookshelf" class="bookshelf"> |
| 9 |
<?php foreach ( $items as $item ) : ?> |
| 10 |
<div id="ebook_formData" class="ebook_formData"></div> |
| 11 |
<figure> |
| 12 |
<div class="perspective"> |
| 13 |
<div class="book" data-book="book-<?php echo esc_attr( $item['ebook_id'] ); ?>"> |
| 14 |
<div onClick="<?php echo esc_attr( (int) $item['disable_cover_buy_now'] === 0 ? $item['buy_link_onclick'] : '' ); ?>" class="cover"> |
| 15 |
<div data-dd="dd" class="front" style="cursor: pointer; cursor: hand; background: url(<?php echo esc_url( $item['cover_url'] ); ?>);"></div> |
| 16 |
<div class="inner inner-left"></div> |
| 17 |
</div> |
| 18 |
<div class="inner inner-right"></div> |
| 19 |
</div> |
| 20 |
</div> |
| 21 |
<div class="buttons"> |
| 22 |
<a href="#" style="display:none;">Look inside</a> |
| 23 |
<a href="#" class="details_link"><?php echo esc_html( $item['locale']['details'] ); ?></a> |
| 24 |
<?php echo $item['add_to_cart_html']; ?> |
| 25 |
<?php echo $item['extra_buttons_html']; ?> |
| 26 |
<a target="_blank" href="<?php echo $item['preview_url'] ? esc_url( $item['preview_url'] ) : '#'; ?>" class=""<?php echo $item['preview_url'] ? '' : ' style="display:none;"'; ?>><?php echo esc_html( isset( $item['preview_label'] ) ? $item['preview_label'] : __( 'Preview', 'ebook-store' ) ); ?></a> |
| 27 |
<?php if ( ! empty( $item['show_primary_buy_link'] ) ) : ?> |
| 28 |
<a style="<?php echo (int) $item['hide_buy_now'] > 0 ? 'display: none;' : ''; ?>" class="ebook_buy_link" data-md5_nonce="<?php echo esc_attr( $item['md5_nonce'] ); ?>" href="<?php echo esc_url( $item['buy_link_href'] ); ?>" onClick="<?php echo esc_attr( $item['buy_link_onclick'] ); ?>"<?php echo ! empty( $item['primary_payment_method'] ) ? ' data-ebook-store-payment-method="' . esc_attr( $item['primary_payment_method'] ) . '" data-ebook-store-add-payment-info="1" data-ebook-store-begin-checkout="1" data-ebook-store-item-id="' . esc_attr( $item['ebook_id'] ) . '" data-ebook-store-item-name="' . esc_attr( $item['title'] ) . '" data-ebook-store-currency="' . esc_attr( $item['paypal_currency'] ) . '" data-ebook-store-value="' . esc_attr( (string) ebook_store_price_plus_vat( $item['ebook']['ebook_price'] ) ) . '"' : ''; ?>><?php echo esc_html( $item['buy_link_text'] ); ?></a> |
| 29 |
<?php endif; ?> |
| 30 |
<?php echo $item['form_html']; ?> |
| 31 |
</div> |
| 32 |
<figcaption> |
| 33 |
<h2><?php echo esc_html( $item['title'] ); ?> <span><?php echo esc_html( $item['authors'] ); ?></span></h2> |
| 34 |
</figcaption> |
| 35 |
<div class="details"> |
| 36 |
<ul> |
| 37 |
<li><div class="ebookStorEbookContent"><?php echo $item['content_raw']; ?></div></li> |
| 38 |
<li><?php echo esc_html( $item['publishers'] ); ?></li> |
| 39 |
<li><?php echo esc_html( $item['date_text'] ); ?></li> |
| 40 |
<li><?php echo esc_html( $item['pages_text'] ); ?></li> |
| 41 |
</ul> |
| 42 |
<span class="close-details"></span> |
| 43 |
</div> |
| 44 |
</figure> |
| 45 |
<style> |
| 46 |
.book[data-book="book-<?php echo esc_attr( $item['ebook_id'] ); ?>"] .cover::before { |
| 47 |
background: url(<?php echo esc_url( $item['side_url'] ); ?>); |
| 48 |
} |
| 49 |
.bookshelf figure .buttons a { |
| 50 |
font-size: <?php echo esc_attr( $item['buy_link_font_size'] ); ?>em !important; |
| 51 |
} |
| 52 |
.bookshelf figure h2 { |
| 53 |
font-size: <?php echo esc_attr( $item['title_font_size'] ); ?>em !important; |
| 54 |
} |
| 55 |
div#bookshelf { |
| 56 |
-ms-transform: scale(<?php echo esc_attr( $item['form_scale'] ); ?>, <?php echo esc_attr( $item['form_scale'] ); ?>); |
| 57 |
-webkit-transform: scale(<?php echo esc_attr( $item['form_scale'] ); ?>, <?php echo esc_attr( $item['form_scale'] ); ?>); |
| 58 |
transform: scale(<?php echo esc_attr( $item['form_scale'] ); ?>, <?php echo esc_attr( $item['form_scale'] ); ?>); |
| 59 |
} |
| 60 |
</style> |
| 61 |
<?php endforeach; ?> |
| 62 |
</div> |
| 63 |
|