- Timestamp:
- May 23, 2011, 3:03:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Ver3.0/xpressme_integration_kit/include/xpress_block_render.php
r749 r757 4 4 require_once dirname( __FILE__ ) .'/xml.php' ; 5 5 require_once dirname( __FILE__ ) .'/xpress_cache.php' ; 6 global $ xoops_config;7 8 if (!is_object($ xoops_config)){ // is call other modules9 require_once dirname(dirname( __FILE__ )) .'/class/ config_from_xoops.class.php' ;10 $ xoops_config = new ConfigFromXoops;6 global $modInfo; 7 8 if (!is_object($modInfo)){ // is call other modules 9 require_once dirname(dirname( __FILE__ )) .'/class/modInfo_class.php' ; 10 $modInfo = new modInfoClass; 11 11 } 12 12 … … 68 68 { 69 69 global $xoopsDB; 70 $modules_tbl = $xoopsDB->prefix('modules'); 71 72 $sql = "SELECT mid FROM $modules_tbl WHERE dirname = '$mydirname'"; 73 $result = $xoopsDB->query($sql, 0, 0); 74 if ($xoopsDB->getRowsNum($result) > 0){ 75 $row = $xoopsDB->fetchArray($result); 76 $mid = $row['mid']; 77 } 78 return $mid; 70 $module_handler =& xoops_gethandler('module'); 71 $module =& $module_handler->getByDirname($mydirname); 72 $module_id = $module->getVar('mid'); 73 return $module_id; 79 74 } 80 75 … … 121 116 function xpress_block_cache_found($mydirname,$block_name) 122 117 { 123 global $ xoops_config;118 global $modInfo; 124 119 125 $cache_dir = $ xoops_config->xoops_cache_path. '/';120 $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 126 121 $xml_name = $block_name . '.xml'; 127 122 … … 138 133 function xpress_block_render($mydirname,$block_function_name,$options) 139 134 { 140 global $wpdb,$ xoops_config,$xoopsUserIsAdmin;135 global $wpdb,$modInfo,$xoopsUserIsAdmin; 141 136 $func_file = $block_function_name; 142 137 $call_theme_function_name = str_replace(".php", "", $block_function_name); … … 183 178 184 179 $tpl =& new XoopsTpl() ; 185 $tpl->template_dir = $ xoops_config->module_path . '/templates';180 $tpl->template_dir = $modInfo->get_module_templates_path(); 186 181 if (!$tpl->template_exists($templates_file)){ 187 $src_file_path = $ xoops_config->module_path . '/templates/' .$mydirname. '_' . str_replace(".php", ".html", $block_function_name);182 $src_file_path = $modInfo->get_module_templates_path() . '/' .$mydirname. '_' . str_replace(".php", ".html", $block_function_name); 188 183 $templates_file = add_xpress_tpl($mydirname,$templates_file,$src_file_path); 189 184 } … … 198 193 199 194 function add_xpress_tpl($mydirname,$templates='',$src_file_path){ 200 global $wpdb,$ xoops_config, $xoops_db;195 global $wpdb,$modInfo , $xoops_db; 201 196 202 197 $mid = get_block_mid($mydirname); … … 210 205 $type = $temp_parm[0]; 211 206 } 212 $temp_file_path = $ xoops_config->module_path . '/templates/'. $filename;207 $temp_file_path = $modInfo->get_module_templates_path() . '/'. $filename; 213 208 $pattern = '^' . $mydirname . '_'; 214 209 if (preg_match('/' . $pattern . '/' , $filename, $match)){ // file prefix check … … 274 269 function xpress_unnecessary_block_cache_delete($mydirname) 275 270 { 276 global $xoops_db,$ xoops_config;271 global $xoops_db,$modInfo; 277 272 278 273 $mid = get_xpress_modid(); … … 289 284 $pattern = '(' . $pattern . ')'; 290 285 291 $cache_dir = $ xoops_config->xoops_cache_path. '/';286 $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 292 287 $cache_time = 0; 293 288 if ($dh = opendir($cache_dir)) {
Note: See TracChangeset
for help on using the changeset viewer.