public static function get_theme_selection($site_type) { add_thickbox(); $current_theme_info = wp_get_theme(); $current_theme_info->screenshot_url = $current_theme_info->get_screenshot(); $current_theme_info->author = $current_theme_info->display('Author', false, true); $themes = self::get_available_themes($site_type, $current_theme_info->slug); ?> <script type="text/javascript"> function showBox(id) { tb_show('', '#TB_inline?height=500&width=900&inlineId=' + id + '&modal=false', null); } </script> <form action="<?php echo esc_url(add_query_arg(array('setup_action' => 'choose_functionality'))); ?> " method="post"> <!-- Add nonce--> <?php wp_nonce_field('choose_functionality'); ?> <input type="hidden" name="sitetype" value="<?php echo esc_attr($site_type); ?> "/> <div class="wrap"> <?php include One_And_One_Wizard::get_views_dir_path() . 'setup-wizard-header.php'; One_And_One_Wizard_Header::get_wizard_header(2); ?> <h3 class="clear"><?php esc_html_e('Step 2 - Selecting appearance', '1and1-wordpress-wizard'); ?> </h3> <p><?php esc_html_e('You can select the desired design here.', '1and1-wordpress-wizard'); ?> </p> <br/> <div> <div class="oneandone-theme-browser"> <?php $popup_id = 'Popup'; $theme_submit_name = 'theme[]'; $theme_submit_value = esc_attr__('Keep Current Theme', '1and1-wordpress-wizard'); include_once One_And_One_Wizard::get_views_dir_path() . 'setup-wizard-theme-item.php'; One_And_One_Theme_Item::get_theme_item($current_theme_info, true, $popup_id, $theme_submit_name, $theme_submit_value); $index = 0; foreach ($themes as $theme) { $popup_id = 'Popup' . $index++; $theme_submit_name = 'theme[' . $theme->slug . ']'; $theme_submit_value = esc_attr__('Select', '1and1-wordpress-wizard'); One_And_One_Theme_Item::get_theme_item($theme, false, $popup_id, $theme_submit_name, $theme_submit_value); } ?> <br class="clear"> </div> <br class="clear"> <a href="<?php echo esc_url(admin_url('tools.php?page=1and1-wordpress-wizard')); ?> "><?php esc_html_e('Back to the beginning', '1and1-wordpress-wizard'); ?> </a> </div> </div> </form> <?php }
public static function get_plugin_selection($site_type, $theme_id) { add_thickbox(); $catalog = new One_And_One_Catalog(); $recommended_plugins = $catalog->get_recommended_plugins($site_type); $default_plugins = $catalog->get_default_plugins($site_type); if (version_compare($GLOBALS['wp_version'], '4.0', '<')) { include_once One_And_One_Wizard::get_views_dir_path() . 'setup-wizard-plugin-item-compatibility.php'; } else { include_once One_And_One_Wizard::get_views_dir_path() . 'setup-wizard-plugin-item.php'; } ?> <script type="text/javascript"> function showBox(id, title) { tb_show(title, '#TB_inline?height=500&width=800&inlineId=' + id + '&modal=false', null); } jQuery(function($) { $( '.oneandone-plugin-browser' ).on( 'click', '.oneandone-install-checkbox input', function(evt) { $checkbox = $(this); if ( $checkbox.prop('checked') ) { $(this).closest('.oneandone-install-checkbox').addClass( 'checked' ); } else { $(this).closest('.oneandone-install-checkbox').removeClass( 'checked' ); } }); }); </script> <form action="<?php echo esc_url(add_query_arg(array('setup_action' => 'install'))); ?> " method="post"> <!-- Add nonce--> <?php wp_nonce_field('install'); ?> <input type="hidden" name="sitetype" value="<?php echo esc_attr($site_type); ?> "/> <input type="hidden" name="theme" value="<?php echo esc_attr($theme_id); ?> "/> <div class="wrap"> <?php include_once One_And_One_Wizard::get_views_dir_path() . 'setup-wizard-header.php'; One_And_One_Wizard_Header::get_wizard_header(3); ?> <h3 class="clear"><?php esc_html_e('Step 3 - Selecting plugins', '1and1-wordpress-wizard'); ?> </h3> <p> <?php $button_title = esc_attr__('Continue', '1and1-wordpress-wizard'); if (false === $default_plugins && false === $recommended_plugins) { esc_html_e("The plugins couldn't get retrieved. Please refresh the page.", '1and1-wordpress-wizard'); } else { if (!$default_plugins && !$recommended_plugins) { esc_html_e('You already installed all the plugins we recommend. Nice job!', '1and1-wordpress-wizard'); } else { $button_title = esc_attr__('Install all selected theme/plugins', '1and1-wordpress-wizard'); esc_html_e('Select the desired plugins to expand the range of functions in your WordPress installation.', '1and1-wordpress-wizard'); } } ?> </p> <br/> <div class="oneandone-functionality-choice"> <?php $index = 0; if ($default_plugins) { ?> <h3><?php esc_html_e('Recommended plugins:', '1and1-wordpress-wizard'); ?> </h3> <div class="oneandone-plugin-browser"> <?php foreach ($default_plugins as $plugin) { $popup_id = "Popup" . $index++; One_And_One_Plugin_Item::get_plugin_item($plugin, $popup_id, true); } ?> </div> <?php } ?> <?php if ($recommended_plugins) { ?> <h3><?php esc_html_e('These plugins are worth a try as well:', '1and1-wordpress-wizard'); ?> </h3> <div class="oneandone-plugin-browser"> <?php foreach ($recommended_plugins as $plugin) { $popup_id = "Popup" . $index++; One_And_One_Plugin_Item::get_plugin_item($plugin, $popup_id, false); } ?> </div> <?php } ?> </div> <br class="clear"> <input type="submit" name="install" value="<?php echo $button_title; ?> " class="button button-primary"/> <p> <a href="<?php echo esc_url(admin_url('tools.php?page=1and1-wordpress-wizard')); ?> "><?php esc_html_e('Back to the beginning', '1and1-wordpress-wizard'); ?> </a> </p> </div> <?php }
public static function get_site_selection() { ?> <form action="<?php echo esc_url(add_query_arg(array('setup_action' => 'choose_appearance'))); ?> " method="post"> <?php wp_nonce_field('choose_appearance'); ?> <div class="wrap"> <?php include_once One_And_One_Wizard::get_views_dir_path() . 'setup-wizard-header.php'; One_And_One_Wizard_Header::get_wizard_header(1); ?> <h3 class="clear"><?php esc_html_e('Step 1 - Selecting website type', '1and1-wordpress-wizard'); ?> </h3> <p><?php esc_html_e('Here you can select the desired website type.', '1and1-wordpress-wizard'); ?> </p> <br/> <div class="oneandone-site-type-browser"> <?php include_once One_And_One_Wizard::get_inc_dir_path() . 'site-types-catalog.php'; $site_type_catalog = new One_And_One_Site_Type_Catalog(); $site_types = $site_type_catalog->get_all_site_types(); if ($site_types) { foreach ($site_types as $site_type) { ?> <div class="oneandone-site-selection"> <div class="oneandone-site-type-picture"> <img src="<?php echo $site_type->get_pic_url(); ?> " alt=""/> </div> <span class="oneandone-site-type-description"><h3><?php echo $site_type->get_name(); ?> </h3><p><?php echo $site_type->get_description(); ?> </p></span> <h3 class="oneandone-site-type-name"><?php echo $site_type->get_name(); ?> </h3> <div class="oneandone-site-type-actions"> <input type="submit" name="sitetype[<?php echo $site_type->get_id(); ?> ]" value="<?php esc_attr_e('Select', '1and1-wordpress-wizard'); ?> " class="button button-primary"/> </div> </div> <?php } } else { echo '<strong style="font-size:14px;">'; esc_html_e("The website types couldn't get retrieved. Please refresh the page.", '1and1-wordpress-wizard'); echo '</strong>'; } ?> </div> <br class="clear"/> </div> </form> <script> jQuery(document).ready(function($) { $('.oneandone-site-type-browser').on( 'click' , '.oneandone-site-selection', function() { $( '.button-primary', this ).trigger('click'); }); $('.oneandone-site-type-browser').on( 'click' , '.button-primary', function(evt) { evt.stopPropagation(); }); }); </script> <?php }