예제 #1
0
}
# ===== BACKEND =====
add_action('changedata-save', 'delete_i18n_search_index');
add_action('page-delete', 'delete_i18n_search_index');
// GetSimple 3.0+
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, i18n_r('i18n_search/CONFIGURE')));
# ===== FRONTEND =====
add_action('index-pretemplate', 'i18n_search_pretemplate_for_rss');
add_action('index-pretemplate', 'i18n_search_pretemplate_for_mark');
add_action('theme-header', 'i18n_search_header_for_rss');
add_filter('content', 'i18n_search_content');
add_filter('search-index-page', 'i18n_search_index_page');
# ===== BACKEND HOOKS =====
# workaround for page-delete in GetSimple 2.03:
if (basename($_SERVER['PHP_SELF']) == 'deletefile.php') {
    delete_i18n_search_index();
}
# can also be called directly
function delete_i18n_search_index()
{
    require_once GSPLUGINPATH . 'i18n_search/indexer.class.php';
    I18nSearchIndexer::deleteIndex();
}
# ===== INDEXING =====
function create_i18n_search_index()
{
    require_once GSPLUGINPATH . 'i18n_search/indexer.class.php';
    I18nSearchIndexer::index();
}
function i18n_search_index_page($item)
{
예제 #2
0
 public function refreshIndex()
 {
     if (function_exists('delete_i18n_search_index')) {
         delete_i18n_search_index();
         return true;
     } else {
         return false;
     }
 }