Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#193 2016-05-13 21:06:51

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,261

Re: ied_plugin_composer - new plugins never came that easy

Yes, type 5.
Thanks for your offer, and yes, still MAMP, but that gives me a new idea (dang, why not earlier), I’ll try it out in the wild and let you know. But chances are low, I had it working before, both official v1.06 and 1.10 beta 2, and now both are broken in one go and I don’t see what I’ve done that might have caused that.

I’ll see what the www-server brings, asking me for Network panels and Response blocks … might last longer :P


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#194 2016-05-13 21:28:48

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,261

Re: ied_plugin_composer - new plugins never came that easy

Bloke wrote #299111:

Does the browser’s inspector indicate any errors being thrown, or anything weird in the response block?

Well, I can’t judge weirdness in the Network panel. Anyways, here’s the response block for “Save code”:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<textpattern>
	<ied_plugin_msg value='                $(document).ready(function ()&#xA;                {&#xA;                    $(&quot;#messagepane&quot;).html(&quot;&lt;span class=\&quot;messageflash success\&quot; role=\&quot;alert\&quot; aria-live=\&quot;assertive\&quot;&gt;&lt;span class=\&quot;ui-icon ui-icon-check\&quot;&gt;&lt;/span&gt; Code saved&amp;#160;&lt;a class=\&quot;close\&quot; role=\&quot;button\&quot; title=\&quot;Schlie&szlig;en\&quot; aria-label=\&quot;Schlie&szlig;en\&quot; href=\&quot;#close\&quot;&gt;&amp;#215;&lt;/a&gt;&lt;/span&gt;&quot;);&#xA;                    $(window).resize(function ()&#xA;                    {&#xA;                        $(&quot;#messagepane&quot;).css({&#xA;                            left: ($(window).width() - $(&quot;#messagepane&quot;).outerWidth()) / 2&#xA;                        });&#xA;                    });&#xA;                    $(window).resize();&#xA;                });' />

	<http-status value='200 OK' />

</textpattern>

In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#195 2016-05-24 17:06:25

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,261

Re: ied_plugin_composer - new plugins never came that easy

uli wrote #299112:

yes, still MAMP, but that gives me a new idea (dang, why not earlier), I’ll try it out in the wild and let you know.

I’ve installed ied_pc on a www website and everything works as expected. So I really think it might have something to do with my local environment, especially given the fact that both ied_pc versions stopped AJAX-saving in one go. But I recently discovered what broke the connection between my text editor and the It’s All Text controlled textareas1 and so I can keep working my way and the AJAX issue is no longer a problem that I stumble upon.

What I want to suggest now is an improvement for the textpack pane: When I translate an English plugin I get titles for every text field I hover over. That’s been a very very useful idea that facilitates translations. Just, it doesn’t work the other way around, you don’t get titles hovering English strings. So I as someone wanting to introduce gTxt strings to an existing, un-gTxt-ified plugin, for both English and German strings, can’t make fully use of that nifty feature.

That’s actually a comment for the previous version, it seems the current 1.10beta works exactly the other way around (or changes its behaviour, I can’t tell ATM2, too fresh), anyways I’d be super cool if both user languages would have titles displayed over the text strings.

1 One obviously has to save the text area in question one time. That removes the token in the URL. Once that is done one can start editing, and then every saving inside the text editor transfers the text over to Firefox.

2 Does it take the current admin language into account? I switch quite often between German and English in 4.6, now that it’s so much easier to do so.

Last edited by uli (2016-05-24 17:43:10)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#196 2016-05-25 13:18:12

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,261

Re: ied_plugin_composer - new plugins never came that easy

Stef, sorry for posting here like there were no tomorrow, I’m currently spending much time in ied_pc.

I recently saw gTxt strings in ied_pc though I had the English textpack installed. The reason: I installed it while my admin was set to German, plus: The English textpack isn’t labeled as English (@# language en-gb). Thus the string set has automatically been associated with the currently selected admin language, German, and whenever I switched to English there was nothing for the TXP admin to read in. Quickly cured.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#197 2016-05-25 13:40:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,579
Website GitHub

Re: ied_plugin_composer - new plugins never came that easy

uli wrote #299274:

I installed it while my admin was set to German

This is by design. It’s a Textpack feature: if you don’t specify the language against one string set in the Textpack, it loads those strings into the current language, regardless of what language it is.

Without this feature, it would run the risk of not matching anything for those people using admin-side languages that are not included in the plugin. If I explicitly specified en-gb in the pack, anyone who wasn’t represented with a language would get ied_pc_untranslated_strings everywhere, which is ugly.

The Composer reinforces this, btw. If you export a plugin and select multiple Textpack languages to bundle with it, the default admin-side language will be exported without designator and put first in the list.

I could maybe expose this as a preference so you could get the Composer to always designate packs with a language designator during export? I don’t think it’s a very useful feature, but I suppose some might prefer it. In my mind, with a non-designated language, at least users will see English strings instead of untranslated strings. Which might prompt them to translate them and send a pack in :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#198 2016-05-25 15:48:16

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,261

Re: ied_plugin_composer - new plugins never came that easy

Bloke wrote #299276:

If I explicitly specified en-gb in the pack, anyone who wasn’t represented with a language would get ied_pc_untranslated_strings everywhere

What happened to me must be tapped in reverse logic, of course. And yes, my constant language switching and having a non-native language most of the time (most, not always) is certainly a special case.

I really thought there were a simple solution :)

(Edit: typo)

Last edited by uli (2016-05-25 15:48:51)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#199 2016-09-06 14:27:26

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,753
Website

Re: ied_plugin_composer - new plugins never came that easy

Bloke,

I noticed you had an updated version of this on GitHub, which I used to update my local site’s install with using 4.6 beta. It seems you’re still tweaking the presentational bits, which is fine, but noticed labels and such in the UI, including the link in the Extensions list were all like foo_bar_boo. My languages are updated. Not sure there was something else I needed to do.

Not a blocker for me, though. I only use it occasionally.

Offline

#200 2016-09-06 15:18:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,579
Website GitHub

Re: ied_plugin_composer - new plugins never came that easy

Destry wrote #301118:

labels and such in the UI were all like foo_bar_boo.

Simplest thing to fix that is to open the ied_plugin_composer.php file you downloaded from GitHub, and grab the Textpack block from near the top of the plugin. Copy all the strings, from (and including):

#@ied_plugin

all the way to the last line before the EOT; marker. Paste that lot into the textarea at the bottom of your Admin->Languages panel and upload them. Job done.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#201 2016-09-10 19:05:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,579
Website GitHub

Re: ied_plugin_composer - new plugins never came that easy

New official version for Txp 4.6.0 released.

It has a completely revamped interface compared with the 4.5.7-compatible version. Massive thanks go to Phil Wareham for the mockups that led to this. I merely coded what he drew.

A slew of annoying little bugs have also been zapped, and the admin-side code has been rewritten as a class so there’s less pollution of your Textpattern scope. This is a coding pattern I’ll be rolling out to all my admin-side plugins over time, because it’s far tidier and less prone to trample on other globals.

I’ve attached the plugin textpack as part of the release package — currently only English and (mostly) French are supported. As and when people translate the strings, I’ll try and add them to the release so you can grab them and install them directly in your Admin->Languages panel.

I’ve been using this version of the Composer for months and it’s served me well. Hope you enjoy it too. Please post any feedback here, or submit bug/feature reports directly on GitHub so I can track them. Thanks!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#202 2016-10-12 14:28:25

testdeputy
Member
Registered: 2011-05-29
Posts: 27

Re: ied_plugin_composer - new plugins never came that easy

with “zem_plugin_example.php” in folder “/full/path/dev/plugins” an error occurs…

Warning "constant(): Couldn't find constant PLUGIN_HAS_PREFS | PLUGIN_LIFECYCLE_NOTIFY"
in <snip>/textpattern/lib/txplib_misc.php(1782) : eval()'d code at line 2611.
adminErrorHandler()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:2611 constant()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:626 ied_pc->read_file()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:435 ied_pc->table()
ied_pc->plugin_composer()
textpattern/lib/txplib_misc.php:1895 call_user_func_array()
textpattern/index.php:214 callback_event()

no errors when line 48 in file “zem_plugin_example.php” disabled
$plugin['flags'] = PLUGIN_HAS_PREFS | PLUGIN_LIFECYCLE_NOTIFY;

edit: oh shoot, i’m terrible with textile…
@ whoever is in charge of docs/wiki: appreciate all the works/updates

update/solved: line 48 in file “zem_plugin_example.php” needs some quoting love
$plugin['flags'] = "'". PLUGIN_HAS_PREFS | PLUGIN_LIFECYCLE_NOTIFY ."'";
culprit was file zem_plugin_example.php, not ied_plugin_composer
see issue@github

a big thanks for this fantastic plugin

Last edited by testdeputy (2016-10-13 13:19:21)

Offline

#203 2016-10-14 22:45:14

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,579
Website GitHub

Re: ied_plugin_composer - new plugins never came that easy

testdeputy wrote #302142:

Warning “constant(): Couldn’t find constant PLUGIN_HAS_PREFS | PLUGIN_LIFECYCLE_NOTIFY” … culprit was file zem_plugin_example.php, not ied_plugin_composer

On further inspection, I’m not so sure actually. I built the ability to handle constants into the latest release. Unfortunately it was actually only the ability for it to handle a constant. Singular.

I’ve fixed it in the master branch so it can handle quoted or unquoted constants, including pipe-delimited ones. If you’d like to take it for a test drive, please report back and I’ll release it. Also fixed the broken multi-edit widgets, oops.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#204 2016-10-15 11:10:10

testdeputy
Member
Registered: 2011-05-29
Posts: 27

Re: ied_plugin_composer - new plugins never came that easy

Sorry Bloke, I’m a noob.
Your fix seems to work!

Offline

Board footer

Powered by FluxBB