Textpattern Forum

You are not logged in. Register | Login | Help

#131 2010-10-14 20:59:20

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,967
Website

Re: ied_plugin_composer - new plugins never came that easy

Hi Stef,

you know, I like to run plugins from plugin_cache_dir. It makes my life easier, it let me do versioning and other crazy things, like having a /txp_plugins/ folder, full of TXP plugins (and its versions) somewhere on my system and symlink each plugin I need on a per-TXP-installation basis.

But there is one thing that I miss from installing/activating/running plugins from DB, and that is, that some plugins (glz_custom_fields, arc_twitter, and others too), when activated, they add an “Options” link in the “Manage” column (on “Admin -> Plugins”).

Do you think it would be possible to have this “Options” link on the “Publish” column, in “Extensions -> Plugin composer”, for those plugins that have options.

If not, there is no way to easily access/find-out that a plugin have an Options tab. And that always catch me…

Of course, it may be the price to pay for being so über-cool and run plugins from filesystem, but, hopefully, it’s just that you forgot to add it :)

Thank you.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#132 2010-10-14 22:45:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: ied_plugin_composer - new plugins never came that easy

maniqui wrote:

Do you think it would be possible to have this “Options” link… hopefully, it’s just that you forgot to add it :)

I didn’t forget to add it. It’s a bug. The new template file format introduced something near the top of the file that I previously checked to signify the end of the header block. So the header portion bombs out early before it reaches the plugin flags. Simple one-line fix until I get round to it officially. Find line 922ish where it says:

if (strpos( $content[$idx], 'if (!defined' ) === 0) {

and change it to:

if (strpos( $content[$idx], 'if (!defined(\'txpinterface\')' ) === 0) {

Job done. You’ll get the [Options] link on the left after the plugin name, just like you do with DB-installed plugins (of course, now you’ll say you desperately want it in the Publish column, right? :-)

Sorry about that, and thanks for spotting this bug. I’ll fix it along with the stupid backslash bugs (with luck, when I find them) in the next version.

Last edited by Bloke (2010-10-14 22:48:50)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#133 2010-10-14 23:23:24

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,967
Website

Re: ied_plugin_composer - new plugins never came that easy

Hi Bloke,
Thanks for the prompt reply.
Applied the change, job done. Thank you very much for that one too.

I can live with the [Options] link right there, next to the plugin name. Someday, having it on the Publish column will be a nice thing too :)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#134 2010-11-03 16:48:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: ied_plugin_composer - new plugins never came that easy

For those waiting patiently for some fixes, you’ll be pleased to hear I have a version that has all the above problems nailed, plus a few other little niggles that have been bugging me for the last 6 versions or so. I could release it now (and probably will). But where I’m falling down is integrating textpacks.

The trouble I have is that if I add a textbox for the textpack — like the help/css boxes — then I need to store the contents of it somewhere on save. Without a DB field in the txp_plugin table I’ll need to stash it somewhere else — probably on disk or in my own DB table — and then simply marry the two when you Export the plugin. That’s pretty nasty so I can see why Rick added the textpack column to the txp_plugin table in his plugin.

However, I don’t think adding such a column to the core is viable/efficient. It’d effectively be duplicating effort and wasting space holding the same info as the txp_lang table — just in a different form. After all, the strings are designed to simply be inserted into the DB at plugin (or theme) installation time, or after the fact from the Language tab. It’s only people who want to use ied_plugin_composer or smd_amdin_themes who will ever need to edit them and link them to a plugin or theme and edit them in anger.

All other times I can see Rick’s plugin being the basis of a textpack manager which could keep track of who installed what and offer uninstall options, updates, installs, etc from a repository of textpacks (textpattern.org is an obvious candidate here — it’s on the “to investigate” pile).

When editing plugins in the plugin_cache_dir it’s pretty easy because the textpack can be stashed directly in the template file and retrieved when needed. It’s the plugins in the database that are the problem. But maybe I’m just not thinking outside the box enough and the solution is simple for the composer and the admin themer. Anyone have any thoughts on how it might be best achieved? Ta.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#135 2010-11-04 14:29:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: ied_plugin_composer - new plugins never came that easy

Amazing what less than 24 hours of background processing can do. Think I’ve figured out how to handle textpacks:

  1. Allow you to specify a prefix for each plugin which I’ll stash somewhere (probably in a tmp file). It’ll default to the name of your plugin
  2. Add a smallish textarea (or two) to allow you to add strings one by one (or maybe one per line or something so you can add more than one at once)
  3. Add a dropdown nearby which lists all the installed languages you have
  4. The strings will be inserted directly in txp_lang under the given language, thus you can use them immediately in your code with gTxt('abc_plugin_some_string', array('{rep}' => 'replacement'))
  5. At export time, the plugin composer will collect together all lang entries that are prefixed with your given prefix, group them by language and create a textpack from them on the fly. It will insert that at the relevant place in the plugin
  6. I’ll add a dedicated export button at the bottom so you can export the pack as an entire file or as one pack per language for standalone redistribution
  7. I guess I’ll also need a management screen so you can see which strings have been installed for the current plugin and edit, rename or delete them as necessary. Might be nice to do this in a floaty panel like wet_quicklink so you can see at a glance which are in use, filter them and maybe even insert the names raw or as a formatted gTxt() string into your code at the cursor location. Not sure yet if that’d be of any use
  8. When editing the template file directly in the plugin cache dir, the strings will be written into the file as you go

Anyone see any flaws in the above, or can think of anything better / neater?

Last edited by Bloke (2010-11-04 14:30:26)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#136 2010-11-04 18:16:57

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 744
Website

Re: ied_plugin_composer - new plugins never came that easy

it doesn’t take much, but I’m impressed :)

Offline

#137 2010-11-11 12:59:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: ied_plugin_composer - new plugins never came that easy

Until I can get round to the Textpack thing I mentioned above, here’s a quick bug fix update to v0.92.

Fixes:

  • Options link for plugins from cache dir (thanks maniqui)
  • Escaping of exported php files (thanks maniqui)
  • Escaping when importing from PHP file (hopefully… never fully got my head round magic_quotes_gpc in PHP)
  • jQuery bug on setup panel
  • Cosmetic tweaks:
    • plugin_cache_dir section only displayed if there are valid PHP files
    • View Help link improved slightly
  • Extended resizer cookie to one year expiry

Should tide you over until Textpack support comes along. Enjoy.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#138 2010-11-11 17:45:00

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 225
Website

Re: ied_plugin_composer - new plugins never came that easy

HI, i have installed now the v0.92 in my txp 4.3 localhost.

I obtain an error, when into the setup page of ied_plugin_composer i set the php editor as Editarea.
It change the input field below but when i save, it replace anything after / whit undefined!

Es. http://localhost/js/editarea -> save -> http://localhost/js/undefined
Es. http://localhost/pincopallino -> save -> http://localhost/undefined

Is a bug?

Offline

#139 2010-11-11 20:26:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: ied_plugin_composer - new plugins never came that easy

MarcoK wrote:

Is a bug?

Yes, sorry. When I fixed the jQuery toggle behaviour I broke something else. Will fix asap.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#140 2010-11-23 16:41:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: ied_plugin_composer - new plugins never came that easy

Finally got round to fixing my stupid ‘undefined’ setup bug in v0.93. Thanks MarcoK for finding that one.

Last edited by Bloke (2010-11-23 16:42:41)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB