From: <tr...@us...> - 2011-10-22 22:52:27
|
Revision: 7925 http://xoops.svn.sourceforge.net/xoops/?rev=7925&view=rev Author: trabis Date: 2011-10-22 22:52:19 +0000 (Sat, 22 Oct 2011) Log Message: ----------- more updating Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoops_link.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/textfilter.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -41,6 +41,7 @@ */ static function getAuthConnection($uname) { + $xoops = Xoops::getInstance(); static $auth_instance; if (!isset($auth_instance)) { /* @var $config_handler XoopsConfigHandler */ @@ -56,7 +57,7 @@ $xoops_auth_method = 'xoops'; } - $ret = include_once $GLOBALS['xoops']->path('class/auth/auth_' . $xoops_auth_method . '.php'); + $ret = include_once $xoops->path('class/auth/auth_' . $xoops_auth_method . '.php'); if ($ret == false) { return false; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -119,6 +119,8 @@ */ public function isActive() { + $xoops = Xoops::getInstance(); + if (isset($this->active)) { return $this->active; } @@ -126,7 +128,7 @@ $this->active = false; return $this->active; } - if (!empty($this->config['skipmember']) && is_object($GLOBALS['xoopsUser'])) { + if (!empty($this->config['skipmember']) && $xoops->isUser()) { $this->active = false; return $this->active; } @@ -214,6 +216,7 @@ */ public function verify($skipMember = null, $name = null) { + $xoops = Xoops::getInstance(); $sessionName = empty($name) ? $this->name : $name; $skipMember = ($skipMember === null) ? $_SESSION["{$sessionName}_skipmember"] : $skipMember; $maxAttempts = $_SESSION["{$sessionName}_maxattempts"]; @@ -224,7 +227,7 @@ $is_valid = true; // Skip CAPTCHA for member if set } else { - if (is_object($GLOBALS['xoopsUser']) && !empty($skipMember)) { + if ($xoops->isUser() && !empty($skipMember)) { $is_valid = true; // Kill too many attempts } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -40,17 +40,15 @@ * 'from' address * * @var string - * @access private */ - private $From = ''; + public $From = ''; /** * 'from' name * * @var string - * @access private */ - private $FromName = ''; + public $FromName = ''; // can be 'smtp', 'sendmail', or 'mail' /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoops_link.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoops_link.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoops_link.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -50,6 +50,7 @@ function smarty_function_xoops_link($params, &$smarty) { + $xoops = Xoops::getInstance(); $urlstr = ''; if (isset($params['urlvars'])) { $szvars = explode('&', $params['urlvars']); @@ -78,10 +79,9 @@ // Get default module/page from current ones if necessary $module = ''; - $page = ''; if (!isset($params['module'])) { - if (isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule'])) { - $module = $GLOBALS['xoopsModule']->getVar('dirname'); + if ($xoops->isModule()) { + $module = $xoops->module->getVar('dirname'); } } else { $module = $params['module']; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -37,6 +37,8 @@ public function load(MyTextSanitizer &$ts, $text) { static $censorConf; + $xoops = Xoops::getInstance(); + if (!isset($censorConf)) { /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); @@ -54,7 +56,7 @@ return $text; } - if (empty($censorConf['censor_admin']) && $GLOBALS['xoopsUserIsAdmin']) { + if (empty($censorConf['censor_admin']) && $xoops->userIsAdmin) { return $text; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -32,6 +32,7 @@ { static $jsLoaded; + $xoops = Xoops::getInstance(); $config = $this->loadConfig(dirname(__FILE__)); $ts->patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1 width=(['\"]?)([0-9]*)\\3]([^\"\(\)\?\&'<>]*)\[\/img\]/sU"; $ts->patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU"; @@ -51,10 +52,10 @@ $ts->replacements[] = '<a href="' . XOOPS_URL . '/image.php?id=\\2" rel="external" title="\\3">\\3</a>'; } else { - if (!empty($config['resize']) && empty($config['clickable']) && !empty($config['max_width']) && !empty($GLOBALS['xoTheme'])) { + if (!empty($config['resize']) && empty($config['clickable']) && !empty($config['max_width']) && !empty($xoops->theme)) { if (!$jsLoaded) { $jsLoaded = true; - $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', array( + $xoops->theme->addScript('/class/textsanitizer/image/image.js', array( 'type' => 'text/javascript' )); } @@ -66,10 +67,10 @@ ? " onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/>"; } else { - if (!empty($config['clickable']) && !empty($config['max_width']) && !empty($GLOBALS['xoTheme'])) { + if (!empty($config['clickable']) && !empty($config['max_width']) && !empty($xoops->theme)) { if (!$jsLoaded) { $jsLoaded = true; - $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', array( + $xoops->theme->addScript('/class/textsanitizer/image/image.js', array( 'type' => 'text/javascript' )); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/textfilter.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/textfilter.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/textfilter.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -30,7 +30,8 @@ */ public function load(MyTextSanitizer &$ts, $text, $force = false) { - if (empty($force) && $GLOBALS['xoopsUserIsAdmin']) { + $xoops = Xoops::getInstance(); + if (empty($force) && $xoops->userIsAdmin) { return $text; } // Built-in fitlers for XSS scripts Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -80,6 +80,7 @@ */ static function validate() { + $xoops = Xoops::getInstance(); $args = func_get_args(); $args_num = func_num_args(); @@ -117,7 +118,6 @@ xoops_loadLanguage('user'); - $xoopsUser_isAdmin = is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isAdmin(); $stop = ''; // Invalid email address if (!checkEmail($email)) { @@ -127,7 +127,7 @@ $stop .= _US_EMAILNOSPACES . '<br />'; } // Check forbidden email address if current operator is not an administrator - if (!$xoopsUser_isAdmin) { + if (!$xoops->userIsAdmin) { foreach ($GLOBALS['xoopsConfigUser']['bad_emails'] as $be) { if (!empty($be) && preg_match('/' . $be . '/i', $email)) { $stop .= _US_INVALIDMAIL . '<br />'; @@ -155,7 +155,7 @@ $stop .= _US_INVALIDNICKNAME . '<br />'; } // Check uname settings if current operator is not an administrator - if (!$xoopsUser_isAdmin) { + if (!$xoops->userIsAdmin) { if (strlen($uname) > $GLOBALS['xoopsConfigUser']['maxuname']) { $stop .= sprintf(_US_NICKNAMETOOLONG, $GLOBALS['xoopsConfigUser']['maxuname']) . '<br />'; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -38,8 +38,9 @@ */ public function render() { - if (isset($GLOBALS['xoTheme'])) { - $GLOBALS['xoTheme']->addScript('include/color-picker.js'); + $xoops = Xoops::getInstance(); + if (isset($xoops->theme)) { + $xoops->theme->addScript('include/color-picker.js'); } else { echo '<script type="text/javascript" src="' . XOOPS_URL . '/include/color-picker.js"></script>'; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -94,8 +94,7 @@ * @param string $hiddentext Identifier for hidden Text * @param array $options Extra options */ - public function __construct($caption, $name, $value = "", $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = - array()) + public function __construct($caption, $name, $value = "", $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = array()) { static $inLoop = 0; @@ -104,6 +103,7 @@ if ($inLoop > 2) { return; } + // Else, initialize parent::__construct($caption, $name, $value, $rows, $cols); $this->_hiddenText = $hiddentext; @@ -111,9 +111,11 @@ if ($inLoop > 1) { return; } + + $xoops = Xoops::getInstance(); if (!isset($options['editor'])) { - if (isset($GLOBALS['SxoopsConfig']['editor'])) { - $options['editor'] = $GLOBALS['SxoopsConfig']['editor']; + if (isset($xoops->config['editor'])) { + $options['editor'] = $xoops->config['editor']; } } @@ -159,6 +161,8 @@ } static $js_loaded; + $xoops = Xoops::getInstance(); + xoops_loadLanguage('formdhtmltextarea'); $ret = ""; // actions @@ -172,13 +176,13 @@ $ret .= "<textarea id='" . $this->getName() . "' name='" . $this->getName() . "' title='" . $this->getTitle() . "' onselect=\"xoopsSavePosition('" . $this->getName() . "');\" onclick=\"xoopsSavePosition('" . $this->getName() . "');\" onkeyup=\"xoopsSavePosition('" . $this->getName() . "');\" cols='" . $this->getCols() . "' rows='" . $this->getRows() . "'" . $this->getExtra() . ">" . $this->getValue() . "</textarea><br />\n"; if (empty($this->skipPreview)) { - if (empty($GLOBALS['xoTheme'])) { + if (empty($xoops->theme)) { $this->js .= implode("", file(XOOPS_ROOT_PATH . "/class/textsanitizer/image/image.js")); } else { - $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', + $xoops->theme->addScript('/class/textsanitizer/image/image.js', array('type' => 'text/javascript')); } - $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "value='" . _PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . intval($this->doHtml) . ", '" . $GLOBALS['xoopsSecurity']->createToken() . "')\"" . " />"; + $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "value='" . _PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . intval($this->doHtml) . ", '" . $xoops->security->createToken() . "')\"" . " />"; $ret .= "<br />" . "<div id='" . $this->getName() . "_hidden' style='display: block;'> " . "<fieldset>" . "<legend>" . $button . "</legend>" . "<div id='" . $this->getName() . "_hidden_data'>" . _XOOPS_FORM_PREVIEW_CONTENT . "</div>" . "</fieldset>" . "</div>"; } // Load javascript Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -33,7 +33,8 @@ */ public function __construct($name = 'XOOPS_TOKEN', $timeout = 0) { - parent::__construct($name . '_REQUEST', $GLOBALS['xoopsSecurity']->createToken($timeout, $name)); + $xoops = Xoops::getInstance(); + parent::__construct($name . '_REQUEST', $xoops->security->createToken($timeout, $name)); } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -95,7 +95,7 @@ return true; } </script>"; - $token = $GLOBALS['xoopsSecurity']->createToken(); + $token = $xoops->security->createToken(); $action_tray = new XoopsFormElementTray("", " | "); $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;">' . _MA_USER_REMOVE . "</a>")); $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="openWithSelfMain(\'' . XOOPS_URL . '/include/findusers.php?target=' . $name . '&multiple=' . $multiple . '&token=' . $token . '\', \'userselect\', 800, 600, null); return false;" >' . _MA_USER_MORE . "</a>" . $js_addusers)); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -308,14 +308,15 @@ */ static function loadConfig($data = null) { + $xoops = Xoops::getInstance(); $configs = array(); if (is_array($data)) { $configs = $data; } else { if (!empty($data)) { $dirname = $data; - } elseif (is_object($GLOBALS['xoopsModule'])) { - $dirname = $GLOBALS['xoopsModule']->getVar('dirname', 'n'); + } elseif ($xoops->isModule()) { + $dirname = $xoops->module->getVar('dirname', 'n'); } else { return false; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -213,8 +213,9 @@ */ public function setTemplateDir($value = null) { - if ($value === null && is_object($GLOBALS['xoopsModule'])) { - $value = $GLOBALS['xoopsModule']->getVar('dirname', 'n'); + $xoops = Xoops::getInstance(); + if ($value === null && $xoops->isModule()) { + $value = $xoops->module->getVar('dirname', 'n'); } else { $value = str_replace(DIRECTORY_SEPARATOR, "/", $value); } @@ -440,12 +441,13 @@ */ private function sendPM($uid, $subject, $body) { + $xoops = Xoops::getInstance(); $pm_handler = xoops_gethandler('privmessage'); $pm = $pm_handler->create(); $pm->setVar("subject", $subject); // RMV-NOTIFY $pm->setVar('from_userid', !empty($this->fromUser) ? $this->fromUser->getVar('uid') - : (empty($GLOBALS['xoopsUser']) ? 1 : $GLOBALS['xoopsUser']->getVar('uid'))); + : (!$xoops->isUser() ? 1 : $xoops->user->getVar('uid'))); $pm->setVar("msg_text", $body); $pm->setVar("to_userid", $uid); if (!$pm_handler->insert($pm)) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -173,7 +173,7 @@ foreach (array( 'GLOBALS', '_SESSION', 'HTTP_SESSION_VARS', '_GET', 'HTTP_GET_VARS', '_POST', 'HTTP_POST_VARS', '_COOKIE', 'HTTP_COOKIE_VARS', '_REQUEST', '_SERVER', 'HTTP_SERVER_VARS', '_ENV', 'HTTP_ENV_VARS', '_FILES', - 'HTTP_POST_FILES', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', + 'HTTP_POST_FILES', 'xoops', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', 'xoopsConfig', 'xoopsOption', 'xoopsModule', 'xoopsModuleConfig', 'xoopsRequestUri' ) as $bad_global) { if (isset($_REQUEST[$bad_global])) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -105,7 +105,7 @@ * Requires XoopsLogger, XOOPS_DB_PROXY; */ $xoops->db = XoopsDatabaseFactory::getDatabaseConnection(); -$xoopsDb = $xoops->db; +$xoopsDB = $xoops->db; /** * Get xoops configs Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -327,13 +327,14 @@ */ public function getOptions() { + $xoops = Xoops::getInstance(); if (!$this->isCustom()) { $edit_func = (string)$this->getVar('edit_func'); if (!$edit_func) { return false; } if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'))) { - if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php')) { + if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/' . $xoops->config['language'] . '/blocks.php')) { include_once $file; } else { if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/english/blocks.php')) { @@ -370,7 +371,7 @@ */ public function buildBlock() { - global $xoopsConfig, $xoopsOption, $xoTheme; + $xoops = Xoops::getInstance(); $block = array(); if (!$this->isCustom()) { // get block display function @@ -378,7 +379,7 @@ if (!$show_func) { return false; } - if (!file_exists($func_file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')))) { + if (!file_exists($func_file = $xoops->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')))) { return false; } // must get lang files b4 including the file @@ -413,6 +414,7 @@ */ public function getForm($mode = 'edit') { + $xoops = Xoops::getInstance(); xoops_loadLanguage('blocks', 'system'); if ($this->isNew()) { $title = _AM_SYSTEM_BLOCKS_ADDBLOCK; @@ -503,7 +505,7 @@ if ($this->getVar('template') != '') { /* @var $tplfile_handler XoopsTplfileHandler */ $tplfile_handler = xoops_gethandler('tplfile'); - $btemplate = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $this->getVar('bid')); + $btemplate = $tplfile_handler->find($xoops->config['template_set'], 'block', $this->getVar('bid')); if (count($btemplate) > 0) { $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar('tpl_id') . '">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -18,9 +18,6 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once $GLOBALS['xoops']->path('kernel/configoption.php'); -require_once $GLOBALS['xoops']->path('kernel/configitem.php'); - /** * XOOPS configuration handling class. * This class acts as an interface for handling general configurations of XOOPS @@ -65,8 +62,8 @@ */ public function __construct($db) { - $this->_cHandler = new XoopsConfigItemHandler($db); - $this->_oHandler = new XoopsConfigOptionHandler($db); + $this->_cHandler = xoops_getHandler('configitem'); + $this->_oHandler = xoops_getHandler('configoption'); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -221,15 +221,15 @@ */ public function loadInfo($dirname, $verbose = true) { + $xoops = xoops::getInstance(); $dirname = basename($dirname); - global $xoopsConfig; - if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/' . $xoopsConfig['language'] . '/modinfo.php'))) { + if (file_exists($file = $xoops->path('modules/' . $dirname . '/language/' . $xoops->config['language'] . '/modinfo.php'))) { include_once $file; - } else if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/english/modinfo.php'))) { + } else if (file_exists($file = $xoops->path('modules/' . $dirname . '/language/english/modinfo.php'))) { include_once $file; } - if (!file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/xoops_version.php'))) { + if (!file_exists($file = $xoops->path('modules/' . $dirname . '/xoops_version.php'))) { if (false != $verbose) { echo "Module File for $dirname Not Found!"; } @@ -252,6 +252,7 @@ */ public function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0) { + $xoops = xoops::getInstance(); if ($this->getVar('hassearch') != 1) { return false; } @@ -259,7 +260,7 @@ if ($this->getVar('hassearch') != 1 || ! isset($search['file']) || ! isset($search['func']) || $search['func'] == '' || $search['file'] == '') { return false; } - if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/' . $search['file']))) { + if (file_exists($file = $xoops->path('modules/' . $this->getVar('dirname') . '/' . $search['file']))) { include_once $file; } else { return false; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -21,8 +21,9 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); // RMV-NOTIFY -include_once $GLOBALS['xoops']->path('include/notification_constants.php'); -include_once $GLOBALS['xoops']->path('include/notification_functions.php'); +$xoops = xoops::getInstance(); +include_once $xoops->path('include/notification_constants.php'); +include_once $xoops->path('include/notification_functions.php'); /** * A Notification @@ -141,6 +142,8 @@ **/ public function notifyUser($template_dir, $template, $subject, $tags) { + $xoops = xoops::getInstance(); + /** * @var $member_handler XoopsMemberHandler * @var $config_handler XoopsConfigHandler @@ -155,7 +158,7 @@ $method = $user->getVar('notify_method'); $xoopsMailer = xoops_getMailer(); - include_once $GLOBALS['xoops']->path('include/notification_constants.php'); + include_once $xoops->path('include/notification_constants.php'); switch ($method) { case XOOPS_NOTIFICATION_METHOD_PM: $xoopsMailer->usePM(); @@ -189,7 +192,7 @@ // If send-once-then-delete, delete notification // If send-once-then-wait, disable notification - include_once $GLOBALS['xoops']->path('include/notification_constants.php'); + include_once $xoops->path('include/notification_constants.php'); $notification_handler = xoops_gethandler('notification'); if ($this->getVar('not_mode') == XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE) { @@ -488,14 +491,14 @@ */ public function triggerEvent($category, $item_id, $event, $extra_tags = array(), $user_list = array(), $module_id = null, $omit_user_id = null) { + $xoops = xoops::getInstance(); /** * @var $config_handler XoopsConfigHandler */ if (!isset($module_id)) { - global $xoopsModule; - $module = $xoopsModule; - $module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0; + $module = $xoops->module; + $module_id = $xoops->isModule() ? $xoops->module->getVar('mid') : 0; } else { $module_handler = xoops_gethandler('module'); $module = $module_handler->get($module_id); @@ -514,9 +517,8 @@ } if (!isset($omit_user_id)) { - global $xoopsUser; - if (!empty($xoopsUser)) { - $omit_user_id = $xoopsUser->getVar('uid'); + if (!$xoops->isUser()) { + $omit_user_id = $xoops->user->getVar('uid'); } else { $omit_user_id = 0; } @@ -549,7 +551,7 @@ $tags = array(); if (!empty($not_config)) { if (!empty($not_config['tags_file'])) { - $tags_file = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname') . '/' . $not_config['tags_file']); + $tags_file = $xoops->path('modules/' . $module->getVar('dirname') . '/' . $not_config['tags_file']); if (file_exists($tags_file)) { include_once $tags_file; if (!empty($not_config['tags_func'])) { @@ -562,7 +564,7 @@ } // RMV-NEW if (!empty($not_config['lookup_file'])) { - $lookup_file = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']); + $lookup_file = $xoops->path('modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']); if (file_exists($lookup_file)) { include_once $lookup_file; if (!empty($not_config['lookup_func'])) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -121,6 +121,7 @@ */ public function getUnameFromId($userid, $usereal = 0) { + $xoops = xoops::getInstance(); $userid = intval($userid); $usereal = intval($usereal); if ($userid > 0) { @@ -141,7 +142,7 @@ } } } - return $GLOBALS['xoopsConfig']['anonymous']; + return $xoops->config['anonymous']; } /** @@ -208,8 +209,9 @@ */ public function isAdmin($module_id = null) { + $xoops = xoops::getInstance(); if (is_null($module_id)) { - $module_id = isset($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('mid', 'n') : 1; + $module_id = $xoops->isModule() ? $xoops->module->getVar('mid', 'n') : 1; } elseif (intval($module_id) < 1) { $module_id = 0; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -38,7 +38,7 @@ function xoops_module_install($dirname) { - global $xoopsUser, $xoopsConfig; + global $xoopsUser, $xoopsConfig, $xoopsDB; $dirname = trim($dirname); $db = $GLOBALS["xoopsDB"]; $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); @@ -354,6 +354,8 @@ $groups = array(XOOPS_GROUP_ADMIN); } // retrieve all block ids for this module + /* @var $block_handler XoopsBlockHandler */ + $block_handler = xoops_getHandler('block'); $blocks = $block_handler->getByModule($newmid, false); $msgs[] = _AM_SYSTEM_MODULES_GROUP_SETTINGS_ADD; $gperm_handler = xoops_gethandler('groupperm'); @@ -475,7 +477,7 @@ { global $xoopsConfig; $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); - $db = Database::getInstance(); + $db = XoopsDatabaseFactory::getDatabaseConnection(); $module_handler = xoops_gethandler('module'); $module = $module_handler->getByDirname($dirname); include_once XOOPS_ROOT_PATH . '/class/template.php'; @@ -536,6 +538,8 @@ unset($templates); // delete blocks and block tempalte files + /* @var $block_handler XoopsBlockHandler */ + $block_handler = xoops_getHandler('block'); $block_arr = $block_handler->getByModule($module->getVar('mid')); if (is_array($block_arr)) { $bcount = count($block_arr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |