[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] 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 | <68e8cea4552b0_2c1a9e6c82601@gitlab-sidekiq-low-urgency-cpu-bound-v2-67f7b598f6-5xs82.mail> |
Victor Emanouilov pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki
Commits:
55c473c7 by Victor Emanouilov at 2025-10-10T12:15:06+03:00
[FIX] use jitGet besides _GET global var when replacing argvariables - e.g. ajax services have the _GET global one reset and filtered
- - - - -
f42bafc6 by Victor Emanouilov at 2025-10-10T12:15:07+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
=====================================
@@ -1875,7 +1875,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');
@@ -2278,6 +2278,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
=====================================
@@ -69,28 +69,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/e89e4cb261c74e72fe02c124367545bffec7cabc...f42bafc6d9de4c97dd8ead6647827d28ca1cf117
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/e89e4cb261c74e72fe02c124367545bffec7cabc...f42bafc6d9de4c97dd8ead6647827d28ca1cf117
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