XPressME Integration Kit

Trac


Ignore:
Timestamp:
May 23, 2011, 3:03:57 PM (13 years ago)
Author:
toemon
Message:

ConfigFromXoopsクラスを廃止し、modInfoクラスを使用するように変更
WP2.2以下で使用するテンプレートold_templateの廃止

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php

    r658 r757  
    11<?php 
    2 global $xoops_config; 
    3 if (!is_object($xoops_config)){ // is call other modules 
    4         require_once dirname(dirname(dirname(dirname(dirname( __FILE__ ))))) .'/class/config_from_xoops.class.php' ; 
    5         $xoops_config = new ConfigFromXoops; 
     2global $modInfo; 
     3if (!is_object($modInfo)){ // is call other modules 
     4        require_once dirname(dirname(dirname(dirname(dirname( __FILE__ ))))) .'/class/modInfoClass.php' ; 
     5        $modInfo = new ConfigFromXoops; 
    66} 
    77 
     
    1414        global $xoops_db; 
    1515         
    16         $modules_db = get_xoops_prefix() . 'modules'; 
     16        $module_handler =& xoops_gethandler('module'); 
     17        $module =& $module_handler->getByDirname($mydirname); 
     18        $moduleID = $module->getVar('mid'); 
     19 
    1720        $config_db = get_xoops_prefix() . 'config'; 
    18  
    19         $moduleID = $xoops_db->get_var("SELECT mid FROM $modules_db WHERE dirname = '$module_dir'"); 
    2021        if (empty($moduleID)) return null; 
    2122        $conf_value = $xoops_db->get_var("SELECT conf_value FROM $config_db WHERE (conf_modid = $moduleID) AND (conf_name = '$config_name')"); 
     
    4647function get_xoops_prefix() 
    4748{ 
    48         global $xoops_config; 
    49         $ret =$xoops_config->xoops_db_prefix . '_'; 
     49        global $modInfo; 
     50        $ret = $modInfo->get_xoops_db_prefix(); 
    5051        return $ret; 
    5152} 
     
    5354function get_xoops_trust_path() 
    5455{ 
    55         global $xoops_config; 
    56         $ret =$xoops_config->xoops_trust_path; 
     56        global $modInfo; 
     57        $ret =$modInfo->get_xoops_trust_path(); 
    5758        return $ret; 
    5859} 
     
    6061function get_xoops_root_path() 
    6162{ 
    62         global $xoops_config; 
    63         $ret =$xoops_config->xoops_root_path; 
     63        global $modInfo; 
     64        $ret =$modInfo->get_xoops_root_path(); 
    6465        return $ret; 
    6566} 
     
    7273function get_xoops_url() 
    7374{ 
    74         global $xoops_config; 
    75         $ret =$xoops_config->xoops_url ; 
     75        global $modInfo; 
     76        $ret =$modInfo->get_xoops_url() ; 
    7677        return $ret; 
    7778} 
     
    7980function get_xpress_url() 
    8081{ 
    81         global $xoops_config; 
    82         $ret =$xoops_config->module_url ; 
     82        global $modInfo; 
     83        $ret =$modInfo->get_module_url() ; 
    8384        return $ret; 
    8485} 
     
    8687function get_xpress_modid() 
    8788{ 
    88         global $xoops_db; 
    89          
    90         $modulename = get_xpress_dir_name();     
    91         $sql = "SELECT mid FROM " . get_xoops_prefix() . "modules WHERE dirname = '$modulename'"; 
    92         $mid = $xoops_db->get_var($sql); 
    93         return $mid;     
     89        global $modInfo; 
     90         
     91        $modulename = get_xpress_dir_name(); 
     92        $mid = $modInfo->get_moduleID_ByDirname($modulename); 
     93        return $mid; 
    9494} 
    9595 
     
    369369function get_block_file_path($mydirname,$file_name) 
    370370{ 
    371         global $xoops_config, $xpress_config; 
    372         $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
     371        global $modInfo, $xpress_config; 
     372        $mydirpath = $modInfo->get_xoops_root_path() . '/modules/' . $mydirname; 
    373373        $select_theme = xpress_ThemeTemplate(get_xpress_theme_name($mydirname)); 
    374374        $xpress_default_theme = 'xpress_default'; 
Note: See TracChangeset for help on using the changeset viewer.