PriorityIconsPlugin (plugin id osticket:priority-icons, name "Priority Icons"), configuration class PriorityIconsConfig.enable() automatically creates an instance when needed.bootstrap(): Nothing happens on AJAX requests (header X-Requested-With: XMLHttpRequest). Nothing happens either when the option enabled is off in the configuration of the first active instance. Otherwise ob_start() starts with the callback injectAssetsIntoOutput().</head> (otherwise before </body>): a <style>, a <script> with window.PriorityIconsConfig and a <script> with the logic, all carrying the attribute data-plugin="priority-icons". If the output already contains this attribute, nothing is inserted twice.JSON_HEX_TAG | JSON_HEX_APOS..htaccess in osTicket's include/ folder blocks HTTP access to plugin files, which is why CSS and JavaScript are delivered inline. No core files are changed.addExtraHeader() or signal apps.scp: According to a code comment, $ost is still NULL in bootstrap(), and apps.scp only fires on the Apps page.table.list.queue.tickets, .ticket_info, .ticket-info, #ticket-status, .pjax-container. If the script finds none of them, it scans the whole body.script, style, textarea and input are left alone..priority-wrapper. It contains an icon .priority-icon (circle, with title and aria-label="Priority: <name>") and the original text as .sr-only. The color is set on the icon via --priority-color.td, the cell gets the attribute data-priority-cell and a light background color.pjax:end via jQuery (if jQuery is present) and watches the body with a MutationObserver. Rescans are debounced (50 to 100 ms). Already replaced elements are recognized by data-priority-icon.title attribute (::after), arrow via ::before.prefers-reduced-motion: reduce the animation is off.prefers-color-scheme: dark, tooltip background and text color are swapped.print-color-adjust: exact), tooltips and animation are dropped.priority-icon--badge and priority-icon--dot. The script never sets these classes, so the rules have no effect.JSON_HEX_TAG, so a </script> in a value cannot end the block.^#[0-9a-fA-F]{3,6}$.innerHTML.assets/.htaccess forbids PHP execution in the assets/ folder.The repository contains these files. Only plugin.php, class.PriorityIconsPlugin.php, config.php and assets/ are needed to run the plugin.
priority-icons/
+-- plugin.php # Plugin metadata
+-- class.PriorityIconsPlugin.php # Plugin class
+-- config.php # Configuration form
+-- assets/
| +-- .htaccess
| +-- priority-icons.css # Stylesheet
| +-- priority-icons.js # Replacement and PJAX handling
+-- README.md
+-- CHANGELOG.md
+-- CONTRIBUTING.md
+-- LICENSE
+-- docs/ # ARCHITECTURE.md, CODE_REVIEW.md
+-- tests/ # PHPUnit tests
+-- .github/workflows/ci.yml
+-- composer.json
+-- phpunit.xml
+-- .releaseinclude
+-- .gitignore