/** * Display search form for searching plugins. * * @since 2.7.0 */ function _install_search_form($type_selector = true) { $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term'; if (HW_SESSION::get_session('search_module')) { //because i using APF form to list modules from repository, so we not recommend to search via form method thourhg post by default $term = HW_SESSION::get_session('search_module'); HW_SESSION::del_session('search_module'); } else { if (isset($_REQUEST['sm'])) { $term = wp_unslash($_REQUEST['sm']); } else { $term = ''; } } $input_attrs = ''; $button_type = 'button screen-reader-text'; // assume no $type_selector means it's a simplified search form if (!$type_selector) { $input_attrs = 'class="wp-filter-search" placeholder="' . esc_attr__('Search Plugins') . '" '; } ?> <!-- <form class="search-form search-plugins" method="get"> <input type="hidden" name="tab" value="search" /> --> <?php /*if ( $type_selector ) : ?> <select name="type" id="typeselector"> <option value="term"<?php selected('term', $type) ?>><?php _e('Keyword'); ?></option> <option value="author"<?php selected('author', $type) ?>><?php _e('Author'); ?></option> <option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option> </select> <?php endif;*/ ?> <label><span class="screen-reader-text"><?php _e('Search Plugins'); ?> </span> <input type="text" name="sm" id="hw_module_search_text" value="<?php echo esc_attr($term); ?> " <?php echo $input_attrs; ?> /> </label> <?php submit_button(__('Search Plugins'), $button_type, false, false, array('id' => 'search-submit')); ?> <label> <input type="button" id="search-submit" onclick="_search_module(this, $('#hw_module_search_text').val())" class="button " value="Tìm module"> </label> <!-- </form> --> <?php }
/** * build & save custom wp menus */ public function save_custom_wp_menus() { //refresh cache for first $this->refresh_wp_menus_cache(); $submenu = HW_SESSION::get_session('submenu'); $menu = HW_SESSION::get_session('menu'); #HW_Modules_Manager::build_modules_wp_menu(); if ($menu) { HW_HOANGWEB::add_wp_option('hw_custom_wp_menu', $menu); } if ($submenu) { HW_HOANGWEB::add_wp_option('hw_custom_wp_submenu', $submenu); } //remove sessions HW_SESSION::del_session('submenu', 'menu'); $this->command_log('Build & Save custom wp menus !'); }