XPressME Integration Kit

Trac

Changeset 780


Ignore:
Timestamp:
May 30, 2011, 10:37:06 AM (13 years ago)
Author:
toemon
Message:

$xoopsModuleがロードされていないときディレクトリー名指定でモジュール情報を取得するように変更

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/class/modInfo_class.php

    r776 r780  
    5050    function modInfoClass()     //for PHP4 constructor 
    5151    {   
    52         global $xoopsModule,$wpConfigInfo; 
    53         if (is_object($wpConfigInfo)){ 
     52        global $xoopsModule,$wpConfigInfo,$xoopsConfig; 
     53        if (!is_object($wpConfigInfo)){ 
    5454                include_once dirname(__FILE__).'/wpConfigInfo_class.php'; 
    5555                $this->wpConfigInfo = new wpConfigInfoClass; 
    5656        } 
    57                 $this->xoops_root_path = XOOPS_ROOT_PATH; 
     57        if (! is_object($xoopsModule)){ 
     58                        $module_handler =& xoops_gethandler('module'); 
     59                        $xoopsModule =& $module_handler->getByDirname(basename(dirname(dirname(__FILE__)))); 
     60                }        
     61 
     62        $this->xoops_root_path = XOOPS_ROOT_PATH; 
    5863                $this->xoops_trust_path = (defined('XOOPS_TRUST_PATH')) ? XOOPS_TRUST_PATH : ''; 
    5964                $this->xoops_url = XOOPS_URL; 
     
    7883                if (function_exists('date_default_timezone_get')){ 
    7984                        $this->xoops_time_zone = date_default_timezone_get(); 
    80                 } 
    81  
     85                } else { 
     86                        $this->xoops_time_zone = $xoopsConfig['default_TZ']; 
     87                } 
    8288    } 
    8389 
     
    230236                $module =& $module_handler->getByDirname($dir_name); 
    231237                $module_id = $module->getVar('mid'); 
    232         } 
    233          
     238                return $module_id; 
     239        } 
     240 
    234241        function get_moduleID(){ 
    235242                global $xoopsModule; 
Note: See TracChangeset for help on using the changeset viewer.