function wm_form_skins( $value, $isMeta = null ) { global $skinAtts; $skinAttsArray = array_keys( $skinAtts ); if ( 'meta' == $isMeta ) $val = wm_meta_option( $value['id'] ); else $val = wm_option( $value['id'] ); $valId = WM_THEME_SETTINGS_PREFIX . $value['id']; $default = ( isset( $value['default'] ) ) ? ( esc_attr( $value['default'] ) ) : ( null ); if ( $val ) $setValue = $val; elseif ( $default ) $setValue = $default; else $setValue = ''; ?> <!-- Layouts --> <div class="option" data-option="<?php echo $valId; ?>" id="skin-selector"> <p> <label><?php echo strip_tags( $value['label'] ); ?></label> </p> <?php if ( isset( $value['desc'] ) && $value['desc'] ) echo '<p class="desc">' . $value['desc'] . '</p>'; ?> <div class="layout-boxes"> <?php if ( isset( $value['options'] ) && is_array( $value['options'] ) && ! empty( $value['options'] ) ) { foreach ( $value['options'] as $thumbLayout ) { ?> <div class="layout-box<?php if ( $thumbLayout['id'] == $setValue ) echo ' active'; ?>"> <label for="<?php echo $valId . '-' . $thumbLayout['id']; ?>"> <img src="<?php echo $thumbLayout['img']; ?>" alt="<?php echo $thumbLayout['name']; ?>" title="<?php if ( isset( $thumbLayout['desc'] ) ) echo $thumbLayout['desc']; ?>" /> <span class="ie-bug tipsy" title="<?php if ( isset( $thumbLayout['desc'] ) ) echo $thumbLayout['desc']; ?>"> </span> </label><br /> <input type="radio" name="<?php echo $valId; ?>" id="<?php echo $valId . '-' . $thumbLayout['id']; ?>" value="<?php echo $thumbLayout['value']; ?>" <?php checked( $thumbLayout['value'], $setValue ); $skinAttsOut = ''; foreach ( $skinAttsArray as $key ) { //NOTE: "#" character has to be there due to color number values starting with 0 (otherwise it will be cut of) $skinAttsOut .= ' data-' . $key . '="#' . esc_html( str_replace( '__', ' ', wm_skin_meta( $thumbLayout['value'], $key ) ) ) . '"'; } echo $skinAttsOut; ?> /> </div> <?php } } ?> </div> <!-- /layout-boxes --> <script><!-- jQuery(function(){ jQuery( '#skin-selector input[type="radio"]' ).change( function() { var skinOptionsInputs = [<?php echo "'" . implode( "', '", $skinAttsArray ) . "'"; ?>]; //loop through the array for( var i in skinOptionsInputs ) { var valueChange = jQuery( this ).data( skinOptionsInputs[i] ); valueChange = valueChange.substr(1); jQuery( '#wm-design-' + skinOptionsInputs[i] ).val( valueChange ); } } ); }); //--></script> </div> <!-- /option --> <?php wm_conditional_show( $value, $valId ); }
function wm_skins() { //empty item $themeSkins = array(); //get files $files = array(); if ( $dir = @opendir( WM_SKINS ) ) { //this is the correct way to loop over the directory while ( false != ( $file = readdir( $dir ) ) ) { $files[] = $file; } closedir( $dir ); } asort( $files ); //create output array foreach ( $files as $file ) { if ( 5 < strlen( $file ) && 'css' == strtolower( pathinfo( $file, PATHINFO_EXTENSION ) ) ) { if ( wm_skin_meta( $file, 'skin' ) && WM_THEME_NAME === wm_skin_meta( $file, 'package' ) ) { //$themeSkins[$file] = wm_skin_meta( $file, 'skin' ); $fileName = str_replace( array( '.css', '.CSS' ), '', $file ); $previewImage = WM_ASSETS_THEME . 'css/skins/' . $fileName . '.png'; $item = array(); $item['name'] = wm_skin_meta( $file, 'skin' ); $item['desc'] = wm_skin_meta( $file, 'skin' ) . ' - ' . wm_skin_meta( $file, 'description' ); $item['id'] = esc_attr( $fileName ); $item['value'] = esc_attr( $file ); $item['img'] = ( file_exists( WM_SKINS . '/' . $fileName . '.png' ) ) ? ( $previewImage ) : ( WM_ASSETS_ADMIN . 'img/skin.png' ); $themeSkins[] = $item; } } } return $themeSkins; }
'.content #reviews #comments > div[itemprop]', '.content ul.cart_list li dl', '.content ul.product_list_widget li dl' ); $toppanelBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-toppanel' ), $themeToppanelBE ); $headerBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-header' ), $themeHeaderBE ); $navigationBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-navigation' ), $themeNavigationBE ); $sliderBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-slider' ), $themeSliderBE ); $mainheadingBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-mainheading' ), $themeMainheadingBE ); $pageexcerptBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-pageexcerpt' ), $themePageexcerptBE ); $contentBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-content' ), $themeContentBE ); $abovefooterBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-abovefooter' ), $themeAbovefooterBE ); $breadcrumbsBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-breadcrumbs' ), $themeBreadcrumbsBE ); $footerBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-footer' ), $themeFooterBE ); $bottomBE = wm_compare_elements( wm_skin_meta( $themeSkin, 'border-bottom' ), $themeBottomBE ); //text color calculations $textColorCoeficient = ( wm_option( 'design-text-color-coeficient' ) ) ? ( 2.55 * absint( wm_option( 'design-text-color-coeficient' ) + 50 ) ) : ( 170 ); //RTL compensations if ( ! is_rtl() ) { $borderLeft = 'border-left'; $borderRight = 'border-right'; } else { $borderLeft = 'border-right'; $borderRight = 'border-left'; }
array( "type" => "heading3", "content" => __( 'Website main theme skin', 'lespaul_domain_panel' ) ), array( "type" => "skins-json", "id" => $prefix."skin", "label" => __( 'Theme skins', 'lespaul_domain_panel' ), "desc" => __( 'It is recommended to set a theme skin first to be used as a base for your additional design changes.', 'lespaul_domain_panel' ) . '<br /><strong>' . __( 'When skin is changed, it will automatically reset several different options, so, be sure to keep a backup of settings (use Options Export/Import) if you made some design changes.', 'lespaul_domain_panel' ) . '</strong>', "options" => wm_skins(), "default" => "default.css" ), array( "type" => "info", "content" => ( ! wm_option( 'design-skin' ) ) ? ( '<strong>' . wm_skin_meta( wm_option( 'default.css' ), 'skin' ) . ' ' . __( 'skin description', 'lespaul_domain_panel' ) . ':</strong><br />' . wm_skin_meta( 'default.css', 'description' ) ) : ( '<strong>' . wm_skin_meta( wm_option( 'design-skin' ), 'skin' ) . ' ' . __( 'skin description', 'lespaul_domain_panel' ) . ':</strong><br />' . wm_skin_meta( wm_option( 'design-skin' ), 'description' ) . '<br />— by ' . wm_skin_meta( wm_option( 'design-skin' ), 'author' ) ) ), array( "type" => "hr" ), array( "type" => "heading3", "content" => __( 'CSS3 Animations', 'lespaul_domain_panel' ), ), array( "type" => "checkbox", "id" => $prefix."no-animation-navigation", "label" => __( 'Disable navigation animation', 'lespaul_domain_panel' ), "desc" => __( 'Disables CSS3 animation effects on main theme menu', 'lespaul_domain_panel' ), ),