The plugin belongs in its own folder under include/plugins/, the recommended name is custom-css-loader.
/path/to/osticket/include/plugins/custom-css-loader/
When it is included, the plugin class loads vendor/autoload.php. This Composer autoloader must exist in the plugin folder, otherwise loading the plugin aborts with a fatal error.
include/plugins/custom-css-loader/.The release ZIP contains the autoloader (vendor/autoload.php and vendor/composer/), no further steps are needed.
The vendor/ directory is not part of the repository. After cloning, generate the autoloader with Composer.
cd /path/to/osticket/include/plugins
git clone https://github.com/markus-michalski/osticket-custom-css-loader.git custom-css-loader
cd custom-css-loader
composer install --no-dev
The plugin has no runtime dependencies other than PHP 8.1. Composer is only needed for the autoloader of the plugin's own classes in
src/.
On activation enable() runs and does the following in order:
assets/custom/css/ is missing in the osTicket root directory, it is created with mode 0755..css file yet, custom-staff.css and custom-client.css are copied in from assets/demo/. Existing files are never overwritten.installed_version.If the web server cannot create the folder, the plugin writes a message to the PHP error log. Then create the folder yourself:
mkdir -p /path/to/osticket/assets/custom/css
chmod 755 /path/to/osticket/assets/custom/css
The folder must be reachable through the web server, because the browser loads the CSS files from <osTicket path>/assets/custom/css/<file>.
On every start the plugin compares installed_version with the version in plugin.php. If the value is missing or lower, the plugin makes sure the CSS folder exists and stores the new version. Your CSS files are not touched. With the ZIP, the vendor/ folder inside the plugin folder is replaced along with the rest. With a Git clone, run composer install --no-dev again after pulling.
Deactivating in the Admin Panel stops the inclusion. The CSS files and the assets/custom/css/ folder remain, the plugin deletes nothing.