Modified Plugin Compiler.
After a head-scratching morning, I decided I just had to modify the plugin compiler that Zem originally wrote.
Why?
Glad you asked, happy to tell.
Yesterday I added some admin-side processing to one of my existing plugins. As usual, I did all my development in the plugin cache directory until I was satisfied with the results, everything was working. I then compiled the plugin, copied and pasted the code into TXP, uploaded, installed and activated it. No problem. However, I got some unexpected behaviour when I went to the extensions tab and looked for my plugin’s output. Zip, nothing, tiada!
After a lot of digging, it turned out to be the simplest mistake I could have made—and something the compiler could have saved me from but didn’t.
In the plugin’s file I had forgotten to mark the plugin as type=1 to show it as an admin plugin. But when you run from the cache directory, this setting is ignored and your plugin is loaded in the admin interface and the client interface. Doh!
So now I present to you a new version of the compiler that checks to see if the declared type of a plugin actually matches what it tries to do. If it is not an admin plugin but tries to check the txpinterface == 'admin' then the compiler will halt and suggest you adjust the plugin’s type.
Additionally
This version of the compiler also adds a special CSS section to the plugin source file. Unlike the Help section, the CSS section does not get put through the textile mangler. So you can confidently add style information into this part of the file without it getting chewed on.
Please Note: Be sure to make the rules specific to the help section so that the rest of the admin interface isn’t mucked up by your beautiful styling; the example plugin shows you how to do it.
Downloads
Without further waffle then, here is the download for you.
- sed_tpl.0.1.zip [8.93KB]
v0.1 of my modified plugin compiler plus example plugin. : 869 download(s)