[TikiWiki-commits] [Git][tikiwiki/tiki][master] [REF] Webmail: stop rewriting Cypht's generated links in favor of...

"Merci Jacob \(@mercihabam\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a7f3536c53ec_382d7cb28284ed@gitlab-sidekiq-low-urgency-cpu-bound-v2-7774c44f54-xq97m.mail>

Merci Jacob pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
84b6345d by Merci Jacob at 2026-08-14T15:15:02+00:00
[REF] Webmail: stop rewriting Cypht's generated links in favor of 'append_url_query' and 'page_param_name' configurations
---
* upgrade Cypht to latest master revision

* [REF] Webmail: stop rewritting Cypht generated links in favor of 'append_url_query' and 'page_param_name' configurations

See merge request tikiwiki/tiki!10884

- - - - -


12 changed files:

- lib/core/Search/ContentSource/FileSource.php
- lib/core/Search/Index/Cypht.php
- lib/core/Services/Cypht/Controller.php
- lib/core/Tracker/Field/EmailFolder.php
- lib/cypht/.env
- lib/cypht/integration/Tiki_Hm_Custom_Session.php
- lib/cypht/modules/tiki/functions.php
- lib/cypht/modules/tiki/groupmail_modules.php
- lib/cypht/modules/tiki/site.js
- lib/cypht/modules/tiki/tracker_modules.php
- lib/wiki-plugins/wikiplugin_cypht.php
- vendor_bundled/composer.lock


Changes:

=====================================
lib/core/Search/ContentSource/FileSource.php
=====================================
@@ -99,9 +99,6 @@ class Search_ContentSource_FileSource implements Search_ContentSource_Interface,
                             $page_info = TikiLib::lib('tiki')->get_page_info_from_id($parsed_fields['source_id']);
                             if ($page_info && stristr($page_info['data'], "cypht")) {
                                 $view_path = smarty_modifier_sefurl($page_info['pageName']);
-                                if (preg_match("/tiki-index\.php\?page=.*/", $view_path)) {
-                                    $view_path = "tiki-index.php?page_id=" . $parsed_fields['source_id'];
-                                }
                             }
                         }
                         if (str_contains($view_path, '?')) {
@@ -109,7 +106,7 @@ class Search_ContentSource_FileSource implements Search_ContentSource_Interface,
                         } else {
                             $view_path .= '?';
                         }
-                        $view_path .= "page=message&uid=" . $file['fileId'] . "&list_path=tracker_folder_" . $rel['itemId'] . "_" . $rel['fieldId'] . "&list_parent=tracker_" . TikiLib::lib('trk')->get_tracker_for_item($rel['itemId']);
+                        $view_path .= "cypht_page=message&uid=" . $file['fileId'] . "&list_path=tracker_folder_" . $rel['itemId'] . "_" . $rel['fieldId'] . "&list_parent=tracker_" . TikiLib::lib('trk')->get_tracker_for_item($rel['itemId']);
                         $data['url'] = $typeFactory->identifier($view_path);
                         break;
                     }


=====================================
lib/core/Search/Index/Cypht.php
=====================================
@@ -310,7 +310,7 @@ class Cypht
             'email_body' => $content_placeholder,
             'email_plaintext' => $content_placeholder,
             'email_html' => $content_placeholder,
-            'url' => 'tiki-webmail.php?page=message&uid=' . $msg['uid'] . '&list_path=' . sprintf('imap_%s_%s', $msg['server_id'], $msg['folder']) . '&list_parent=' . $parent_path,
+            'url' => 'tiki-webmail.php?cypht_page=message&uid=' . $msg['uid'] . '&list_path=' . sprintf('imap_%s_%s', $msg['server_id'], $msg['folder']) . '&list_parent=' . $parent_path,
         ];
     }
 }


=====================================
lib/core/Services/Cypht/Controller.php
=====================================
@@ -24,6 +24,9 @@ class Services_Cypht_Controller
 
         /* get configuration */
         $config = new Tiki_Hm_Site_Config_File([], $session_prefix, @$_SESSION[$session_prefix]['settings_per_page']);
+        if ($input->page->text()) {
+            $config->set('append_url_query', 'page=' . urlencode($input->page->text()));
+        }
         $environment->define_default_constants($config);
 
         /* process the request */
@@ -39,7 +42,7 @@ class Services_Cypht_Controller
         Feedback::sendHeaders();
 
         // either html or already json encoded, so skip broker/accesslib output and do it here
-        echo $dispatcher->session->dedup_page_links($dispatcher->output);
+        echo $dispatcher->output;
         exit;
     }
 }


=====================================
lib/core/Tracker/Field/EmailFolder.php
=====================================
@@ -225,9 +225,6 @@ class Tracker_Field_EmailFolder extends Tracker_Field_Files implements \Tracker\
             $page_info = TikiLib::lib('tiki')->get_page_info_from_id($parsed_fields['source_id']);
             if ($page_info && stristr($page_info['data'], "cypht")) {
                 $view_path = smarty_modifier_sefurl($page_info['pageName']);
-                if (preg_match("/tiki-index\.php\?page=.*/", $view_path)) {
-                    $view_path = "tiki-index.php?page_id=" . $parsed_fields['source_id'];
-                }
             }
         }
         if (str_contains($view_path, '?')) {
@@ -238,9 +235,9 @@ class Tracker_Field_EmailFolder extends Tracker_Field_Files implements \Tracker\
 
 
         if (in_array('Draft', $parsed_fields['flags'])) {
-            $view_path .= "page=compose&draft_id=" . $parsed_fields['fileId'] . "&list_path=tracker_folder_" . $parsed_fields['itemId'] . "_" . $parsed_fields['fieldId'] . "&list_parent=tracker_" . $parsed_fields['trackerId'];
+            $view_path .= "cypht_page=compose&draft_id=" . $parsed_fields['fileId'] . "&list_path=tracker_folder_" . $parsed_fields['itemId'] . "_" . $parsed_fields['fieldId'] . "&list_parent=tracker_" . $parsed_fields['trackerId'];
         } else {
-            $view_path .= "page=message&uid=" . $parsed_fields['fileId'] . "&list_path=tracker_folder_" . $parsed_fields['itemId'] . "_" . $parsed_fields['fieldId'] . "&list_parent=tracker_" . $parsed_fields['trackerId'];
+            $view_path .= "cypht_page=message&uid=" . $parsed_fields['fileId'] . "&list_path=tracker_folder_" . $parsed_fields['itemId'] . "_" . $parsed_fields['fieldId'] . "&list_parent=tracker_" . $parsed_fields['trackerId'];
         }
         $parsed_fields['view_path'] = $view_path;
 


=====================================
lib/cypht/.env
=====================================
@@ -188,3 +188,5 @@ RECAPTCHA_SITE_KEY=
 CYPHT_MODULES="core,contacts,imap,smtp,nux,developer,history,saved_searches,advanced_search,profiles,inline_message,imap_folders,keyboard_shortcuts,site,dynamic_login,sievefilters,tiki"
 
 JS_EXCLUDE_DEPS=cash,bootstrap
+
+PAGE_PARAM_NAME=cypht_page


=====================================
lib/cypht/integration/Tiki_Hm_Custom_Session.php
=====================================
@@ -157,27 +157,6 @@ class Tiki_Hm_Custom_Session extends Hm_Session
         $this->set('changed_settings', $list);
     }
 
-    /**
-     * When Cypht runs in a wiki page as a wiki plugin and SEFURL is off
-     * replace all Cypht links to include the page_id of the wiki page
-     * so tiki-index can load the correct wiki page. Cypht reuses page param
-     * for its internal uses.
-     */
-    public function dedup_page_links($output)
-    {
-        global $prefs;
-        if ($prefs['feature_sefurl'] === 'y') {
-            return $output;
-        }
-        if (! $this->get('page_id')) {
-            return $output;
-        }
-        $output = str_replace("?page=", "?page_id=" . $this->get('page_id') . "&page=", $output);
-        $output = str_replace('<input type="hidden" name="page" value=', '<input type="hidden" name="page_id" value="' . $this->get('page_id') . '"><input type="hidden" name="page" value=', $output);
-        $output = str_replace('<input type=\\"hidden\\" name=\\"page\\" value=', '<input type=\\"hidden\\" name=\\"page_id\\" value=\\"' . $this->get('page_id') . '\\"><input type=\\"hidden\\" name=\\"page\\" value=', $output);
-        return $output;
-    }
-
     protected function session_prefix()
     {
         return $this->site_config->get('session_prefix') ?? 'cypht';


=====================================
lib/cypht/modules/tiki/functions.php
=====================================
@@ -737,9 +737,11 @@ function format_tracker_message_list($msg_list, $output_module, $parent_list = f
         }
 
         // Build message URL
-        $url = '?page=message&uid=' . $msg['fileId'] . '&list_path=' .
-                sprintf('tracker_folder_%s_%s', $msg['itemId'], $msg['fieldId']) .
-                '&list_parent=' . sprintf('tracker_%s', $msg['trackerId']);
+        $url = $output_module->build_page_url('message', [
+            'uid' => $msg['fileId'],
+            'list_path' => sprintf('tracker_folder_%s_%s', $msg['itemId'], $msg['fieldId']),
+            'list_parent' => sprintf('tracker_%s', $msg['trackerId']),
+        ]);
 
         if ($list_page) {
             $url .= '&list_page=' . $output_module->html_safe($list_page);


=====================================
lib/cypht/modules/tiki/groupmail_modules.php
=====================================
@@ -268,7 +268,7 @@ class Hm_Output_groupmail_page_link extends Hm_Output_Module
         if (! $this->get('groupmail_enabled')) {
             return '';
         }
-        $res = '<li class="menu_groupmail"><a class="unread_link" href="?page=groupmail">';
+        $res = '<li class="menu_groupmail"><a class="unread_link" href="' . $this->build_page_url('groupmail') . '">';
         if (! $this->get('hide_folder_icons')) {
             $res .= '<i class="bi bi-people account_icon"></i> ';
         }
@@ -414,8 +414,8 @@ class Hm_Output_filter_groupmail_data extends Hm_Output_Module
                 $row_class .= ' ' . str_replace(' ', '_', $source);
                 if ($msg['folder'] && hex2bin($msg['folder']) != 'INBOX') {
                     $source .= '-' . preg_replace("/^INBOX.{1}/", '', hex2bin($msg['folder']));
-                }
-                $url = '?page=message&uid=' . $msg['uid'] . '&list_path=' . sprintf('imap_%d_%s', $msg['server_id'], $msg['folder']) . '&list_parent=' . $parent_value;
+                };
+                $url = $this->build_page_url('message', ['uid' => $msg['uid'], 'list_path' => sprintf('imap_%d_%s', $msg['server_id'], $msg['folder']), 'list_parent' => $parent_value]);
                 if ($list_page) {
                     $url .= '&list_page=' . $this->html_safe($list_page);
                 }


=====================================
lib/cypht/modules/tiki/site.js
=====================================
@@ -160,7 +160,7 @@ var tiki_event_message_headers_actions = function(){
         var msg_text= $('.msg_text_inner').html();
 
         var params = [
-            { name: 'page', value: 'message' },
+            { name: hm_page_param_name(), value: 'message' },
             { name: 'uid', value: uid },
             { name: 'header_subject', value: header_subject },
             { name: 'header_date', value: header_date },
@@ -260,7 +260,7 @@ var tiki_setup_move_to_trackers = function(callback_handler = null) {
                 if (links[1]) {
                     window.location.href = links[1];
                 } else {
-                    window.location.href = '?page=message_list&list_path=' + getParam('list_parent');
+                    window.location.href = '?' + hm_page_param_name() + '=message_list&list_path=' + getParam('list_parent');
                 }
             });
         } else {
@@ -536,7 +536,7 @@ var tiki_delete_message = function() {
                         window.location.href = nlink.attr('href');
                     }
                     else {
-                        window.location.href = "?page=message_list&list_path="+getListPathParam();
+                        window.location.href = '?' + hm_page_param_name() + "=message_list&list_path="+getListPathParam();
                     }
                 }
             }
@@ -563,7 +563,7 @@ var tiki_archive_message = function() {
                         window.location.href = nlink.attr('href');
                     }
                     else {
-                        window.location.href = "?page=message_list&list_path="+getListPathParam();
+                        window.location.href = '?' + hm_page_param_name() + "=message_list&list_path="+getListPathParam();
                     }
                 }
             }
@@ -606,7 +606,7 @@ var tiki_unread_message = function() {
             {'name': 'imap_msg_uid', 'value': uid},
             {'name': 'list_path', 'value': list_path}],
             function() {
-                window.location.href = "?page=message_list&list_path="+getListPathParam();
+                window.location.href = '?' + hm_page_param_name() + "=message_list&list_path="+getListPathParam();
             }
         );
     }
@@ -650,7 +650,7 @@ var tiki_perform_move_copy = function(dest_id, move_to) {
                         window.location.href = nlink.attr('href');
                     }
                     else {
-                        window.location.href = "?page=message_list&list_path="+getListPathParam();
+                        window.location.href = '?' + hm_page_param_name() + "=message_list&list_path="+getListPathParam();
                     }
                 }
             }
@@ -678,7 +678,7 @@ var tiki_restore_message = function(e) {
                     if (nlink.length) {
                         window.location.href = nlink.attr('href');
                     } else {
-                        window.location.href = "?page=message_list&list_path="+getListPathParam();
+                        window.location.href = '?' + hm_page_param_name() + "=message_list&list_path="+getListPathParam();
                     }
                 }
             }


=====================================
lib/cypht/modules/tiki/tracker_modules.php
=====================================
@@ -850,11 +850,11 @@ class Hm_Handler_tiki_message_content extends Hm_Handler_Module
         $this->out('msg_download_args', sprintf("page=message&amp;uid=%s&amp;list_path=%s&amp;tiki_download_message=1", $form['imap_msg_uid'], $this->request->post['list_path']));
         $this->out('msg_show_args', sprintf("page=message&amp;uid=%s&amp;list_path=%s&amp;tiki_show_message=1", $form['imap_msg_uid'], $this->request->post['list_path']));
         if ($email['prev']) {
-            $this->out('msg_prev_link', sprintf("?page=message&amp;uid=%s&amp;list_path=tracker_folder_%s_%s&list_parent=tracker_%s", $email['prev']['fileId'], $email['prev']['itemId'], $email['prev']['fieldId'], $email['prev']['trackerId']));
+            $this->out('msg_prev_link', $this->build_page_url('message', ['uid' => $email['prev']['fileId'], 'list_path' => sprintf("tracker_folder_%s_%s", $email['prev']['itemId'], $email['prev']['fieldId']), 'list_parent' => sprintf("tracker_%s", $email['prev']['trackerId'])]));
             $this->out('msg_prev_subject', $email['prev']['subject']);
         }
         if ($email['next']) {
-            $this->out('msg_next_link', sprintf("?page=message&amp;uid=%s&amp;list_path=tracker_folder_%s_%s&list_parent=tracker_%s", $email['next']['fileId'], $email['next']['itemId'], $email['next']['fieldId'], $email['next']['trackerId']));
+            $this->out('msg_next_link', $this->build_page_url('message', ['uid' => $email['next']['fileId'], 'list_path' => sprintf("tracker_folder_%s_%s", $email['next']['itemId'], $email['next']['fieldId']), 'list_parent' => sprintf("tracker_%s", $email['next']['trackerId'])]));
             $this->out('msg_next_subject', $email['next']['subject']);
         }
         $this->out('show_archive', $email['show_archive']);
@@ -1481,7 +1481,7 @@ class Hm_Output_combined_trackers_link extends Hm_Output_Module
 {
     protected function output()
     {
-        $res = '<li class="menu_combined_trackers"><a class="unread_link" href="?page=message_list&list_path=trackers">';
+        $res = '<li class="menu_combined_trackers"><a class="unread_link" href="' . $this->build_page_url('message_list', ['list_path' => 'trackers']) . '">';
         if (! $this->get('hide_folder_icons')) {
             $res .= '<i class="bi bi-database account_icon"></i> ';
         }


=====================================
lib/wiki-plugins/wikiplugin_cypht.php
=====================================
@@ -346,6 +346,7 @@ function wikiplugin_cypht($data, $params)
 
     /* get configuration */
     $config = new Tiki_Hm_Site_Config_File([], $session_prefix, $settings_per_page);
+    $config->set('append_url_query', 'page=' . urlencode($page));
     $environment->define_default_constants($config);
 
     // merge existing configuration with plugin params for smtp/imap servers
@@ -434,6 +435,6 @@ function wikiplugin_cypht($data, $params)
     return '<div class="inline-cypht">'
         . '<input type="hidden" id="hm_page_key" value="' . Hm_Request_Key::generate() . '" />'
         . '<input type="hidden" id="hm_session_prefix" value="' . htmlentities($session_prefix, ENT_COMPAT) . '" />'
-        . $dispatcher->session->dedup_page_links($dispatcher->output)
+        . $dispatcher->output
         . "</div>";
 }


=====================================
vendor_bundled/composer.lock
=====================================
@@ -3325,12 +3325,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/cypht-org/cypht.git",
-                "reference": "8b3cb0c289531906f039bcaad67528396841923f"
+                "reference": "07cc884d25bfb3f22c869aecaf5e82566d7ef6e3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/cypht-org/cypht/zipball/8b3cb0c289531906f039bcaad67528396841923f",
-                "reference": "8b3cb0c289531906f039bcaad67528396841923f",
+                "url": "https://api.github.com/repos/cypht-org/cypht/zipball/07cc884d25bfb3f22c869aecaf5e82566d7ef6e3",
+                "reference": "07cc884d25bfb3f22c869aecaf5e82566d7ef6e3",
                 "shasum": ""
             },
             "require": {
@@ -3408,7 +3408,7 @@
                 "source": "https://github.com/cypht-org/cypht/",
                 "wiki": "https://github.com/cypht-org/cypht/wiki"
             },
-            "time": "2026-07-29T05:24:52+00:00"
+            "time": "2026-08-14T14:14:56+00:00"
         },
         {
             "name": "jean85/pretty-package-versions",
@@ -20125,7 +20125,7 @@
         "ext-openssl": "*",
         "ext-zip": "*"
     },
-    "platform-dev": [],
+    "platform-dev": {},
     "platform-overrides": {
         "php": "8.1",
         "ext-ldap": "0",
@@ -20133,5 +20133,5 @@
         "ext-sockets": "0",
         "ext-ftp": "0"
     },
-    "plugin-api-version": "2.6.0"
+    "plugin-api-version": "2.9.0"
 }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/84b6345d523a2c3cbc6f122b5be1c3b032c11f5c

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/84b6345d523a2c3cbc6f122b5be1c3b032c11f5c
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
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.