1: <?php
2: /**
3: * XOOPS legacy functions
4: *
5: * You may not change or alter any portion of this comment or credits
6: * of supporting developers from this source code or any supporting source code
7: * which is considered copyrighted (c) material of the original comment or credit authors.
8: * This program is distributed in the hope that it will be useful,
9: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11: *
12: * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
13: * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
14: * @package kernel
15: * @since 2.3.0
16: * @author Taiwen Jiang <phppp@users.sourceforge.net>
17: */
18: defined('XOOPS_ROOT_PATH') || exit('Restricted access');
19:
20: /**
21: * Deprecated functions
22: * @param $name
23: * @param string $module
24: * @param string $default
25: * @return bool
26: */
27:
28: // Backward compatibility for 2.2*
29: function xoops_load_lang_file($name, $module = '', $default = 'english')
30: {
31: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . '() is deprecated, use xoops_loadLanguage() instead');
32:
33: return xoops_loadLanguage($name, $module);
34: }
35:
36: /**
37: * @param int $docheck
38: *
39: * @return mixed
40: */
41: function xoops_refcheck($docheck = 1)
42: {
43: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . '() is deprecated, use xoopsSecurity::checkReferer instead');
44:
45: return $GLOBALS['xoopsSecurity']->checkReferer($docheck);
46: }
47:
48: /**
49: * @param $userid
50: *
51: * @return string
52: */
53: function xoops_getLinkedUnameFromId($userid)
54: {
55: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . '() is deprecated, use XoopsUserUtility::getUnameFromId() instead');
56: xoops_load('XoopsUserUtility');
57:
58: return XoopsUserUtility::getUnameFromId($userid, false, true);
59: }
60:
61: /*
62: * Function to display banners in all pages
63: */
64: function showbanner()
65: {
66: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . '() is deprecated, use xoops_getbanner instead');
67: echo xoops_getbanner();
68: }
69:
70: /*
71: * This function is deprecated. Do not use!
72: */
73: function getTheme()
74: {
75: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . "() is deprecated, use \$xoopsConfig['theme_set'] directly");
76:
77: return $GLOBALS['xoopsConfig']['theme_set'];
78: }
79:
80: /*
81: * Function to get css file for a certain theme
82: * This function will be deprecated.
83: */
84: /**
85: * @param string $theme
86: *
87: * @return string
88: */
89: function getcss($theme = '')
90: {
91: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . '() is deprecated, use xoops_getcss instead');
92:
93: return xoops_getcss($theme);
94: }
95:
96: /**
97: * @return XoopsMailer|XoopsMailerLocal
98: */
99: function getMailer()
100: {
101: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . '() is deprecated, use xoops_getMailer instead');
102: $mailer = xoops_getMailer();
103:
104: return $mailer;
105: }
106:
107: /*
108: * Functions to display dhtml loading image box
109: */
110: function OpenWaitBox()
111: {
112: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . '() is deprecated');
113: echo "<div id='waitDiv' style='position:absolute;left:40%;top:50%;visibility:hidden;text-align: center;'>
114: <table cellpadding='6' border='2' class='bg2'>
115: <tr>
116: <td align='center'><strong><big>" . _FETCHING . "</big></strong><br><img src='" . XOOPS_URL . "/images/await.gif' alt='' /><br>" . _PLEASEWAIT . "</td>
117: </tr>
118: </table>
119: </div>
120: <script type='text/javascript'>
121: <!--//
122: var DHTML = (document.getElementById || document.all || document.layers);
123: function ap_getObj(name)
124: {
125: if (document.getElementById){
126: return document.getElementById(name).style;
127: } elseif (document.all)
128: {
129: return document.all[name].style;
130: } elseif (document.layers)
131: {
132: return document.layers[name];
133: }
134: }
135: function ap_showWaitMessage(div,flag)
136: {
137: if (!DHTML) {
138: return null;
139: }
140: var x = ap_getObj(div);
141: x.visibility = (flag) ? 'visible' : 'hidden';
142: if (!document.getElementById) {
143: if (document.layers) {
144: x.left=280/2;
145: }
146: }
147:
148: return true;
149: }
150: ap_showWaitMessage('waitDiv', 1);
151: //-->
152: </script>";
153: }
154:
155: function CloseWaitBox()
156: {
157: $GLOBALS['xoopsLogger']->addDeprecated('Function ' . __FUNCTION__ . '() is deprecated');
158: echo "<script type='text/javascript'>
159: <!--//
160: ap_showWaitMessage('waitDiv', 0);
161: //-->
162: </script>
163: ";
164: }
165: