<?php
/*
 * Copyright 2005 Randy Smith <perlstalker@gmail.com>
 * $Id: hooks.php,v 1.4 2005/10/07 15:31:18 randy Exp $
 */

if (!defined ('SM_PATH')) { define ('SM_PATH','../../'); }
include_once(SM_PATH.'plugins/web_search/web_search.conf.php');

global $engine, $adsense, $below_folder_list;

function ws_menuline () {
  // set gettext domain
  bindtextdomain('web_search', SM_PATH.'locale');
  textdomain('web_search');

  include(SM_PATH.'plugins/web_search/web_search.conf.php');

  if (isset($search_in_right) && $search_in_right) {
    include_once (SM_PATH.'plugins/web_search/api.php');
    echo "<div style='position:absolute;top:10px;right:7em'>";
    mini_search();
    echo "</div>";
  }

  if (isset($advanced_search) && $advanced_search) {
    //displayInternalLink('plugins/web_search/search.php', _("Web Search"));
  }

  // put it back
  bindtextdomain('squirrelmail', SM_PATH.'locale');
  textdomain('squirrelmail');

}

function ws_left_main_before () {
  include_once (SM_PATH.'plugins/web_search/api.php');
  include(SM_PATH.'plugins/web_search/web_search.conf.php');
  if (!isset($below_folder_list)
      || ! $below_folder_list) {
    ws_left_main();
  }
}

function ws_left_main_after () {
  include_once (SM_PATH.'plugins/web_search/api.php');
  include(SM_PATH.'plugins/web_search/web_search.conf.php');
  if (isset($below_folder_list)
      && $below_folder_list) {
    ws_left_main();
  }
}

function ws_left_main () {
  include_once (SM_PATH.'plugins/web_search/api.php');
  global $engine;
  mini_search();
}

?>
