|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
/* |
|
3
|
|
|
You may not change or alter any portion of this comment or credits |
|
4
|
|
|
of supporting developers from this source code or any supporting source code |
|
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
6
|
|
|
|
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
|
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
14
|
|
|
* @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
|
15
|
|
|
* @since 4.3 |
|
16
|
|
|
* @author irmtfan <[email protected]> |
|
17
|
|
|
* @author The Persian Xoops Support Site<www.xoops.ir> |
|
18
|
|
|
*/ |
|
19
|
|
|
global $xoTheme; |
|
20
|
|
|
|
|
21
|
|
|
require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.render.php'); |
|
22
|
|
|
$iconHandler = newbbGetIconHandler(); |
|
23
|
|
|
// get css rel path from setted language |
|
24
|
|
|
$css_rel_path = $iconHandler->getPath('language/' . $GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'css'); |
|
25
|
|
|
// add local stylesheet |
|
26
|
|
|
/** @var xos_opal_Theme $xoTheme */ |
|
27
|
|
|
$xoTheme->addStylesheet($css_rel_path . '/style.css'); |
|
28
|
|
|
|
|
29
|
|
|
// get js rel path from setted language |
|
30
|
|
|
$js_rel_path = $iconHandler->getPath('language/' . $GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'js'); |
|
31
|
|
|
// add all local js files inside js directory |
|
32
|
|
|
xoops_load('XoopsLists'); |
|
33
|
|
|
$allfiles = \XoopsLists::getFileListAsArray($GLOBALS['xoops']->path($js_rel_path)); |
|
34
|
|
|
foreach ($allfiles as $jsfile) { |
|
35
|
|
|
if ('js' === \mb_strtolower(pathinfo((string) $jsfile, PATHINFO_EXTENSION))) { |
|
|
|
|
|
|
36
|
|
|
$xoTheme->addScript($js_rel_path . '/' . $jsfile); |
|
37
|
|
|
} |
|
38
|
|
|
} |
|
39
|
|
|
global $forumCookie; // for $forumCookie["prefix"] revert last change - use global instead of include |
|
40
|
|
|
// add toggle script |
|
41
|
|
|
//$toggle_script = "var toggle_cookie=\"" . $forumCookie['prefix'] . 'G' . '\';'; |
|
42
|
|
|
$toggle_script = 'let toggle_cookie="' . (isset($forumCookie['prefix'])?:'') . 'G";'; |
|
|
|
|
|
|
43
|
|
|
$xoTheme->addScript('', ['type' => 'text/javascript'], $toggle_script); |
|
44
|
|
|
|