function ajaxy_shortcode()
{
    ob_start();
    if (function_exists('ajaxy_search_form') && class_exists('AjaxyLiveSearch')) {
        ajaxy_search_form();
    } else {
        ?>
		<div id="ajaxy-live-search-shortcode">Please enable the <strong>Ajaxy Live Search</strong> plugin</div>		
	<?php 
    }
    $html = ob_get_contents();
    ob_end_clean();
    return $html;
}
예제 #2
0
파일: sf.php 프로젝트: mynein/myne
    function admin_page()
    {
        $message = false;
        require_once 'admin/classes/class-wp-ajaxy-sf-list-table.php';
        require_once 'admin/classes/class-wp-ajaxy-sf-themes-list-table.php';
        if (isset($_GET['edit'])) {
            if ($_GET['type'] == 'taxonomy') {
                include_once 'admin/admin-edit-taxonomy-form.php';
                return true;
            } elseif ($_GET['type'] == 'role') {
                include_once 'admin/admin-edit-role-form.php';
                return true;
            } else {
                include_once 'admin/admin-edit-post-form.php';
                return true;
            }
        }
        $tab = !empty($_GET['tab']) ? trim($_GET['tab']) : false;
        $type = !empty($_GET['type']) ? trim($_GET['type']) : false;
        //form data
        switch ($tab) {
            case 'woocommerce':
            case 'taxonomy':
            case 'author':
            case 'post_type':
            case 'templates':
                $public = $tab == 'author' ? false : true;
                if (isset($_POST['action'])) {
                    $action = trim($_POST['action']);
                    $ids = isset($_POST['template_id']) ? (array) $_POST['template_id'] : false;
                    if ($action == 'hide' && $ids) {
                        global $AjaxyLiveSearch;
                        $k = 0;
                        foreach ($ids as $id) {
                            $setting = (array) $AjaxyLiveSearch->get_setting($id, $public);
                            $setting['show'] = 0;
                            $AjaxyLiveSearch->set_setting($id, $setting);
                            $k++;
                        }
                        $message = sprintf(_('%s templates hidden'), $k);
                    } elseif ($action == 'show' && $ids) {
                        global $AjaxyLiveSearch;
                        $k = 0;
                        foreach ($ids as $id) {
                            $setting = (array) $AjaxyLiveSearch->get_setting($id, $public);
                            $setting['show'] = 1;
                            $AjaxyLiveSearch->set_setting($id, $setting);
                            $k++;
                        }
                        $message = sprintf(_('%s templates shown'), $k);
                    }
                } elseif (isset($_GET['show']) && isset($_GET['name'])) {
                    global $AjaxyLiveSearch;
                    if ($tab == 'author') {
                        $setting = (array) $AjaxyLiveSearch->get_setting('role_' . $_GET['name'], $public);
                        $setting['show'] = (int) $_GET['show'];
                        $AjaxyLiveSearch->set_setting('role_' . $_GET['name'], $setting);
                    } else {
                        $setting = (array) $AjaxyLiveSearch->get_setting($_GET['name'], $public);
                        $setting['show'] = (int) $_GET['show'];
                        $AjaxyLiveSearch->set_setting($_GET['name'], $setting);
                    }
                    $message = _('Template modified');
                }
                break;
            case 'themes':
                if (isset($_GET['theme']) && isset($_GET['apply'])) {
                    global $AjaxyLiveSearch;
                    $AjaxyLiveSearch->set_style_setting('theme', $_GET['theme']);
                    $message = $_GET['theme'] . ' theme applied';
                }
                break;
            default:
        }
        ?>
		<style type="text/css">
		.column-order, .column-limit_results, .column-show_on_search
		{
			text-align: center !important;
			width: 75px;
		}
		</style>
		<div class="wrap">
			<div id="icon-edit" class="icon32 icon32-posts-post"><br></div>
			<h2><?php 
        _e('Ajaxy Live Search');
        ?>
</h2>
			<ul class="subsubsub">
				<li class="active"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false);
        ?>
" class="<?php 
        echo !$tab ? 'current' : '';
        ?>
"><?php 
        _e('General settings');
        ?>
<span class="count"></span></a> |</li>
				<li class="active"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false) . '&tab=post_type';
        ?>
" class="<?php 
        echo $tab == 'post_type' ? 'current' : '';
        ?>
"><?php 
        _e('Post type Search');
        ?>
<span class="count"></span></a> |</li>
				<li class="active"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false) . '&tab=taxonomy';
        ?>
" class="<?php 
        echo $tab == 'taxonomy' ? 'current' : '';
        ?>
"><?php 
        _e('Taxonomy Search');
        ?>
<span class="count"></span></a> |</li>
				<li class="active"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false) . '&tab=author';
        ?>
" class="<?php 
        echo $tab == 'author' ? 'current' : '';
        ?>
"><?php 
        _e('Author Search');
        ?>
<span class="count"></span></a> |</li>

				<li class="active ajaxy-sf-new"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false) . '&tab=woocommerce';
        ?>
" class="<?php 
        echo $tab == 'woocommerce' ? 'current' : '';
        ?>
"><?php 
        _e('WooCommerce');
        ?>
<span class="count-new">New *</span></a> |</li>
				<!--<li class="active ajaxy-sf-new pro"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false) . '&tab=selective';
        ?>
" class="<?php 
        echo $tab == 'selective' ? 'current' : '';
        ?>
"><?php 
        _e('Selective Search');
        ?>
<span class="count-new">New *</span></a> |</li>-->
				
				<li class="active"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false) . '&tab=themes';
        ?>
" class="<?php 
        echo $tab == 'themes' ? 'current' : '';
        ?>
"><?php 
        _e('Themes');
        ?>
<span class="count"></span></a> |</li>
				<li class="active"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false) . '&tab=shortcode';
        ?>
" class="<?php 
        echo $tab == 'shortcode' ? 'current' : '';
        ?>
"><?php 
        _e('Shortcodes');
        ?>
<span class="count"></span></a> |</li>
				<li class="active"><a href="<?php 
        echo menu_page_url('ajaxy_sf_admin', false) . '&tab=preview';
        ?>
" class="<?php 
        echo $tab == 'preview' ? 'current' : '';
        ?>
"><?php 
        _e('Preview');
        ?>
<span class="count"></span></a></li>
			</ul>
			<hr style="clear:both; display:block"/>
			<div id="message-bottom" class="updated">
				<table>
					<tr>
						<td>
						<p>
							<?php 
        printf(__('please donate some dollars for this project development and themes to be created, we are trying to make this project better, if you think it is worth it then u should support it.
							contact me at %s for support and development, please include your paypal id or donation id in your message.'), '<a href="mailto:icu090@gmail.com">icu090@gmail.com</a>');
        ?>
						</p>
						</td>
						<td>
						<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QDDZQHHCPUDDG"><img class="aligncenter size-full wp-image-180" title="btn_donateCC_LG" alt="" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" width="147" height="47"></a>
						</td>
					</tr>
				</table>
			</div>
			<form id="ajaxy-form" action="" method="post">
			<?php 
        wp_nonce_field();
        ?>
			<?php 
        if ($tab == 'post_type') {
            ?>
				<?php 
            $list_table = new WP_SF_List_Table($this->get_search_objects(true, 'post_type'));
            ?>
				<div>
					<?php 
            if ($message) {
                ?>
					<div id="message" class="updated"><p><?php 
                echo $message;
                ?>
</p></div>
					<?php 
            }
            ?>
					<?php 
            $list_table->display();
            ?>
				</div>
			<?php 
        } elseif ($tab == 'taxonomy') {
            ?>
				<?php 
            $list_table = new WP_SF_List_Table($this->get_search_objects(true, 'taxonomy'));
            ?>
				<div>
					<?php 
            if ($message) {
                ?>
					<div id="message" class="updated"><p><?php 
                echo $message;
                ?>
</p></div>
					<?php 
            }
            ?>
					<?php 
            $list_table->display();
            ?>
				</div>
			<?php 
        } elseif ($tab == 'author') {
            ?>
				<?php 
            $list_table = new WP_SF_List_Table($this->get_search_objects(true, 'author'), false, 'role_');
            ?>
				<div>
					<?php 
            if ($message) {
                ?>
					<div id="message" class="updated"><p><?php 
                echo $message;
                ?>
</p></div>
					<?php 
            }
            ?>
					<?php 
            $list_table->display();
            ?>
				</div>
			<?php 
        } elseif ($tab == 'themes') {
            ?>
				<?php 
            $list_table = new WP_SF_THEMES_List_Table();
            ?>
				<div>
					<?php 
            if ($message) {
                ?>
					<div id="message" class="updated"><p><?php 
                echo $message;
                ?>
</p></div>
					<?php 
            }
            ?>
					<?php 
            $list_table->display();
            ?>
				</div>
			<?php 
        } elseif ($tab == 'preview') {
            ?>
				<br class="clear" />
				<hr style="margin-bottom:20px"/>
				<div class="wrap">
				<?php 
            ajaxy_search_form();
            ?>
				</div>
				<hr style="margin:20px 0 10px 0"/>
				<p class="description"><?php 
            _e('Use the form above to preview theme changes and settings, please note that the changes could vary from one theme to another, please contact the author of this plugin for more help');
            ?>
</p>
				<hr style="margin:10px 0"/>
			<?php 
        } elseif ($tab == 'selective') {
            ?>
			<?php 
        } elseif ($tab == 'woocommerce') {
            $list_table = new WP_SF_List_Table($this->get_search_objects(true, 'taxonomy', array(), self::$woocommerce_taxonomies));
            ?>
				<h3><?php 
            _e('WooCommerce Taxonomies');
            ?>
</h3>
				<div class="ajaxy-form-table ajaxy-form-nowrap">
					<?php 
            if ($message) {
                ?>
					<div id="message" class="updated"><p><?php 
                echo $message;
                ?>
</p></div>
					<?php 
            }
            ?>
					<?php 
            $list_table->display();
            ?>
				</div>
				<h3><?php 
            _e('WooCommerce Post Types');
            ?>
</h3>
			<?php 
            $list_table = new WP_SF_List_Table($this->get_search_objects(true, 'post_type', self::$woocommerce_post_types, array()));
            ?>
				<div class="ajaxy-form-table ajaxy-form-nowrap">
					<?php 
            if ($message) {
                ?>
					<div id="message" class="updated"><p><?php 
                echo $message;
                ?>
</p></div>
					<?php 
            }
            ?>
					<?php 
            $list_table->display();
            ?>
				</div>
			<?php 
        } elseif ($tab == 'author') {
            $list_table = new WP_SF_List_Table($this->get_search_objects(false, 'author'), true, 'role_');
            ?>
				<h3><?php 
            _e('WooCommerce Taxonomies');
            ?>
</h3>
				<div class="ajaxy-form-table ajaxy-form-nowrap">
					<?php 
            if ($message) {
                ?>
					<div id="message" class="updated"><p><?php 
                echo $message;
                ?>
</p></div>
					<?php 
            }
            ?>
					<?php 
            $list_table->display();
            ?>
				</div>
				<h3><?php 
            _e('WooCommerce Post Types');
            ?>
</h3>
			<?php 
            $list_table = new WP_SF_List_Table($this->get_search_objects(true, 'post_type', self::$woocommerce_post_types, array()));
            ?>
				<div class="ajaxy-form-table ajaxy-form-nowrap">
					<?php 
            if ($message) {
                ?>
					<div id="message" class="updated"><p><?php 
                echo $message;
                ?>
</p></div>
					<?php 
            }
            ?>
					<?php 
            $list_table->display();
            ?>
				</div>
			<?php 
        } elseif ($tab == 'shortcode') {
            include_once 'admin/admin-shortcodes.php';
        } else {
            include_once 'admin/admin-settings.php';
        }
        ?>
			 </form>
			 
		</div>
		<?php 
    }
예제 #3
0
파일: search.php 프로젝트: mynein/myne
 function searchform($instance)
 {
     echo $instance['text_before'];
     $label = $instance['label'];
     $setings = array();
     if (trim($instance['label']) != "") {
         $setings['label'] = $instance['label'];
     }
     if (trim($instance['expand']) != "") {
         $setings['expand'] = $instance['expand'];
     }
     if (trim($instance['width']) != "") {
         $setings['width'] = $instance['width'];
     }
     if (trim($instance['delay']) != "") {
         $setings['delay'] = $instance['delay'];
     }
     if (trim($instance['border']) != "") {
         $setings['border'] = $instance['border'];
     }
     if (isset($instance['credits'])) {
         $setings['credits'] = (int) $instance['credits'];
     }
     if (isset($instance['show_category'])) {
         $setings['show_category'] = (int) $instance['show_category'];
     }
     if (isset($instance['show_post_category'])) {
         $setings['show_post_category'] = (int) $instance['show_post_category'];
     }
     if (trim($instance['post_types']) != "") {
         $setings['post_types'] = $instance['post_types'];
     }
     ajaxy_search_form($setings);
     echo $instance['text_after'];
 }