public static function add_search_widget_mce_popup() { $items_search_default = WC_Predictive_Search_Widgets::get_items_search(); ?> <style type="text/css"> #TB_ajaxContent{width:auto !important;} #TB_ajaxContent p { padding:2px 0; margin:6px 0; } .field_content { padding:0 0 0 40px; } .field_content label{ width:150px; float:left; text-align:left; } .a3-view-docs-button { background-color: #FFFFE0 !important; border: 1px solid #E6DB55 !important; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; color: #21759B !important; outline: 0 none; text-shadow:none !important; font-weight:normal !important; font-family: sans-serif; font-size: 12px; text-decoration: none; padding: 3px 8px; position: relative; margin-left: 4px; white-space:nowrap; } .a3-view-docs-button:hover { color: #D54E21 !important; } @media screen and ( max-width: 782px ) { #woo_search_box_text { width:100% !important; } } @media screen and ( max-width: 480px ) { .a3_woocommerce_search_exclude_item { float:none !important; display:block; } } #woo_predictive_upgrade_area { border:2px solid #E6DB55;-webkit-border-radius:10px;-moz-border-radius:10px;-o-border-radius:10px; border-radius: 10px; padding:0; position:relative} #woo_predictive_upgrade_area h3{ margin-left:10px;} .a3-rev-logo-extensions { position:absolute; left:10px; top:0px; z-index:10; color:#46719D; } .a3-rev-logo-extensions:before { font-family: "a3-sidebar-menu" !important; font-style: normal !important; font-weight: normal !important; font-variant: normal !important; text-transform: none !important; speak: none; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; display:inline-block; font-size:25px !important; font-weight:400; height: 36px; padding: 8px 0; transition: all 0.1s ease-in-out 0s; content: "\a3" !important; } #woo_predictive_extensions { background:#FFFBCC; -webkit-border-radius:10px 10px 0 0;-moz-border-radius:10px 10px 0 0;-o-border-radius:10px 10px 0 0; border-radius: 10px 10px 0 0; color: #555555; margin: 0px; padding: 4px 8px 4px 40px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); position:relative;} </style> <div id="woo_search_widget_shortcode" style="display:none;"> <div> <h3><?php _e('Customize the Predictive Search Shortcode', 'woops'); ?> <a class="add-new-h2 a3-view-docs-button" target="_blank" href="<?php echo WOO_PREDICTIVE_SEARCH_DOCS_URI; ?> #section-16" ><?php _e('View Docs', 'woops'); ?> </a></h3> <div style="clear:both"></div> <div id="woo_predictive_upgrade_area"><div class="a3-rev-logo-extensions"></div><?php echo WC_Predictive_Search::predictive_extension_shortcode(); ?> <div class="field_content"> <?php foreach ($items_search_default as $key => $data) { ?> <p><label for="woo_search_<?php echo $key; ?> _items"><?php echo $data['name']; ?> :</label> <input disabled="disabled" style="width:100px;" size="10" id="woo_search_<?php echo $key; ?> _items" name="woo_search_<?php echo $key; ?> _items" type="text" value="<?php echo $data['number']; ?> " /> <span class="description"><?php _e('Number of', 'woops'); echo ' ' . $data['name'] . ' '; _e('results to show in dropdown', 'woops'); ?> </span></p> <?php } ?> <p><label for="woo_search_show_price"><?php _e('Price', 'woops'); ?> :</label> <input disabled="disabled" type="checkbox" checked="checked" id="woo_search_show_price" name="woo_search_show_price" value="1" /> <span class="description"><?php _e('Show Product prices', 'woops'); ?> </span></p> <p><label for="woo_search_text_lenght"><?php _e('Characters', 'woops'); ?> :</label> <input disabled="disabled" style="width:100px;" size="10" id="woo_search_text_lenght" name="woo_search_text_lenght" type="text" value="100" /> <span class="description"><?php _e('Number of product description characters', 'woops'); ?> </span></p> <p><label for="woo_search_align"><?php _e('Alignment', 'woops'); ?> :</label> <select disabled="disabled" style="width:100px" id="woo_search_align" name="woo_search_align"><option value="none" selected="selected"><?php _e('None', 'woops'); ?> </option><option value="left-wrap"><?php _e('Left - wrap', 'woops'); ?> </option><option value="left"><?php _e('Left - no wrap', 'woops'); ?> </option><option value="center"><?php _e('Center', 'woops'); ?> </option><option value="right-wrap"><?php _e('Right - wrap', 'woops'); ?> </option><option value="right"><?php _e('Right - no wrap', 'woops'); ?> </option></select> <span class="description"><?php _e('Horizontal aliginment of search box', 'woops'); ?> </span></p> <p><label for="woo_search_width"><?php _e('Search box width', 'woops'); ?> :</label> <input disabled="disabled" style="width:100px;" size="10" id="woo_search_width" name="woo_search_width" type="text" value="200" />px</p> <p><label for="woo_search_box_text"><?php _e('Search box text message', 'woops'); ?> :</label> <input disabled="disabled" style="width:300px;" size="10" id="woo_search_box_text" name="woo_search_box_text" type="text" value="<?php echo get_option('woocommerce_search_box_text'); ?> " /></p> <p><label for="woo_search_padding"><strong><?php _e('Padding', 'woops'); ?> </strong>:</label><br /> <label for="woo_search_padding_top" style="width:auto; float:none"><?php _e('Above', 'woops'); ?> :</label><input disabled="disabled" style="width:50px;" size="10" id="woo_search_padding_top" name="woo_search_padding_top" type="text" value="10" />px <label for="woo_search_padding_bottom" style="width:auto; float:none"><?php _e('Below', 'woops'); ?> :</label> <input disabled="disabled" style="width:50px;" size="10" id="woo_search_padding_bottom" name="woo_search_padding_bottom" type="text" value="10" />px <label for="woo_search_padding_left" style="width:auto; float:none"><?php _e('Left', 'woops'); ?> :</label> <input disabled="disabled" style="width:50px;" size="10" id="woo_search_padding_left" name="woo_search_padding_left" type="text" value="0" />px <label for="woo_search_padding_right" style="width:auto; float:none"><?php _e('Right', 'woops'); ?> :</label> <input disabled="disabled" style="width:50px;" size="10" id="woo_search_padding_right" name="woo_search_padding_right" type="text" value="0" />px </p> </div> <p> <input disabled="disabled" type="button" class="button-primary" value="<?php _e('Insert Shortcode', 'woops'); ?> " /> <a class="button" style="" href="#" onclick="tb_remove(); return false;"><?php _e('Cancel', 'woops'); ?> </a> </p> <div style="clear:both;"></div> </div> </div> <div style="clear:both;"></div> </div> <?php }
function form($instance) { $global_search_box_text = get_option('woocommerce_search_box_text'); $items_search_default = WC_Predictive_Search_Widgets::get_items_search(); $instance = wp_parse_args((array) $instance, array('title' => '', 'number_items' => 6, 'text_lenght' => 100, 'show_price' => 1, 'search_global' => 0, 'search_box_text' => $global_search_box_text)); $title = strip_tags($instance['title']); $number_items = $instance['number_items']; if (empty($number_items) || is_array($number_items)) { $number_items = 6; } else { $number_items = strip_tags($instance['number_items']); } $text_lenght = strip_tags($instance['text_lenght']); $show_price = $instance['show_price']; $search_global = $instance['search_global']; $search_box_text = $instance['search_box_text']; ?> <style> #woo_predictive_upgrade_area { border:2px solid #E6DB55;-webkit-border-radius:10px;-moz-border-radius:10px;-o-border-radius:10px; border-radius: 10px; padding:5px; position:relative} #woo_predictive_upgrade_area legend {margin-left:4px; font-weight:bold;} .item_heading{ width:130px; display:inline-block;} ul.predictive_search_item li{padding-left:15px; background:url(<?php echo WOOPS_IMAGES_URL; ?> /sortable.gif) no-repeat left center; cursor:pointer;} ul.predictive_search_item li.ui-sortable-placeholder{border:1px dotted #111; visibility:visible !important; background:none;} ul.predictive_search_item li.ui-sortable-helper{background-color:#DDD;} </style> <p><label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title:', 'woops'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo esc_attr($title); ?> " /></p> <p><label for="<?php echo $this->get_field_id('search_box_text'); ?> "><?php _e('Search box text message:', 'woops'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('search_box_text'); ?> " name="<?php echo $this->get_field_name('search_box_text'); ?> " type="text" value="<?php echo esc_attr($search_box_text); ?> " /></p> <?php if (class_exists('SitePress')) { global $sitepress; $active_languages = $sitepress->get_active_languages(); if (is_array($active_languages) && count($active_languages) > 0) { ?> <fieldset id="woo_predictive_upgrade_area"><legend><?php _e('Upgrade to', 'woops'); ?> <a href="<?php echo WOOPS_AUTHOR_URI; ?> " target="_blank"><?php _e('Pro Version', 'woops'); ?> </a> <?php _e('to activate', 'woops'); ?> </legend> <?php foreach ($active_languages as $language) { ?> <p><label for="search_box_text_<?php echo $language['code']; ?> "><?php _e('Search box text message', 'woops'); ?> (<?php echo $language['display_name']; ?> )</label> <input disabled="disabled" class="widefat" id="search_box_text_<?php echo $language['code']; ?> " name="search_box_text_language[<?php echo $language['code']; ?> ]" type="text" value="" /></p> <?php } ?> </fieldset> <?php } } ?> <p><label for="<?php echo $this->get_field_id('number_items'); ?> "><?php _e('Number of results to show:', 'woops'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('number_items'); ?> " name="<?php echo $this->get_field_name('number_items'); ?> " type="text" value="<?php echo esc_attr($number_items); ?> " /></p> <p><label><input type="checkbox" name="<?php echo $this->get_field_name('show_price'); ?> " value="1" <?php checked($show_price, 1); ?> /> <?php _e('Show Product prices', 'woops'); ?> </label> </p> <p><label for="<?php echo $this->get_field_id('text_lenght'); ?> "><?php _e(' Results description character count:', 'woops'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('text_lenght'); ?> " name="<?php echo $this->get_field_name('text_lenght'); ?> " type="text" value="<?php echo esc_attr($text_lenght); ?> " /></p> <fieldset id="woo_predictive_upgrade_area"><legend><?php _e('Upgrade to', 'woops'); ?> <a href="<?php echo WOOPS_AUTHOR_URI; ?> " target="_blank"><?php _e('Pro Version', 'woops'); ?> </a> <?php _e('to activate', 'woops'); ?> </legend> <p><?php _e("Activate search 'types' for this widget by entering the number of results to show in the widget dropdown. <empty> = not activated. Sort order by drag and drop", 'woops'); ?> </p> <ul class="ui-sortable predictive_search_item"> <?php foreach ($items_search_default as $key => $data) { ?> <li><span class="item_heading"><label><?php echo $data['name']; ?> </label></span> <input disabled="disabled" id="" name="" type="text" value="<?php echo esc_attr($data['number']); ?> " style="width:50px;" /></li> <?php } ?> </ul> <p><label><?php _e(' Results description character count:', 'woops'); ?> </label> <input disabled="disabled" class="widefat" id="" name="" type="text" value="100" /></p> <p><input disabled="disabled" type="radio" value="1" checked="checked" /> <label><?php _e('Search All Products', 'woops'); ?> </label><br /> <input disabled="disabled" type="radio" value="0" /> <label><?php _e('Smart Search', 'woops'); ?> </label> </p> </fieldset> <?php }