onokazu
onoka****@users*****
2006年 2月 6日 (月) 14:43:58 JST
Index: xoops2jp/html/kernel/module.php diff -u xoops2jp/html/kernel/module.php:1.4 xoops2jp/html/kernel/module.php:1.4.6.1 --- xoops2jp/html/kernel/module.php:1.4 Wed Aug 3 21:39:12 2005 +++ xoops2jp/html/kernel/module.php Mon Feb 6 14:43:58 2006 @@ -1,5 +1,5 @@ <?php -// $Id: module.php,v 1.4 2005/08/03 12:39:12 onokazu Exp $ +// $Id: module.php,v 1.4.6.1 2006/02/06 05:43:58 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -120,7 +120,8 @@ if ( isset($this->modinfo[$name]) ) { return $this->modinfo[$name]; } - return false; + $ret = false; + return $ret; } return $this->modinfo; } @@ -216,23 +217,24 @@ **/ function &search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0) { + $ret = false; if ($this->getVar('hassearch') != 1) { - return false; + return $ret; } $search =& $this->getInfo('search'); if ($this->getVar('hassearch') != 1 || !isset($search['file']) || !isset($search['func']) || $search['func'] == '' || $search['file'] == '') { - return false; + return $ret; } if (file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname').'/'.$search['file'])) { include_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/'.$search['file']; } else { - return false; + return $ret; } if (function_exists($search['func'])) { $func = $search['func']; - return $func($term, $andor, $limit, $offset, $userid); + $ret = $func($term, $andor, $limit, $offset, $userid); } - return false; + return $ret; } /**#@+ @@ -254,7 +256,8 @@ function &getByDirName($dirname) { $modhandler =& xoops_gethandler('module'); - return $modhandler->getByDirname($dirname); + $ret =& $modhandler->getByDirname($dirname); + return $ret; } /**#@-*/ } @@ -297,7 +300,7 @@ **/ function &create($isNew = true) { - $module = new XoopsModule(); + $module =& new XoopsModule(); if ($isNew) { $module->setNew(); } @@ -335,7 +338,8 @@ } } } - return false; + $ret = false; + return $ret; } /** @@ -349,24 +353,24 @@ { static $_cachedModule_mid; static $_cachedModule_dirname; + $ret = false; if (!empty($_cachedModule_dirname[$dirname])) { - return $_cachedModule_dirname[$dirname]; + $ret = $_cachedModule_dirname[$dirname]; } else { $sql = "SELECT * FROM ".$this->db->prefix('modules')." WHERE dirname = '".trim($dirname)."'"; - if (!$result = $this->db->query($sql)) { - return false; - } - $numrows = $this->db->getRowsNum($result); - if ($numrows == 1) { - $module = new XoopsModule(); - $myrow = $this->db->fetchArray($result); - $module->assignVars($myrow); - $_cachedModule_dirname[$dirname] =& $module; - $_cachedModule_mid[$module->getVar('mid')] =& $module; - return $module; + if ($result = $this->db->query($sql)) { + $numrows = $this->db->getRowsNum($result); + if ($numrows == 1) { + $module =& new XoopsModule(); + $myrow = $this->db->fetchArray($result); + $module->assignVars($myrow); + $_cachedModule_dirname[$dirname] =& $module; + $_cachedModule_mid[$module->getVar('mid')] =& $module; + $ret =& $module; + } } - return false; } + return $ret; } /**