<?php
if(file_exists(XOOPS_ROOT_PATH."/mainfile.php")){
  include_once XOOPS_ROOT_PATH."/mainfile.php";
  include_once "common/xoops.php";
  define("TADTOOLS_PATH",XOOPS_ROOT_PATH."/modules/tadtools");
  define("TADTOOLS_URL",XOOPS_URL."/modules/tadtools");
}else{
  include_once XOOPS_ROOT_PATH."/common/mainfile.php";
  include_once TADTOOLS_PATH."/common/php.php";
}
global $xoopsConfig;
include_once TADTOOLS_PATH."/language/{$xoopsConfig['language']}/main.php";

//取得TadTools的$XoopsModuleConfig
if(!function_exists('TadToolsXoopsModuleConfig')){
  function TadToolsXoopsModuleConfig(){
    if(WEB_THEME){
      $xoopsModuleConfig['jquery_mode']="local";
      $xoopsModuleConfig['facebook_comments_width']="500";
      return $xoopsModuleConfig;
    }else{
      $modhandler = &xoops_gethandler('module');
      $xoopsModule = &$modhandler->getByDirname("tadtools");
      if(is_object($xoopsModule)){
        $config_handler =& xoops_gethandler('config');
        $xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
        return $xoopsModuleConfig;
      }
      return false;
    }
  }
}
?>