[TikiWiki-commits] [Git][tikiwiki/tiki][29.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 <68e8ce944e57f_2ce07cc37ad@gitlab-sidekiq-low-urgency-cpu-bound-v2-67f7b598f6-f865c.mail>

Victor Emanouilov pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
658f48b1 by Victor Emanouilov at 2025-10-10T12:14:46+03:00
[FIX] use jitGet besides _GET global var when replacing argvariables - e.g. ajax services have the _GET global one reset and filtered

- - - - -
77b121c0 by Victor Emanouilov at 2025-10-10T12:14:54+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
=====================================
@@ -1882,7 +1882,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');
 
@@ -2276,6 +2276,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
=====================================
@@ -72,28 +72,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/b89fe40449319edcda54bef066bf062f0b54060a...77b121c040a732a3df0e4d6c4656f7d1e7ccdc85

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/b89fe40449319edcda54bef066bf062f0b54060a...77b121c040a732a3df0e4d6c4656f7d1e7ccdc85
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.