<?php

/*
 * sasql - SpamAssassin+SQL plugin for SquirrelMail
 * By Randy Smith
 * $Author: perlstalker $
 * $Id: setup.php,v 1.25 2006/11/19 03:01:09 perlstalker Exp $
 */

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

function squirrelmail_plugin_init_sasql () {
  global $squirrelmail_plugin_hooks;

  $squirrelmail_plugin_hooks['optpage_register_block']['sasql'] = 'sasql_optpage_register_block_stub';

#  $squirrelmail_plugin_hooks['read_body_header_right']['sasql'] = 'sasql_add_sa_wblist_stub';

  $squirrelmail_plugin_hooks['read_body_header']['sasql'] = 'sasql_read_body_header';

#  $squirrelmail_plugin_hooks['read_body_bottom']['sasql'] = 'sasql_report_spam_links_stub';

  $squirrelmail_plugin_hooks['special_mailbox']['sasql'] = 'sasql_special_folder_check_stub';

  $squirrelmail_plugin_hooks['left_main_before']['sasql'] = 'sasql_autocreate_spam_folder_stub';
}

function sasql_optpage_register_block_stub()
{
  include_once (SM_PATH.'plugins/sasql/sasql_hooks.php');
  return sasql_optpage_register_block();
}

function sasql_add_sa_wblist_stub()
{
  include_once (SM_PATH.'plugins/sasql/sasql_hooks.php');
  return sasql_add_sa_wblist();
}

function sasql_report_spam_links_stub()
{
  include_once (SM_PATH.'plugins/sasql/sasql_hooks.php');
  return sasql_report_spam_links();
}

function sasql_special_folder_check_stub($box)
{
  include_once (SM_PATH.'plugins/sasql/sasql_hooks.php');
  return sasql_special_folder_check($box);
}

function sasql_autocreate_spam_folder_stub()
{
  include_once (SM_PATH.'plugins/sasql/sasql_hooks.php');
  return sasql_autocreate_spam_folder();
}

function sasql_add_sa_score_stub()
{
  include_once (SM_PATH.'plugins/sasql/sasql_hooks.php');
  return sasql_add_sa_score();
}

function sasql_read_body_header ()
{
  sasql_add_sa_score_stub();
  sasql_add_sa_wblist_stub();
}

function sasql_version () { return '3.2.0'; }

?>
