[TikiWiki-commits] [Git][tikiwiki/tiki][master] 2 commits: [FIX] use jitGet besides _GET global var when replacing argvariables - e.g....
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68e8ce7796b8d_2c16922504495@gitlab-sidekiq-low-urgency-cpu-bound-v2-67f7b598f6-grwpz.mail> |
Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
2cdb4706 by Victor Emanouilov at 2025-10-10T12:14:17+03:00
[FIX] use jitGet besides _GET global var when replacing argvariables - e.g. ajax services have the _GET global one reset and filtered
- - - - -
856b6ba0 by Victor Emanouilov at 2025-10-10T12:14:17+03:00
[ENH] JS module support for theme and theme option custom files - ability to organize larger file bases with module imports
- - - - -
2 changed files:
- lib/parser/parserlib.php
- lib/setup/javascript.php
Changes:
=====================================
lib/parser/parserlib.php
=====================================
@@ -1960,7 +1960,7 @@ class ParserLib extends TikiDb_Bridge
//*
public function parse_wiki_argvariable(&$data)
{
- global $prefs, $user;
+ global $prefs, $user, $jitGet;
$tikilib = TikiLib::lib('tiki');
$smarty = TikiLib::lib('smarty');
@@ -2354,6 +2354,8 @@ class ParserLib extends TikiDb_Bridge
default:
if (isset($_GET[$name])) {
$value = $_GET[$name];
+ } elseif ($jitGet->offsetExists($name)) {
+ $value = $jitGet->offsetGet($name);
} else {
$value = '';
include_once('lib/wiki-plugins/wikiplugin_showpref.php');
=====================================
lib/setup/javascript.php
=====================================
@@ -73,28 +73,37 @@ if ($custom_js) {
// Before Tiki 27, we used to also look in /themes/js for a custom.js file
+$custom_js_files = [];
+$custom_js_modules = [];
+
// Is there a js/custom.js in the current base theme (no options)?
-$custom_js = ThemeLib::getThemePath(null, '', 'js/custom.js');
-if ($custom_js) {
- $headerlib->add_jsfile($custom_js);
-}
+$custom_js_files[] = ThemeLib::getThemePath(null, '', 'js/custom.js');
+$custom_js_modules[] = ThemeLib::getThemePath(null, '', 'js/custom.module.js');
// Is there a js/custom.js in the current theme options?
-$custom_js = ThemeLib::getThemePath(null, null, 'js/custom.js');
-if ($custom_js) {
- $headerlib->add_jsfile($custom_js);
-}
+$custom_js_files[] = ThemeLib::getThemePath(null, null, 'js/custom.js');
+$custom_js_modules[] = ThemeLib::getThemePath(null, null, 'js/custom.module.js');
//Is there a _custom/shared/js/custom.js
-$custom_js = \Tiki\Paths\Customization::getSharedPublicPath(TIKI_CUSTOMIZATIONS_JAVASCRIPT_PATH_FRAGMENT);
-if ($custom_js) {
- $headerlib->add_jsfile($custom_js);
-}
+$custom_js_files[] = \Tiki\Paths\Customization::getSharedPublicPath(TIKI_CUSTOMIZATIONS_JAVASCRIPT_PATH_FRAGMENT);
//Is there a _custom/sites/my.domain/js/custom.js
-$custom_js = \Tiki\Paths\Customization::getCurrentSitePublicPath(TIKI_CUSTOMIZATIONS_JAVASCRIPT_PATH_FRAGMENT);
-if ($custom_js) {
- $headerlib->add_jsfile($custom_js);
+$custom_js_files[] = \Tiki\Paths\Customization::getCurrentSitePublicPath(TIKI_CUSTOMIZATIONS_JAVASCRIPT_PATH_FRAGMENT);
+
+foreach ($custom_js_files as $custom_js_file) {
+ if (! empty($custom_js_file)) {
+ $headerlib->add_jsfile($custom_js_file);
+ }
+}
+
+foreach ($custom_js_modules as $custom_js_module) {
+ if (! empty($custom_js_module)) {
+ $headerlib->add_js_module(
+ "
+import \"./$custom_js_module\";
+"
+ );
+ }
}
// setup timezone array
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/f081d3fa5fce4d8535b1521ae39c325b71491a77...856b6ba016853c9f908131f0bb760bfd0aea7ba8
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/f081d3fa5fce4d8535b1521ae39c325b71491a77...856b6ba016853c9f908131f0bb760bfd0aea7ba8
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs